From 70aab4c79a89d9a7c9e04fc8e6b3ac79040bbe72 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 29 May 2026 09:25:50 +0000 Subject: [PATCH] Regenerate client from commit aa8cef7 of spec repo --- .generator/schemas/v2/openapi.yaml | 4356 +++++++++++++++ examples/v2/incidents/PatchIncidentImpact.rb | 20 + examples/v2/incidents/UpdateIncidentImpact.rb | 20 + features/scenarios_model_mapping.rb | 142 + features/v2/incidents.feature | 60 + features/v2/undo.json | 12 + lib/datadog_api_client/configuration.rb | 37 + lib/datadog_api_client/inflector.rb | 140 + .../v2/api/incidents_api.rb | 4733 +++++++++++++---- ..._ai_postmortem_data_attributes_response.rb | 165 + .../incident_ai_postmortem_data_response.rb | 165 + .../models/incident_ai_postmortem_response.rb | 123 + .../incident_ai_postmortem_response_type.rb | 26 + ...t_configuration_data_attributes_request.rb | 135 + ..._configuration_data_attributes_response.rb | 205 + .../incident_configuration_data_request.rb | 133 + .../incident_configuration_data_response.rb | 175 + ...iguration_patch_data_attributes_request.rb | 135 + ...cident_configuration_patch_data_request.rb | 154 + .../incident_configuration_patch_request.rb | 123 + .../incident_configuration_relationships.rb | 115 + .../models/incident_configuration_request.rb | 123 + .../models/incident_configuration_response.rb | 135 + .../v2/models/incident_configuration_type.rb | 26 + ...te_on_call_page_data_attributes_request.rb | 159 + ...cident_create_on_call_page_data_request.rb | 144 + .../incident_create_on_call_page_request.rb | 123 + ...e_from_incident_data_attributes_request.rb | 169 + ..._create_page_from_incident_data_request.rb | 144 + ...ident_create_page_from_incident_request.rb | 123 + ...incident_create_page_from_incident_type.rb | 26 + ...t_configuration_data_attributes_request.rb | 186 + ..._configuration_data_attributes_response.rb | 228 + ..._google_chat_configuration_data_request.rb | 165 + ...google_chat_configuration_data_response.rb | 175 + ...iguration_patch_data_attributes_request.rb | 135 + ...e_chat_configuration_patch_data_request.rb | 154 + ...google_chat_configuration_patch_request.rb | 123 + ...google_chat_configuration_relationships.rb | 125 + ...hat_configuration_relationships_request.rb | 123 + ...ident_google_chat_configuration_request.rb | 123 + ...dent_google_chat_configuration_response.rb | 135 + ...incident_google_chat_configuration_type.rb | 26 + ...t_configuration_data_attributes_request.rb | 144 + ..._configuration_data_attributes_response.rb | 175 + ..._google_meet_configuration_data_request.rb | 165 + ...google_meet_configuration_data_response.rb | 175 + ...iguration_patch_data_attributes_request.rb | 115 + ...e_meet_configuration_patch_data_request.rb | 154 + ...google_meet_configuration_patch_request.rb | 123 + ...google_meet_configuration_relationships.rb | 125 + ...eet_configuration_relationships_request.rb | 123 + ...ident_google_meet_configuration_request.rb | 123 + ...dent_google_meet_configuration_response.rb | 135 + ...incident_google_meet_configuration_type.rb | 26 + .../v2/models/incident_impact_field_choice.rb | 154 + ...nt_impact_field_data_attributes_request.rb | 195 + ...t_impact_field_data_attributes_response.rb | 195 + .../incident_impact_field_data_request.rb | 165 + .../incident_impact_field_data_response.rb | 175 + .../incident_impact_field_relationships.rb | 125 + ...dent_impact_field_relationships_request.rb | 123 + .../models/incident_impact_field_request.rb | 123 + .../models/incident_impact_field_response.rb | 135 + .../v2/models/incident_impact_field_type.rb | 26 + .../incident_impact_field_value_type.rb | 32 + .../models/incident_impact_fields_response.rb | 137 + ...nt_on_call_page_data_attributes_request.rb | 125 + .../incident_on_call_page_data_request.rb | 154 + .../incident_on_call_page_link_request.rb | 123 + .../v2/models/incident_on_call_page_target.rb | 144 + .../v2/models/incident_on_call_page_type.rb | 26 + ...t_org_settings_data_attributes_response.rb | 165 + .../incident_org_settings_data_response.rb | 175 + .../incident_org_settings_list_response.rb | 125 + .../incident_org_settings_relationships.rb | 105 + .../models/incident_org_settings_response.rb | 123 + .../v2/models/incident_org_settings_type.rb | 26 + .../v2/models/incident_page_role_reference.rb | 144 + .../v2/models/incident_page_role_type.rb | 27 + .../v2/models/incident_page_target.rb | 144 + .../v2/models/incident_page_target_type.rb | 28 + .../incident_page_uuid_data_response.rb | 144 + .../v2/models/incident_page_uuid_response.rb | 123 + .../v2/models/incident_page_uuid_type.rb | 26 + ...dent_responder_data_attributes_response.rb | 216 + .../models/incident_responder_data_request.rb | 144 + .../incident_responder_data_response.rb | 175 + .../incident_responder_relationships.rb | 143 + ...ncident_responder_relationships_request.rb | 123 + .../v2/models/incident_responder_request.rb | 123 + .../v2/models/incident_responder_response.rb | 135 + ...onder_role_assignment_relationship_data.rb | 144 + ...responder_role_assignments_relationship.rb | 107 + .../v2/models/incident_responder_type.rb | 26 + .../incident_responder_user_relationship.rb | 123 + ...cident_responder_user_relationship_data.rb | 144 + .../v2/models/incident_responders_response.rb | 137 + .../v2/models/incident_rule_condition.rb | 146 + .../incident_rule_data_attributes_request.rb | 278 + .../incident_rule_data_attributes_response.rb | 268 + .../v2/models/incident_rule_data_request.rb | 144 + .../v2/models/incident_rule_data_response.rb | 165 + .../v2/models/incident_rule_execution_type.rb | 27 + ...dent_rule_patch_data_attributes_request.rb | 147 + .../incident_rule_patch_data_request.rb | 154 + .../v2/models/incident_rule_patch_request.rb | 123 + .../models/incident_rule_query_condition.rb | 124 + .../v2/models/incident_rule_request.rb | 123 + .../v2/models/incident_rule_response.rb | 123 + .../v2/models/incident_rule_response_type.rb | 26 + .../v2/models/incident_rule_task_id_type.rb | 37 + .../v2/models/incident_rule_trigger_type.rb | 28 + .../v2/models/incident_rule_type.rb | 26 + .../v2/models/incident_rules_response.rb | 125 + ...vice_now_record_data_attributes_request.rb | 175 + ...ncident_service_now_record_data_request.rb | 144 + ...incident_service_now_record_prompt_type.rb | 26 + .../incident_service_now_record_request.rb | 123 + ...estamp_override_data_attributes_request.rb | 144 + ...stamp_override_data_attributes_response.rb | 225 + ...ncident_timestamp_override_data_request.rb | 144 + ...cident_timestamp_override_data_response.rb | 175 + ..._override_patch_data_attributes_request.rb | 115 + ...t_timestamp_override_patch_data_request.rb | 154 + ...cident_timestamp_override_patch_request.rb | 123 + ...cident_timestamp_override_relationships.rb | 115 + .../incident_timestamp_override_request.rb | 123 + .../incident_timestamp_override_response.rb | 135 + .../incident_timestamp_override_type.rb | 26 + .../incident_timestamp_overrides_response.rb | 137 + .../v2/models/incident_timestamp_type.rb | 29 + ...er_defined_role_data_attributes_request.rb | 162 + ...r_defined_role_data_attributes_response.rb | 204 + ...incident_user_defined_role_data_request.rb | 165 + ...ncident_user_defined_role_data_response.rb | 175 + ...defined_role_incident_type_relationship.rb | 123 + ...ed_role_incident_type_relationship_data.rb | 144 + ...ncident_user_defined_role_included_item.rb | 63 + ...ined_role_patch_data_attributes_request.rb | 133 + ...nt_user_defined_role_patch_data_request.rb | 154 + ...ncident_user_defined_role_patch_request.rb | 123 + .../incident_user_defined_role_policy.rb | 123 + ...user_defined_role_relationships_request.rb | 123 + ...ser_defined_role_relationships_response.rb | 125 + .../incident_user_defined_role_request.rb | 123 + .../incident_user_defined_role_response.rb | 135 + .../models/incident_user_defined_role_type.rb | 26 + .../incident_user_defined_roles_response.rb | 137 + 149 files changed, 26322 insertions(+), 972 deletions(-) create mode 100644 examples/v2/incidents/PatchIncidentImpact.rb create mode 100644 examples/v2/incidents/UpdateIncidentImpact.rb create mode 100644 lib/datadog_api_client/v2/models/incident_ai_postmortem_data_attributes_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_ai_postmortem_data_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_ai_postmortem_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_ai_postmortem_response_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_configuration_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_configuration_data_attributes_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_configuration_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_configuration_data_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_configuration_patch_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_configuration_patch_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_configuration_patch_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_configuration_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/incident_configuration_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_configuration_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_configuration_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_create_on_call_page_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_create_on_call_page_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_create_on_call_page_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_create_page_from_incident_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_create_page_from_incident_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_create_page_from_incident_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_create_page_from_incident_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_chat_configuration_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_chat_configuration_data_attributes_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_chat_configuration_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_chat_configuration_data_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_chat_configuration_patch_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_chat_configuration_patch_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_chat_configuration_patch_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_chat_configuration_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_chat_configuration_relationships_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_chat_configuration_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_chat_configuration_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_chat_configuration_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_meet_configuration_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_meet_configuration_data_attributes_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_meet_configuration_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_meet_configuration_data_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_meet_configuration_patch_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_meet_configuration_patch_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_meet_configuration_patch_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_meet_configuration_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_meet_configuration_relationships_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_meet_configuration_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_meet_configuration_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_google_meet_configuration_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_impact_field_choice.rb create mode 100644 lib/datadog_api_client/v2/models/incident_impact_field_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_impact_field_data_attributes_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_impact_field_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_impact_field_data_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_impact_field_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/incident_impact_field_relationships_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_impact_field_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_impact_field_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_impact_field_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_impact_field_value_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_impact_fields_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_on_call_page_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_on_call_page_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_on_call_page_link_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_on_call_page_target.rb create mode 100644 lib/datadog_api_client/v2/models/incident_on_call_page_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_org_settings_data_attributes_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_org_settings_data_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_org_settings_list_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_org_settings_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/incident_org_settings_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_org_settings_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_page_role_reference.rb create mode 100644 lib/datadog_api_client/v2/models/incident_page_role_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_page_target.rb create mode 100644 lib/datadog_api_client/v2/models/incident_page_target_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_page_uuid_data_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_page_uuid_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_page_uuid_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_responder_data_attributes_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_responder_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_responder_data_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_responder_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/incident_responder_relationships_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_responder_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_responder_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_responder_role_assignment_relationship_data.rb create mode 100644 lib/datadog_api_client/v2/models/incident_responder_role_assignments_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/incident_responder_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_responder_user_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/incident_responder_user_relationship_data.rb create mode 100644 lib/datadog_api_client/v2/models/incident_responders_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_rule_condition.rb create mode 100644 lib/datadog_api_client/v2/models/incident_rule_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_rule_data_attributes_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_rule_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_rule_data_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_rule_execution_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_rule_patch_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_rule_patch_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_rule_patch_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_rule_query_condition.rb create mode 100644 lib/datadog_api_client/v2/models/incident_rule_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_rule_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_rule_response_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_rule_task_id_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_rule_trigger_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_rule_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_rules_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_service_now_record_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_service_now_record_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_service_now_record_prompt_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_service_now_record_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_data_attributes_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_data_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_patch_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_patch_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_patch_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_relationships.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_override_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_overrides_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_timestamp_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_user_defined_role_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_user_defined_role_data_attributes_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_user_defined_role_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_user_defined_role_data_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_user_defined_role_incident_type_relationship.rb create mode 100644 lib/datadog_api_client/v2/models/incident_user_defined_role_incident_type_relationship_data.rb create mode 100644 lib/datadog_api_client/v2/models/incident_user_defined_role_included_item.rb create mode 100644 lib/datadog_api_client/v2/models/incident_user_defined_role_patch_data_attributes_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_user_defined_role_patch_data_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_user_defined_role_patch_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_user_defined_role_policy.rb create mode 100644 lib/datadog_api_client/v2/models/incident_user_defined_role_relationships_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_user_defined_role_relationships_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_user_defined_role_request.rb create mode 100644 lib/datadog_api_client/v2/models/incident_user_defined_role_response.rb create mode 100644 lib/datadog_api_client/v2/models/incident_user_defined_role_type.rb create mode 100644 lib/datadog_api_client/v2/models/incident_user_defined_roles_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b2e0e022c91c..fba8f21df2d7 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -675,6 +675,22 @@ components: required: true schema: type: string + IncidentGoogleChatConfigurationIDPathParameter: + description: The UUID of the Google Chat configuration. + in: path + name: id + required: true + schema: + format: uuid + type: string + IncidentGoogleMeetConfigurationIDPathParameter: + description: The UUID of the Google Meet configuration. + in: path + name: id + required: true + schema: + format: uuid + type: string IncidentIDPathParameter: description: The UUID of the incident. in: path @@ -682,6 +698,14 @@ components: required: true schema: type: string + IncidentImpactFieldIDPathParameter: + description: The UUID of the impact field. + in: path + name: field_id + required: true + schema: + format: uuid + type: string IncidentImpactIDPathParameter: description: The UUID of the incident impact. in: path @@ -774,6 +798,30 @@ components: schema: example: "created_by_user,incident_type" type: string + IncidentOrgSettingsTypeIDPathParameter: + description: The UUID of the incident type. + in: path + name: incident_type_id + required: true + schema: + format: uuid + type: string + IncidentResponderIDPathParameter: + description: The UUID of the incident responder. + in: path + name: responder_id + required: true + schema: + format: uuid + type: string + IncidentRuleIDPathParameter: + description: The UUID of the incident rule. + in: path + name: rule_id + required: true + schema: + format: uuid + type: string IncidentSearchIncludeQueryParameter: description: Specifies which types of related objects should be included in the response. in: query @@ -822,6 +870,14 @@ components: schema: example: "ExampleServiceName" type: string + IncidentTimestampOverrideIDPathParameter: + description: The UUID of the timestamp override. + in: path + name: id + required: true + schema: + format: uuid + type: string IncidentTodoIDPathParameter: description: The UUID of the incident todo. in: path @@ -851,6 +907,15 @@ components: schema: example: "00000000-0000-0000-0000-000000000000" type: string + IncidentUserDefinedRoleIDPathParameter: + description: The UUID of the incident user-defined role. + in: path + name: role_id + required: true + schema: + example: "00000000-0000-0000-0000-000000000002" + format: uuid + type: string Include: description: Include relationship data. explode: true @@ -38599,6 +38664,71 @@ components: type: string x-mimetype: application/xml type: object + IncidentAIPostmortemDataAttributesResponse: + description: Attributes of an AI-generated incident postmortem. + properties: + action_items: + description: Action items to prevent recurrence. + example: "1. Improve failover testing. 2. Add more monitoring alerts." + type: string + customer_impact: + description: The impact of the incident on customers. + example: "5% of users experienced timeouts for 30 minutes." + type: string + executive_summary: + description: An executive summary of the incident. + example: "A database failover caused a 30-minute service outage affecting 5% of users." + type: string + key_insights: + description: Key insights from the incident. + example: "The auto-failover mechanism was slower than expected under high load." + type: string + key_timeline: + description: Key timeline events during the incident. + example: "10:00 - Alert fired. 10:05 - On-call engineer paged. 10:30 - Issue resolved." + type: string + lessons_learned: + description: Lessons learned from the incident. + example: "We need to test the failover process under realistic load conditions." + type: string + system_overview: + description: An overview of the affected systems. + example: "The primary database cluster experienced a failover event." + type: string + type: object + IncidentAIPostmortemDataResponse: + description: AI postmortem data in a response. + properties: + attributes: + $ref: "#/components/schemas/IncidentAIPostmortemDataAttributesResponse" + id: + description: The incident identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + type: + $ref: "#/components/schemas/IncidentAIPostmortemResponseType" + required: + - id + - type + - attributes + type: object + IncidentAIPostmortemResponse: + description: Response with an AI-generated incident postmortem. + properties: + data: + $ref: "#/components/schemas/IncidentAIPostmortemDataResponse" + required: + - data + type: object + IncidentAIPostmortemResponseType: + description: AI postmortem response resource type. + enum: + - get_incident_ai_postmortem_response + example: get_incident_ai_postmortem_response + type: string + x-enum-varnames: + - GET_INCIDENT_AI_POSTMORTEM_RESPONSE IncidentAttachmentType: default: incident_attachments description: The incident attachment resource type. @@ -38608,6 +38738,175 @@ components: type: string x-enum-varnames: - INCIDENT_ATTACHMENTS + IncidentConfigurationDataAttributesRequest: + description: Attributes for creating an incident configuration. + properties: + execute_integrations: + description: Whether to execute integrations for this incident. + example: true + type: boolean + execute_notification_rules: + description: Whether to execute notification rules for this incident. + example: true + type: boolean + include_in_analytics: + description: Whether to include this incident in analytics. + example: true + type: boolean + include_in_search: + description: Whether to include this incident in search results. + example: true + type: boolean + type: object + IncidentConfigurationDataAttributesResponse: + description: Attributes of an incident configuration in a response. + properties: + created_at: + description: Timestamp when the configuration was created. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + execute_integrations: + description: Whether integrations are executed for this incident. + example: true + type: boolean + execute_notification_rules: + description: Whether notification rules are executed for this incident. + example: true + type: boolean + incident_id: + description: The incident identifier. + example: 00000000-0000-0000-0000-000000000000 + type: string + include_in_analytics: + description: Whether this incident is included in analytics. + example: true + type: boolean + include_in_search: + description: Whether this incident is included in search results. + example: true + type: boolean + modified_at: + description: Timestamp when the configuration was last modified. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + required: + - incident_id + - created_at + - modified_at + type: object + IncidentConfigurationDataRequest: + description: Incident configuration data in a create request. + properties: + attributes: + $ref: "#/components/schemas/IncidentConfigurationDataAttributesRequest" + type: + $ref: "#/components/schemas/IncidentConfigurationType" + required: + - type + type: object + IncidentConfigurationDataResponse: + description: Incident configuration data in a response. + properties: + attributes: + $ref: "#/components/schemas/IncidentConfigurationDataAttributesResponse" + id: + description: The incident configuration identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + relationships: + $ref: "#/components/schemas/IncidentConfigurationRelationships" + type: + $ref: "#/components/schemas/IncidentConfigurationType" + required: + - id + - type + - attributes + type: object + IncidentConfigurationPatchDataAttributesRequest: + description: Attributes for patching an incident configuration. All fields are optional. + properties: + execute_integrations: + description: Whether to execute integrations for this incident. + example: true + type: boolean + execute_notification_rules: + description: Whether to execute notification rules for this incident. + example: true + type: boolean + include_in_analytics: + description: Whether to include this incident in analytics. + example: true + type: boolean + include_in_search: + description: Whether to include this incident in search results. + example: true + type: boolean + type: object + IncidentConfigurationPatchDataRequest: + description: Incident configuration data in a patch request. + properties: + attributes: + $ref: "#/components/schemas/IncidentConfigurationPatchDataAttributesRequest" + id: + description: The incident configuration identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + type: + $ref: "#/components/schemas/IncidentConfigurationType" + required: + - id + - type + type: object + IncidentConfigurationPatchRequest: + description: Request payload for patching an incident configuration. + properties: + data: + $ref: "#/components/schemas/IncidentConfigurationPatchDataRequest" + required: + - data + type: object + IncidentConfigurationRelationships: + description: Relationships for an incident configuration. + properties: + created_by_user: + $ref: "#/components/schemas/RelationshipToUser" + last_modified_by_user: + $ref: "#/components/schemas/RelationshipToUser" + type: object + IncidentConfigurationRequest: + description: Request payload for creating an incident configuration. + properties: + data: + $ref: "#/components/schemas/IncidentConfigurationDataRequest" + required: + - data + type: object + IncidentConfigurationResponse: + description: Response with an incident configuration. + properties: + data: + $ref: "#/components/schemas/IncidentConfigurationDataResponse" + included: + description: Included related resources. + items: + $ref: "#/components/schemas/IncidentUserData" + readOnly: true + type: array + required: + - data + type: object + IncidentConfigurationType: + description: Incident configuration resource type. + enum: + - incidents_configurations + example: incidents_configurations + type: string + x-enum-varnames: + - INCIDENTS_CONFIGURATIONS IncidentCreateAttributes: description: The incident's attributes for a create request. properties: @@ -38665,6 +38964,117 @@ components: - type - attributes type: object + IncidentCreateOnCallPageDataAttributesRequest: + description: Attributes for creating an on-call page from an incident. + properties: + description: + description: The description of the page. + example: A critical incident affecting production systems. + type: string + role: + $ref: "#/components/schemas/IncidentPageRoleReference" + services: + description: List of affected services. + example: + - web-store + items: + type: string + type: array + tags: + description: List of tags for the page. + example: + - env:prod + items: + type: string + type: array + target: + $ref: "#/components/schemas/IncidentPageTarget" + title: + description: The title of the page. + example: Production outage - SEV-1 + type: string + type: object + IncidentCreateOnCallPageDataRequest: + description: On-call page data in a create request. + properties: + attributes: + $ref: "#/components/schemas/IncidentCreateOnCallPageDataAttributesRequest" + type: + $ref: "#/components/schemas/IncidentCreatePageFromIncidentType" + required: + - type + - attributes + type: object + IncidentCreateOnCallPageRequest: + description: Request payload for creating an on-call page from an incident. + properties: + data: + $ref: "#/components/schemas/IncidentCreateOnCallPageDataRequest" + required: + - data + type: object + IncidentCreatePageFromIncidentDataAttributesRequest: + description: Attributes for creating a page from an incident. + properties: + description: + description: The description of the page. + example: A critical incident affecting production systems. + type: string + incident_public_id: + description: The public ID of the incident. + example: "12345" + type: string + role: + $ref: "#/components/schemas/IncidentPageRoleReference" + services: + description: List of affected services. + example: + - web-store + - checkout + items: + type: string + type: array + tags: + description: List of tags for the page. + example: + - env:prod + items: + type: string + type: array + target: + $ref: "#/components/schemas/IncidentPageTarget" + title: + description: The title of the page. + example: Production outage - SEV-1 + type: string + type: object + IncidentCreatePageFromIncidentDataRequest: + description: Page data in a create request. + properties: + attributes: + $ref: "#/components/schemas/IncidentCreatePageFromIncidentDataAttributesRequest" + type: + $ref: "#/components/schemas/IncidentCreatePageFromIncidentType" + required: + - type + - attributes + type: object + IncidentCreatePageFromIncidentRequest: + description: Request payload for creating a page from an incident. + properties: + data: + $ref: "#/components/schemas/IncidentCreatePageFromIncidentDataRequest" + required: + - data + type: object + IncidentCreatePageFromIncidentType: + description: Resource type for a page creation request. + enum: + - page + example: page + type: string + x-enum-varnames: + - PAGE IncidentCreateRelationships: description: The relationships the incident will have with other resources once created. properties: @@ -38738,6 +39148,351 @@ components: - TEXTARRAY - METRICTAG - AUTOCOMPLETE + IncidentGoogleChatConfigurationDataAttributesRequest: + description: Attributes for creating a Google Chat configuration. + properties: + domain_id: + description: The Google Chat domain ID. + example: my-domain + type: string + space_name_template: + description: The template for the Google Chat space name. + example: "{{incident.title}}" + type: string + space_target_audience_id: + description: The target audience ID for the Google Chat space. + example: "123456789" + type: string + space_time_zone: + description: The time zone for the Google Chat space. + example: America/New_York + type: string + required: + - domain_id + - space_name_template + - space_time_zone + - space_target_audience_id + type: object + IncidentGoogleChatConfigurationDataAttributesResponse: + description: Attributes of a Google Chat configuration. + properties: + created_at: + description: Timestamp when the configuration was created. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + domain_id: + description: The Google Chat domain ID. + example: my-domain + type: string + modified_at: + description: Timestamp when the configuration was last modified. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + space_name_template: + description: The template for the Google Chat space name. + example: "{{incident.title}}" + type: string + space_target_audience_id: + description: The target audience ID for the Google Chat space. + example: "123456789" + type: string + space_time_zone: + description: The time zone for the Google Chat space. + example: America/New_York + type: string + required: + - domain_id + - space_name_template + - space_time_zone + - space_target_audience_id + - created_at + - modified_at + type: object + IncidentGoogleChatConfigurationDataRequest: + description: Google Chat configuration data in a create request. + properties: + attributes: + $ref: "#/components/schemas/IncidentGoogleChatConfigurationDataAttributesRequest" + relationships: + $ref: "#/components/schemas/IncidentGoogleChatConfigurationRelationshipsRequest" + type: + $ref: "#/components/schemas/IncidentGoogleChatConfigurationType" + required: + - type + - attributes + - relationships + type: object + IncidentGoogleChatConfigurationDataResponse: + description: Google Chat configuration data in a response. + properties: + attributes: + $ref: "#/components/schemas/IncidentGoogleChatConfigurationDataAttributesResponse" + id: + description: The configuration identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + relationships: + $ref: "#/components/schemas/IncidentGoogleChatConfigurationRelationships" + type: + $ref: "#/components/schemas/IncidentGoogleChatConfigurationType" + required: + - id + - type + - attributes + type: object + IncidentGoogleChatConfigurationPatchDataAttributesRequest: + description: Attributes for patching a Google Chat configuration. All fields are optional. + properties: + domain_id: + description: The Google Chat domain ID. + example: my-domain + type: string + space_name_template: + description: The template for the Google Chat space name. + example: "{{incident.title}}" + type: string + space_target_audience_id: + description: The target audience ID for the Google Chat space. + example: "123456789" + type: string + space_time_zone: + description: The time zone for the Google Chat space. + example: America/New_York + type: string + type: object + IncidentGoogleChatConfigurationPatchDataRequest: + description: Google Chat configuration data in a patch request. + properties: + attributes: + $ref: "#/components/schemas/IncidentGoogleChatConfigurationPatchDataAttributesRequest" + id: + description: The configuration identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + type: + $ref: "#/components/schemas/IncidentGoogleChatConfigurationType" + required: + - id + - type + type: object + IncidentGoogleChatConfigurationPatchRequest: + description: Request payload for patching a Google Chat configuration. + properties: + data: + $ref: "#/components/schemas/IncidentGoogleChatConfigurationPatchDataRequest" + required: + - data + type: object + IncidentGoogleChatConfigurationRelationships: + description: Relationships for a Google Chat configuration. + properties: + created_by_user: + $ref: "#/components/schemas/RelationshipToUser" + incident_type: + $ref: "#/components/schemas/RelationshipToIncidentType" + last_modified_by_user: + $ref: "#/components/schemas/RelationshipToUser" + type: object + IncidentGoogleChatConfigurationRelationshipsRequest: + description: Relationships for a Google Chat configuration create request. + properties: + incident_type: + $ref: "#/components/schemas/RelationshipToIncidentType" + required: + - incident_type + type: object + IncidentGoogleChatConfigurationRequest: + description: Request payload for creating a Google Chat configuration. + properties: + data: + $ref: "#/components/schemas/IncidentGoogleChatConfigurationDataRequest" + required: + - data + type: object + IncidentGoogleChatConfigurationResponse: + description: Response with a Google Chat configuration. + properties: + data: + $ref: "#/components/schemas/IncidentGoogleChatConfigurationDataResponse" + included: + description: Included related resources. + items: + $ref: "#/components/schemas/IncidentUserData" + readOnly: true + type: array + required: + - data + type: object + IncidentGoogleChatConfigurationType: + description: Google Chat configuration resource type. + enum: + - google_chat_configurations + example: google_chat_configurations + type: string + x-enum-varnames: + - GOOGLE_CHAT_CONFIGURATIONS + IncidentGoogleMeetConfigurationDataAttributesRequest: + description: Attributes for creating a Google Meet configuration. + properties: + allow_manual_meeting_creation: + description: Whether to allow manual meeting creation. + example: true + type: boolean + auto_summarize: + description: Whether to auto-summarize meetings. + example: false + type: boolean + required: + - allow_manual_meeting_creation + - auto_summarize + type: object + IncidentGoogleMeetConfigurationDataAttributesResponse: + description: Attributes of a Google Meet configuration. + properties: + allow_manual_meeting_creation: + description: Whether manual meeting creation is allowed. + example: true + type: boolean + auto_summarize: + description: Whether meetings are auto-summarized. + example: false + type: boolean + created_at: + description: Timestamp when the configuration was created. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + modified_at: + description: Timestamp when the configuration was last modified. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + required: + - allow_manual_meeting_creation + - auto_summarize + - modified_at + type: object + IncidentGoogleMeetConfigurationDataRequest: + description: Google Meet configuration data in a create request. + properties: + attributes: + $ref: "#/components/schemas/IncidentGoogleMeetConfigurationDataAttributesRequest" + relationships: + $ref: "#/components/schemas/IncidentGoogleMeetConfigurationRelationshipsRequest" + type: + $ref: "#/components/schemas/IncidentGoogleMeetConfigurationType" + required: + - type + - attributes + - relationships + type: object + IncidentGoogleMeetConfigurationDataResponse: + description: Google Meet configuration data in a response. + properties: + attributes: + $ref: "#/components/schemas/IncidentGoogleMeetConfigurationDataAttributesResponse" + id: + description: The configuration identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + relationships: + $ref: "#/components/schemas/IncidentGoogleMeetConfigurationRelationships" + type: + $ref: "#/components/schemas/IncidentGoogleMeetConfigurationType" + required: + - id + - type + - attributes + type: object + IncidentGoogleMeetConfigurationPatchDataAttributesRequest: + description: Attributes for patching a Google Meet configuration. All fields are optional. + properties: + allow_manual_meeting_creation: + description: Whether to allow manual meeting creation. + example: true + type: boolean + auto_summarize: + description: Whether to auto-summarize meetings. + example: false + type: boolean + type: object + IncidentGoogleMeetConfigurationPatchDataRequest: + description: Google Meet configuration data in a patch request. + properties: + attributes: + $ref: "#/components/schemas/IncidentGoogleMeetConfigurationPatchDataAttributesRequest" + id: + description: The configuration identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + type: + $ref: "#/components/schemas/IncidentGoogleMeetConfigurationType" + required: + - id + - type + type: object + IncidentGoogleMeetConfigurationPatchRequest: + description: Request payload for patching a Google Meet configuration. + properties: + data: + $ref: "#/components/schemas/IncidentGoogleMeetConfigurationPatchDataRequest" + required: + - data + type: object + IncidentGoogleMeetConfigurationRelationships: + description: Relationships for a Google Meet configuration. + properties: + created_by_user: + $ref: "#/components/schemas/RelationshipToUser" + incident_type: + $ref: "#/components/schemas/RelationshipToIncidentType" + last_modified_by_user: + $ref: "#/components/schemas/RelationshipToUser" + type: object + IncidentGoogleMeetConfigurationRelationshipsRequest: + description: Relationships for a Google Meet configuration create request. + properties: + incident_type: + $ref: "#/components/schemas/RelationshipToIncidentType" + required: + - incident_type + type: object + IncidentGoogleMeetConfigurationRequest: + description: Request payload for creating a Google Meet configuration. + properties: + data: + $ref: "#/components/schemas/IncidentGoogleMeetConfigurationDataRequest" + required: + - data + type: object + IncidentGoogleMeetConfigurationResponse: + description: Response with a Google Meet configuration. + properties: + data: + $ref: "#/components/schemas/IncidentGoogleMeetConfigurationDataResponse" + included: + description: Included related resources. + items: + $ref: "#/components/schemas/IncidentUserData" + readOnly: true + type: array + required: + - data + type: object + IncidentGoogleMeetConfigurationType: + description: Google Meet configuration resource type. + enum: + - google_meet_configurations + example: google_meet_configurations + type: string + x-enum-varnames: + - GOOGLE_MEET_CONFIGURATIONS IncidentHandleAttributesFields: description: Dynamic fields associated with the handle example: @@ -39015,12 +39770,205 @@ components: required: - data type: object + IncidentImpactFieldChoice: + description: A choice option for a dropdown or multiselect impact field. + properties: + description: + description: The description of the choice. + example: Affects all customers + type: string + display_name: + description: The display name of the choice. + example: Critical + type: string + value: + description: The value of the choice. + example: critical + type: string + required: + - value + - display_name + type: object + IncidentImpactFieldDataAttributesRequest: + description: Attributes for creating an impact field. + properties: + display_name: + description: The display name of the impact field. + example: Customer Impact Scope + type: string + field_choices: + description: The choices for dropdown or multiselect fields. + items: + $ref: "#/components/schemas/IncidentImpactFieldChoice" + type: array + field_type: + $ref: "#/components/schemas/IncidentImpactFieldValueType" + name: + description: The normalized name of the impact field (used as identifier). + example: customer_impact_scope + type: string + tag_key: + description: The tag key associated with the field (for metrictag type). + example: env + nullable: true + type: string + required: + - name + - display_name + - field_type + type: object + IncidentImpactFieldDataAttributesResponse: + description: Attributes of an impact field in a response. + properties: + display_name: + description: The display name of the impact field. + example: Customer Impact Scope + type: string + field_choices: + description: The choices for dropdown or multiselect fields. + items: + $ref: "#/components/schemas/IncidentImpactFieldChoice" + type: array + field_type: + $ref: "#/components/schemas/IncidentImpactFieldValueType" + name: + description: The normalized name of the impact field. + example: customer_impact_scope + type: string + tag_key: + description: The tag key associated with the field. + example: env + nullable: true + type: string + required: + - name + - display_name + - field_type + type: object + IncidentImpactFieldDataRequest: + description: Impact field data in a create request. + properties: + attributes: + $ref: "#/components/schemas/IncidentImpactFieldDataAttributesRequest" + relationships: + $ref: "#/components/schemas/IncidentImpactFieldRelationshipsRequest" + type: + $ref: "#/components/schemas/IncidentImpactFieldType" + required: + - type + - attributes + - relationships + type: object + IncidentImpactFieldDataResponse: + description: Impact field data in a response. + properties: + attributes: + $ref: "#/components/schemas/IncidentImpactFieldDataAttributesResponse" + id: + description: The impact field identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + relationships: + $ref: "#/components/schemas/IncidentImpactFieldRelationships" + type: + $ref: "#/components/schemas/IncidentImpactFieldType" + required: + - id + - type + - attributes + type: object + IncidentImpactFieldRelationships: + description: Relationships for an impact field. + properties: + created_by_user: + $ref: "#/components/schemas/RelationshipToUser" + incident_type: + $ref: "#/components/schemas/RelationshipToIncidentType" + last_modified_by_user: + $ref: "#/components/schemas/RelationshipToUser" + type: object + IncidentImpactFieldRelationshipsRequest: + description: Relationships for an impact field create request. + properties: + incident_type: + $ref: "#/components/schemas/RelationshipToIncidentType" + required: + - incident_type + type: object + IncidentImpactFieldRequest: + description: Request payload for creating an impact field. + properties: + data: + $ref: "#/components/schemas/IncidentImpactFieldDataRequest" + required: + - data + type: object + IncidentImpactFieldResponse: + description: Response with a single impact field. + properties: + data: + $ref: "#/components/schemas/IncidentImpactFieldDataResponse" + included: + description: Included related resources. + items: + $ref: "#/components/schemas/IncidentUserData" + readOnly: true + type: array + required: + - data + type: object + IncidentImpactFieldType: + description: Impact field resource type. + enum: + - impact_fields + example: impact_fields + type: string + x-enum-varnames: + - IMPACT_FIELDS + IncidentImpactFieldValueType: + description: The type of an impact field. + enum: + - dropdown + - text + - textarray + - metrictag + - number + - datetime + - multiselect + example: dropdown + type: string + x-enum-varnames: + - DROPDOWN + - TEXT + - TEXTARRAY + - METRICTAG + - NUMBER + - DATETIME + - MULTISELECT IncidentImpactFieldsObject: additionalProperties: {} description: An object mapping impact field names to field values. example: {"customers_impacted": "all", "products_impacted": ["shopping", "marketing"]} nullable: true type: object + IncidentImpactFieldsResponse: + description: Response with a list of impact fields. + properties: + data: + description: List of impact fields. + items: + $ref: "#/components/schemas/IncidentImpactFieldDataResponse" + type: array + included: + description: Included related resources. + items: + $ref: "#/components/schemas/IncidentUserData" + readOnly: true + type: array + required: + - data + type: object IncidentImpactRelatedObject: description: A reference to a resource related to an incident impact. enum: @@ -40074,6 +41022,226 @@ components: - id - type type: object + IncidentOnCallPageDataAttributesRequest: + description: Attributes for linking a page to an incident. + properties: + key: + description: The key of the on-call page. + example: PAGE-12345 + type: string + page_target: + $ref: "#/components/schemas/IncidentOnCallPageTarget" + team_id: + description: The team ID associated with the page (deprecated, use page_target instead). + example: team-abc-123 + type: string + type: object + IncidentOnCallPageDataRequest: + description: On-call page data in a link request. + properties: + attributes: + $ref: "#/components/schemas/IncidentOnCallPageDataAttributesRequest" + id: + description: The ID of the on-call page to link. + example: PAGE-12345 + type: string + type: + $ref: "#/components/schemas/IncidentOnCallPageType" + required: + - id + - type + type: object + IncidentOnCallPageLinkRequest: + description: Request payload for linking an on-call page to an incident. + properties: + data: + $ref: "#/components/schemas/IncidentOnCallPageDataRequest" + required: + - data + type: object + IncidentOnCallPageTarget: + description: The target of an on-call page. + properties: + identifier: + description: The identifier of the page target. + example: my-oncall-team + type: string + type: + description: The type of the page target. + example: team_handle + type: string + required: + - type + - identifier + type: object + IncidentOnCallPageType: + description: On-call page resource type. + enum: + - page + example: page + type: string + x-enum-varnames: + - PAGE + IncidentOrgSettingsDataAttributesResponse: + description: Attributes of an incident org settings resource in a response. + properties: + created: + description: Timestamp when the settings were created. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + modified: + description: Timestamp when the settings were last modified. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + settings: + $ref: "#/components/schemas/IncidentOrgSettingsMeta" + required: + - created + - modified + - settings + type: object + IncidentOrgSettingsDataResponse: + description: Incident org settings data in a response. + properties: + attributes: + $ref: "#/components/schemas/IncidentOrgSettingsDataAttributesResponse" + id: + description: The org settings identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + relationships: + $ref: "#/components/schemas/IncidentOrgSettingsRelationships" + type: + $ref: "#/components/schemas/IncidentOrgSettingsType" + required: + - id + - type + - attributes + type: object + IncidentOrgSettingsListResponse: + description: Response with a list of incident org settings resources. + properties: + data: + description: List of incident org settings resources. + items: + $ref: "#/components/schemas/IncidentOrgSettingsDataResponse" + type: array + required: + - data + type: object + IncidentOrgSettingsMeta: + additionalProperties: {} + description: The settings configuration for an incident org settings resource. + example: + allow_anonymous_incident_declaration: false + allow_guest_incident_declaration: false + pagerduty_paging: true + private_incidents_by_default: false + type: object + IncidentOrgSettingsRelationships: + description: Relationships for an incident org settings resource. + properties: + incident_type: + $ref: "#/components/schemas/RelationshipToIncidentType" + type: object + IncidentOrgSettingsResponse: + description: Response with a single incident org settings resource. + properties: + data: + $ref: "#/components/schemas/IncidentOrgSettingsDataResponse" + required: + - data + type: object + IncidentOrgSettingsType: + description: Incident org settings resource type. + enum: + - incident_org_settings + example: incident_org_settings + type: string + x-enum-varnames: + - INCIDENT_ORG_SETTINGS + IncidentPageRoleReference: + description: A reference to an incident role for a page. + properties: + id: + description: The role identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + type: + $ref: "#/components/schemas/IncidentPageRoleType" + required: + - type + - id + type: object + IncidentPageRoleType: + description: The type of incident role for a page. + enum: + - incident_user_defined_roles + - incident_reserved_roles + example: incident_user_defined_roles + type: string + x-enum-varnames: + - INCIDENT_USER_DEFINED_ROLES + - INCIDENT_RESERVED_ROLES + IncidentPageTarget: + description: The target recipient for a page. + properties: + identifier: + description: The identifier of the target (handle, UUID, or user UUID). + example: my-team-handle + type: string + type: + $ref: "#/components/schemas/IncidentPageTargetType" + required: + - type + - identifier + type: object + IncidentPageTargetType: + description: The type of target for a page request. + enum: + - team_handle + - team_uuid + - user_uuid + example: team_uuid + type: string + x-enum-varnames: + - TEAM_HANDLE + - TEAM_UUID + - USER_UUID + IncidentPageUUIDDataResponse: + description: Page UUID data in a response. + properties: + id: + description: The UUID of the created page. + example: 00000000-0000-0000-0000-000000000001 + format: uuid + type: string + type: + $ref: "#/components/schemas/IncidentPageUUIDType" + required: + - id + - type + type: object + IncidentPageUUIDResponse: + description: Response with a page UUID. + properties: + data: + $ref: "#/components/schemas/IncidentPageUUIDDataResponse" + required: + - data + type: object + IncidentPageUUIDType: + description: Resource type for a page UUID response. + enum: + - page_uuid + example: page_uuid + type: string + x-enum-varnames: + - PAGE_UUID IncidentPostmortemType: default: incident_postmortems description: Incident postmortem resource type. @@ -40113,6 +41281,195 @@ components: type: string x-enum-varnames: - INCIDENTS + IncidentResponderDataAttributesResponse: + description: Attributes of an incident responder in a response. + properties: + created: + description: Timestamp when the responder was created. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + external_id: + description: The external ID of the responder. + example: + nullable: true + type: string + external_source: + description: The external source of the responder. + example: + nullable: true + type: string + is_billable: + description: Whether this responder counts toward billing. + example: true + type: boolean + last_active: + description: Timestamp when the responder was last active. + example: "2024-01-01T00:00:00.000Z" + format: date-time + nullable: true + type: string + meta: + additionalProperties: {} + description: Additional metadata for the responder. + nullable: true + type: object + modified: + description: Timestamp when the responder was last modified. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + required: + - created + - modified + - is_billable + type: object + IncidentResponderDataRequest: + description: Incident responder data in a create request. + properties: + relationships: + $ref: "#/components/schemas/IncidentResponderRelationshipsRequest" + type: + $ref: "#/components/schemas/IncidentResponderType" + required: + - type + - relationships + type: object + IncidentResponderDataResponse: + description: Incident responder data in a response. + properties: + attributes: + $ref: "#/components/schemas/IncidentResponderDataAttributesResponse" + id: + description: The responder identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + relationships: + $ref: "#/components/schemas/IncidentResponderRelationships" + type: + $ref: "#/components/schemas/IncidentResponderType" + required: + - id + - type + - attributes + type: object + IncidentResponderRelationships: + description: Relationships for an incident responder. + properties: + created_by: + $ref: "#/components/schemas/RelationshipToUser" + last_modified_by: + $ref: "#/components/schemas/RelationshipToUser" + role_assignments: + $ref: "#/components/schemas/IncidentResponderRoleAssignmentsRelationship" + user: + $ref: "#/components/schemas/NullableRelationshipToUser" + type: object + IncidentResponderRelationshipsRequest: + description: Relationships for creating an incident responder. + properties: + user: + $ref: "#/components/schemas/IncidentResponderUserRelationship" + required: + - user + type: object + IncidentResponderRequest: + description: Request payload for creating an incident responder. + properties: + data: + $ref: "#/components/schemas/IncidentResponderDataRequest" + required: + - data + type: object + IncidentResponderResponse: + description: Response with a single incident responder. + properties: + data: + $ref: "#/components/schemas/IncidentResponderDataResponse" + included: + description: Included related resources. + items: + $ref: "#/components/schemas/IncidentUserData" + readOnly: true + type: array + required: + - data + type: object + IncidentResponderRoleAssignmentRelationshipData: + description: A single role assignment relationship data object. + properties: + id: + description: The role assignment identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + type: + description: The role assignment resource type. + example: incident_role_assignments + type: string + required: + - id + - type + type: object + IncidentResponderRoleAssignmentsRelationship: + description: Relationship to role assignments for a responder. + properties: + data: + description: List of role assignment relationship data. + items: + $ref: "#/components/schemas/IncidentResponderRoleAssignmentRelationshipData" + type: array + type: object + IncidentResponderType: + description: Incident responder resource type. + enum: + - incident_responders + example: incident_responders + type: string + x-enum-varnames: + - INCIDENT_RESPONDERS + IncidentResponderUserRelationship: + description: Relationship to a user for a responder create request. + properties: + data: + $ref: "#/components/schemas/IncidentResponderUserRelationshipData" + required: + - data + type: object + IncidentResponderUserRelationshipData: + description: A user relationship data object for creating a responder. + properties: + id: + description: The user identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + type: + description: The user resource type. + example: users + type: string + required: + - id + - type + type: object + IncidentRespondersResponse: + description: Response with a list of incident responders. + properties: + data: + description: List of incident responders. + items: + $ref: "#/components/schemas/IncidentResponderDataResponse" + type: array + included: + description: Included related resources. + items: + $ref: "#/components/schemas/IncidentUserData" + readOnly: true + type: array + required: + - data + type: object IncidentRespondersType: description: The incident responders type. enum: @@ -40348,6 +41705,332 @@ components: user_defined_fields: $ref: "#/components/schemas/RelationshipToIncidentUserDefinedFields" type: object + IncidentRuleCondition: + description: A condition for an incident rule. + properties: + field: + description: The field to match on. + example: severity + type: string + values: + description: The values to match. + example: + - SEV-1 + - SEV-2 + items: + type: string + type: array + required: + - field + - values + type: object + IncidentRuleDataAttributesRequest: + description: Attributes for creating an incident rule. + properties: + condition: + $ref: "#/components/schemas/IncidentRuleQueryCondition" + condition_table_type: + description: "The condition table type. 1 = raw query." + example: 1 + type: integer + conditions: + description: List of field-based conditions. + items: + $ref: "#/components/schemas/IncidentRuleCondition" + type: array + enabled: + description: Whether the rule is enabled. + example: true + type: boolean + execution_type: + $ref: "#/components/schemas/IncidentRuleExecutionType" + incident_type_uuid: + description: The UUID of the incident type this rule applies to. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + nullable: true + type: string + match_any_condition: + description: Whether any condition (OR logic) should match instead of all (AND logic). + example: false + type: boolean + task_id: + $ref: "#/components/schemas/IncidentRuleTaskIDType" + task_payload: + description: The JSON-encoded payload for the task. + example: "{}" + type: string + trigger: + $ref: "#/components/schemas/IncidentRuleTriggerType" + required: + - execution_type + - condition_table_type + - condition + - task_id + - task_payload + - enabled + type: object + IncidentRuleDataAttributesResponse: + description: Attributes of an incident rule in a response. + properties: + condition: + $ref: "#/components/schemas/IncidentRuleQueryCondition" + condition_table_type: + description: The condition table type. + example: 1 + type: integer + conditions: + description: List of field-based conditions. + items: + $ref: "#/components/schemas/IncidentRuleCondition" + type: array + created: + description: Timestamp when the rule was created. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + created_by_uuid: + description: UUID of the user who created the rule. + example: 00000000-0000-0000-0000-000000000001 + format: uuid + type: string + deleted: + description: Timestamp when the rule was deleted. + example: + format: date-time + nullable: true + type: string + enabled: + description: Whether the rule is enabled. + example: true + type: boolean + execution_type: + description: The execution type of the rule. + example: 1 + type: integer + incident_settings_association_uuid: + description: The incident settings association UUID. + example: + format: uuid + nullable: true + type: string + match_any_condition: + description: Whether any condition should match. + example: false + type: boolean + modified: + description: Timestamp when the rule was last modified. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + modified_by_uuid: + description: UUID of the user who last modified the rule. + example: 00000000-0000-0000-0000-000000000001 + format: uuid + type: string + org_id: + description: The organization ID. + example: 123456 + format: int64 + type: integer + task_id: + description: The task ID. + example: notify-incident-handles-job + nullable: true + type: string + task_payload: + description: The JSON-encoded task payload. + example: "{}" + nullable: true + type: string + trigger: + description: The trigger event for the rule. + example: incident_created_trigger + type: string + type: object + IncidentRuleDataRequest: + description: Incident rule data in a create request. + properties: + attributes: + $ref: "#/components/schemas/IncidentRuleDataAttributesRequest" + type: + $ref: "#/components/schemas/IncidentRuleType" + required: + - type + - attributes + type: object + IncidentRuleDataResponse: + description: Incident rule data in a response. + properties: + attributes: + $ref: "#/components/schemas/IncidentRuleDataAttributesResponse" + id: + description: The rule identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + type: + $ref: "#/components/schemas/IncidentRuleResponseType" + required: + - id + - type + - attributes + type: object + IncidentRuleExecutionType: + description: The execution type of an incident rule. + enum: + - 1 + - 2 + example: 1 + format: int64 + type: integer + x-enum-varnames: + - SINGLE_EXECUTION + - MULTI_EXECUTION + IncidentRulePatchDataAttributesRequest: + description: Attributes for patching an incident rule. All fields are optional. + properties: + condition: + $ref: "#/components/schemas/IncidentRuleQueryCondition" + conditions: + description: List of field-based conditions. + items: + $ref: "#/components/schemas/IncidentRuleCondition" + type: array + enabled: + description: Whether the rule is enabled. + example: true + type: boolean + task_payload: + description: The JSON-encoded payload for the task. + example: "{}" + type: string + trigger: + $ref: "#/components/schemas/IncidentRuleTriggerType" + type: object + IncidentRulePatchDataRequest: + description: Incident rule data in a patch request. + properties: + attributes: + $ref: "#/components/schemas/IncidentRulePatchDataAttributesRequest" + id: + description: The rule identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + type: + $ref: "#/components/schemas/IncidentRuleType" + required: + - id + - type + type: object + IncidentRulePatchRequest: + description: Request payload for patching an incident rule. + properties: + data: + $ref: "#/components/schemas/IncidentRulePatchDataRequest" + required: + - data + type: object + IncidentRuleQueryCondition: + description: A query-based condition for an incident rule. + properties: + normalized_query: + description: The normalized query string. + example: "severity:SEV-1" + nullable: true + type: string + raw_query: + description: The raw query string. + example: "severity:SEV-1" + nullable: true + type: string + type: object + IncidentRuleRequest: + description: Request payload for creating an incident rule. + properties: + data: + $ref: "#/components/schemas/IncidentRuleDataRequest" + required: + - data + type: object + IncidentRuleResponse: + description: Response with a single incident rule. + properties: + data: + $ref: "#/components/schemas/IncidentRuleDataResponse" + required: + - data + type: object + IncidentRuleResponseType: + description: Incident rule response resource type. + enum: + - incidents_rules + example: incidents_rules + type: string + x-enum-varnames: + - INCIDENTS_RULES + IncidentRuleTaskIDType: + description: The task ID for an incident rule. + enum: + - jira-create-issue-job + - notify-incident-handles-job + - servicenow-create-incident-job + - slack-create-channel-job + - zoom-create-meeting-job + - google-meet-create-meeting-job + - workflow-automation-job + - ms-teams-create-meeting-job + - google-chat-create-space-job + - zoom-suppress-summarization-job + - ms-teams-suppress-summarization-job + - google-meet-suppress-summarization-job + example: notify-incident-handles-job + type: string + x-enum-varnames: + - JIRA_CREATE_ISSUE_JOB + - NOTIFY_INCIDENT_HANDLES_JOB + - SERVICENOW_CREATE_INCIDENT_JOB + - SLACK_CREATE_CHANNEL_JOB + - ZOOM_CREATE_MEETING_JOB + - GOOGLE_MEET_CREATE_MEETING_JOB + - WORKFLOW_AUTOMATION_JOB + - MS_TEAMS_CREATE_MEETING_JOB + - GOOGLE_CHAT_CREATE_SPACE_JOB + - ZOOM_SUPPRESS_SUMMARIZATION_JOB + - MS_TEAMS_SUPPRESS_SUMMARIZATION_JOB + - GOOGLE_MEET_SUPPRESS_SUMMARIZATION_JOB + IncidentRuleTriggerType: + description: The trigger event for an incident rule. + enum: + - incident_saved_trigger + - incident_created_trigger + - incident_modified_trigger + example: incident_created_trigger + type: string + x-enum-varnames: + - INCIDENT_SAVED_TRIGGER + - INCIDENT_CREATED_TRIGGER + - INCIDENT_MODIFIED_TRIGGER + IncidentRuleType: + description: Incident rule resource type. + enum: + - incident_rules + example: incident_rules + type: string + x-enum-varnames: + - INCIDENT_RULES + IncidentRulesResponse: + description: Response with a list of incident rules. + properties: + data: + description: List of incident rules. + items: + $ref: "#/components/schemas/IncidentRuleDataResponse" + type: array + required: + - data + type: object IncidentSearchResponse: description: Response with incidents and facets. properties: @@ -40604,6 +42287,57 @@ components: description: An object related to an incident service which is present in the included payload. oneOf: - $ref: "#/components/schemas/User" + IncidentServiceNowRecordDataAttributesRequest: + description: Attributes for creating a ServiceNow record for an incident. + properties: + assignment_group: + description: The ServiceNow assignment group. + example: IT Support + type: string + configuration_item_mapping: + description: The ServiceNow configuration item mapping. + example: my-service + type: string + instance_name: + description: The ServiceNow instance name. + example: my-instance + type: string + record_id: + description: An existing ServiceNow record ID (Sys ID) to link instead of creating a new record. + example: abc123def456 + type: string + required: + - instance_name + - assignment_group + - configuration_item_mapping + type: object + IncidentServiceNowRecordDataRequest: + description: ServiceNow record data in a create request. + properties: + attributes: + $ref: "#/components/schemas/IncidentServiceNowRecordDataAttributesRequest" + type: + $ref: "#/components/schemas/IncidentServiceNowRecordPromptType" + required: + - type + - attributes + type: object + IncidentServiceNowRecordPromptType: + description: ServiceNow record prompt resource type. + enum: + - incident_servicenow_record_prompt + example: incident_servicenow_record_prompt + type: string + x-enum-varnames: + - INCIDENT_SERVICENOW_RECORD_PROMPT + IncidentServiceNowRecordRequest: + description: Request payload for creating a ServiceNow record for an incident. + properties: + data: + $ref: "#/components/schemas/IncidentServiceNowRecordDataRequest" + required: + - data + type: object IncidentServiceRelationships: description: The incident service's relationships. properties: @@ -40783,6 +42517,191 @@ components: nullable: false type: string type: object + IncidentTimestampOverrideDataAttributesRequest: + description: Attributes for creating a timestamp override. + properties: + timestamp_type: + $ref: "#/components/schemas/IncidentTimestampType" + timestamp_value: + description: The overridden timestamp value. + example: "2024-01-01T10:00:00.000Z" + format: date-time + type: string + required: + - timestamp_type + - timestamp_value + type: object + IncidentTimestampOverrideDataAttributesResponse: + description: Attributes of a timestamp override in a response. + properties: + created_at: + description: Timestamp when the override was created. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + deleted_at: + description: Timestamp when the override was deleted. + example: + format: date-time + nullable: true + type: string + incident_id: + description: The incident identifier. + example: 00000000-0000-0000-0000-000000000000 + type: string + modified_at: + description: Timestamp when the override was last modified. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + timestamp_type: + $ref: "#/components/schemas/IncidentTimestampType" + timestamp_value: + description: The overridden timestamp value. + example: "2024-01-01T10:00:00.000Z" + format: date-time + type: string + required: + - incident_id + - timestamp_type + - timestamp_value + - created_at + - modified_at + type: object + IncidentTimestampOverrideDataRequest: + description: Timestamp override data in a create request. + properties: + attributes: + $ref: "#/components/schemas/IncidentTimestampOverrideDataAttributesRequest" + type: + $ref: "#/components/schemas/IncidentTimestampOverrideType" + required: + - type + - attributes + type: object + IncidentTimestampOverrideDataResponse: + description: Timestamp override data in a response. + properties: + attributes: + $ref: "#/components/schemas/IncidentTimestampOverrideDataAttributesResponse" + id: + description: The timestamp override identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + relationships: + $ref: "#/components/schemas/IncidentTimestampOverrideRelationships" + type: + $ref: "#/components/schemas/IncidentTimestampOverrideType" + required: + - id + - type + - attributes + type: object + IncidentTimestampOverridePatchDataAttributesRequest: + description: Attributes for patching a timestamp override. All fields are optional. + properties: + timestamp_type: + $ref: "#/components/schemas/IncidentTimestampType" + timestamp_value: + description: The overridden timestamp value. + example: "2024-01-01T10:00:00.000Z" + format: date-time + type: string + type: object + IncidentTimestampOverridePatchDataRequest: + description: Timestamp override data in a patch request. + properties: + attributes: + $ref: "#/components/schemas/IncidentTimestampOverridePatchDataAttributesRequest" + id: + description: The timestamp override identifier. + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + type: + $ref: "#/components/schemas/IncidentTimestampOverrideType" + required: + - id + - type + type: object + IncidentTimestampOverridePatchRequest: + description: Request payload for patching a timestamp override. + properties: + data: + $ref: "#/components/schemas/IncidentTimestampOverridePatchDataRequest" + required: + - data + type: object + IncidentTimestampOverrideRelationships: + description: Relationships for a timestamp override. + properties: + created_by_user: + $ref: "#/components/schemas/RelationshipToUser" + last_modified_by_user: + $ref: "#/components/schemas/RelationshipToUser" + type: object + IncidentTimestampOverrideRequest: + description: Request payload for creating a timestamp override. + properties: + data: + $ref: "#/components/schemas/IncidentTimestampOverrideDataRequest" + required: + - data + type: object + IncidentTimestampOverrideResponse: + description: Response with a single timestamp override. + properties: + data: + $ref: "#/components/schemas/IncidentTimestampOverrideDataResponse" + included: + description: Included related resources. + items: + $ref: "#/components/schemas/IncidentUserData" + readOnly: true + type: array + required: + - data + type: object + IncidentTimestampOverrideType: + description: Incident timestamp override resource type. + enum: + - incidents_timestamp_overrides + example: incidents_timestamp_overrides + type: string + x-enum-varnames: + - INCIDENTS_TIMESTAMP_OVERRIDES + IncidentTimestampOverridesResponse: + description: Response with a list of timestamp overrides. + properties: + data: + description: List of timestamp overrides. + items: + $ref: "#/components/schemas/IncidentTimestampOverrideDataResponse" + type: array + included: + description: Included related resources. + items: + $ref: "#/components/schemas/IncidentUserData" + readOnly: true + type: array + required: + - data + type: object + IncidentTimestampType: + description: The type of timestamp to override. + enum: + - created + - detected + - resolved + - declared + example: detected + type: string + x-enum-varnames: + - CREATED + - DETECTED + - RESOLVED + - DECLARED IncidentTodoAnonymousAssignee: description: Anonymous assignee entity. properties: @@ -41731,6 +43650,229 @@ components: - display_name - value type: object + IncidentUserDefinedRoleDataAttributesRequest: + description: Attributes for creating an incident user-defined role. + properties: + description: + description: A description of the user-defined role. + example: "The technical lead for the incident." + nullable: true + type: string + name: + description: The name of the user-defined role. + example: "Tech Lead" + type: string + policy: + $ref: "#/components/schemas/IncidentUserDefinedRolePolicy" + required: + - name + - policy + type: object + IncidentUserDefinedRoleDataAttributesResponse: + description: Attributes of an incident user-defined role. + properties: + created: + description: Timestamp when the role was created. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + description: + description: A description of the user-defined role. + example: "The technical lead for the incident." + nullable: true + type: string + modified: + description: Timestamp when the role was last modified. + example: "2024-01-01T00:00:00.000Z" + format: date-time + type: string + name: + description: The name of the user-defined role. + example: "Tech Lead" + type: string + policy: + $ref: "#/components/schemas/IncidentUserDefinedRolePolicy" + required: + - name + - policy + - created + - modified + type: object + IncidentUserDefinedRoleDataRequest: + description: Data for creating an incident user-defined role. + properties: + attributes: + $ref: "#/components/schemas/IncidentUserDefinedRoleDataAttributesRequest" + relationships: + $ref: "#/components/schemas/IncidentUserDefinedRoleRelationshipsRequest" + type: + $ref: "#/components/schemas/IncidentUserDefinedRoleType" + required: + - type + - attributes + - relationships + type: object + IncidentUserDefinedRoleDataResponse: + description: Data for an incident user-defined role response. + properties: + attributes: + $ref: "#/components/schemas/IncidentUserDefinedRoleDataAttributesResponse" + id: + description: The ID of the user-defined role. + example: "00000000-0000-0000-0000-000000000002" + format: uuid + type: string + relationships: + $ref: "#/components/schemas/IncidentUserDefinedRoleRelationshipsResponse" + type: + $ref: "#/components/schemas/IncidentUserDefinedRoleType" + required: + - id + - type + - attributes + type: object + IncidentUserDefinedRoleIncidentTypeRelationship: + description: Relationship to an incident type for a user-defined role. + properties: + data: + $ref: "#/components/schemas/IncidentUserDefinedRoleIncidentTypeRelationshipData" + required: + - data + type: object + IncidentUserDefinedRoleIncidentTypeRelationshipData: + description: Data for the incident type relationship of a user-defined role. + properties: + id: + description: The ID of the incident type. + example: "00000000-0000-0000-0000-000000000001" + format: uuid + type: string + type: + description: The type of the resource. + example: "incident_types" + type: string + required: + - id + - type + type: object + IncidentUserDefinedRoleIncludedItem: + description: A single included resource in a user-defined role response. + oneOf: + - $ref: "#/components/schemas/IncidentUserData" + - $ref: "#/components/schemas/IncidentTypeObject" + IncidentUserDefinedRoleIncludedResponse: + description: Included resources for an incident user-defined role response. + items: + $ref: "#/components/schemas/IncidentUserDefinedRoleIncludedItem" + type: array + IncidentUserDefinedRolePatchDataAttributesRequest: + description: Attributes for updating an incident user-defined role. + properties: + description: + description: A description of the user-defined role. + example: "The technical lead for the incident." + nullable: true + type: string + name: + description: The name of the user-defined role. + example: "Tech Lead" + type: string + policy: + $ref: "#/components/schemas/IncidentUserDefinedRolePolicy" + type: object + IncidentUserDefinedRolePatchDataRequest: + description: Data for updating an incident user-defined role. + properties: + attributes: + $ref: "#/components/schemas/IncidentUserDefinedRolePatchDataAttributesRequest" + id: + description: The ID of the user-defined role to update. + example: "00000000-0000-0000-0000-000000000002" + format: uuid + type: string + type: + $ref: "#/components/schemas/IncidentUserDefinedRoleType" + required: + - id + - type + type: object + IncidentUserDefinedRolePatchRequest: + description: Request for updating an incident user-defined role. + properties: + data: + $ref: "#/components/schemas/IncidentUserDefinedRolePatchDataRequest" + required: + - data + type: object + IncidentUserDefinedRolePolicy: + description: Policy configuration for a user-defined role. + properties: + is_single: + description: Whether this role can only be assigned to one responder at a time. + example: true + type: boolean + required: + - is_single + type: object + IncidentUserDefinedRoleRelationshipsRequest: + description: Relationships for creating a user-defined role. + properties: + incident_type: + $ref: "#/components/schemas/IncidentUserDefinedRoleIncidentTypeRelationship" + required: + - incident_type + type: object + IncidentUserDefinedRoleRelationshipsResponse: + description: Relationships of a user-defined role response. + properties: + created_by_user: + $ref: "#/components/schemas/RelationshipToUser" + incident_type: + $ref: "#/components/schemas/IncidentUserDefinedRoleIncidentTypeRelationship" + last_modified_by_user: + $ref: "#/components/schemas/RelationshipToUser" + type: object + IncidentUserDefinedRoleRequest: + description: Request for creating an incident user-defined role. + properties: + data: + $ref: "#/components/schemas/IncidentUserDefinedRoleDataRequest" + required: + - data + type: object + IncidentUserDefinedRoleResponse: + description: Response with a single incident user-defined role. + properties: + data: + $ref: "#/components/schemas/IncidentUserDefinedRoleDataResponse" + included: + $ref: "#/components/schemas/IncidentUserDefinedRoleIncludedResponse" + required: + - data + type: object + IncidentUserDefinedRoleType: + description: Incident user-defined role resource type. + enum: + - incident_user_defined_roles + example: incident_user_defined_roles + type: string + x-enum-varnames: + - INCIDENT_USER_DEFINED_ROLES + IncidentUserDefinedRolesDataResponse: + description: List of incident user-defined role data objects. + items: + $ref: "#/components/schemas/IncidentUserDefinedRoleDataResponse" + type: array + IncidentUserDefinedRolesResponse: + description: Response with a list of incident user-defined roles. + properties: + data: + $ref: "#/components/schemas/IncidentUserDefinedRolesDataResponse" + included: + $ref: "#/components/schemas/IncidentUserDefinedRoleIncludedResponse" + required: + - data + type: object IncidentsResponse: description: Response with a list of incidents. properties: @@ -120478,6 +122620,491 @@ paths: x-unstable: |- **Note**: This endpoint is in public beta and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/config/google-chat-configurations: + post: + description: Create a Google Chat configuration for incidents. + operationId: CreateIncidentGoogleChatConfiguration + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + domain_id: my-domain + space_name_template: "{{incident.title}}" + space_target_audience_id: "123456789" + space_time_zone: America/New_York + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000000 + type: incident_types + type: google_chat_configurations + schema: + $ref: "#/components/schemas/IncidentGoogleChatConfigurationRequest" + description: Google Chat configuration payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00.000Z" + domain_id: my-domain + modified_at: "2024-01-01T00:00:00.000Z" + space_name_template: "{{incident.title}}" + space_target_audience_id: "123456789" + space_time_zone: America/New_York + id: 00000000-0000-0000-0000-000000000001 + type: google_chat_configurations + schema: + $ref: "#/components/schemas/IncidentGoogleChatConfigurationResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Create an incident Google Chat configuration + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - incident_settings_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/config/google-chat-configurations/{id}: + patch: + description: Update a Google Chat configuration for incidents. + operationId: UpdateIncidentGoogleChatConfiguration + parameters: + - $ref: "#/components/parameters/IncidentGoogleChatConfigurationIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + domain_id: updated-domain + id: 00000000-0000-0000-0000-000000000001 + type: google_chat_configurations + schema: + $ref: "#/components/schemas/IncidentGoogleChatConfigurationPatchRequest" + description: Google Chat configuration patch payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00.000Z" + domain_id: updated-domain + modified_at: "2024-01-02T00:00:00.000Z" + space_name_template: "{{incident.title}}" + space_target_audience_id: "123456789" + space_time_zone: America/New_York + id: 00000000-0000-0000-0000-000000000001 + type: google_chat_configurations + schema: + $ref: "#/components/schemas/IncidentGoogleChatConfigurationResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Update an incident Google Chat configuration + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - incident_settings_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/config/google-meet-configurations: + post: + description: Create a Google Meet configuration for incidents. + operationId: CreateIncidentGoogleMeetConfiguration + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + allow_manual_meeting_creation: true + auto_summarize: false + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000000 + type: incident_types + type: google_meet_configurations + schema: + $ref: "#/components/schemas/IncidentGoogleMeetConfigurationRequest" + description: Google Meet configuration payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + allow_manual_meeting_creation: true + auto_summarize: false + created_at: "2024-01-01T00:00:00.000Z" + modified_at: "2024-01-01T00:00:00.000Z" + id: 00000000-0000-0000-0000-000000000001 + type: google_meet_configurations + schema: + $ref: "#/components/schemas/IncidentGoogleMeetConfigurationResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Create an incident Google Meet configuration + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - incident_settings_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/config/google-meet-configurations/{id}: + patch: + description: Update a Google Meet configuration for incidents. + operationId: UpdateIncidentGoogleMeetConfiguration + parameters: + - $ref: "#/components/parameters/IncidentGoogleMeetConfigurationIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + auto_summarize: true + id: 00000000-0000-0000-0000-000000000001 + type: google_meet_configurations + schema: + $ref: "#/components/schemas/IncidentGoogleMeetConfigurationPatchRequest" + description: Google Meet configuration patch payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + allow_manual_meeting_creation: true + auto_summarize: true + created_at: "2024-01-01T00:00:00.000Z" + modified_at: "2024-01-02T00:00:00.000Z" + id: 00000000-0000-0000-0000-000000000001 + type: google_meet_configurations + schema: + $ref: "#/components/schemas/IncidentGoogleMeetConfigurationResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Update an incident Google Meet configuration + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - incident_settings_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/config/impact-fields: + get: + description: List all impact fields for incidents. + operationId: ListIncidentImpactFields + responses: + "200": + content: + application/json: + examples: + default: + value: + data: [] + schema: + $ref: "#/components/schemas/IncidentImpactFieldsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_read + summary: List incident impact fields + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_settings_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create an impact field for incidents. + operationId: CreateIncidentImpactField + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + display_name: Customer Impact Scope + field_choices: + - description: Affects all customers + display_name: All Customers + value: all_customers + - description: Affects some customers + display_name: Some Customers + value: some_customers + field_type: dropdown + name: customer_impact_scope + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000000 + type: incident_types + type: impact_fields + schema: + $ref: "#/components/schemas/IncidentImpactFieldRequest" + description: Impact field payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + display_name: Customer Impact Scope + field_choices: + - description: Affects all customers + display_name: All Customers + value: all_customers + field_type: dropdown + name: customer_impact_scope + id: 00000000-0000-0000-0000-000000000001 + type: impact_fields + schema: + $ref: "#/components/schemas/IncidentImpactFieldResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Create an incident impact field + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - incident_settings_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/config/impact-fields/{field_id}: + delete: + description: Delete an impact field for incidents. + operationId: DeleteIncidentImpactField + parameters: + - $ref: "#/components/parameters/IncidentImpactFieldIDPathParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Delete an incident impact field + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_settings_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + put: + description: Update an impact field for incidents. + operationId: UpdateIncidentImpactField + parameters: + - $ref: "#/components/parameters/IncidentImpactFieldIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + display_name: Customer Impact Scope Updated + field_type: dropdown + name: customer_impact_scope + relationships: + incident_type: + data: + id: 00000000-0000-0000-0000-000000000000 + type: incident_types + type: impact_fields + schema: + $ref: "#/components/schemas/IncidentImpactFieldRequest" + description: Impact field update payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + display_name: Customer Impact Scope Updated + field_type: dropdown + name: customer_impact_scope + id: 00000000-0000-0000-0000-000000000001 + type: impact_fields + schema: + $ref: "#/components/schemas/IncidentImpactFieldResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Update an incident impact field + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - incident_settings_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/incidents/config/notification-rules: get: description: Lists all notification rules for the organization. Optionally filter by incident type. @@ -121321,6 +123948,302 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/config/rules: + get: + description: List all incident rules. + operationId: ListIncidentRules + parameters: + - description: Filter rules by task ID. + in: query + name: "filter[task_id]" + required: false + schema: + example: notify-incident-handles-job + type: string + - description: Filter rules by trigger. + in: query + name: "filter[trigger]" + required: false + schema: + example: incident_created_trigger + type: string + - description: Filter rules by incident type UUID. + in: query + name: incidentTypeUUID + required: false + schema: + example: 00000000-0000-0000-0000-000000000000 + format: uuid + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: [] + schema: + $ref: "#/components/schemas/IncidentRulesResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_read + summary: List incident rules + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_settings_read + - incident_notification_settings_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create an incident rule. + operationId: CreateIncidentRule + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + condition: + raw_query: "severity:SEV-1" + condition_table_type: 1 + enabled: true + execution_type: 1 + task_id: notify-incident-handles-job + task_payload: "{}" + trigger: incident_created_trigger + type: incident_rules + schema: + $ref: "#/components/schemas/IncidentRuleRequest" + description: Incident rule payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + condition: + raw_query: "severity:SEV-1" + condition_table_type: 1 + created: "2024-01-01T00:00:00.000Z" + enabled: true + execution_type: 1 + modified: "2024-01-01T00:00:00.000Z" + task_id: notify-incident-handles-job + task_payload: "{}" + trigger: incident_created_trigger + id: 00000000-0000-0000-0000-000000000001 + type: incidents_rules + schema: + $ref: "#/components/schemas/IncidentRuleResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Create an incident rule + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - incident_settings_write + - incident_notification_settings_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/config/rules/{rule_id}: + delete: + description: Delete an incident rule. + operationId: DeleteIncidentRule + parameters: + - $ref: "#/components/parameters/IncidentRuleIDPathParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Delete an incident rule + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_settings_write + - incident_notification_settings_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get a single incident rule by ID. + operationId: GetIncidentRule + parameters: + - $ref: "#/components/parameters/IncidentRuleIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + condition: + raw_query: "severity:SEV-1" + condition_table_type: 1 + created: "2024-01-01T00:00:00.000Z" + enabled: true + execution_type: 1 + modified: "2024-01-01T00:00:00.000Z" + task_id: notify-incident-handles-job + task_payload: "{}" + trigger: incident_created_trigger + id: 00000000-0000-0000-0000-000000000001 + type: incidents_rules + schema: + $ref: "#/components/schemas/IncidentRuleResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_read + summary: Get an incident rule + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_settings_read + - incident_notification_settings_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + patch: + description: Update an incident rule. + operationId: UpdateIncidentRule + parameters: + - $ref: "#/components/parameters/IncidentRuleIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: false + id: 00000000-0000-0000-0000-000000000001 + type: incident_rules + schema: + $ref: "#/components/schemas/IncidentRulePatchRequest" + description: Incident rule patch payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + condition: + raw_query: "severity:SEV-1" + condition_table_type: 1 + created: "2024-01-01T00:00:00.000Z" + enabled: false + execution_type: 1 + modified: "2024-01-02T00:00:00.000Z" + task_id: notify-incident-handles-job + task_payload: "{}" + trigger: incident_created_trigger + id: 00000000-0000-0000-0000-000000000001 + type: incidents_rules + schema: + $ref: "#/components/schemas/IncidentRuleResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Update an incident rule + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - incident_settings_write + - incident_notification_settings_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/incidents/config/types: get: description: Get all incident types. @@ -121433,6 +124356,74 @@ paths: x-unstable: |- **Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/config/types/org-settings: + get: + description: List org settings for all incident types. + operationId: ListOrgSettings + parameters: + - description: Maximum number of results to return. + in: query + name: "page[size]" + required: false + schema: + example: 10 + type: integer + - description: The offset for pagination. + in: query + name: "page[offset]" + required: false + schema: + example: 0 + type: integer + - description: Whether to include deleted records. + in: query + name: include-deleted + required: false + schema: + example: false + type: boolean + - description: Comma-separated list of related resources to include in the response. + in: query + name: include + required: false + schema: + example: incident_type + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: [] + schema: + $ref: "#/components/schemas/IncidentOrgSettingsListResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_read + summary: List incident type org settings + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_settings_read + - incident_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/incidents/config/types/{incident_type_id}: delete: description: Delete an incident type. @@ -121583,6 +124574,66 @@ paths: x-unstable: |- **Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/config/types/{incident_type_id}/org-settings: + get: + description: Get the org settings for a specific incident type. + operationId: GetOrgSettingsByIncidentType + parameters: + - $ref: "#/components/parameters/IncidentOrgSettingsTypeIDPathParameter" + - description: Comma-separated list of related resources to include in the response. + in: query + name: include + required: false + schema: + example: incident_type + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created: "2024-01-01T00:00:00.000Z" + modified: "2024-01-01T00:00:00.000Z" + settings: + allow_anonymous_incident_declaration: false + allow_guest_incident_declaration: false + pagerduty_paging: true + private_incidents_by_default: false + id: 00000000-0000-0000-0000-000000000001 + type: incident_org_settings + schema: + $ref: "#/components/schemas/IncidentOrgSettingsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_read + summary: Get org settings by incident type + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_settings_read + - incident_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/incidents/config/user-defined-fields: get: description: Get a list of all incident user-defined fields. @@ -122060,6 +125111,303 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/config/user-defined-roles: + get: + description: List all user-defined roles for incidents. + operationId: ListIncidentUserDefinedRoles + parameters: + - description: Filter roles by incident type UUID. + in: query + name: filter[incident-type] + required: false + schema: + example: "00000000-0000-0000-0000-000000000001" + format: uuid + type: string + - description: Comma-separated list of related resources to include in the response. + in: query + name: include + required: false + schema: + example: "created_by_user,last_modified_by_user,incident_type" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created: "2024-01-01T00:00:00.000Z" + description: "The technical lead for the incident." + modified: "2024-01-01T00:00:00.000Z" + name: "Tech Lead" + policy: + is_single: true + id: "00000000-0000-0000-0000-000000000002" + type: incident_user_defined_roles + schema: + $ref: "#/components/schemas/IncidentUserDefinedRolesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_read + summary: List incident user-defined roles + tags: + - Incidents + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create a new user-defined role for incidents. + operationId: CreateIncidentUserDefinedRole + parameters: + - description: Comma-separated list of related resources to include in the response. + in: query + name: include + required: false + schema: + example: "created_by_user,last_modified_by_user,incident_type" + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: "The technical lead for the incident." + name: "Tech Lead" + policy: + is_single: true + relationships: + incident_type: + data: + id: "00000000-0000-0000-0000-000000000001" + type: incident_types + type: incident_user_defined_roles + schema: + $ref: "#/components/schemas/IncidentUserDefinedRoleRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + created: "2024-01-01T00:00:00.000Z" + description: "The technical lead for the incident." + modified: "2024-01-01T00:00:00.000Z" + name: "Tech Lead" + policy: + is_single: true + id: "00000000-0000-0000-0000-000000000002" + type: incident_user_defined_roles + schema: + $ref: "#/components/schemas/IncidentUserDefinedRoleResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Create an incident user-defined role + tags: + - Incidents + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/config/user-defined-roles/{role_id}: + delete: + description: Delete an existing user-defined role for incidents. + operationId: DeleteIncidentUserDefinedRole + parameters: + - $ref: "#/components/parameters/IncidentUserDefinedRoleIDPathParameter" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Delete an incident user-defined role + tags: + - Incidents + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Retrieve a single user-defined role for incidents. + operationId: GetIncidentUserDefinedRole + parameters: + - $ref: "#/components/parameters/IncidentUserDefinedRoleIDPathParameter" + - description: Comma-separated list of related resources to include in the response. + in: query + name: include + required: false + schema: + example: "created_by_user,last_modified_by_user,incident_type" + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created: "2024-01-01T00:00:00.000Z" + description: "The technical lead for the incident." + modified: "2024-01-01T00:00:00.000Z" + name: "Tech Lead" + policy: + is_single: true + id: "00000000-0000-0000-0000-000000000002" + type: incident_user_defined_roles + schema: + $ref: "#/components/schemas/IncidentUserDefinedRoleResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_read + summary: Get an incident user-defined role + tags: + - Incidents + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + patch: + description: Update an existing user-defined role for incidents. + operationId: UpdateIncidentUserDefinedRole + parameters: + - $ref: "#/components/parameters/IncidentUserDefinedRoleIDPathParameter" + - description: Comma-separated list of related resources to include in the response. + in: query + name: include + required: false + schema: + example: "created_by_user,last_modified_by_user,incident_type" + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + name: "Updated Tech Lead" + id: "00000000-0000-0000-0000-000000000002" + type: incident_user_defined_roles + schema: + $ref: "#/components/schemas/IncidentUserDefinedRolePatchRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created: "2024-01-01T00:00:00.000Z" + modified: "2024-01-02T00:00:00.000Z" + name: "Updated Tech Lead" + policy: + is_single: true + id: "00000000-0000-0000-0000-000000000002" + type: incident_user_defined_roles + schema: + $ref: "#/components/schemas/IncidentUserDefinedRoleResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_settings_write + summary: Update an incident user-defined role + tags: + - Incidents + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/incidents/import: post: description: |- @@ -122394,6 +125742,57 @@ paths: x-unstable: |- **Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/{incident_id}/ai/postmortem: + post: + description: Generate an AI postmortem for an incident. + operationId: GetIncidentAIPostmortem + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + action_items: "1. Improve failover testing." + customer_impact: "5% of users experienced timeouts for 30 minutes." + executive_summary: "A database failover caused a 30-minute service outage." + key_timeline: "10:00 - Alert fired. 10:30 - Issue resolved." + lessons_learned: "We need to test the failover process under realistic load." + system_overview: "The primary database cluster experienced a failover event." + id: 00000000-0000-0000-0000-000000000000 + type: get_incident_ai_postmortem_response + schema: + $ref: "#/components/schemas/IncidentAIPostmortemResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Get an AI-generated incident postmortem + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/incidents/{incident_id}/attachments: get: description: List incident attachments. @@ -122689,6 +126088,211 @@ paths: x-unstable: |- **Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/{incident_id}/cases/page: + post: + description: Create a page from an incident using the Cases service. + operationId: CreatePageFromIncident + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: A critical incident affecting production systems. + services: + - web-store + tags: + - env:prod + target: + identifier: my-oncall-team + type: team_handle + title: Production outage - SEV-1 + type: page + schema: + $ref: "#/components/schemas/IncidentCreatePageFromIncidentRequest" + description: Page creation payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + id: 00000000-0000-0000-0000-000000000001 + type: page_uuid + schema: + $ref: "#/components/schemas/IncidentPageUUIDResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Create a page from an incident + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: AND + permissions: + - oncall_page + - incident_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/{incident_id}/configurations: + patch: + description: Update a configuration for an incident. + operationId: UpdateIncidentConfiguration + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + include_in_search: false + id: 00000000-0000-0000-0000-000000000001 + type: incidents_configurations + schema: + $ref: "#/components/schemas/IncidentConfigurationPatchRequest" + description: Incident configuration patch payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00.000Z" + execute_integrations: true + execute_notification_rules: true + incident_id: 00000000-0000-0000-0000-000000000000 + include_in_analytics: true + include_in_search: false + modified_at: "2024-01-02T00:00:00.000Z" + id: 00000000-0000-0000-0000-000000000001 + type: incidents_configurations + schema: + $ref: "#/components/schemas/IncidentConfigurationResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Update an incident configuration + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - incident_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create a configuration for an incident. + operationId: CreateIncidentConfiguration + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + execute_integrations: true + execute_notification_rules: true + include_in_analytics: true + include_in_search: true + type: incidents_configurations + schema: + $ref: "#/components/schemas/IncidentConfigurationRequest" + description: Incident configuration payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00.000Z" + execute_integrations: true + execute_notification_rules: true + incident_id: 00000000-0000-0000-0000-000000000000 + include_in_analytics: true + include_in_search: true + modified_at: "2024-01-01T00:00:00.000Z" + id: 00000000-0000-0000-0000-000000000001 + type: incidents_configurations + schema: + $ref: "#/components/schemas/IncidentConfigurationResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Create an incident configuration + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - incident_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/incidents/{incident_id}/impacts: get: description: Get all impacts for an incident. @@ -122832,6 +126436,273 @@ paths: operator: OR permissions: - incident_write + patch: + description: Partially update an incident impact. + operationId: PatchIncidentImpact + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + - $ref: "#/components/parameters/IncidentImpactIDPathParameter" + - $ref: "#/components/parameters/IncidentImpactIncludeQueryParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Patched service impact description + type: incident_impacts + schema: + $ref: "#/components/schemas/IncidentImpactCreateRequest" + description: Incident impact patch payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Patched service impact description + start_at: "2025-08-28T13:17:00Z" + id: 00000000-0000-0000-0000-000000000002 + type: incident_impacts + schema: + $ref: "#/components/schemas/IncidentImpactResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Patch an incident impact + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - incident_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + put: + description: Update an incident impact. + operationId: UpdateIncidentImpact + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + - $ref: "#/components/parameters/IncidentImpactIDPathParameter" + - $ref: "#/components/parameters/IncidentImpactIncludeQueryParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Updated service impact description + end_at: "2025-08-29T13:17:00Z" + start_at: "2025-08-28T13:17:00Z" + type: incident_impacts + schema: + $ref: "#/components/schemas/IncidentImpactCreateRequest" + description: Incident impact payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + description: Updated service impact description + end_at: "2025-08-29T13:17:00Z" + start_at: "2025-08-28T13:17:00Z" + id: 00000000-0000-0000-0000-000000000002 + type: incident_impacts + schema: + $ref: "#/components/schemas/IncidentImpactResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Update an incident impact + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - incident_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/{incident_id}/page: + post: + description: Create an on-call page directly from an incident. + operationId: CreateOnCallPageFromIncident + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + description: A critical incident affecting production systems. + services: + - web-store + target: + identifier: my-oncall-team + type: team_handle + title: Production outage - SEV-1 + type: page + schema: + $ref: "#/components/schemas/IncidentCreateOnCallPageRequest" + description: On-call page creation payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + id: 00000000-0000-0000-0000-000000000001 + type: page_uuid + schema: + $ref: "#/components/schemas/IncidentPageUUIDResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Create an on-call page from an incident + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: AND + permissions: + - oncall_page + - incident_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/{incident_id}/pages/link: + post: + description: Link an existing on-call page to an incident. + operationId: LinkPageToIncident + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + key: PAGE-12345 + page_target: + identifier: my-oncall-team + type: team_handle + id: PAGE-12345 + type: page + schema: + $ref: "#/components/schemas/IncidentOnCallPageLinkRequest" + description: On-call page link payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + integration_type: 1 + status: 1 + id: 00000000-0000-0000-0000-000000000001 + type: incident_integrations + schema: + $ref: "#/components/schemas/IncidentIntegrationMetadataResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict - page already linked to incident + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Link a page to an incident + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - incident_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/incidents/{incident_id}/relationships/integrations: get: description: Get all integration metadata for an incident. @@ -123370,6 +127241,491 @@ paths: x-unstable: |- **Note**: This endpoint is in public beta. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/{incident_id}/responders: + get: + description: List all responders for an incident. + operationId: ListIncidentResponders + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: [] + schema: + $ref: "#/components/schemas/IncidentRespondersResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_read + summary: List incident responders + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Add a responder to an incident. + operationId: CreateIncidentResponder + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + relationships: + user: + data: + id: 00000000-0000-0000-0000-000000000001 + type: users + type: incident_responders + schema: + $ref: "#/components/schemas/IncidentResponderRequest" + description: Incident responder payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + created: "2024-01-01T00:00:00.000Z" + is_billable: true + modified: "2024-01-01T00:00:00.000Z" + id: 00000000-0000-0000-0000-000000000002 + type: incident_responders + schema: + $ref: "#/components/schemas/IncidentResponderResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Create an incident responder + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - incident_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/{incident_id}/responders/{responder_id}: + delete: + description: Remove a responder from an incident. + operationId: DeleteIncidentResponder + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + - $ref: "#/components/parameters/IncidentResponderIDPathParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Delete an incident responder + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Get a single responder for an incident. + operationId: GetIncidentResponder + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + - $ref: "#/components/parameters/IncidentResponderIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created: "2024-01-01T00:00:00.000Z" + is_billable: true + modified: "2024-01-01T00:00:00.000Z" + id: 00000000-0000-0000-0000-000000000002 + type: incident_responders + schema: + $ref: "#/components/schemas/IncidentResponderResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_read + summary: Get an incident responder + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/{incident_id}/servicenow-records: + post: + description: Create a ServiceNow record for an incident. + operationId: CreateIncidentServiceNowRecord + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + assignment_group: IT Support + configuration_item_mapping: my-service + instance_name: my-instance + type: incident_servicenow_record_prompt + schema: + $ref: "#/components/schemas/IncidentServiceNowRecordRequest" + description: ServiceNow record payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + incident_id: 00000000-0000-0000-0000-000000000000 + integration_type: 0 + metadata: + records: + - instance_name: my-instance + record_num: INC0001234 + redirect_url: https://my-instance.service-now.com/nav_to.do?uri=incident.do?sys_id=abc123 + status: 1 + id: 00000000-0000-0000-0000-000000000001 + type: incident_integrations + schema: + $ref: "#/components/schemas/IncidentIntegrationMetadataResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Create an incident ServiceNow record + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - incident_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/{incident_id}/timestamp-overrides: + get: + description: List all timestamp overrides for an incident. + operationId: ListTimestampOverrides + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: [] + schema: + $ref: "#/components/schemas/IncidentTimestampOverridesResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_read + summary: List incident timestamp overrides + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Create a timestamp override for an incident. + operationId: CreateTimestampOverride + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + timestamp_type: detected + timestamp_value: "2024-01-01T10:00:00.000Z" + type: incidents_timestamp_overrides + schema: + $ref: "#/components/schemas/IncidentTimestampOverrideRequest" + description: Timestamp override payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00.000Z" + incident_id: 00000000-0000-0000-0000-000000000000 + modified_at: "2024-01-01T00:00:00.000Z" + timestamp_type: detected + timestamp_value: "2024-01-01T10:00:00.000Z" + id: 00000000-0000-0000-0000-000000000001 + type: incidents_timestamp_overrides + schema: + $ref: "#/components/schemas/IncidentTimestampOverrideResponse" + description: Created + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Create an incident timestamp override + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - incident_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/incidents/{incident_id}/timestamp-overrides/{id}: + delete: + description: Delete a timestamp override for an incident. + operationId: DeleteTimestampOverride + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + - $ref: "#/components/parameters/IncidentTimestampOverrideIDPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00.000Z" + deleted_at: "2024-01-03T00:00:00.000Z" + incident_id: 00000000-0000-0000-0000-000000000000 + modified_at: "2024-01-01T00:00:00.000Z" + timestamp_type: detected + timestamp_value: "2024-01-01T10:00:00.000Z" + id: 00000000-0000-0000-0000-000000000001 + type: incidents_timestamp_overrides + schema: + $ref: "#/components/schemas/IncidentTimestampOverrideResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Delete an incident timestamp override + tags: + - Incidents + x-permission: + operator: OR + permissions: + - incident_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + patch: + description: Update a timestamp override for an incident. + operationId: UpdateTimestampOverride + parameters: + - $ref: "#/components/parameters/IncidentIDPathParameter" + - $ref: "#/components/parameters/IncidentTimestampOverrideIDPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + timestamp_value: "2024-01-01T11:00:00.000Z" + id: 00000000-0000-0000-0000-000000000001 + type: incidents_timestamp_overrides + schema: + $ref: "#/components/schemas/IncidentTimestampOverridePatchRequest" + description: Timestamp override patch payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-01T00:00:00.000Z" + incident_id: 00000000-0000-0000-0000-000000000000 + modified_at: "2024-01-02T00:00:00.000Z" + timestamp_type: detected + timestamp_value: "2024-01-01T11:00:00.000Z" + id: 00000000-0000-0000-0000-000000000001 + type: incidents_timestamp_overrides + schema: + $ref: "#/components/schemas/IncidentTimestampOverrideResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - incident_write + summary: Update an incident timestamp override + tags: + - Incidents + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - incident_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/integration/aws/accounts: get: description: Get a list of AWS Account Integration Configs. diff --git a/examples/v2/incidents/PatchIncidentImpact.rb b/examples/v2/incidents/PatchIncidentImpact.rb new file mode 100644 index 000000000000..5dd474baad2b --- /dev/null +++ b/examples/v2/incidents/PatchIncidentImpact.rb @@ -0,0 +1,20 @@ +# Patch an incident impact returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.patch_incident_impact".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new + +body = DatadogAPIClient::V2::IncidentImpactCreateRequest.new({ + data: DatadogAPIClient::V2::IncidentImpactCreateData.new({ + attributes: DatadogAPIClient::V2::IncidentImpactCreateAttributes.new({ + description: "Service was unavailable for external users", + end_at: "2025-08-29T13:17:00Z", + fields: DatadogAPIClient::V2::IncidentImpactFieldsObject.new({}), + start_at: "2025-08-28T13:17:00Z", + }), + type: DatadogAPIClient::V2::IncidentImpactType::INCIDENT_IMPACTS, + }), +}) +p api_instance.patch_incident_impact("incident_id", "impact_id", body) diff --git a/examples/v2/incidents/UpdateIncidentImpact.rb b/examples/v2/incidents/UpdateIncidentImpact.rb new file mode 100644 index 000000000000..040a71a7e6dc --- /dev/null +++ b/examples/v2/incidents/UpdateIncidentImpact.rb @@ -0,0 +1,20 @@ +# Update an incident impact returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_incident_impact".to_sym] = true +end +api_instance = DatadogAPIClient::V2::IncidentsAPI.new + +body = DatadogAPIClient::V2::IncidentImpactCreateRequest.new({ + data: DatadogAPIClient::V2::IncidentImpactCreateData.new({ + attributes: DatadogAPIClient::V2::IncidentImpactCreateAttributes.new({ + description: "Service was unavailable for external users", + end_at: "2025-08-29T13:17:00Z", + fields: DatadogAPIClient::V2::IncidentImpactFieldsObject.new({}), + start_at: "2025-08-28T13:17:00Z", + }), + type: DatadogAPIClient::V2::IncidentImpactType::INCIDENT_IMPACTS, + }), +}) +p api_instance.update_incident_impact("incident_id", "impact_id", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 920e80f058e0..46676f984374 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3134,6 +3134,30 @@ "v2.UpdateGlobalIncidentSettings" => { "body" => "GlobalIncidentSettingsRequest", }, + "v2.CreateIncidentGoogleChatConfiguration" => { + "body" => "IncidentGoogleChatConfigurationRequest", + }, + "v2.UpdateIncidentGoogleChatConfiguration" => { + "id" => "UUID", + "body" => "IncidentGoogleChatConfigurationPatchRequest", + }, + "v2.CreateIncidentGoogleMeetConfiguration" => { + "body" => "IncidentGoogleMeetConfigurationRequest", + }, + "v2.UpdateIncidentGoogleMeetConfiguration" => { + "id" => "UUID", + "body" => "IncidentGoogleMeetConfigurationPatchRequest", + }, + "v2.CreateIncidentImpactField" => { + "body" => "IncidentImpactFieldRequest", + }, + "v2.DeleteIncidentImpactField" => { + "field_id" => "UUID", + }, + "v2.UpdateIncidentImpactField" => { + "field_id" => "UUID", + "body" => "IncidentImpactFieldRequest", + }, "v2.ListIncidentNotificationRules" => { "include" => "String", }, @@ -3186,12 +3210,36 @@ "template_id" => "String", "body" => "PostmortemTemplateRequest", }, + "v2.ListIncidentRules" => { + "filter_task_id" => "String", + "filter_trigger" => "String", + "incident_type_uuid" => "UUID", + }, + "v2.CreateIncidentRule" => { + "body" => "IncidentRuleRequest", + }, + "v2.DeleteIncidentRule" => { + "rule_id" => "UUID", + }, + "v2.GetIncidentRule" => { + "rule_id" => "UUID", + }, + "v2.UpdateIncidentRule" => { + "rule_id" => "UUID", + "body" => "IncidentRulePatchRequest", + }, "v2.ListIncidentTypes" => { "include_deleted" => "Boolean", }, "v2.CreateIncidentType" => { "body" => "IncidentTypeCreateRequest", }, + "v2.ListOrgSettings" => { + "page_size" => "Integer", + "page_offset" => "Integer", + "include_deleted" => "Boolean", + "include" => "String", + }, "v2.DeleteIncidentType" => { "incident_type_id" => "String", }, @@ -3202,6 +3250,10 @@ "incident_type_id" => "String", "body" => "IncidentTypePatchRequest", }, + "v2.GetOrgSettingsByIncidentType" => { + "incident_type_id" => "UUID", + "include" => "String", + }, "v2.ListIncidentUserDefinedFields" => { "page_size" => "Integer", "page_number" => "Integer", @@ -3225,6 +3277,26 @@ "include" => "String", "body" => "IncidentUserDefinedFieldUpdateRequest", }, + "v2.ListIncidentUserDefinedRoles" => { + "filter_incident_type" => "UUID", + "include" => "String", + }, + "v2.CreateIncidentUserDefinedRole" => { + "include" => "String", + "body" => "IncidentUserDefinedRoleRequest", + }, + "v2.DeleteIncidentUserDefinedRole" => { + "role_id" => "UUID", + }, + "v2.GetIncidentUserDefinedRole" => { + "role_id" => "UUID", + "include" => "String", + }, + "v2.UpdateIncidentUserDefinedRole" => { + "role_id" => "UUID", + "include" => "String", + "body" => "IncidentUserDefinedRolePatchRequest", + }, "v2.ImportIncident" => { "include" => "Array", "body" => "IncidentImportRequest", @@ -3248,6 +3320,9 @@ "include" => "Array", "body" => "IncidentUpdateRequest", }, + "v2.GetIncidentAIPostmortem" => { + "incident_id" => "String", + }, "v2.ListIncidentAttachments" => { "incident_id" => "String", "filter_attachment_type" => "String", @@ -3272,6 +3347,18 @@ "include" => "String", "body" => "PatchAttachmentRequest", }, + "v2.CreatePageFromIncident" => { + "incident_id" => "String", + "body" => "IncidentCreatePageFromIncidentRequest", + }, + "v2.UpdateIncidentConfiguration" => { + "incident_id" => "String", + "body" => "IncidentConfigurationPatchRequest", + }, + "v2.CreateIncidentConfiguration" => { + "incident_id" => "String", + "body" => "IncidentConfigurationRequest", + }, "v2.ListIncidentImpacts" => { "incident_id" => "String", "include" => "Array", @@ -3285,6 +3372,26 @@ "incident_id" => "String", "impact_id" => "String", }, + "v2.PatchIncidentImpact" => { + "incident_id" => "String", + "impact_id" => "String", + "include" => "Array", + "body" => "IncidentImpactCreateRequest", + }, + "v2.UpdateIncidentImpact" => { + "incident_id" => "String", + "impact_id" => "String", + "include" => "Array", + "body" => "IncidentImpactCreateRequest", + }, + "v2.CreateOnCallPageFromIncident" => { + "incident_id" => "String", + "body" => "IncidentCreateOnCallPageRequest", + }, + "v2.LinkPageToIncident" => { + "incident_id" => "String", + "body" => "IncidentOnCallPageLinkRequest", + }, "v2.ListIncidentIntegrations" => { "incident_id" => "String", }, @@ -3325,6 +3432,41 @@ "todo_id" => "String", "body" => "IncidentTodoPatchRequest", }, + "v2.ListIncidentResponders" => { + "incident_id" => "String", + }, + "v2.CreateIncidentResponder" => { + "incident_id" => "String", + "body" => "IncidentResponderRequest", + }, + "v2.DeleteIncidentResponder" => { + "incident_id" => "String", + "responder_id" => "UUID", + }, + "v2.GetIncidentResponder" => { + "incident_id" => "String", + "responder_id" => "UUID", + }, + "v2.CreateIncidentServiceNowRecord" => { + "incident_id" => "String", + "body" => "IncidentServiceNowRecordRequest", + }, + "v2.ListTimestampOverrides" => { + "incident_id" => "String", + }, + "v2.CreateTimestampOverride" => { + "incident_id" => "String", + "body" => "IncidentTimestampOverrideRequest", + }, + "v2.DeleteTimestampOverride" => { + "incident_id" => "String", + "id" => "UUID", + }, + "v2.UpdateTimestampOverride" => { + "incident_id" => "String", + "id" => "UUID", + "body" => "IncidentTimestampOverridePatchRequest", + }, "v2.ListAWSAccounts" => { "aws_account_id" => "String", }, diff --git a/features/v2/incidents.feature b/features/v2/incidents.feature index e30ccb252928..ad6a8db18e17 100644 --- a/features/v2/incidents.feature +++ b/features/v2/incidents.feature @@ -1122,6 +1122,36 @@ Feature: Incidents When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/incident-app + Scenario: Patch an incident impact returns "Bad Request" response + Given operation "PatchIncidentImpact" enabled + And new "PatchIncidentImpact" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "impact_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Service was unavailable for external users", "end_at": "2025-08-29T13:17:00Z", "fields": {"customers_impacted": "all", "products_impacted": ["shopping", "marketing"]}, "start_at": "2025-08-28T13:17:00Z"}, "type": "incident_impacts"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Patch an incident impact returns "Not Found" response + Given operation "PatchIncidentImpact" enabled + And new "PatchIncidentImpact" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "impact_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Service was unavailable for external users", "end_at": "2025-08-29T13:17:00Z", "fields": {"customers_impacted": "all", "products_impacted": ["shopping", "marketing"]}, "start_at": "2025-08-28T13:17:00Z"}, "type": "incident_impacts"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/incident-app + Scenario: Patch an incident impact returns "OK" response + Given operation "PatchIncidentImpact" enabled + And new "PatchIncidentImpact" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "impact_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Service was unavailable for external users", "end_at": "2025-08-29T13:17:00Z", "fields": {"customers_impacted": "all", "products_impacted": ["shopping", "marketing"]}, "start_at": "2025-08-28T13:17:00Z"}, "type": "incident_impacts"}} + When the request is sent + Then the response status is 200 OK + @team:DataDog/incident-app Scenario: Remove commander from an incident returns "OK" response Given operation "UpdateIncident" enabled @@ -1232,6 +1262,36 @@ Feature: Incidents Then the response status is 200 OK And the response "data.attributes.title" is equal to "{{ incident.data.attributes.title }}-updated" + @generated @skip @team:DataDog/incident-app + Scenario: Update an incident impact returns "Bad Request" response + Given operation "UpdateIncidentImpact" enabled + And new "UpdateIncidentImpact" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "impact_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Service was unavailable for external users", "end_at": "2025-08-29T13:17:00Z", "fields": {"customers_impacted": "all", "products_impacted": ["shopping", "marketing"]}, "start_at": "2025-08-28T13:17:00Z"}, "type": "incident_impacts"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/incident-app + Scenario: Update an incident impact returns "Not Found" response + Given operation "UpdateIncidentImpact" enabled + And new "UpdateIncidentImpact" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "impact_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Service was unavailable for external users", "end_at": "2025-08-29T13:17:00Z", "fields": {"customers_impacted": "all", "products_impacted": ["shopping", "marketing"]}, "start_at": "2025-08-28T13:17:00Z"}, "type": "incident_impacts"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/incident-app + Scenario: Update an incident impact returns "OK" response + Given operation "UpdateIncidentImpact" enabled + And new "UpdateIncidentImpact" request + And request contains "incident_id" parameter from "REPLACE.ME" + And request contains "impact_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "Service was unavailable for external users", "end_at": "2025-08-29T13:17:00Z", "fields": {"customers_impacted": "all", "products_impacted": ["shopping", "marketing"]}, "start_at": "2025-08-28T13:17:00Z"}, "type": "incident_impacts"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:Datadog/incident-app Scenario: Update an incident notification rule returns "Bad Request" response Given operation "UpdateIncidentNotificationRule" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index f1a04b48a1aa..e27a03165c94 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2992,6 +2992,18 @@ "type": "idempotent" } }, + "PatchIncidentImpact": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, + "UpdateIncidentImpact": { + "tag": "Incidents", + "undo": { + "type": "idempotent" + } + }, "ListIncidentIntegrations": { "tag": "Incidents", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index eeeec9db856f..12e71c186e09 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -433,56 +433,93 @@ def initialize "v2.create_global_incident_handle": false, "v2.create_incident": false, "v2.create_incident_attachment": false, + "v2.create_incident_configuration": false, + "v2.create_incident_google_chat_configuration": false, + "v2.create_incident_google_meet_configuration": false, + "v2.create_incident_impact_field": false, "v2.create_incident_integration": false, "v2.create_incident_notification_rule": false, "v2.create_incident_notification_template": false, "v2.create_incident_postmortem_attachment": false, "v2.create_incident_postmortem_template": false, + "v2.create_incident_responder": false, + "v2.create_incident_rule": false, + "v2.create_incident_service_now_record": false, "v2.create_incident_todo": false, "v2.create_incident_type": false, "v2.create_incident_user_defined_field": false, + "v2.create_incident_user_defined_role": false, + "v2.create_on_call_page_from_incident": false, + "v2.create_page_from_incident": false, + "v2.create_timestamp_override": false, "v2.delete_global_incident_handle": false, "v2.delete_incident": false, "v2.delete_incident_attachment": false, + "v2.delete_incident_impact_field": false, "v2.delete_incident_integration": false, "v2.delete_incident_notification_rule": false, "v2.delete_incident_notification_template": false, "v2.delete_incident_postmortem_template": false, + "v2.delete_incident_responder": false, + "v2.delete_incident_rule": false, "v2.delete_incident_todo": false, "v2.delete_incident_type": false, "v2.delete_incident_user_defined_field": false, + "v2.delete_incident_user_defined_role": false, + "v2.delete_timestamp_override": false, "v2.get_global_incident_settings": false, "v2.get_incident": false, + "v2.get_incident_ai_postmortem": false, "v2.get_incident_integration": false, "v2.get_incident_notification_rule": false, "v2.get_incident_notification_template": false, "v2.get_incident_postmortem_template": false, + "v2.get_incident_responder": false, + "v2.get_incident_rule": false, "v2.get_incident_todo": false, "v2.get_incident_type": false, "v2.get_incident_user_defined_field": false, + "v2.get_incident_user_defined_role": false, + "v2.get_org_settings_by_incident_type": false, "v2.import_incident": false, + "v2.link_page_to_incident": false, "v2.list_global_incident_handles": false, "v2.list_incident_attachments": false, + "v2.list_incident_impact_fields": false, "v2.list_incident_integrations": false, "v2.list_incident_notification_rules": false, "v2.list_incident_notification_templates": false, "v2.list_incident_postmortem_templates": false, + "v2.list_incident_responders": false, + "v2.list_incident_rules": false, "v2.list_incidents": false, "v2.list_incident_todos": false, "v2.list_incident_types": false, "v2.list_incident_user_defined_fields": false, + "v2.list_incident_user_defined_roles": false, + "v2.list_org_settings": false, + "v2.list_timestamp_overrides": false, + "v2.patch_incident_impact": false, "v2.search_incidents": false, "v2.update_global_incident_handle": false, "v2.update_global_incident_settings": false, "v2.update_incident": false, "v2.update_incident_attachment": false, + "v2.update_incident_configuration": false, + "v2.update_incident_google_chat_configuration": false, + "v2.update_incident_google_meet_configuration": false, + "v2.update_incident_impact": false, + "v2.update_incident_impact_field": false, "v2.update_incident_integration": false, "v2.update_incident_notification_rule": false, "v2.update_incident_notification_template": false, "v2.update_incident_postmortem_template": false, + "v2.update_incident_rule": false, "v2.update_incident_todo": false, "v2.update_incident_type": false, "v2.update_incident_user_defined_field": false, + "v2.update_incident_user_defined_role": false, + "v2.update_timestamp_override": false, "v2.create_aws_account_ccm_config": false, "v2.delete_aws_account_ccm_config": false, "v2.get_aws_account_ccm_config": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index bfa0086bf6f1..8402c992b618 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3394,9 +3394,31 @@ def overrides "v2.http_token_auth_update" => "HTTPTokenAuthUpdate", "v2.http_token_update" => "HTTPTokenUpdate", "v2.idp_metadata_form_data" => "IdPMetadataFormData", + "v2.incident_ai_postmortem_data_attributes_response" => "IncidentAIPostmortemDataAttributesResponse", + "v2.incident_ai_postmortem_data_response" => "IncidentAIPostmortemDataResponse", + "v2.incident_ai_postmortem_response" => "IncidentAIPostmortemResponse", + "v2.incident_ai_postmortem_response_type" => "IncidentAIPostmortemResponseType", "v2.incident_attachment_type" => "IncidentAttachmentType", + "v2.incident_configuration_data_attributes_request" => "IncidentConfigurationDataAttributesRequest", + "v2.incident_configuration_data_attributes_response" => "IncidentConfigurationDataAttributesResponse", + "v2.incident_configuration_data_request" => "IncidentConfigurationDataRequest", + "v2.incident_configuration_data_response" => "IncidentConfigurationDataResponse", + "v2.incident_configuration_patch_data_attributes_request" => "IncidentConfigurationPatchDataAttributesRequest", + "v2.incident_configuration_patch_data_request" => "IncidentConfigurationPatchDataRequest", + "v2.incident_configuration_patch_request" => "IncidentConfigurationPatchRequest", + "v2.incident_configuration_relationships" => "IncidentConfigurationRelationships", + "v2.incident_configuration_request" => "IncidentConfigurationRequest", + "v2.incident_configuration_response" => "IncidentConfigurationResponse", + "v2.incident_configuration_type" => "IncidentConfigurationType", "v2.incident_create_attributes" => "IncidentCreateAttributes", "v2.incident_create_data" => "IncidentCreateData", + "v2.incident_create_on_call_page_data_attributes_request" => "IncidentCreateOnCallPageDataAttributesRequest", + "v2.incident_create_on_call_page_data_request" => "IncidentCreateOnCallPageDataRequest", + "v2.incident_create_on_call_page_request" => "IncidentCreateOnCallPageRequest", + "v2.incident_create_page_from_incident_data_attributes_request" => "IncidentCreatePageFromIncidentDataAttributesRequest", + "v2.incident_create_page_from_incident_data_request" => "IncidentCreatePageFromIncidentDataRequest", + "v2.incident_create_page_from_incident_request" => "IncidentCreatePageFromIncidentRequest", + "v2.incident_create_page_from_incident_type" => "IncidentCreatePageFromIncidentType", "v2.incident_create_relationships" => "IncidentCreateRelationships", "v2.incident_create_request" => "IncidentCreateRequest", "v2.incident_field_attributes" => "IncidentFieldAttributes", @@ -3404,6 +3426,30 @@ def overrides "v2.incident_field_attributes_single_value" => "IncidentFieldAttributesSingleValue", "v2.incident_field_attributes_single_value_type" => "IncidentFieldAttributesSingleValueType", "v2.incident_field_attributes_value_type" => "IncidentFieldAttributesValueType", + "v2.incident_google_chat_configuration_data_attributes_request" => "IncidentGoogleChatConfigurationDataAttributesRequest", + "v2.incident_google_chat_configuration_data_attributes_response" => "IncidentGoogleChatConfigurationDataAttributesResponse", + "v2.incident_google_chat_configuration_data_request" => "IncidentGoogleChatConfigurationDataRequest", + "v2.incident_google_chat_configuration_data_response" => "IncidentGoogleChatConfigurationDataResponse", + "v2.incident_google_chat_configuration_patch_data_attributes_request" => "IncidentGoogleChatConfigurationPatchDataAttributesRequest", + "v2.incident_google_chat_configuration_patch_data_request" => "IncidentGoogleChatConfigurationPatchDataRequest", + "v2.incident_google_chat_configuration_patch_request" => "IncidentGoogleChatConfigurationPatchRequest", + "v2.incident_google_chat_configuration_relationships" => "IncidentGoogleChatConfigurationRelationships", + "v2.incident_google_chat_configuration_relationships_request" => "IncidentGoogleChatConfigurationRelationshipsRequest", + "v2.incident_google_chat_configuration_request" => "IncidentGoogleChatConfigurationRequest", + "v2.incident_google_chat_configuration_response" => "IncidentGoogleChatConfigurationResponse", + "v2.incident_google_chat_configuration_type" => "IncidentGoogleChatConfigurationType", + "v2.incident_google_meet_configuration_data_attributes_request" => "IncidentGoogleMeetConfigurationDataAttributesRequest", + "v2.incident_google_meet_configuration_data_attributes_response" => "IncidentGoogleMeetConfigurationDataAttributesResponse", + "v2.incident_google_meet_configuration_data_request" => "IncidentGoogleMeetConfigurationDataRequest", + "v2.incident_google_meet_configuration_data_response" => "IncidentGoogleMeetConfigurationDataResponse", + "v2.incident_google_meet_configuration_patch_data_attributes_request" => "IncidentGoogleMeetConfigurationPatchDataAttributesRequest", + "v2.incident_google_meet_configuration_patch_data_request" => "IncidentGoogleMeetConfigurationPatchDataRequest", + "v2.incident_google_meet_configuration_patch_request" => "IncidentGoogleMeetConfigurationPatchRequest", + "v2.incident_google_meet_configuration_relationships" => "IncidentGoogleMeetConfigurationRelationships", + "v2.incident_google_meet_configuration_relationships_request" => "IncidentGoogleMeetConfigurationRelationshipsRequest", + "v2.incident_google_meet_configuration_request" => "IncidentGoogleMeetConfigurationRequest", + "v2.incident_google_meet_configuration_response" => "IncidentGoogleMeetConfigurationResponse", + "v2.incident_google_meet_configuration_type" => "IncidentGoogleMeetConfigurationType", "v2.incident_handle_attributes_fields" => "IncidentHandleAttributesFields", "v2.incident_handle_attributes_request" => "IncidentHandleAttributesRequest", "v2.incident_handle_attributes_response" => "IncidentHandleAttributesResponse", @@ -3422,6 +3468,18 @@ def overrides "v2.incident_impact_create_attributes" => "IncidentImpactCreateAttributes", "v2.incident_impact_create_data" => "IncidentImpactCreateData", "v2.incident_impact_create_request" => "IncidentImpactCreateRequest", + "v2.incident_impact_field_choice" => "IncidentImpactFieldChoice", + "v2.incident_impact_field_data_attributes_request" => "IncidentImpactFieldDataAttributesRequest", + "v2.incident_impact_field_data_attributes_response" => "IncidentImpactFieldDataAttributesResponse", + "v2.incident_impact_field_data_request" => "IncidentImpactFieldDataRequest", + "v2.incident_impact_field_data_response" => "IncidentImpactFieldDataResponse", + "v2.incident_impact_field_relationships" => "IncidentImpactFieldRelationships", + "v2.incident_impact_field_relationships_request" => "IncidentImpactFieldRelationshipsRequest", + "v2.incident_impact_field_request" => "IncidentImpactFieldRequest", + "v2.incident_impact_field_response" => "IncidentImpactFieldResponse", + "v2.incident_impact_fields_response" => "IncidentImpactFieldsResponse", + "v2.incident_impact_field_type" => "IncidentImpactFieldType", + "v2.incident_impact_field_value_type" => "IncidentImpactFieldValueType", "v2.incident_impact_related_object" => "IncidentImpactRelatedObject", "v2.incident_impact_relationships" => "IncidentImpactRelationships", "v2.incident_impact_response" => "IncidentImpactResponse", @@ -3488,11 +3546,42 @@ def overrides "v2.incident_notification_template_type" => "IncidentNotificationTemplateType", "v2.incident_notification_template_update_attributes" => "IncidentNotificationTemplateUpdateAttributes", "v2.incident_notification_template_update_data" => "IncidentNotificationTemplateUpdateData", + "v2.incident_on_call_page_data_attributes_request" => "IncidentOnCallPageDataAttributesRequest", + "v2.incident_on_call_page_data_request" => "IncidentOnCallPageDataRequest", + "v2.incident_on_call_page_link_request" => "IncidentOnCallPageLinkRequest", + "v2.incident_on_call_page_target" => "IncidentOnCallPageTarget", + "v2.incident_on_call_page_type" => "IncidentOnCallPageType", + "v2.incident_org_settings_data_attributes_response" => "IncidentOrgSettingsDataAttributesResponse", + "v2.incident_org_settings_data_response" => "IncidentOrgSettingsDataResponse", + "v2.incident_org_settings_list_response" => "IncidentOrgSettingsListResponse", + "v2.incident_org_settings_relationships" => "IncidentOrgSettingsRelationships", + "v2.incident_org_settings_response" => "IncidentOrgSettingsResponse", + "v2.incident_org_settings_type" => "IncidentOrgSettingsType", + "v2.incident_page_role_reference" => "IncidentPageRoleReference", + "v2.incident_page_role_type" => "IncidentPageRoleType", + "v2.incident_page_target" => "IncidentPageTarget", + "v2.incident_page_target_type" => "IncidentPageTargetType", + "v2.incident_page_uuid_data_response" => "IncidentPageUUIDDataResponse", + "v2.incident_page_uuid_response" => "IncidentPageUUIDResponse", + "v2.incident_page_uuid_type" => "IncidentPageUUIDType", "v2.incident_postmortem_type" => "IncidentPostmortemType", "v2.incident_related_object" => "IncidentRelatedObject", "v2.incident_relationship_data" => "IncidentRelationshipData", "v2.incident_resource_type" => "IncidentResourceType", + "v2.incident_responder_data_attributes_response" => "IncidentResponderDataAttributesResponse", + "v2.incident_responder_data_request" => "IncidentResponderDataRequest", + "v2.incident_responder_data_response" => "IncidentResponderDataResponse", + "v2.incident_responder_relationships" => "IncidentResponderRelationships", + "v2.incident_responder_relationships_request" => "IncidentResponderRelationshipsRequest", + "v2.incident_responder_request" => "IncidentResponderRequest", + "v2.incident_responder_response" => "IncidentResponderResponse", + "v2.incident_responder_role_assignment_relationship_data" => "IncidentResponderRoleAssignmentRelationshipData", + "v2.incident_responder_role_assignments_relationship" => "IncidentResponderRoleAssignmentsRelationship", + "v2.incident_responders_response" => "IncidentRespondersResponse", "v2.incident_responders_type" => "IncidentRespondersType", + "v2.incident_responder_type" => "IncidentResponderType", + "v2.incident_responder_user_relationship" => "IncidentResponderUserRelationship", + "v2.incident_responder_user_relationship_data" => "IncidentResponderUserRelationshipData", "v2.incident_response" => "IncidentResponse", "v2.incident_response_attributes" => "IncidentResponseAttributes", "v2.incident_response_data" => "IncidentResponseData", @@ -3500,6 +3589,23 @@ def overrides "v2.incident_response_meta" => "IncidentResponseMeta", "v2.incident_response_meta_pagination" => "IncidentResponseMetaPagination", "v2.incident_response_relationships" => "IncidentResponseRelationships", + "v2.incident_rule_condition" => "IncidentRuleCondition", + "v2.incident_rule_data_attributes_request" => "IncidentRuleDataAttributesRequest", + "v2.incident_rule_data_attributes_response" => "IncidentRuleDataAttributesResponse", + "v2.incident_rule_data_request" => "IncidentRuleDataRequest", + "v2.incident_rule_data_response" => "IncidentRuleDataResponse", + "v2.incident_rule_execution_type" => "IncidentRuleExecutionType", + "v2.incident_rule_patch_data_attributes_request" => "IncidentRulePatchDataAttributesRequest", + "v2.incident_rule_patch_data_request" => "IncidentRulePatchDataRequest", + "v2.incident_rule_patch_request" => "IncidentRulePatchRequest", + "v2.incident_rule_query_condition" => "IncidentRuleQueryCondition", + "v2.incident_rule_request" => "IncidentRuleRequest", + "v2.incident_rule_response" => "IncidentRuleResponse", + "v2.incident_rule_response_type" => "IncidentRuleResponseType", + "v2.incident_rules_response" => "IncidentRulesResponse", + "v2.incident_rule_task_id_type" => "IncidentRuleTaskIDType", + "v2.incident_rule_trigger_type" => "IncidentRuleTriggerType", + "v2.incident_rule_type" => "IncidentRuleType", "v2.incident_search_response" => "IncidentSearchResponse", "v2.incident_search_response_attributes" => "IncidentSearchResponseAttributes", "v2.incident_search_response_data" => "IncidentSearchResponseData", @@ -3517,6 +3623,10 @@ def overrides "v2.incident_service_create_data" => "IncidentServiceCreateData", "v2.incident_service_create_request" => "IncidentServiceCreateRequest", "v2.incident_service_included_items" => "IncidentServiceIncludedItems", + "v2.incident_service_now_record_data_attributes_request" => "IncidentServiceNowRecordDataAttributesRequest", + "v2.incident_service_now_record_data_request" => "IncidentServiceNowRecordDataRequest", + "v2.incident_service_now_record_prompt_type" => "IncidentServiceNowRecordPromptType", + "v2.incident_service_now_record_request" => "IncidentServiceNowRecordRequest", "v2.incident_service_relationships" => "IncidentServiceRelationships", "v2.incident_service_response" => "IncidentServiceResponse", "v2.incident_service_response_attributes" => "IncidentServiceResponseAttributes", @@ -3532,6 +3642,19 @@ def overrides "v2.incident_timeline_cell_markdown_content_type" => "IncidentTimelineCellMarkdownContentType", "v2.incident_timeline_cell_markdown_create_attributes" => "IncidentTimelineCellMarkdownCreateAttributes", "v2.incident_timeline_cell_markdown_create_attributes_content" => "IncidentTimelineCellMarkdownCreateAttributesContent", + "v2.incident_timestamp_override_data_attributes_request" => "IncidentTimestampOverrideDataAttributesRequest", + "v2.incident_timestamp_override_data_attributes_response" => "IncidentTimestampOverrideDataAttributesResponse", + "v2.incident_timestamp_override_data_request" => "IncidentTimestampOverrideDataRequest", + "v2.incident_timestamp_override_data_response" => "IncidentTimestampOverrideDataResponse", + "v2.incident_timestamp_override_patch_data_attributes_request" => "IncidentTimestampOverridePatchDataAttributesRequest", + "v2.incident_timestamp_override_patch_data_request" => "IncidentTimestampOverridePatchDataRequest", + "v2.incident_timestamp_override_patch_request" => "IncidentTimestampOverridePatchRequest", + "v2.incident_timestamp_override_relationships" => "IncidentTimestampOverrideRelationships", + "v2.incident_timestamp_override_request" => "IncidentTimestampOverrideRequest", + "v2.incident_timestamp_override_response" => "IncidentTimestampOverrideResponse", + "v2.incident_timestamp_overrides_response" => "IncidentTimestampOverridesResponse", + "v2.incident_timestamp_override_type" => "IncidentTimestampOverrideType", + "v2.incident_timestamp_type" => "IncidentTimestampType", "v2.incident_todo_anonymous_assignee" => "IncidentTodoAnonymousAssignee", "v2.incident_todo_anonymous_assignee_source" => "IncidentTodoAnonymousAssigneeSource", "v2.incident_todo_assignee" => "IncidentTodoAssignee", @@ -3585,6 +3708,23 @@ def overrides "v2.incident_user_defined_field_update_data" => "IncidentUserDefinedFieldUpdateData", "v2.incident_user_defined_field_update_request" => "IncidentUserDefinedFieldUpdateRequest", "v2.incident_user_defined_field_valid_value" => "IncidentUserDefinedFieldValidValue", + "v2.incident_user_defined_role_data_attributes_request" => "IncidentUserDefinedRoleDataAttributesRequest", + "v2.incident_user_defined_role_data_attributes_response" => "IncidentUserDefinedRoleDataAttributesResponse", + "v2.incident_user_defined_role_data_request" => "IncidentUserDefinedRoleDataRequest", + "v2.incident_user_defined_role_data_response" => "IncidentUserDefinedRoleDataResponse", + "v2.incident_user_defined_role_incident_type_relationship" => "IncidentUserDefinedRoleIncidentTypeRelationship", + "v2.incident_user_defined_role_incident_type_relationship_data" => "IncidentUserDefinedRoleIncidentTypeRelationshipData", + "v2.incident_user_defined_role_included_item" => "IncidentUserDefinedRoleIncludedItem", + "v2.incident_user_defined_role_patch_data_attributes_request" => "IncidentUserDefinedRolePatchDataAttributesRequest", + "v2.incident_user_defined_role_patch_data_request" => "IncidentUserDefinedRolePatchDataRequest", + "v2.incident_user_defined_role_patch_request" => "IncidentUserDefinedRolePatchRequest", + "v2.incident_user_defined_role_policy" => "IncidentUserDefinedRolePolicy", + "v2.incident_user_defined_role_relationships_request" => "IncidentUserDefinedRoleRelationshipsRequest", + "v2.incident_user_defined_role_relationships_response" => "IncidentUserDefinedRoleRelationshipsResponse", + "v2.incident_user_defined_role_request" => "IncidentUserDefinedRoleRequest", + "v2.incident_user_defined_role_response" => "IncidentUserDefinedRoleResponse", + "v2.incident_user_defined_roles_response" => "IncidentUserDefinedRolesResponse", + "v2.incident_user_defined_role_type" => "IncidentUserDefinedRoleType", "v2.include_type" => "IncludeType", "v2.input_schema" => "InputSchema", "v2.input_schema_parameters" => "InputSchemaParameters", diff --git a/lib/datadog_api_client/v2/api/incidents_api.rb b/lib/datadog_api_client/v2/api/incidents_api.rb index e5ea4e02b73e..e8afe72374e5 100644 --- a/lib/datadog_api_client/v2/api/incidents_api.rb +++ b/lib/datadog_api_client/v2/api/incidents_api.rb @@ -251,6 +251,230 @@ def create_incident_attachment_with_http_info(incident_id, body, opts = {}) return data, status_code, headers end + # Create an incident configuration. + # + # @see #create_incident_configuration_with_http_info + def create_incident_configuration(incident_id, body, opts = {}) + data, _status_code, _headers = create_incident_configuration_with_http_info(incident_id, body, opts) + data + end + + # Create an incident configuration. + # + # Create a configuration for an incident. + # + # @param incident_id [String] The UUID of the incident. + # @param body [IncidentConfigurationRequest] Incident configuration payload. + # @param opts [Hash] the optional parameters + # @return [Array<(IncidentConfigurationResponse, Integer, Hash)>] IncidentConfigurationResponse data, response status code and response headers + def create_incident_configuration_with_http_info(incident_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_configuration".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_configuration") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_configuration")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_configuration ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.create_incident_configuration" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_configuration" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/configurations'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentConfigurationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_incident_configuration, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create an incident Google Chat configuration. + # + # @see #create_incident_google_chat_configuration_with_http_info + def create_incident_google_chat_configuration(body, opts = {}) + data, _status_code, _headers = create_incident_google_chat_configuration_with_http_info(body, opts) + data + end + + # Create an incident Google Chat configuration. + # + # Create a Google Chat configuration for incidents. + # + # @param body [IncidentGoogleChatConfigurationRequest] Google Chat configuration payload. + # @param opts [Hash] the optional parameters + # @return [Array<(IncidentGoogleChatConfigurationResponse, Integer, Hash)>] IncidentGoogleChatConfigurationResponse data, response status code and response headers + def create_incident_google_chat_configuration_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_google_chat_configuration".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_google_chat_configuration") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_google_chat_configuration")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_google_chat_configuration ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_google_chat_configuration" + end + # resource path + local_var_path = '/api/v2/incidents/config/google-chat-configurations' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentGoogleChatConfigurationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_incident_google_chat_configuration, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_google_chat_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create an incident Google Meet configuration. + # + # @see #create_incident_google_meet_configuration_with_http_info + def create_incident_google_meet_configuration(body, opts = {}) + data, _status_code, _headers = create_incident_google_meet_configuration_with_http_info(body, opts) + data + end + + # Create an incident Google Meet configuration. + # + # Create a Google Meet configuration for incidents. + # + # @param body [IncidentGoogleMeetConfigurationRequest] Google Meet configuration payload. + # @param opts [Hash] the optional parameters + # @return [Array<(IncidentGoogleMeetConfigurationResponse, Integer, Hash)>] IncidentGoogleMeetConfigurationResponse data, response status code and response headers + def create_incident_google_meet_configuration_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_google_meet_configuration".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_google_meet_configuration") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_google_meet_configuration")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_google_meet_configuration ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_google_meet_configuration" + end + # resource path + local_var_path = '/api/v2/incidents/config/google-meet-configurations' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentGoogleMeetConfigurationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_incident_google_meet_configuration, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_google_meet_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create an incident impact. # # @see #create_incident_impact_with_http_info @@ -325,6 +549,79 @@ def create_incident_impact_with_http_info(incident_id, body, opts = {}) return data, status_code, headers end + # Create an incident impact field. + # + # @see #create_incident_impact_field_with_http_info + def create_incident_impact_field(body, opts = {}) + data, _status_code, _headers = create_incident_impact_field_with_http_info(body, opts) + data + end + + # Create an incident impact field. + # + # Create an impact field for incidents. + # + # @param body [IncidentImpactFieldRequest] Impact field payload. + # @param opts [Hash] the optional parameters + # @return [Array<(IncidentImpactFieldResponse, Integer, Hash)>] IncidentImpactFieldResponse data, response status code and response headers + def create_incident_impact_field_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_impact_field".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_impact_field") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_impact_field")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_impact_field ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_impact_field" + end + # resource path + local_var_path = '/api/v2/incidents/config/impact-fields' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentImpactFieldResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_incident_impact_field, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_impact_field\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Create an incident integration metadata. # # @see #create_incident_integration_with_http_info @@ -704,43 +1001,43 @@ def create_incident_postmortem_template_with_http_info(body, opts = {}) return data, status_code, headers end - # Create an incident todo. + # Create an incident responder. # - # @see #create_incident_todo_with_http_info - def create_incident_todo(incident_id, body, opts = {}) - data, _status_code, _headers = create_incident_todo_with_http_info(incident_id, body, opts) + # @see #create_incident_responder_with_http_info + def create_incident_responder(incident_id, body, opts = {}) + data, _status_code, _headers = create_incident_responder_with_http_info(incident_id, body, opts) data end - # Create an incident todo. + # Create an incident responder. # - # Create an incident todo. + # Add a responder to an incident. # # @param incident_id [String] The UUID of the incident. - # @param body [IncidentTodoCreateRequest] Incident todo payload. + # @param body [IncidentResponderRequest] Incident responder payload. # @param opts [Hash] the optional parameters - # @return [Array<(IncidentTodoResponse, Integer, Hash)>] IncidentTodoResponse data, response status code and response headers - def create_incident_todo_with_http_info(incident_id, body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_todo".to_sym] + # @return [Array<(IncidentResponderResponse, Integer, Hash)>] IncidentResponderResponse data, response status code and response headers + def create_incident_responder_with_http_info(incident_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_responder".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_todo") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_responder") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_todo")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_responder")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_todo ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_responder ...' end # verify the required parameter 'incident_id' is set if @api_client.config.client_side_validation && incident_id.nil? - fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.create_incident_todo" + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.create_incident_responder" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_todo" + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_responder" end # resource path - local_var_path = '/api/v2/incidents/{incident_id}/relationships/todos'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/{incident_id}/responders'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -759,13 +1056,13 @@ def create_incident_todo_with_http_info(incident_id, body, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'IncidentTodoResponse' + return_type = opts[:debug_return_type] || 'IncidentResponderResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :create_incident_todo, + :operation => :create_incident_responder, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -777,43 +1074,43 @@ def create_incident_todo_with_http_info(incident_id, body, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_todo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_responder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Create an incident type. + # Create an incident rule. # - # @see #create_incident_type_with_http_info - def create_incident_type(body, opts = {}) - data, _status_code, _headers = create_incident_type_with_http_info(body, opts) + # @see #create_incident_rule_with_http_info + def create_incident_rule(body, opts = {}) + data, _status_code, _headers = create_incident_rule_with_http_info(body, opts) data end - # Create an incident type. + # Create an incident rule. # - # Create an incident type. + # Create an incident rule. # - # @param body [IncidentTypeCreateRequest] Incident type payload. + # @param body [IncidentRuleRequest] Incident rule payload. # @param opts [Hash] the optional parameters - # @return [Array<(IncidentTypeResponse, Integer, Hash)>] IncidentTypeResponse data, response status code and response headers - def create_incident_type_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_type".to_sym] + # @return [Array<(IncidentRuleResponse, Integer, Hash)>] IncidentRuleResponse data, response status code and response headers + def create_incident_rule_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_rule".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_type") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_rule") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_type")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_rule")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_type ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_rule ...' end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_type" + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_rule" end # resource path - local_var_path = '/api/v2/incidents/config/types' + local_var_path = '/api/v2/incidents/config/rules' # query parameters query_params = opts[:query_params] || {} @@ -832,13 +1129,13 @@ def create_incident_type_with_http_info(body, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'IncidentTypeResponse' + return_type = opts[:debug_return_type] || 'IncidentRuleResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :create_incident_type, + :operation => :create_incident_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -850,48 +1147,51 @@ def create_incident_type_with_http_info(body, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Create an incident user-defined field. + # Create an incident ServiceNow record. # - # @see #create_incident_user_defined_field_with_http_info - def create_incident_user_defined_field(body, opts = {}) - data, _status_code, _headers = create_incident_user_defined_field_with_http_info(body, opts) + # @see #create_incident_service_now_record_with_http_info + def create_incident_service_now_record(incident_id, body, opts = {}) + data, _status_code, _headers = create_incident_service_now_record_with_http_info(incident_id, body, opts) data end - # Create an incident user-defined field. + # Create an incident ServiceNow record. # - # Create an incident user-defined field. + # Create a ServiceNow record for an incident. # - # @param body [IncidentUserDefinedFieldCreateRequest] Incident user-defined field payload. + # @param incident_id [String] The UUID of the incident. + # @param body [IncidentServiceNowRecordRequest] ServiceNow record payload. # @param opts [Hash] the optional parameters - # @option opts [String] :include Comma-separated list of related resources to include. Supported values are "last_modified_by_user", "created_by_user", and "incident_type". - # @return [Array<(IncidentUserDefinedFieldResponse, Integer, Hash)>] IncidentUserDefinedFieldResponse data, response status code and response headers - def create_incident_user_defined_field_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_user_defined_field".to_sym] + # @return [Array<(IncidentIntegrationMetadataResponse, Integer, Hash)>] IncidentIntegrationMetadataResponse data, response status code and response headers + def create_incident_service_now_record_with_http_info(incident_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_service_now_record".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_user_defined_field") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_service_now_record") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_user_defined_field")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_service_now_record")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_user_defined_field ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_service_now_record ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.create_incident_service_now_record" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_user_defined_field" + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_service_now_record" end # resource path - local_var_path = '/api/v2/incidents/config/user-defined-fields' + local_var_path = '/api/v2/incidents/{incident_id}/servicenow-records'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} @@ -907,13 +1207,13 @@ def create_incident_user_defined_field_with_http_info(body, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'IncidentUserDefinedFieldResponse' + return_type = opts[:debug_return_type] || 'IncidentIntegrationMetadataResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :create_incident_user_defined_field, + :operation => :create_incident_service_now_record, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -925,38 +1225,48 @@ def create_incident_user_defined_field_with_http_info(body, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_user_defined_field\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_service_now_record\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete global incident handle. + # Create an incident todo. # - # @see #delete_global_incident_handle_with_http_info - def delete_global_incident_handle(opts = {}) - delete_global_incident_handle_with_http_info(opts) - nil + # @see #create_incident_todo_with_http_info + def create_incident_todo(incident_id, body, opts = {}) + data, _status_code, _headers = create_incident_todo_with_http_info(incident_id, body, opts) + data end - # Delete global incident handle. + # Create an incident todo. # - # Delete a global incident handle. + # Create an incident todo. # + # @param incident_id [String] The UUID of the incident. + # @param body [IncidentTodoCreateRequest] Incident todo payload. # @param opts [Hash] the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_global_incident_handle_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.delete_global_incident_handle".to_sym] + # @return [Array<(IncidentTodoResponse, Integer, Hash)>] IncidentTodoResponse data, response status code and response headers + def create_incident_todo_with_http_info(incident_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_todo".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_global_incident_handle") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_todo") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_global_incident_handle")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_todo")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_global_incident_handle ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_todo ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.create_incident_todo" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_todo" end # resource path - local_var_path = '/api/v2/incidents/config/global/incident-handles' + local_var_path = '/api/v2/incidents/{incident_id}/relationships/todos'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -964,22 +1274,24 @@ def delete_global_incident_handle_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'IncidentTodoResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :delete_global_incident_handle, + :operation => :create_incident_todo, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -989,45 +1301,45 @@ def delete_global_incident_handle_with_http_info(opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#delete_global_incident_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_todo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete an existing incident. + # Create an incident type. # - # @see #delete_incident_with_http_info - def delete_incident(incident_id, opts = {}) - delete_incident_with_http_info(incident_id, opts) - nil + # @see #create_incident_type_with_http_info + def create_incident_type(body, opts = {}) + data, _status_code, _headers = create_incident_type_with_http_info(body, opts) + data end - # Delete an existing incident. + # Create an incident type. # - # Deletes an existing incident from the users organization. + # Create an incident type. # - # @param incident_id [String] The UUID of the incident. + # @param body [IncidentTypeCreateRequest] Incident type payload. # @param opts [Hash] the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_incident_with_http_info(incident_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident".to_sym] + # @return [Array<(IncidentTypeResponse, Integer, Hash)>] IncidentTypeResponse data, response status code and response headers + def create_incident_type_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_type".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_type") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_type")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_type ...' end - # verify the required parameter 'incident_id' is set - if @api_client.config.client_side_validation && incident_id.nil? - fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.delete_incident" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_type" end # resource path - local_var_path = '/api/v2/incidents/{incident_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/config/types' # query parameters query_params = opts[:query_params] || {} @@ -1035,22 +1347,24 @@ def delete_incident_with_http_info(incident_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'IncidentTypeResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :delete_incident, + :operation => :create_incident_type, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1060,70 +1374,72 @@ def delete_incident_with_http_info(incident_id, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete incident attachment. + # Create an incident user-defined field. # - # @see #delete_incident_attachment_with_http_info - def delete_incident_attachment(incident_id, attachment_id, opts = {}) - delete_incident_attachment_with_http_info(incident_id, attachment_id, opts) - nil + # @see #create_incident_user_defined_field_with_http_info + def create_incident_user_defined_field(body, opts = {}) + data, _status_code, _headers = create_incident_user_defined_field_with_http_info(body, opts) + data end - # Delete incident attachment. - # @param incident_id [String] The UUID of the incident. - # @param attachment_id [String] The ID of the attachment. + # Create an incident user-defined field. + # + # Create an incident user-defined field. + # + # @param body [IncidentUserDefinedFieldCreateRequest] Incident user-defined field payload. # @param opts [Hash] the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_incident_attachment_with_http_info(incident_id, attachment_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_attachment".to_sym] + # @option opts [String] :include Comma-separated list of related resources to include. Supported values are "last_modified_by_user", "created_by_user", and "incident_type". + # @return [Array<(IncidentUserDefinedFieldResponse, Integer, Hash)>] IncidentUserDefinedFieldResponse data, response status code and response headers + def create_incident_user_defined_field_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_user_defined_field".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_attachment") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_user_defined_field") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_attachment")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_user_defined_field")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_attachment ...' - end - # verify the required parameter 'incident_id' is set - if @api_client.config.client_side_validation && incident_id.nil? - fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.delete_incident_attachment" + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_user_defined_field ...' end - # verify the required parameter 'attachment_id' is set - if @api_client.config.client_side_validation && attachment_id.nil? - fail ArgumentError, "Missing the required parameter 'attachment_id' when calling IncidentsAPI.delete_incident_attachment" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_user_defined_field" end # resource path - local_var_path = '/api/v2/incidents/{incident_id}/attachments/{attachment_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{attachment_id}', CGI.escape(attachment_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/config/user-defined-fields' # query parameters query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'IncidentUserDefinedFieldResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :delete_incident_attachment, + :operation => :create_incident_user_defined_field, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1133,67 +1449,72 @@ def delete_incident_attachment_with_http_info(incident_id, attachment_id, opts = :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_user_defined_field\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete an incident impact. + # Create an incident user-defined role. # - # @see #delete_incident_impact_with_http_info - def delete_incident_impact(incident_id, impact_id, opts = {}) - delete_incident_impact_with_http_info(incident_id, impact_id, opts) - nil + # @see #create_incident_user_defined_role_with_http_info + def create_incident_user_defined_role(body, opts = {}) + data, _status_code, _headers = create_incident_user_defined_role_with_http_info(body, opts) + data end - # Delete an incident impact. + # Create an incident user-defined role. # - # Delete an incident impact. + # Create a new user-defined role for incidents. # - # @param incident_id [String] The UUID of the incident. - # @param impact_id [String] The UUID of the incident impact. + # @param body [IncidentUserDefinedRoleRequest] # @param opts [Hash] the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_incident_impact_with_http_info(incident_id, impact_id, opts = {}) + # @option opts [String] :include Comma-separated list of related resources to include in the response. + # @return [Array<(IncidentUserDefinedRoleResponse, Integer, Hash)>] IncidentUserDefinedRoleResponse data, response status code and response headers + def create_incident_user_defined_role_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_incident_user_defined_role".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_incident_user_defined_role") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_incident_user_defined_role")) + end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_impact ...' - end - # verify the required parameter 'incident_id' is set - if @api_client.config.client_side_validation && incident_id.nil? - fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.delete_incident_impact" + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_incident_user_defined_role ...' end - # verify the required parameter 'impact_id' is set - if @api_client.config.client_side_validation && impact_id.nil? - fail ArgumentError, "Missing the required parameter 'impact_id' when calling IncidentsAPI.delete_incident_impact" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_incident_user_defined_role" end # resource path - local_var_path = '/api/v2/incidents/{incident_id}/impacts/{impact_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{impact_id}', CGI.escape(impact_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/config/user-defined-roles' # query parameters query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'IncidentUserDefinedRoleResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :delete_incident_impact, + :operation => :create_incident_user_defined_role, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1203,50 +1524,50 @@ def delete_incident_impact_with_http_info(incident_id, impact_id, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_impact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#create_incident_user_defined_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete an incident integration metadata. + # Create an on-call page from an incident. # - # @see #delete_incident_integration_with_http_info - def delete_incident_integration(incident_id, integration_metadata_id, opts = {}) - delete_incident_integration_with_http_info(incident_id, integration_metadata_id, opts) - nil + # @see #create_on_call_page_from_incident_with_http_info + def create_on_call_page_from_incident(incident_id, body, opts = {}) + data, _status_code, _headers = create_on_call_page_from_incident_with_http_info(incident_id, body, opts) + data end - # Delete an incident integration metadata. + # Create an on-call page from an incident. # - # Delete an incident integration metadata. + # Create an on-call page directly from an incident. # # @param incident_id [String] The UUID of the incident. - # @param integration_metadata_id [String] The UUID of the incident integration metadata. + # @param body [IncidentCreateOnCallPageRequest] On-call page creation payload. # @param opts [Hash] the optional parameters - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_incident_integration_with_http_info(incident_id, integration_metadata_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_integration".to_sym] + # @return [Array<(IncidentPageUUIDResponse, Integer, Hash)>] IncidentPageUUIDResponse data, response status code and response headers + def create_on_call_page_from_incident_with_http_info(incident_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_on_call_page_from_incident".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_integration") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_on_call_page_from_incident") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_integration")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_on_call_page_from_incident")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_integration ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_on_call_page_from_incident ...' end # verify the required parameter 'incident_id' is set if @api_client.config.client_side_validation && incident_id.nil? - fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.delete_incident_integration" + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.create_on_call_page_from_incident" end - # verify the required parameter 'integration_metadata_id' is set - if @api_client.config.client_side_validation && integration_metadata_id.nil? - fail ArgumentError, "Missing the required parameter 'integration_metadata_id' when calling IncidentsAPI.delete_incident_integration" + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_on_call_page_from_incident" end # resource path - local_var_path = '/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{integration_metadata_id}', CGI.escape(integration_metadata_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/{incident_id}/page'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -1254,22 +1575,24 @@ def delete_incident_integration_with_http_info(incident_id, integration_metadata # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) - - # form parameters + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'IncidentPageUUIDResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :delete_incident_integration, + :operation => :create_on_call_page_from_incident, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1279,70 +1602,75 @@ def delete_incident_integration_with_http_info(incident_id, integration_metadata :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#create_on_call_page_from_incident\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete an incident notification rule. + # Create a page from an incident. # - # @see #delete_incident_notification_rule_with_http_info - def delete_incident_notification_rule(id, opts = {}) - delete_incident_notification_rule_with_http_info(id, opts) - nil + # @see #create_page_from_incident_with_http_info + def create_page_from_incident(incident_id, body, opts = {}) + data, _status_code, _headers = create_page_from_incident_with_http_info(incident_id, body, opts) + data end - # Delete an incident notification rule. + # Create a page from an incident. # - # Deletes a notification rule by its ID. + # Create a page from an incident using the Cases service. # - # @param id [UUID] The ID of the notification rule. + # @param incident_id [String] The UUID of the incident. + # @param body [IncidentCreatePageFromIncidentRequest] Page creation payload. # @param opts [Hash] the optional parameters - # @option opts [String] :include Comma-separated list of resources to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type`, `notification_template` - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_incident_notification_rule_with_http_info(id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_notification_rule".to_sym] + # @return [Array<(IncidentPageUUIDResponse, Integer, Hash)>] IncidentPageUUIDResponse data, response status code and response headers + def create_page_from_incident_with_http_info(incident_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_page_from_incident".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_notification_rule") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_page_from_incident") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_notification_rule")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_page_from_incident")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_notification_rule ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_page_from_incident ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling IncidentsAPI.delete_incident_notification_rule" + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.create_page_from_incident" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_page_from_incident" end # resource path - local_var_path = '/api/v2/incidents/config/notification-rules/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/{incident_id}/cases/page'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'IncidentPageUUIDResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :delete_incident_notification_rule, + :operation => :create_page_from_incident, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1352,70 +1680,75 @@ def delete_incident_notification_rule_with_http_info(id, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_notification_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#create_page_from_incident\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete a notification template. + # Create an incident timestamp override. # - # @see #delete_incident_notification_template_with_http_info - def delete_incident_notification_template(id, opts = {}) - delete_incident_notification_template_with_http_info(id, opts) - nil + # @see #create_timestamp_override_with_http_info + def create_timestamp_override(incident_id, body, opts = {}) + data, _status_code, _headers = create_timestamp_override_with_http_info(incident_id, body, opts) + data end - # Delete a notification template. + # Create an incident timestamp override. # - # Deletes a notification template by its ID. + # Create a timestamp override for an incident. # - # @param id [UUID] The ID of the notification template. + # @param incident_id [String] The UUID of the incident. + # @param body [IncidentTimestampOverrideRequest] Timestamp override payload. # @param opts [Hash] the optional parameters - # @option opts [String] :include Comma-separated list of relationships to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type` - # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_incident_notification_template_with_http_info(id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_notification_template".to_sym] + # @return [Array<(IncidentTimestampOverrideResponse, Integer, Hash)>] IncidentTimestampOverrideResponse data, response status code and response headers + def create_timestamp_override_with_http_info(incident_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.create_timestamp_override".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_notification_template") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.create_timestamp_override") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_notification_template")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.create_timestamp_override")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_notification_template ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.create_timestamp_override ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling IncidentsAPI.delete_incident_notification_template" + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.create_timestamp_override" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.create_timestamp_override" end # resource path - local_var_path = '/api/v2/incidents/config/notification-templates/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/{incident_id}/timestamp-overrides'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['*/*']) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] + return_type = opts[:debug_return_type] || 'IncidentTimestampOverrideResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :delete_incident_notification_template, + :operation => :create_timestamp_override, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1425,45 +1758,40 @@ def delete_incident_notification_template_with_http_info(id, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_notification_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#create_timestamp_override\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete postmortem template. + # Delete global incident handle. # - # @see #delete_incident_postmortem_template_with_http_info - def delete_incident_postmortem_template(template_id, opts = {}) - delete_incident_postmortem_template_with_http_info(template_id, opts) + # @see #delete_global_incident_handle_with_http_info + def delete_global_incident_handle(opts = {}) + delete_global_incident_handle_with_http_info(opts) nil end - # Delete postmortem template. + # Delete global incident handle. # - # Delete a postmortem template. + # Delete a global incident handle. # - # @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 = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_postmortem_template".to_sym] + def delete_global_incident_handle_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_global_incident_handle".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_postmortem_template") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_global_incident_handle") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_postmortem_template")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_global_incident_handle")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_postmortem_template ...' - end - # verify the required parameter 'template_id' is set - if @api_client.config.client_side_validation && template_id.nil? - fail ArgumentError, "Missing the required parameter 'template_id' when calling IncidentsAPI.delete_incident_postmortem_template" + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_global_incident_handle ...' end # resource path - local_var_path = '/api/v2/incidents/config/postmortem-templates/{template_id}'.sub('{template_id}', CGI.escape(template_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/config/global/incident-handles' # query parameters query_params = opts[:query_params] || {} @@ -1486,7 +1814,7 @@ def delete_incident_postmortem_template_with_http_info(template_id, opts = {}) auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :delete_incident_postmortem_template, + :operation => :delete_global_incident_handle, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1498,48 +1826,43 @@ def delete_incident_postmortem_template_with_http_info(template_id, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_postmortem_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#delete_global_incident_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete an incident todo. + # Delete an existing incident. # - # @see #delete_incident_todo_with_http_info - def delete_incident_todo(incident_id, todo_id, opts = {}) - delete_incident_todo_with_http_info(incident_id, todo_id, opts) + # @see #delete_incident_with_http_info + def delete_incident(incident_id, opts = {}) + delete_incident_with_http_info(incident_id, opts) nil end - # Delete an incident todo. + # Delete an existing incident. # - # Delete an incident todo. + # Deletes an existing incident from the users organization. # # @param incident_id [String] The UUID of the incident. - # @param todo_id [String] The UUID of the incident todo. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_incident_todo_with_http_info(incident_id, todo_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_todo".to_sym] + def delete_incident_with_http_info(incident_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_todo") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_todo")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_todo ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident ...' end # verify the required parameter 'incident_id' is set if @api_client.config.client_side_validation && incident_id.nil? - fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.delete_incident_todo" - end - # verify the required parameter 'todo_id' is set - if @api_client.config.client_side_validation && todo_id.nil? - fail ArgumentError, "Missing the required parameter 'todo_id' when calling IncidentsAPI.delete_incident_todo" + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.delete_incident" end # resource path - local_var_path = '/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{todo_id}', CGI.escape(todo_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/{incident_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -1562,7 +1885,7 @@ def delete_incident_todo_with_http_info(incident_id, todo_id, opts = {}) auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :delete_incident_todo, + :operation => :delete_incident, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1574,43 +1897,45 @@ def delete_incident_todo_with_http_info(incident_id, todo_id, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_todo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete an incident type. + # Delete incident attachment. # - # @see #delete_incident_type_with_http_info - def delete_incident_type(incident_type_id, opts = {}) - delete_incident_type_with_http_info(incident_type_id, opts) + # @see #delete_incident_attachment_with_http_info + def delete_incident_attachment(incident_id, attachment_id, opts = {}) + delete_incident_attachment_with_http_info(incident_id, attachment_id, opts) nil end - # Delete an incident type. - # - # Delete an incident type. - # - # @param incident_type_id [String] The UUID of the incident type. + # Delete incident attachment. + # @param incident_id [String] The UUID of the incident. + # @param attachment_id [String] The ID of the attachment. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_incident_type_with_http_info(incident_type_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_type".to_sym] + def delete_incident_attachment_with_http_info(incident_id, attachment_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_attachment".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_type") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_attachment") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_type")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_attachment")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_type ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_attachment ...' end - # verify the required parameter 'incident_type_id' is set - if @api_client.config.client_side_validation && incident_type_id.nil? - fail ArgumentError, "Missing the required parameter 'incident_type_id' when calling IncidentsAPI.delete_incident_type" + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.delete_incident_attachment" + end + # verify the required parameter 'attachment_id' is set + if @api_client.config.client_side_validation && attachment_id.nil? + fail ArgumentError, "Missing the required parameter 'attachment_id' when calling IncidentsAPI.delete_incident_attachment" end # resource path - local_var_path = '/api/v2/incidents/config/types/{incident_type_id}'.sub('{incident_type_id}', CGI.escape(incident_type_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/{incident_id}/attachments/{attachment_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{attachment_id}', CGI.escape(attachment_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -1633,7 +1958,7 @@ def delete_incident_type_with_http_info(incident_type_id, opts = {}) auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :delete_incident_type, + :operation => :delete_incident_attachment, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1645,43 +1970,42 @@ def delete_incident_type_with_http_info(incident_type_id, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Delete an incident user-defined field. + # Delete an incident impact. # - # @see #delete_incident_user_defined_field_with_http_info - def delete_incident_user_defined_field(field_id, opts = {}) - delete_incident_user_defined_field_with_http_info(field_id, opts) + # @see #delete_incident_impact_with_http_info + def delete_incident_impact(incident_id, impact_id, opts = {}) + delete_incident_impact_with_http_info(incident_id, impact_id, opts) nil end - # Delete an incident user-defined field. + # Delete an incident impact. # - # Delete an incident user-defined field. + # Delete an incident impact. # - # @param field_id [String] The ID of the incident user-defined field. + # @param incident_id [String] The UUID of the incident. + # @param impact_id [String] The UUID of the incident impact. # @param opts [Hash] the optional parameters # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers - def delete_incident_user_defined_field_with_http_info(field_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_user_defined_field".to_sym] - if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_user_defined_field") - else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_user_defined_field")) - end + def delete_incident_impact_with_http_info(incident_id, impact_id, opts = {}) if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_user_defined_field ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_impact ...' end - # verify the required parameter 'field_id' is set - if @api_client.config.client_side_validation && field_id.nil? - fail ArgumentError, "Missing the required parameter 'field_id' when calling IncidentsAPI.delete_incident_user_defined_field" + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.delete_incident_impact" + end + # verify the required parameter 'impact_id' is set + if @api_client.config.client_side_validation && impact_id.nil? + fail ArgumentError, "Missing the required parameter 'impact_id' when calling IncidentsAPI.delete_incident_impact" end # resource path - local_var_path = '/api/v2/incidents/config/user-defined-fields/{field_id}'.sub('{field_id}', CGI.escape(field_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/{incident_id}/impacts/{impact_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{impact_id}', CGI.escape(impact_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -1704,7 +2028,7 @@ def delete_incident_user_defined_field_with_http_info(field_id, opts = {}) auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :delete_incident_user_defined_field, + :operation => :delete_incident_impact, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1716,38 +2040,43 @@ def delete_incident_user_defined_field_with_http_info(field_id, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_user_defined_field\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_impact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get global incident settings. + # Delete an incident impact field. # - # @see #get_global_incident_settings_with_http_info - def get_global_incident_settings(opts = {}) - data, _status_code, _headers = get_global_incident_settings_with_http_info(opts) - data + # @see #delete_incident_impact_field_with_http_info + def delete_incident_impact_field(field_id, opts = {}) + delete_incident_impact_field_with_http_info(field_id, opts) + nil end - # Get global incident settings. + # Delete an incident impact field. # - # Retrieve global incident settings for the organization. + # Delete an impact field for incidents. # + # @param field_id [UUID] The UUID of the impact field. # @param opts [Hash] the optional parameters - # @return [Array<(GlobalIncidentSettingsResponse, Integer, Hash)>] GlobalIncidentSettingsResponse data, response status code and response headers - def get_global_incident_settings_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_global_incident_settings".to_sym] + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_incident_impact_field_with_http_info(field_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_impact_field".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_global_incident_settings") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_impact_field") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_global_incident_settings")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_impact_field")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_global_incident_settings ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_impact_field ...' end - # resource path - local_var_path = '/api/v2/incidents/config/global/settings' + # verify the required parameter 'field_id' is set + if @api_client.config.client_side_validation && field_id.nil? + fail ArgumentError, "Missing the required parameter 'field_id' when calling IncidentsAPI.delete_incident_impact_field" + end + # resource path + local_var_path = '/api/v2/incidents/config/impact-fields/{field_id}'.sub('{field_id}', CGI.escape(field_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -1755,7 +2084,7 @@ def get_global_incident_settings_with_http_info(opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} @@ -1764,13 +2093,13 @@ def get_global_incident_settings_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'GlobalIncidentSettingsResponse' + return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :get_global_incident_settings, + :operation => :delete_incident_impact_field, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1780,55 +2109,58 @@ def get_global_incident_settings_with_http_info(opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#get_global_incident_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_impact_field\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get the details of an incident. + # Delete an incident integration metadata. # - # @see #get_incident_with_http_info - def get_incident(incident_id, opts = {}) - data, _status_code, _headers = get_incident_with_http_info(incident_id, opts) - data + # @see #delete_incident_integration_with_http_info + def delete_incident_integration(incident_id, integration_metadata_id, opts = {}) + delete_incident_integration_with_http_info(incident_id, integration_metadata_id, opts) + nil end - # Get the details of an incident. + # Delete an incident integration metadata. # - # Get the details of an incident by `incident_id`. + # Delete an incident integration metadata. # # @param incident_id [String] The UUID of the incident. + # @param integration_metadata_id [String] The UUID of the incident integration metadata. # @param opts [Hash] the optional parameters - # @option opts [Array] :include Specifies which types of related objects should be included in the response. - # @return [Array<(IncidentResponse, Integer, Hash)>] IncidentResponse data, response status code and response headers - def get_incident_with_http_info(incident_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_incident".to_sym] + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_incident_integration_with_http_info(incident_id, integration_metadata_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_integration".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_integration") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_integration")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_integration ...' end # verify the required parameter 'incident_id' is set if @api_client.config.client_side_validation && incident_id.nil? - fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.get_incident" + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.delete_incident_integration" + end + # verify the required parameter 'integration_metadata_id' is set + if @api_client.config.client_side_validation && integration_metadata_id.nil? + fail ArgumentError, "Missing the required parameter 'integration_metadata_id' when calling IncidentsAPI.delete_incident_integration" end # resource path - local_var_path = '/api/v2/incidents/{incident_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{integration_metadata_id}', CGI.escape(integration_metadata_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} @@ -1837,13 +2169,13 @@ def get_incident_with_http_info(incident_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentResponse' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :get_incident, + :operation => :delete_incident_integration, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1853,58 +2185,55 @@ def get_incident_with_http_info(incident_id, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#get_incident\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get incident integration metadata details. + # Delete an incident notification rule. # - # @see #get_incident_integration_with_http_info - def get_incident_integration(incident_id, integration_metadata_id, opts = {}) - data, _status_code, _headers = get_incident_integration_with_http_info(incident_id, integration_metadata_id, opts) - data + # @see #delete_incident_notification_rule_with_http_info + def delete_incident_notification_rule(id, opts = {}) + delete_incident_notification_rule_with_http_info(id, opts) + nil end - # Get incident integration metadata details. + # Delete an incident notification rule. # - # Get incident integration metadata details. + # Deletes a notification rule by its ID. # - # @param incident_id [String] The UUID of the incident. - # @param integration_metadata_id [String] The UUID of the incident integration metadata. + # @param id [UUID] The ID of the notification rule. # @param opts [Hash] the optional parameters - # @return [Array<(IncidentIntegrationMetadataResponse, Integer, Hash)>] IncidentIntegrationMetadataResponse data, response status code and response headers - def get_incident_integration_with_http_info(incident_id, integration_metadata_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_integration".to_sym] + # @option opts [String] :include Comma-separated list of resources to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type`, `notification_template` + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_incident_notification_rule_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_notification_rule".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_integration") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_notification_rule") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_integration")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_notification_rule")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_integration ...' - end - # verify the required parameter 'incident_id' is set - if @api_client.config.client_side_validation && incident_id.nil? - fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.get_incident_integration" + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_notification_rule ...' end - # verify the required parameter 'integration_metadata_id' is set - if @api_client.config.client_side_validation && integration_metadata_id.nil? - fail ArgumentError, "Missing the required parameter 'integration_metadata_id' when calling IncidentsAPI.get_incident_integration" + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling IncidentsAPI.delete_incident_notification_rule" end # resource path - local_var_path = '/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{integration_metadata_id}', CGI.escape(integration_metadata_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/config/notification-rules/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} @@ -1913,13 +2242,13 @@ def get_incident_integration_with_http_info(incident_id, integration_metadata_id post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentIntegrationMetadataResponse' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :get_incident_integration, + :operation => :delete_incident_notification_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -1929,46 +2258,46 @@ def get_incident_integration_with_http_info(incident_id, integration_metadata_id :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_notification_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get an incident notification rule. + # Delete a notification template. # - # @see #get_incident_notification_rule_with_http_info - def get_incident_notification_rule(id, opts = {}) - data, _status_code, _headers = get_incident_notification_rule_with_http_info(id, opts) - data + # @see #delete_incident_notification_template_with_http_info + def delete_incident_notification_template(id, opts = {}) + delete_incident_notification_template_with_http_info(id, opts) + nil end - # Get an incident notification rule. + # Delete a notification template. # - # Retrieves a specific notification rule by its ID. + # Deletes a notification template by its ID. # - # @param id [UUID] The ID of the notification rule. + # @param id [UUID] The ID of the notification template. # @param opts [Hash] the optional parameters - # @option opts [String] :include Comma-separated list of resources to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type`, `notification_template` - # @return [Array<(IncidentNotificationRule, Integer, Hash)>] IncidentNotificationRule data, response status code and response headers - def get_incident_notification_rule_with_http_info(id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_notification_rule".to_sym] + # @option opts [String] :include Comma-separated list of relationships to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type` + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_incident_notification_template_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_notification_template".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_notification_rule") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_notification_template") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_notification_rule")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_notification_template")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_notification_rule ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_notification_template ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling IncidentsAPI.get_incident_notification_rule" + fail ArgumentError, "Missing the required parameter 'id' when calling IncidentsAPI.delete_incident_notification_template" end # resource path - local_var_path = '/api/v2/incidents/config/notification-rules/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/config/notification-templates/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -1977,7 +2306,7 @@ def get_incident_notification_rule_with_http_info(id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} @@ -1986,13 +2315,13 @@ def get_incident_notification_rule_with_http_info(id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentNotificationRule' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :get_incident_notification_rule, + :operation => :delete_incident_notification_template, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2002,55 +2331,53 @@ def get_incident_notification_rule_with_http_info(id, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_notification_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_notification_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get incident notification template. + # Delete postmortem template. # - # @see #get_incident_notification_template_with_http_info - def get_incident_notification_template(id, opts = {}) - data, _status_code, _headers = get_incident_notification_template_with_http_info(id, opts) - data + # @see #delete_incident_postmortem_template_with_http_info + def delete_incident_postmortem_template(template_id, opts = {}) + delete_incident_postmortem_template_with_http_info(template_id, opts) + nil end - # Get incident notification template. + # Delete postmortem template. # - # Retrieves a specific notification template by its ID. + # Delete a postmortem template. # - # @param id [UUID] The ID of the notification template. + # @param template_id [String] The ID of the postmortem template # @param opts [Hash] the optional parameters - # @option opts [String] :include Comma-separated list of relationships to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type` - # @return [Array<(IncidentNotificationTemplate, Integer, Hash)>] IncidentNotificationTemplate data, response status code and response headers - def get_incident_notification_template_with_http_info(id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_notification_template".to_sym] + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_incident_postmortem_template_with_http_info(template_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_postmortem_template".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_notification_template") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_postmortem_template") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_notification_template")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_postmortem_template")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_notification_template ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_postmortem_template ...' end - # verify the required parameter 'id' is set - if @api_client.config.client_side_validation && id.nil? - fail ArgumentError, "Missing the required parameter 'id' when calling IncidentsAPI.get_incident_notification_template" + # verify the required parameter 'template_id' is set + if @api_client.config.client_side_validation && template_id.nil? + fail ArgumentError, "Missing the required parameter 'template_id' when calling IncidentsAPI.delete_incident_postmortem_template" end # resource path - local_var_path = '/api/v2/incidents/config/notification-templates/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/config/postmortem-templates/{template_id}'.sub('{template_id}', CGI.escape(template_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} @@ -2059,13 +2386,13 @@ def get_incident_notification_template_with_http_info(id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentNotificationTemplate' + return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :get_incident_notification_template, + :operation => :delete_incident_postmortem_template, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2075,45 +2402,50 @@ def get_incident_notification_template_with_http_info(id, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_notification_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_postmortem_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get postmortem template. + # Delete an incident responder. # - # @see #get_incident_postmortem_template_with_http_info - def get_incident_postmortem_template(template_id, opts = {}) - data, _status_code, _headers = get_incident_postmortem_template_with_http_info(template_id, opts) - data + # @see #delete_incident_responder_with_http_info + def delete_incident_responder(incident_id, responder_id, opts = {}) + delete_incident_responder_with_http_info(incident_id, responder_id, opts) + nil end - # Get postmortem template. + # Delete an incident responder. # - # Retrieve details of a specific postmortem template. + # Remove a responder from an incident. # - # @param template_id [String] The ID of the postmortem template + # @param incident_id [String] The UUID of the incident. + # @param responder_id [UUID] The UUID of the incident responder. # @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 = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_postmortem_template".to_sym] + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_incident_responder_with_http_info(incident_id, responder_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_responder".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_postmortem_template") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_responder") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_postmortem_template")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_responder")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_postmortem_template ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_responder ...' end - # verify the required parameter 'template_id' is set - if @api_client.config.client_side_validation && template_id.nil? - fail ArgumentError, "Missing the required parameter 'template_id' when calling IncidentsAPI.get_incident_postmortem_template" + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.delete_incident_responder" + end + # verify the required parameter 'responder_id' is set + if @api_client.config.client_side_validation && responder_id.nil? + fail ArgumentError, "Missing the required parameter 'responder_id' when calling IncidentsAPI.delete_incident_responder" end # resource path - local_var_path = '/api/v2/incidents/config/postmortem-templates/{template_id}'.sub('{template_id}', CGI.escape(template_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/{incident_id}/responders/{responder_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{responder_id}', CGI.escape(responder_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -2121,7 +2453,7 @@ def get_incident_postmortem_template_with_http_info(template_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} @@ -2130,13 +2462,13 @@ def get_incident_postmortem_template_with_http_info(template_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'PostmortemTemplateResponse' + return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :get_incident_postmortem_template, + :operation => :delete_incident_responder, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2146,50 +2478,45 @@ def get_incident_postmortem_template_with_http_info(template_id, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_postmortem_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_responder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get incident todo details. + # Delete an incident rule. # - # @see #get_incident_todo_with_http_info - def get_incident_todo(incident_id, todo_id, opts = {}) - data, _status_code, _headers = get_incident_todo_with_http_info(incident_id, todo_id, opts) - data + # @see #delete_incident_rule_with_http_info + def delete_incident_rule(rule_id, opts = {}) + delete_incident_rule_with_http_info(rule_id, opts) + nil end - # Get incident todo details. + # Delete an incident rule. # - # Get incident todo details. + # Delete an incident rule. # - # @param incident_id [String] The UUID of the incident. - # @param todo_id [String] The UUID of the incident todo. + # @param rule_id [UUID] The UUID of the incident rule. # @param opts [Hash] the optional parameters - # @return [Array<(IncidentTodoResponse, Integer, Hash)>] IncidentTodoResponse data, response status code and response headers - def get_incident_todo_with_http_info(incident_id, todo_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_todo".to_sym] + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_incident_rule_with_http_info(rule_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_rule".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_todo") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_rule") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_todo")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_rule")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_todo ...' - end - # verify the required parameter 'incident_id' is set - if @api_client.config.client_side_validation && incident_id.nil? - fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.get_incident_todo" + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_rule ...' end - # verify the required parameter 'todo_id' is set - if @api_client.config.client_side_validation && todo_id.nil? - fail ArgumentError, "Missing the required parameter 'todo_id' when calling IncidentsAPI.get_incident_todo" + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling IncidentsAPI.delete_incident_rule" end # resource path - local_var_path = '/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{todo_id}', CGI.escape(todo_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/config/rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -2197,7 +2524,7 @@ def get_incident_todo_with_http_info(incident_id, todo_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} @@ -2206,13 +2533,13 @@ def get_incident_todo_with_http_info(incident_id, todo_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentTodoResponse' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :get_incident_todo, + :operation => :delete_incident_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2222,45 +2549,50 @@ def get_incident_todo_with_http_info(incident_id, todo_id, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_todo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get incident type details. + # Delete an incident todo. # - # @see #get_incident_type_with_http_info - def get_incident_type(incident_type_id, opts = {}) - data, _status_code, _headers = get_incident_type_with_http_info(incident_type_id, opts) - data + # @see #delete_incident_todo_with_http_info + def delete_incident_todo(incident_id, todo_id, opts = {}) + delete_incident_todo_with_http_info(incident_id, todo_id, opts) + nil end - # Get incident type details. + # Delete an incident todo. # - # Get incident type details. + # Delete an incident todo. # - # @param incident_type_id [String] The UUID of the incident type. + # @param incident_id [String] The UUID of the incident. + # @param todo_id [String] The UUID of the incident todo. # @param opts [Hash] the optional parameters - # @return [Array<(IncidentTypeResponse, Integer, Hash)>] IncidentTypeResponse data, response status code and response headers - def get_incident_type_with_http_info(incident_type_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_type".to_sym] + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_incident_todo_with_http_info(incident_id, todo_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_todo".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_type") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_todo") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_type")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_todo")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_type ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_todo ...' end - # verify the required parameter 'incident_type_id' is set - if @api_client.config.client_side_validation && incident_type_id.nil? - fail ArgumentError, "Missing the required parameter 'incident_type_id' when calling IncidentsAPI.get_incident_type" + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.delete_incident_todo" + end + # verify the required parameter 'todo_id' is set + if @api_client.config.client_side_validation && todo_id.nil? + fail ArgumentError, "Missing the required parameter 'todo_id' when calling IncidentsAPI.delete_incident_todo" end # resource path - local_var_path = '/api/v2/incidents/config/types/{incident_type_id}'.sub('{incident_type_id}', CGI.escape(incident_type_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{todo_id}', CGI.escape(todo_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -2268,7 +2600,7 @@ def get_incident_type_with_http_info(incident_type_id, opts = {}) # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} @@ -2277,13 +2609,13 @@ def get_incident_type_with_http_info(incident_type_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentTypeResponse' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :get_incident_type, + :operation => :delete_incident_todo, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2293,55 +2625,53 @@ def get_incident_type_with_http_info(incident_type_id, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_todo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get an incident user-defined field. + # Delete an incident type. # - # @see #get_incident_user_defined_field_with_http_info - def get_incident_user_defined_field(field_id, opts = {}) - data, _status_code, _headers = get_incident_user_defined_field_with_http_info(field_id, opts) - data + # @see #delete_incident_type_with_http_info + def delete_incident_type(incident_type_id, opts = {}) + delete_incident_type_with_http_info(incident_type_id, opts) + nil end - # Get an incident user-defined field. + # Delete an incident type. # - # Get details of an incident user-defined field. + # Delete an incident type. # - # @param field_id [String] The ID of the incident user-defined field. + # @param incident_type_id [String] The UUID of the incident type. # @param opts [Hash] the optional parameters - # @option opts [String] :include Comma-separated list of related resources to include. Supported values are "last_modified_by_user", "created_by_user", and "incident_type". - # @return [Array<(IncidentUserDefinedFieldResponse, Integer, Hash)>] IncidentUserDefinedFieldResponse data, response status code and response headers - def get_incident_user_defined_field_with_http_info(field_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_user_defined_field".to_sym] + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_incident_type_with_http_info(incident_type_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_type".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_user_defined_field") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_type") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_user_defined_field")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_type")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_user_defined_field ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_type ...' end - # verify the required parameter 'field_id' is set - if @api_client.config.client_side_validation && field_id.nil? - fail ArgumentError, "Missing the required parameter 'field_id' when calling IncidentsAPI.get_incident_user_defined_field" + # verify the required parameter 'incident_type_id' is set + if @api_client.config.client_side_validation && incident_type_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_type_id' when calling IncidentsAPI.delete_incident_type" end # resource path - local_var_path = '/api/v2/incidents/config/user-defined-fields/{field_id}'.sub('{field_id}', CGI.escape(field_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/config/types/{incident_type_id}'.sub('{incident_type_id}', CGI.escape(incident_type_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} @@ -2350,13 +2680,13 @@ def get_incident_user_defined_field_with_http_info(field_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentUserDefinedFieldResponse' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :get_incident_user_defined_field, + :operation => :delete_incident_type, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2366,74 +2696,68 @@ def get_incident_user_defined_field_with_http_info(field_id, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_user_defined_field\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Import an incident. + # Delete an incident user-defined field. # - # @see #import_incident_with_http_info - def import_incident(body, opts = {}) - data, _status_code, _headers = import_incident_with_http_info(body, opts) - data + # @see #delete_incident_user_defined_field_with_http_info + def delete_incident_user_defined_field(field_id, opts = {}) + delete_incident_user_defined_field_with_http_info(field_id, opts) + nil end - # Import an incident. + # Delete an incident user-defined field. # - # Import an incident from an external system. This endpoint allows you to create incidents with - # historical data such as custom timestamps for detection, declaration, and resolution. - # Imported incidents do not execute integrations or notification rules. + # Delete an incident user-defined field. # - # @param body [IncidentImportRequest] Incident import payload. + # @param field_id [String] The ID of the incident user-defined field. # @param opts [Hash] the optional parameters - # @option opts [Array] :include Specifies which related object types to include in the response when importing an incident. - # @return [Array<(IncidentImportResponse, Integer, Hash)>] IncidentImportResponse data, response status code and response headers - def import_incident_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.import_incident".to_sym] + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_incident_user_defined_field_with_http_info(field_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_user_defined_field".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.import_incident") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_user_defined_field") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.import_incident")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_user_defined_field")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.import_incident ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_user_defined_field ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.import_incident" + # verify the required parameter 'field_id' is set + if @api_client.config.client_side_validation && field_id.nil? + fail ArgumentError, "Missing the required parameter 'field_id' when calling IncidentsAPI.delete_incident_user_defined_field" end # resource path - local_var_path = '/api/v2/incidents/import' + local_var_path = '/api/v2/incidents/config/user-defined-fields/{field_id}'.sub('{field_id}', CGI.escape(field_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentImportResponse' + return_type = opts[:debug_return_type] # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :import_incident, + :operation => :delete_incident_user_defined_field, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2443,50 +2767,53 @@ def import_incident_with_http_info(body, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#import_incident\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_user_defined_field\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # List global incident handles. + # Delete an incident user-defined role. # - # @see #list_global_incident_handles_with_http_info - def list_global_incident_handles(opts = {}) - data, _status_code, _headers = list_global_incident_handles_with_http_info(opts) - data + # @see #delete_incident_user_defined_role_with_http_info + def delete_incident_user_defined_role(role_id, opts = {}) + delete_incident_user_defined_role_with_http_info(role_id, opts) + nil end - # List global incident handles. + # Delete an incident user-defined role. # - # Retrieve a list of global incident handles. + # Delete an existing user-defined role for incidents. # + # @param role_id [UUID] The UUID of the incident user-defined role. # @param opts [Hash] the optional parameters - # @option opts [String] :include Comma-separated list of related resources to include in the response - # @return [Array<(IncidentHandlesResponse, Integer, Hash)>] IncidentHandlesResponse data, response status code and response headers - def list_global_incident_handles_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_global_incident_handles".to_sym] + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_incident_user_defined_role_with_http_info(role_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_incident_user_defined_role".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_global_incident_handles") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_incident_user_defined_role") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_global_incident_handles")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_incident_user_defined_role")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_global_incident_handles ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_incident_user_defined_role ...' + end + # verify the required parameter 'role_id' is set + if @api_client.config.client_side_validation && role_id.nil? + fail ArgumentError, "Missing the required parameter 'role_id' when calling IncidentsAPI.delete_incident_user_defined_role" end # resource path - local_var_path = '/api/v2/incidents/config/global/incident-handles' + local_var_path = '/api/v2/incidents/config/user-defined-roles/{role_id}'.sub('{role_id}', CGI.escape(role_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) - header_params['Accept'] = @api_client.select_header_accept(['application/json']) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) # form parameters form_params = opts[:form_params] || {} @@ -2495,13 +2822,13 @@ def list_global_incident_handles_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentHandlesResponse' + return_type = opts[:debug_return_type] # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_global_incident_handles, + :operation => :delete_incident_user_defined_role, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2511,52 +2838,53 @@ def list_global_incident_handles_with_http_info(opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#list_global_incident_handles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#delete_incident_user_defined_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # List incident attachments. + # Delete an incident timestamp override. # - # @see #list_incident_attachments_with_http_info - def list_incident_attachments(incident_id, opts = {}) - data, _status_code, _headers = list_incident_attachments_with_http_info(incident_id, opts) + # @see #delete_timestamp_override_with_http_info + def delete_timestamp_override(incident_id, id, opts = {}) + data, _status_code, _headers = delete_timestamp_override_with_http_info(incident_id, id, opts) data end - # List incident attachments. + # Delete an incident timestamp override. # - # List incident attachments. + # Delete a timestamp override for an incident. # # @param incident_id [String] The UUID of the incident. + # @param id [UUID] The UUID of the timestamp override. # @param opts [Hash] the optional parameters - # @option opts [String] :filter_attachment_type Filter attachments by type. Supported values are `1` (`postmortem`) and `2` (`link`). - # @option opts [String] :include Resource to include in the response. Supported value: `last_modified_by_user`. - # @return [Array<(AttachmentArray, Integer, Hash)>] AttachmentArray data, response status code and response headers - def list_incident_attachments_with_http_info(incident_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_attachments".to_sym] + # @return [Array<(IncidentTimestampOverrideResponse, Integer, Hash)>] IncidentTimestampOverrideResponse data, response status code and response headers + def delete_timestamp_override_with_http_info(incident_id, id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_timestamp_override".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_attachments") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_timestamp_override") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_attachments")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_timestamp_override")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_attachments ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.delete_timestamp_override ...' end # verify the required parameter 'incident_id' is set if @api_client.config.client_side_validation && incident_id.nil? - fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.list_incident_attachments" + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.delete_timestamp_override" + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling IncidentsAPI.delete_timestamp_override" end # resource path - local_var_path = '/api/v2/incidents/{incident_id}/attachments'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/{incident_id}/timestamp-overrides/{id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'filter[attachment_type]'] = opts[:'filter_attachment_type'] if !opts[:'filter_attachment_type'].nil? - query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} @@ -2570,13 +2898,13 @@ def list_incident_attachments_with_http_info(incident_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'AttachmentArray' + return_type = opts[:debug_return_type] || 'IncidentTimestampOverrideResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_incident_attachments, + :operation => :delete_timestamp_override, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2586,44 +2914,43 @@ def list_incident_attachments_with_http_info(incident_id, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#delete_timestamp_override\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # List an incident's impacts. + # Get global incident settings. # - # @see #list_incident_impacts_with_http_info - def list_incident_impacts(incident_id, opts = {}) - data, _status_code, _headers = list_incident_impacts_with_http_info(incident_id, opts) + # @see #get_global_incident_settings_with_http_info + def get_global_incident_settings(opts = {}) + data, _status_code, _headers = get_global_incident_settings_with_http_info(opts) data end - # List an incident's impacts. + # Get global incident settings. # - # Get all impacts for an incident. + # Retrieve global incident settings for the organization. # - # @param incident_id [String] The UUID of the incident. # @param opts [Hash] the optional parameters - # @option opts [Array] :include Specifies which related resources should be included in the response. - # @return [Array<(IncidentImpactsResponse, Integer, Hash)>] IncidentImpactsResponse data, response status code and response headers - def list_incident_impacts_with_http_info(incident_id, opts = {}) + # @return [Array<(GlobalIncidentSettingsResponse, Integer, Hash)>] GlobalIncidentSettingsResponse data, response status code and response headers + def get_global_incident_settings_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_global_incident_settings".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_global_incident_settings") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_global_incident_settings")) + end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_impacts ...' - end - # verify the required parameter 'incident_id' is set - if @api_client.config.client_side_validation && incident_id.nil? - fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.list_incident_impacts" + @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_global_incident_settings ...' end # resource path - local_var_path = '/api/v2/incidents/{incident_id}/impacts'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/config/global/settings' # query parameters query_params = opts[:query_params] || {} - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} @@ -2637,13 +2964,13 @@ def list_incident_impacts_with_http_info(incident_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentImpactsResponse' + return_type = opts[:debug_return_type] || 'GlobalIncidentSettingsResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :list_incident_impacts, + :operation => :get_global_incident_settings, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2655,46 +2982,48 @@ def list_incident_impacts_with_http_info(incident_id, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_impacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#get_global_incident_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get a list of an incident's integration metadata. + # Get the details of an incident. # - # @see #list_incident_integrations_with_http_info - def list_incident_integrations(incident_id, opts = {}) - data, _status_code, _headers = list_incident_integrations_with_http_info(incident_id, opts) + # @see #get_incident_with_http_info + def get_incident(incident_id, opts = {}) + data, _status_code, _headers = get_incident_with_http_info(incident_id, opts) data end - # Get a list of an incident's integration metadata. + # Get the details of an incident. # - # Get all integration metadata for an incident. + # Get the details of an incident by `incident_id`. # # @param incident_id [String] The UUID of the incident. # @param opts [Hash] the optional parameters - # @return [Array<(IncidentIntegrationMetadataListResponse, Integer, Hash)>] IncidentIntegrationMetadataListResponse data, response status code and response headers - def list_incident_integrations_with_http_info(incident_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_integrations".to_sym] + # @option opts [Array] :include Specifies which types of related objects should be included in the response. + # @return [Array<(IncidentResponse, Integer, Hash)>] IncidentResponse data, response status code and response headers + def get_incident_with_http_info(incident_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_incident".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_integrations") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_integrations")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_integrations ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident ...' end # verify the required parameter 'incident_id' is set if @api_client.config.client_side_validation && incident_id.nil? - fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.list_incident_integrations" + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.get_incident" end # resource path - local_var_path = '/api/v2/incidents/{incident_id}/relationships/integrations'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/{incident_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} @@ -2708,13 +3037,13 @@ def list_incident_integrations_with_http_info(incident_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentIntegrationMetadataListResponse' + return_type = opts[:debug_return_type] || 'IncidentResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_incident_integrations, + :operation => :get_incident, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2726,43 +3055,46 @@ def list_incident_integrations_with_http_info(incident_id, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_integrations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#get_incident\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # List incident notification rules. + # Get an AI-generated incident postmortem. # - # @see #list_incident_notification_rules_with_http_info - def list_incident_notification_rules(opts = {}) - data, _status_code, _headers = list_incident_notification_rules_with_http_info(opts) + # @see #get_incident_ai_postmortem_with_http_info + def get_incident_ai_postmortem(incident_id, opts = {}) + data, _status_code, _headers = get_incident_ai_postmortem_with_http_info(incident_id, opts) data end - # List incident notification rules. + # Get an AI-generated incident postmortem. # - # Lists all notification rules for the organization. Optionally filter by incident type. + # Generate an AI postmortem for an incident. # + # @param incident_id [String] The UUID of the incident. # @param opts [Hash] the optional parameters - # @option opts [String] :include Comma-separated list of resources to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type`, `notification_template` - # @return [Array<(IncidentNotificationRuleArray, Integer, Hash)>] IncidentNotificationRuleArray data, response status code and response headers - def list_incident_notification_rules_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_notification_rules".to_sym] + # @return [Array<(IncidentAIPostmortemResponse, Integer, Hash)>] IncidentAIPostmortemResponse data, response status code and response headers + def get_incident_ai_postmortem_with_http_info(incident_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_ai_postmortem".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_notification_rules") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_ai_postmortem") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_notification_rules")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_ai_postmortem")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_notification_rules ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_ai_postmortem ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.get_incident_ai_postmortem" end # resource path - local_var_path = '/api/v2/incidents/config/notification-rules' + local_var_path = '/api/v2/incidents/{incident_id}/ai/postmortem'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} @@ -2776,13 +3108,13 @@ def list_incident_notification_rules_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentNotificationRuleArray' + return_type = opts[:debug_return_type] || 'IncidentAIPostmortemResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_incident_notification_rules, + :operation => :get_incident_ai_postmortem, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2792,47 +3124,53 @@ def list_incident_notification_rules_with_http_info(opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_notification_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_ai_postmortem\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # List incident notification templates. + # Get incident integration metadata details. # - # @see #list_incident_notification_templates_with_http_info - def list_incident_notification_templates(opts = {}) - data, _status_code, _headers = list_incident_notification_templates_with_http_info(opts) + # @see #get_incident_integration_with_http_info + def get_incident_integration(incident_id, integration_metadata_id, opts = {}) + data, _status_code, _headers = get_incident_integration_with_http_info(incident_id, integration_metadata_id, opts) data end - # List incident notification templates. + # Get incident integration metadata details. # - # Lists all notification templates. Optionally filter by incident type. + # Get incident integration metadata details. # + # @param incident_id [String] The UUID of the incident. + # @param integration_metadata_id [String] The UUID of the incident integration metadata. # @param opts [Hash] the optional parameters - # @option opts [UUID] :filter_incident_type Optional incident type ID filter. - # @option opts [String] :include Comma-separated list of relationships to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type` - # @return [Array<(IncidentNotificationTemplateArray, Integer, Hash)>] IncidentNotificationTemplateArray data, response status code and response headers - def list_incident_notification_templates_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_notification_templates".to_sym] + # @return [Array<(IncidentIntegrationMetadataResponse, Integer, Hash)>] IncidentIntegrationMetadataResponse data, response status code and response headers + def get_incident_integration_with_http_info(incident_id, integration_metadata_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_integration".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_notification_templates") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_integration") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_notification_templates")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_integration")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_notification_templates ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_integration ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.get_incident_integration" + end + # verify the required parameter 'integration_metadata_id' is set + if @api_client.config.client_side_validation && integration_metadata_id.nil? + fail ArgumentError, "Missing the required parameter 'integration_metadata_id' when calling IncidentsAPI.get_incident_integration" end # resource path - local_var_path = '/api/v2/incidents/config/notification-templates' + local_var_path = '/api/v2/incidents/{incident_id}/relationships/integrations/{integration_metadata_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{integration_metadata_id}', CGI.escape(integration_metadata_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'filter[incident-type]'] = opts[:'filter_incident_type'] if !opts[:'filter_incident_type'].nil? - query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} @@ -2846,13 +3184,13 @@ def list_incident_notification_templates_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentNotificationTemplateArray' + return_type = opts[:debug_return_type] || 'IncidentIntegrationMetadataResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_incident_notification_templates, + :operation => :get_incident_integration, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2864,41 +3202,48 @@ def list_incident_notification_templates_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_notification_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # List postmortem templates. + # Get an incident notification rule. # - # @see #list_incident_postmortem_templates_with_http_info - def list_incident_postmortem_templates(opts = {}) - data, _status_code, _headers = list_incident_postmortem_templates_with_http_info(opts) + # @see #get_incident_notification_rule_with_http_info + def get_incident_notification_rule(id, opts = {}) + data, _status_code, _headers = get_incident_notification_rule_with_http_info(id, opts) data end - # List postmortem templates. + # Get an incident notification rule. # - # Retrieve a list of all postmortem templates for incidents. + # Retrieves a specific notification rule by its ID. # + # @param id [UUID] The ID of the notification rule. # @param opts [Hash] the optional parameters - # @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] + # @option opts [String] :include Comma-separated list of resources to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type`, `notification_template` + # @return [Array<(IncidentNotificationRule, Integer, Hash)>] IncidentNotificationRule data, response status code and response headers + def get_incident_notification_rule_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_notification_rule".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_postmortem_templates") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_notification_rule") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_postmortem_templates")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_notification_rule")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_postmortem_templates ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_notification_rule ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling IncidentsAPI.get_incident_notification_rule" end # resource path - local_var_path = '/api/v2/incidents/config/postmortem-templates' + local_var_path = '/api/v2/incidents/config/notification-rules/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} @@ -2912,13 +3257,13 @@ def list_incident_postmortem_templates_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'PostmortemTemplatesResponse' + return_type = opts[:debug_return_type] || 'IncidentNotificationRule' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_incident_postmortem_templates, + :operation => :get_incident_notification_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -2930,47 +3275,48 @@ def list_incident_postmortem_templates_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_postmortem_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_notification_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get a list of incidents. + # Get incident notification template. # - # @see #list_incidents_with_http_info - def list_incidents(opts = {}) - data, _status_code, _headers = list_incidents_with_http_info(opts) + # @see #get_incident_notification_template_with_http_info + def get_incident_notification_template(id, opts = {}) + data, _status_code, _headers = get_incident_notification_template_with_http_info(id, opts) data end - # Get a list of incidents. + # Get incident notification template. # - # Get all incidents for the user's organization. + # Retrieves a specific notification template by its ID. # + # @param id [UUID] The ID of the notification template. # @param opts [Hash] the optional parameters - # @option opts [Array] :include Specifies which types of related objects should be included in the response. - # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. - # @option opts [Integer] :page_offset Specific offset to use as the beginning of the returned page. - # @return [Array<(IncidentsResponse, Integer, Hash)>] IncidentsResponse data, response status code and response headers - def list_incidents_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_incidents".to_sym] + # @option opts [String] :include Comma-separated list of relationships to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type` + # @return [Array<(IncidentNotificationTemplate, Integer, Hash)>] IncidentNotificationTemplate data, response status code and response headers + def get_incident_notification_template_with_http_info(id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_notification_template".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incidents") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_notification_template") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incidents")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_notification_template")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incidents ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_notification_template ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling IncidentsAPI.get_incident_notification_template" end # resource path - local_var_path = '/api/v2/incidents' + local_var_path = '/api/v2/incidents/config/notification-templates/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? - query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} @@ -2984,13 +3330,13 @@ def list_incidents_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentsResponse' + return_type = opts[:debug_return_type] || 'IncidentNotificationTemplate' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_incidents, + :operation => :get_incident_notification_template, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3002,64 +3348,43 @@ def list_incidents_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#list_incidents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_notification_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get a list of incidents. - # - # Provide a paginated version of {#list_incidents}, returning all items. - # - # To use it you need to use a block: list_incidents_with_pagination { |item| p item } - # - # @yield [IncidentResponseData] Paginated items - def list_incidents_with_pagination(opts = {}) - api_version = "V2" - page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) - @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) - while true do - response = list_incidents(opts) - @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data").length < page_size - break - end - @api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, @api_client.get_attribute_from_path(opts, "page_offset", 0) + page_size) - end - end - - # Get a list of an incident's todos. + # Get postmortem template. # - # @see #list_incident_todos_with_http_info - def list_incident_todos(incident_id, opts = {}) - data, _status_code, _headers = list_incident_todos_with_http_info(incident_id, opts) + # @see #get_incident_postmortem_template_with_http_info + def get_incident_postmortem_template(template_id, opts = {}) + data, _status_code, _headers = get_incident_postmortem_template_with_http_info(template_id, opts) data end - # Get a list of an incident's todos. + # Get postmortem template. # - # Get all todos for an incident. + # Retrieve details of a specific postmortem template. # - # @param incident_id [String] The UUID of the incident. + # @param template_id [String] The ID of the postmortem template # @param opts [Hash] the optional parameters - # @return [Array<(IncidentTodoListResponse, Integer, Hash)>] IncidentTodoListResponse data, response status code and response headers - def list_incident_todos_with_http_info(incident_id, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_todos".to_sym] + # @return [Array<(PostmortemTemplateResponse, Integer, Hash)>] PostmortemTemplateResponse data, response status code and response headers + def get_incident_postmortem_template_with_http_info(template_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_postmortem_template".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_todos") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_postmortem_template") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_todos")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_postmortem_template")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_todos ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_postmortem_template ...' end - # verify the required parameter 'incident_id' is set - if @api_client.config.client_side_validation && incident_id.nil? - fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.list_incident_todos" + # verify the required parameter 'template_id' is set + if @api_client.config.client_side_validation && template_id.nil? + fail ArgumentError, "Missing the required parameter 'template_id' when calling IncidentsAPI.get_incident_postmortem_template" end # resource path - local_var_path = '/api/v2/incidents/{incident_id}/relationships/todos'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/config/postmortem-templates/{template_id}'.sub('{template_id}', CGI.escape(template_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -3076,13 +3401,13 @@ def list_incident_todos_with_http_info(incident_id, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentTodoListResponse' + return_type = opts[:debug_return_type] || 'PostmortemTemplateResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( - :operation => :list_incident_todos, + :operation => :get_incident_postmortem_template, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3094,43 +3419,51 @@ def list_incident_todos_with_http_info(incident_id, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_todos\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_postmortem_template\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get a list of incident types. + # Get an incident responder. # - # @see #list_incident_types_with_http_info - def list_incident_types(opts = {}) - data, _status_code, _headers = list_incident_types_with_http_info(opts) + # @see #get_incident_responder_with_http_info + def get_incident_responder(incident_id, responder_id, opts = {}) + data, _status_code, _headers = get_incident_responder_with_http_info(incident_id, responder_id, opts) data end - # Get a list of incident types. + # Get an incident responder. # - # Get all incident types. + # Get a single responder for an incident. # + # @param incident_id [String] The UUID of the incident. + # @param responder_id [UUID] The UUID of the incident responder. # @param opts [Hash] the optional parameters - # @option opts [Boolean] :include_deleted Include deleted incident types in the response. - # @return [Array<(IncidentTypeListResponse, Integer, Hash)>] IncidentTypeListResponse data, response status code and response headers - def list_incident_types_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_types".to_sym] + # @return [Array<(IncidentResponderResponse, Integer, Hash)>] IncidentResponderResponse data, response status code and response headers + def get_incident_responder_with_http_info(incident_id, responder_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_responder".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_types") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_responder") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_types")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_responder")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_types ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_responder ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.get_incident_responder" + end + # verify the required parameter 'responder_id' is set + if @api_client.config.client_side_validation && responder_id.nil? + fail ArgumentError, "Missing the required parameter 'responder_id' when calling IncidentsAPI.get_incident_responder" end # resource path - local_var_path = '/api/v2/incidents/config/types' + local_var_path = '/api/v2/incidents/{incident_id}/responders/{responder_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{responder_id}', CGI.escape(responder_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'include_deleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil? # header parameters header_params = opts[:header_params] || {} @@ -3144,13 +3477,13 @@ def list_incident_types_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentTypeListResponse' + return_type = opts[:debug_return_type] || 'IncidentResponderResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_incident_types, + :operation => :get_incident_responder, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3162,60 +3495,46 @@ def list_incident_types_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_responder\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Get a list of incident user-defined fields. + # Get an incident rule. # - # @see #list_incident_user_defined_fields_with_http_info - def list_incident_user_defined_fields(opts = {}) - data, _status_code, _headers = list_incident_user_defined_fields_with_http_info(opts) + # @see #get_incident_rule_with_http_info + def get_incident_rule(rule_id, opts = {}) + data, _status_code, _headers = get_incident_rule_with_http_info(rule_id, opts) data end - # Get a list of incident user-defined fields. + # Get an incident rule. # - # Get a list of all incident user-defined fields. + # Get a single incident rule by ID. # + # @param rule_id [UUID] The UUID of the incident rule. # @param opts [Hash] the optional parameters - # @option opts [Integer] :page_size The number of results to return per page. Must be between 0 and 1000. - # @option opts [Integer] :page_number The page number to retrieve, starting at 0. - # @option opts [Boolean] :include_deleted When true, include soft-deleted fields in the response. - # @option opts [String] :filter_incident_type Filter results to fields associated with the given incident type UUID. - # @option opts [String] :include Comma-separated list of related resources to include. Supported values are "last_modified_by_user", "created_by_user", and "incident_type". - # @return [Array<(IncidentUserDefinedFieldListResponse, Integer, Hash)>] IncidentUserDefinedFieldListResponse data, response status code and response headers - def list_incident_user_defined_fields_with_http_info(opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_user_defined_fields".to_sym] + # @return [Array<(IncidentRuleResponse, Integer, Hash)>] IncidentRuleResponse data, response status code and response headers + def get_incident_rule_with_http_info(rule_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_rule".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_user_defined_fields") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_rule") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_user_defined_fields")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_rule")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_user_defined_fields ...' - end - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IncidentsAPI.list_incident_user_defined_fields, must be smaller than or equal to 1000.' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_rule ...' end - if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0 - fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IncidentsAPI.list_incident_user_defined_fields, must be greater than or equal to 0.' - end - if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 0 - fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling IncidentsAPI.list_incident_user_defined_fields, must be greater than or equal to 0.' + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling IncidentsAPI.get_incident_rule" end # resource path - local_var_path = '/api/v2/incidents/config/user-defined-fields' + local_var_path = '/api/v2/incidents/config/rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? - query_params[:'include-deleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil? - query_params[:'filter[incident-type]'] = opts[:'filter_incident_type'] if !opts[:'filter_incident_type'].nil? - query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} @@ -3229,13 +3548,13 @@ def list_incident_user_defined_fields_with_http_info(opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentUserDefinedFieldListResponse' + return_type = opts[:debug_return_type] || 'IncidentRuleResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :list_incident_user_defined_fields, + :operation => :get_incident_rule, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3247,63 +3566,51 @@ def list_incident_user_defined_fields_with_http_info(opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_user_defined_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Search for incidents. + # Get incident todo details. # - # @see #search_incidents_with_http_info - def search_incidents(query, opts = {}) - data, _status_code, _headers = search_incidents_with_http_info(query, opts) + # @see #get_incident_todo_with_http_info + def get_incident_todo(incident_id, todo_id, opts = {}) + data, _status_code, _headers = get_incident_todo_with_http_info(incident_id, todo_id, opts) data end - # Search for incidents. + # Get incident todo details. # - # Search for incidents matching a certain query. + # Get incident todo details. # - # @param query [String] Specifies which incidents should be returned. The query can contain any number of incident facets joined by `ANDs`, along with multiple values for each of those facets joined by `OR`s. For example: `state:active AND severity:(SEV-2 OR SEV-1)`. + # @param incident_id [String] The UUID of the incident. + # @param todo_id [String] The UUID of the incident todo. # @param opts [Hash] the optional parameters - # @option opts [IncidentRelatedObject] :include Specifies which types of related objects should be included in the response. - # @option opts [IncidentSearchSortOrder] :sort Specifies the order of returned incidents. - # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. - # @option opts [Integer] :page_offset Specific offset to use as the beginning of the returned page. - # @return [Array<(IncidentSearchResponse, Integer, Hash)>] IncidentSearchResponse data, response status code and response headers - def search_incidents_with_http_info(query, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.search_incidents".to_sym] + # @return [Array<(IncidentTodoResponse, Integer, Hash)>] IncidentTodoResponse data, response status code and response headers + def get_incident_todo_with_http_info(incident_id, todo_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_todo".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.search_incidents") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_todo") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.search_incidents")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_todo")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.search_incidents ...' - end - allowable_values = ['users', 'attachments'] - if @api_client.config.client_side_validation && opts[:'include'] && !allowable_values.include?(opts[:'include']) - fail ArgumentError, "invalid value for \"include\", must be one of #{allowable_values}" + @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_todo ...' end - # verify the required parameter 'query' is set - if @api_client.config.client_side_validation && query.nil? - fail ArgumentError, "Missing the required parameter 'query' when calling IncidentsAPI.search_incidents" + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.get_incident_todo" end - allowable_values = ['created', '-created'] - if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) - fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + # verify the required parameter 'todo_id' is set + if @api_client.config.client_side_validation && todo_id.nil? + fail ArgumentError, "Missing the required parameter 'todo_id' when calling IncidentsAPI.get_incident_todo" end # resource path - local_var_path = '/api/v2/incidents/search' + local_var_path = '/api/v2/incidents/{incident_id}/relationships/todos/{todo_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{todo_id}', CGI.escape(todo_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'query'] = query - query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? - query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? - query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? - query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? # header parameters header_params = opts[:header_params] || {} @@ -3317,13 +3624,13 @@ def search_incidents_with_http_info(query, opts = {}) post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentSearchResponse' + return_type = opts[:debug_return_type] || 'IncidentTodoResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :search_incidents, + :operation => :get_incident_todo, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3335,91 +3642,66 @@ def search_incidents_with_http_info(query, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#search_incidents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_todo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Search for incidents. - # - # Provide a paginated version of {#search_incidents}, returning all items. - # - # To use it you need to use a block: search_incidents_with_pagination { |item| p item } - # - # @yield [IncidentSearchResponseIncidentsData] Paginated items - def search_incidents_with_pagination(query, opts = {}) - api_version = "V2" - page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) - @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) - while true do - response = search_incidents(query, opts) - @api_client.get_attribute_from_path(response, "data.attributes.incidents").each { |item| yield(item) } - if @api_client.get_attribute_from_path(response, "data.attributes.incidents").length < page_size - break - end - @api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, @api_client.get_attribute_from_path(opts, "page_offset", 0) + page_size) - end - end - - # Update global incident handle. + # Get incident type details. # - # @see #update_global_incident_handle_with_http_info - def update_global_incident_handle(body, opts = {}) - data, _status_code, _headers = update_global_incident_handle_with_http_info(body, opts) + # @see #get_incident_type_with_http_info + def get_incident_type(incident_type_id, opts = {}) + data, _status_code, _headers = get_incident_type_with_http_info(incident_type_id, opts) data end - # Update global incident handle. + # Get incident type details. # - # Update an existing global incident handle. + # Get incident type details. # - # @param body [IncidentHandleRequest] + # @param incident_type_id [String] The UUID of the incident type. # @param opts [Hash] the optional parameters - # @option opts [String] :include Comma-separated list of related resources to include in the response - # @return [Array<(IncidentHandleResponse, Integer, Hash)>] IncidentHandleResponse data, response status code and response headers - def update_global_incident_handle_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.update_global_incident_handle".to_sym] + # @return [Array<(IncidentTypeResponse, Integer, Hash)>] IncidentTypeResponse data, response status code and response headers + def get_incident_type_with_http_info(incident_type_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_type".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_global_incident_handle") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_type") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_global_incident_handle")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_type")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_global_incident_handle ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_type ...' end - # verify the required parameter 'body' is set - if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_global_incident_handle" + # verify the required parameter 'incident_type_id' is set + if @api_client.config.client_side_validation && incident_type_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_type_id' when calling IncidentsAPI.get_incident_type" end # resource path - local_var_path = '/api/v2/incidents/config/global/incident-handles' + local_var_path = '/api/v2/incidents/config/types/{incident_type_id}'.sub('{incident_type_id}', CGI.escape(incident_type_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) - # HTTP header 'Content-Type' - header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + post_body = opts[:debug_body] # return_type - return_type = opts[:debug_return_type] || 'IncidentHandleResponse' + return_type = opts[:debug_return_type] || 'IncidentTypeResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :update_global_incident_handle, + :operation => :get_incident_type, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3429,45 +3711,2310 @@ def update_global_incident_handle_with_http_info(body, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#update_global_incident_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Update global incident settings. + # Get an incident user-defined field. # - # @see #update_global_incident_settings_with_http_info - def update_global_incident_settings(body, opts = {}) - data, _status_code, _headers = update_global_incident_settings_with_http_info(body, opts) + # @see #get_incident_user_defined_field_with_http_info + def get_incident_user_defined_field(field_id, opts = {}) + data, _status_code, _headers = get_incident_user_defined_field_with_http_info(field_id, opts) data end - # Update global incident settings. + # Get an incident user-defined field. # - # Update global incident settings for the organization. + # Get details of an incident user-defined field. # - # @param body [GlobalIncidentSettingsRequest] + # @param field_id [String] The ID of the incident user-defined field. + # @param opts [Hash] the optional parameters + # @option opts [String] :include Comma-separated list of related resources to include. Supported values are "last_modified_by_user", "created_by_user", and "incident_type". + # @return [Array<(IncidentUserDefinedFieldResponse, Integer, Hash)>] IncidentUserDefinedFieldResponse data, response status code and response headers + def get_incident_user_defined_field_with_http_info(field_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_user_defined_field".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_user_defined_field") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_user_defined_field")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_user_defined_field ...' + end + # verify the required parameter 'field_id' is set + if @api_client.config.client_side_validation && field_id.nil? + fail ArgumentError, "Missing the required parameter 'field_id' when calling IncidentsAPI.get_incident_user_defined_field" + end + # resource path + local_var_path = '/api/v2/incidents/config/user-defined-fields/{field_id}'.sub('{field_id}', CGI.escape(field_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentUserDefinedFieldResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_incident_user_defined_field, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_user_defined_field\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get an incident user-defined role. + # + # @see #get_incident_user_defined_role_with_http_info + def get_incident_user_defined_role(role_id, opts = {}) + data, _status_code, _headers = get_incident_user_defined_role_with_http_info(role_id, opts) + data + end + + # Get an incident user-defined role. + # + # Retrieve a single user-defined role for incidents. + # + # @param role_id [UUID] The UUID of the incident user-defined role. + # @param opts [Hash] the optional parameters + # @option opts [String] :include Comma-separated list of related resources to include in the response. + # @return [Array<(IncidentUserDefinedRoleResponse, Integer, Hash)>] IncidentUserDefinedRoleResponse data, response status code and response headers + def get_incident_user_defined_role_with_http_info(role_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_incident_user_defined_role".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_incident_user_defined_role") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_incident_user_defined_role")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_incident_user_defined_role ...' + end + # verify the required parameter 'role_id' is set + if @api_client.config.client_side_validation && role_id.nil? + fail ArgumentError, "Missing the required parameter 'role_id' when calling IncidentsAPI.get_incident_user_defined_role" + end + # resource path + local_var_path = '/api/v2/incidents/config/user-defined-roles/{role_id}'.sub('{role_id}', CGI.escape(role_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentUserDefinedRoleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_incident_user_defined_role, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#get_incident_user_defined_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get org settings by incident type. + # + # @see #get_org_settings_by_incident_type_with_http_info + def get_org_settings_by_incident_type(incident_type_id, opts = {}) + data, _status_code, _headers = get_org_settings_by_incident_type_with_http_info(incident_type_id, opts) + data + end + + # Get org settings by incident type. + # + # Get the org settings for a specific incident type. + # + # @param incident_type_id [UUID] The UUID of the incident type. + # @param opts [Hash] the optional parameters + # @option opts [String] :include Comma-separated list of related resources to include in the response. + # @return [Array<(IncidentOrgSettingsResponse, Integer, Hash)>] IncidentOrgSettingsResponse data, response status code and response headers + def get_org_settings_by_incident_type_with_http_info(incident_type_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_org_settings_by_incident_type".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_org_settings_by_incident_type") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_org_settings_by_incident_type")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.get_org_settings_by_incident_type ...' + end + # verify the required parameter 'incident_type_id' is set + if @api_client.config.client_side_validation && incident_type_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_type_id' when calling IncidentsAPI.get_org_settings_by_incident_type" + end + # resource path + local_var_path = '/api/v2/incidents/config/types/{incident_type_id}/org-settings'.sub('{incident_type_id}', CGI.escape(incident_type_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentOrgSettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_org_settings_by_incident_type, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#get_org_settings_by_incident_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Import an incident. + # + # @see #import_incident_with_http_info + def import_incident(body, opts = {}) + data, _status_code, _headers = import_incident_with_http_info(body, opts) + data + end + + # Import an incident. + # + # Import an incident from an external system. This endpoint allows you to create incidents with + # historical data such as custom timestamps for detection, declaration, and resolution. + # Imported incidents do not execute integrations or notification rules. + # + # @param body [IncidentImportRequest] Incident import payload. + # @param opts [Hash] the optional parameters + # @option opts [Array] :include Specifies which related object types to include in the response when importing an incident. + # @return [Array<(IncidentImportResponse, Integer, Hash)>] IncidentImportResponse data, response status code and response headers + def import_incident_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.import_incident".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.import_incident") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.import_incident")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.import_incident ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.import_incident" + end + # resource path + local_var_path = '/api/v2/incidents/import' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentImportResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :import_incident, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#import_incident\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Link a page to an incident. + # + # @see #link_page_to_incident_with_http_info + def link_page_to_incident(incident_id, body, opts = {}) + data, _status_code, _headers = link_page_to_incident_with_http_info(incident_id, body, opts) + data + end + + # Link a page to an incident. + # + # Link an existing on-call page to an incident. + # + # @param incident_id [String] The UUID of the incident. + # @param body [IncidentOnCallPageLinkRequest] On-call page link payload. + # @param opts [Hash] the optional parameters + # @return [Array<(IncidentIntegrationMetadataResponse, Integer, Hash)>] IncidentIntegrationMetadataResponse data, response status code and response headers + def link_page_to_incident_with_http_info(incident_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.link_page_to_incident".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.link_page_to_incident") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.link_page_to_incident")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.link_page_to_incident ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.link_page_to_incident" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.link_page_to_incident" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/pages/link'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentIntegrationMetadataResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :link_page_to_incident, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#link_page_to_incident\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List global incident handles. + # + # @see #list_global_incident_handles_with_http_info + def list_global_incident_handles(opts = {}) + data, _status_code, _headers = list_global_incident_handles_with_http_info(opts) + data + end + + # List global incident handles. + # + # Retrieve a list of global incident handles. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :include Comma-separated list of related resources to include in the response + # @return [Array<(IncidentHandlesResponse, Integer, Hash)>] IncidentHandlesResponse data, response status code and response headers + def list_global_incident_handles_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_global_incident_handles".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_global_incident_handles") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_global_incident_handles")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_global_incident_handles ...' + end + # resource path + local_var_path = '/api/v2/incidents/config/global/incident-handles' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentHandlesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_global_incident_handles, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_global_incident_handles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List incident attachments. + # + # @see #list_incident_attachments_with_http_info + def list_incident_attachments(incident_id, opts = {}) + data, _status_code, _headers = list_incident_attachments_with_http_info(incident_id, opts) + data + end + + # List incident attachments. + # + # List incident attachments. + # + # @param incident_id [String] The UUID of the incident. + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_attachment_type Filter attachments by type. Supported values are `1` (`postmortem`) and `2` (`link`). + # @option opts [String] :include Resource to include in the response. Supported value: `last_modified_by_user`. + # @return [Array<(AttachmentArray, Integer, Hash)>] AttachmentArray data, response status code and response headers + def list_incident_attachments_with_http_info(incident_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_attachments".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_attachments") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_attachments")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_attachments ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.list_incident_attachments" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/attachments'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[attachment_type]'] = opts[:'filter_attachment_type'] if !opts[:'filter_attachment_type'].nil? + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'AttachmentArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_incident_attachments, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_attachments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List incident impact fields. + # + # @see #list_incident_impact_fields_with_http_info + def list_incident_impact_fields(opts = {}) + data, _status_code, _headers = list_incident_impact_fields_with_http_info(opts) + data + end + + # List incident impact fields. + # + # List all impact fields for incidents. + # + # @param opts [Hash] the optional parameters + # @return [Array<(IncidentImpactFieldsResponse, Integer, Hash)>] IncidentImpactFieldsResponse data, response status code and response headers + def list_incident_impact_fields_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_impact_fields".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_impact_fields") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_impact_fields")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_impact_fields ...' + end + # resource path + local_var_path = '/api/v2/incidents/config/impact-fields' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentImpactFieldsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_incident_impact_fields, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_impact_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List an incident's impacts. + # + # @see #list_incident_impacts_with_http_info + def list_incident_impacts(incident_id, opts = {}) + data, _status_code, _headers = list_incident_impacts_with_http_info(incident_id, opts) + data + end + + # List an incident's impacts. + # + # Get all impacts for an incident. + # + # @param incident_id [String] The UUID of the incident. + # @param opts [Hash] the optional parameters + # @option opts [Array] :include Specifies which related resources should be included in the response. + # @return [Array<(IncidentImpactsResponse, Integer, Hash)>] IncidentImpactsResponse data, response status code and response headers + def list_incident_impacts_with_http_info(incident_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_impacts ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.list_incident_impacts" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/impacts'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentImpactsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_incident_impacts, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_impacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a list of an incident's integration metadata. + # + # @see #list_incident_integrations_with_http_info + def list_incident_integrations(incident_id, opts = {}) + data, _status_code, _headers = list_incident_integrations_with_http_info(incident_id, opts) + data + end + + # Get a list of an incident's integration metadata. + # + # Get all integration metadata for an incident. + # + # @param incident_id [String] The UUID of the incident. + # @param opts [Hash] the optional parameters + # @return [Array<(IncidentIntegrationMetadataListResponse, Integer, Hash)>] IncidentIntegrationMetadataListResponse data, response status code and response headers + def list_incident_integrations_with_http_info(incident_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_integrations".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_integrations") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_integrations")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_integrations ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.list_incident_integrations" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/relationships/integrations'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentIntegrationMetadataListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_incident_integrations, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_integrations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List incident notification rules. + # + # @see #list_incident_notification_rules_with_http_info + def list_incident_notification_rules(opts = {}) + data, _status_code, _headers = list_incident_notification_rules_with_http_info(opts) + data + end + + # List incident notification rules. + # + # Lists all notification rules for the organization. Optionally filter by incident type. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :include Comma-separated list of resources to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type`, `notification_template` + # @return [Array<(IncidentNotificationRuleArray, Integer, Hash)>] IncidentNotificationRuleArray data, response status code and response headers + def list_incident_notification_rules_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_notification_rules".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_notification_rules") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_notification_rules")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_notification_rules ...' + end + # resource path + local_var_path = '/api/v2/incidents/config/notification-rules' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentNotificationRuleArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_incident_notification_rules, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_notification_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List incident notification templates. + # + # @see #list_incident_notification_templates_with_http_info + def list_incident_notification_templates(opts = {}) + data, _status_code, _headers = list_incident_notification_templates_with_http_info(opts) + data + end + + # List incident notification templates. + # + # Lists all notification templates. Optionally filter by incident type. + # + # @param opts [Hash] the optional parameters + # @option opts [UUID] :filter_incident_type Optional incident type ID filter. + # @option opts [String] :include Comma-separated list of relationships to include. Supported values: `created_by_user`, `last_modified_by_user`, `incident_type` + # @return [Array<(IncidentNotificationTemplateArray, Integer, Hash)>] IncidentNotificationTemplateArray data, response status code and response headers + def list_incident_notification_templates_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_notification_templates".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_notification_templates") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_notification_templates")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_notification_templates ...' + end + # resource path + local_var_path = '/api/v2/incidents/config/notification-templates' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[incident-type]'] = opts[:'filter_incident_type'] if !opts[:'filter_incident_type'].nil? + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentNotificationTemplateArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_incident_notification_templates, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_notification_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List postmortem templates. + # + # @see #list_incident_postmortem_templates_with_http_info + def list_incident_postmortem_templates(opts = {}) + data, _status_code, _headers = list_incident_postmortem_templates_with_http_info(opts) + data + end + + # List postmortem templates. + # + # Retrieve a list of all postmortem templates for incidents. + # + # @param opts [Hash] the optional parameters + # @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] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_postmortem_templates") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_postmortem_templates")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_postmortem_templates ...' + end + # resource path + local_var_path = '/api/v2/incidents/config/postmortem-templates' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'PostmortemTemplatesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_incident_postmortem_templates, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_postmortem_templates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List incident responders. + # + # @see #list_incident_responders_with_http_info + def list_incident_responders(incident_id, opts = {}) + data, _status_code, _headers = list_incident_responders_with_http_info(incident_id, opts) + data + end + + # List incident responders. + # + # List all responders for an incident. + # + # @param incident_id [String] The UUID of the incident. + # @param opts [Hash] the optional parameters + # @return [Array<(IncidentRespondersResponse, Integer, Hash)>] IncidentRespondersResponse data, response status code and response headers + def list_incident_responders_with_http_info(incident_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_responders".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_responders") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_responders")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_responders ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.list_incident_responders" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/responders'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentRespondersResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_incident_responders, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_responders\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List incident rules. + # + # @see #list_incident_rules_with_http_info + def list_incident_rules(opts = {}) + data, _status_code, _headers = list_incident_rules_with_http_info(opts) + data + end + + # List incident rules. + # + # List all incident rules. + # + # @param opts [Hash] the optional parameters + # @option opts [String] :filter_task_id Filter rules by task ID. + # @option opts [String] :filter_trigger Filter rules by trigger. + # @option opts [UUID] :incident_type_uuid Filter rules by incident type UUID. + # @return [Array<(IncidentRulesResponse, Integer, Hash)>] IncidentRulesResponse data, response status code and response headers + def list_incident_rules_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_rules".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_rules") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_rules")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_rules ...' + end + # resource path + local_var_path = '/api/v2/incidents/config/rules' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[task_id]'] = opts[:'filter_task_id'] if !opts[:'filter_task_id'].nil? + query_params[:'filter[trigger]'] = opts[:'filter_trigger'] if !opts[:'filter_trigger'].nil? + query_params[:'incidentTypeUUID'] = opts[:'incident_type_uuid'] if !opts[:'incident_type_uuid'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentRulesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_incident_rules, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_rules\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a list of incidents. + # + # @see #list_incidents_with_http_info + def list_incidents(opts = {}) + data, _status_code, _headers = list_incidents_with_http_info(opts) + data + end + + # Get a list of incidents. + # + # Get all incidents for the user's organization. + # + # @param opts [Hash] the optional parameters + # @option opts [Array] :include Specifies which types of related objects should be included in the response. + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_offset Specific offset to use as the beginning of the returned page. + # @return [Array<(IncidentsResponse, Integer, Hash)>] IncidentsResponse data, response status code and response headers + def list_incidents_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_incidents".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incidents") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incidents")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incidents ...' + end + # resource path + local_var_path = '/api/v2/incidents' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_incidents, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_incidents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a list of incidents. + # + # Provide a paginated version of {#list_incidents}, returning all items. + # + # To use it you need to use a block: list_incidents_with_pagination { |item| p item } + # + # @yield [IncidentResponseData] Paginated items + def list_incidents_with_pagination(opts = {}) + api_version = "V2" + page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) + @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) + while true do + response = list_incidents(opts) + @api_client.get_attribute_from_path(response, "data").each { |item| yield(item) } + if @api_client.get_attribute_from_path(response, "data").length < page_size + break + end + @api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, @api_client.get_attribute_from_path(opts, "page_offset", 0) + page_size) + end + end + + # Get a list of an incident's todos. + # + # @see #list_incident_todos_with_http_info + def list_incident_todos(incident_id, opts = {}) + data, _status_code, _headers = list_incident_todos_with_http_info(incident_id, opts) + data + end + + # Get a list of an incident's todos. + # + # Get all todos for an incident. + # + # @param incident_id [String] The UUID of the incident. + # @param opts [Hash] the optional parameters + # @return [Array<(IncidentTodoListResponse, Integer, Hash)>] IncidentTodoListResponse data, response status code and response headers + def list_incident_todos_with_http_info(incident_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_todos".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_todos") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_todos")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_todos ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.list_incident_todos" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/relationships/todos'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentTodoListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_incident_todos, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_todos\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a list of incident types. + # + # @see #list_incident_types_with_http_info + def list_incident_types(opts = {}) + data, _status_code, _headers = list_incident_types_with_http_info(opts) + data + end + + # Get a list of incident types. + # + # Get all incident types. + # + # @param opts [Hash] the optional parameters + # @option opts [Boolean] :include_deleted Include deleted incident types in the response. + # @return [Array<(IncidentTypeListResponse, Integer, Hash)>] IncidentTypeListResponse data, response status code and response headers + def list_incident_types_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_types".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_types") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_types")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_types ...' + end + # resource path + local_var_path = '/api/v2/incidents/config/types' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include_deleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentTypeListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_incident_types, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get a list of incident user-defined fields. + # + # @see #list_incident_user_defined_fields_with_http_info + def list_incident_user_defined_fields(opts = {}) + data, _status_code, _headers = list_incident_user_defined_fields_with_http_info(opts) + data + end + + # Get a list of incident user-defined fields. + # + # Get a list of all incident user-defined fields. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size The number of results to return per page. Must be between 0 and 1000. + # @option opts [Integer] :page_number The page number to retrieve, starting at 0. + # @option opts [Boolean] :include_deleted When true, include soft-deleted fields in the response. + # @option opts [String] :filter_incident_type Filter results to fields associated with the given incident type UUID. + # @option opts [String] :include Comma-separated list of related resources to include. Supported values are "last_modified_by_user", "created_by_user", and "incident_type". + # @return [Array<(IncidentUserDefinedFieldListResponse, Integer, Hash)>] IncidentUserDefinedFieldListResponse data, response status code and response headers + def list_incident_user_defined_fields_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_user_defined_fields".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_user_defined_fields") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_user_defined_fields")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_user_defined_fields ...' + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IncidentsAPI.list_incident_user_defined_fields, must be smaller than or equal to 1000.' + end + if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0 + fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IncidentsAPI.list_incident_user_defined_fields, must be greater than or equal to 0.' + end + if @api_client.config.client_side_validation && !opts[:'page_number'].nil? && opts[:'page_number'] < 0 + fail ArgumentError, 'invalid value for "opts[:"page_number"]" when calling IncidentsAPI.list_incident_user_defined_fields, must be greater than or equal to 0.' + end + # resource path + local_var_path = '/api/v2/incidents/config/user-defined-fields' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? + query_params[:'include-deleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil? + query_params[:'filter[incident-type]'] = opts[:'filter_incident_type'] if !opts[:'filter_incident_type'].nil? + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentUserDefinedFieldListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_incident_user_defined_fields, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_user_defined_fields\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List incident user-defined roles. + # + # @see #list_incident_user_defined_roles_with_http_info + def list_incident_user_defined_roles(opts = {}) + data, _status_code, _headers = list_incident_user_defined_roles_with_http_info(opts) + data + end + + # List incident user-defined roles. + # + # List all user-defined roles for incidents. + # + # @param opts [Hash] the optional parameters + # @option opts [UUID] :filter_incident_type Filter roles by incident type UUID. + # @option opts [String] :include Comma-separated list of related resources to include in the response. + # @return [Array<(IncidentUserDefinedRolesResponse, Integer, Hash)>] IncidentUserDefinedRolesResponse data, response status code and response headers + def list_incident_user_defined_roles_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_incident_user_defined_roles".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_incident_user_defined_roles") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_incident_user_defined_roles")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_incident_user_defined_roles ...' + end + # resource path + local_var_path = '/api/v2/incidents/config/user-defined-roles' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'filter[incident-type]'] = opts[:'filter_incident_type'] if !opts[:'filter_incident_type'].nil? + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentUserDefinedRolesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_incident_user_defined_roles, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_incident_user_defined_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List incident type org settings. + # + # @see #list_org_settings_with_http_info + def list_org_settings(opts = {}) + data, _status_code, _headers = list_org_settings_with_http_info(opts) + data + end + + # List incident type org settings. + # + # List org settings for all incident types. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :page_size Maximum number of results to return. + # @option opts [Integer] :page_offset The offset for pagination. + # @option opts [Boolean] :include_deleted Whether to include deleted records. + # @option opts [String] :include Comma-separated list of related resources to include in the response. + # @return [Array<(IncidentOrgSettingsListResponse, Integer, Hash)>] IncidentOrgSettingsListResponse data, response status code and response headers + def list_org_settings_with_http_info(opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_org_settings".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_org_settings") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_org_settings")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_org_settings ...' + end + # resource path + local_var_path = '/api/v2/incidents/config/types/org-settings' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? + query_params[:'include-deleted'] = opts[:'include_deleted'] if !opts[:'include_deleted'].nil? + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentOrgSettingsListResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_org_settings, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_org_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List incident timestamp overrides. + # + # @see #list_timestamp_overrides_with_http_info + def list_timestamp_overrides(incident_id, opts = {}) + data, _status_code, _headers = list_timestamp_overrides_with_http_info(incident_id, opts) + data + end + + # List incident timestamp overrides. + # + # List all timestamp overrides for an incident. + # + # @param incident_id [String] The UUID of the incident. + # @param opts [Hash] the optional parameters + # @return [Array<(IncidentTimestampOverridesResponse, Integer, Hash)>] IncidentTimestampOverridesResponse data, response status code and response headers + def list_timestamp_overrides_with_http_info(incident_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_timestamp_overrides".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_timestamp_overrides") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_timestamp_overrides")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.list_timestamp_overrides ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.list_timestamp_overrides" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/timestamp-overrides'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentTimestampOverridesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_timestamp_overrides, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#list_timestamp_overrides\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Patch an incident impact. + # + # @see #patch_incident_impact_with_http_info + def patch_incident_impact(incident_id, impact_id, body, opts = {}) + data, _status_code, _headers = patch_incident_impact_with_http_info(incident_id, impact_id, body, opts) + data + end + + # Patch an incident impact. + # + # Partially update an incident impact. + # + # @param incident_id [String] The UUID of the incident. + # @param impact_id [String] The UUID of the incident impact. + # @param body [IncidentImpactCreateRequest] Incident impact patch payload. + # @param opts [Hash] the optional parameters + # @option opts [Array] :include Specifies which related resources should be included in the response. + # @return [Array<(IncidentImpactResponse, Integer, Hash)>] IncidentImpactResponse data, response status code and response headers + def patch_incident_impact_with_http_info(incident_id, impact_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.patch_incident_impact".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.patch_incident_impact") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.patch_incident_impact")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.patch_incident_impact ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.patch_incident_impact" + end + # verify the required parameter 'impact_id' is set + if @api_client.config.client_side_validation && impact_id.nil? + fail ArgumentError, "Missing the required parameter 'impact_id' when calling IncidentsAPI.patch_incident_impact" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.patch_incident_impact" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/impacts/{impact_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{impact_id}', CGI.escape(impact_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentImpactResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :patch_incident_impact, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#patch_incident_impact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Search for incidents. + # + # @see #search_incidents_with_http_info + def search_incidents(query, opts = {}) + data, _status_code, _headers = search_incidents_with_http_info(query, opts) + data + end + + # Search for incidents. + # + # Search for incidents matching a certain query. + # + # @param query [String] Specifies which incidents should be returned. The query can contain any number of incident facets joined by `ANDs`, along with multiple values for each of those facets joined by `OR`s. For example: `state:active AND severity:(SEV-2 OR SEV-1)`. + # @param opts [Hash] the optional parameters + # @option opts [IncidentRelatedObject] :include Specifies which types of related objects should be included in the response. + # @option opts [IncidentSearchSortOrder] :sort Specifies the order of returned incidents. + # @option opts [Integer] :page_size Size for a given page. The maximum allowed value is 100. + # @option opts [Integer] :page_offset Specific offset to use as the beginning of the returned page. + # @return [Array<(IncidentSearchResponse, Integer, Hash)>] IncidentSearchResponse data, response status code and response headers + def search_incidents_with_http_info(query, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.search_incidents".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.search_incidents") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.search_incidents")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.search_incidents ...' + end + allowable_values = ['users', 'attachments'] + if @api_client.config.client_side_validation && opts[:'include'] && !allowable_values.include?(opts[:'include']) + fail ArgumentError, "invalid value for \"include\", must be one of #{allowable_values}" + end + # verify the required parameter 'query' is set + if @api_client.config.client_side_validation && query.nil? + fail ArgumentError, "Missing the required parameter 'query' when calling IncidentsAPI.search_incidents" + end + allowable_values = ['created', '-created'] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/incidents/search' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'query'] = query + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? + query_params[:'page[offset]'] = opts[:'page_offset'] if !opts[:'page_offset'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'IncidentSearchResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :search_incidents, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#search_incidents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Search for incidents. + # + # Provide a paginated version of {#search_incidents}, returning all items. + # + # To use it you need to use a block: search_incidents_with_pagination { |item| p item } + # + # @yield [IncidentSearchResponseIncidentsData] Paginated items + def search_incidents_with_pagination(query, opts = {}) + api_version = "V2" + page_size = @api_client.get_attribute_from_path(opts, "page_size", 10) + @api_client.set_attribute_from_path(api_version, opts, "page_size", Integer, page_size) + while true do + response = search_incidents(query, opts) + @api_client.get_attribute_from_path(response, "data.attributes.incidents").each { |item| yield(item) } + if @api_client.get_attribute_from_path(response, "data.attributes.incidents").length < page_size + break + end + @api_client.set_attribute_from_path(api_version, opts, "page_offset", Integer, @api_client.get_attribute_from_path(opts, "page_offset", 0) + page_size) + end + end + + # Update global incident handle. + # + # @see #update_global_incident_handle_with_http_info + def update_global_incident_handle(body, opts = {}) + data, _status_code, _headers = update_global_incident_handle_with_http_info(body, opts) + data + end + + # Update global incident handle. + # + # Update an existing global incident handle. + # + # @param body [IncidentHandleRequest] + # @param opts [Hash] the optional parameters + # @option opts [String] :include Comma-separated list of related resources to include in the response + # @return [Array<(IncidentHandleResponse, Integer, Hash)>] IncidentHandleResponse data, response status code and response headers + def update_global_incident_handle_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_global_incident_handle".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_global_incident_handle") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_global_incident_handle")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_global_incident_handle ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_global_incident_handle" + end + # resource path + local_var_path = '/api/v2/incidents/config/global/incident-handles' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentHandleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_global_incident_handle, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#update_global_incident_handle\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update global incident settings. + # + # @see #update_global_incident_settings_with_http_info + def update_global_incident_settings(body, opts = {}) + data, _status_code, _headers = update_global_incident_settings_with_http_info(body, opts) + data + end + + # Update global incident settings. + # + # Update global incident settings for the organization. + # + # @param body [GlobalIncidentSettingsRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(GlobalIncidentSettingsResponse, Integer, Hash)>] GlobalIncidentSettingsResponse data, response status code and response headers + def update_global_incident_settings_with_http_info(body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_global_incident_settings".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_global_incident_settings") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_global_incident_settings")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_global_incident_settings ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_global_incident_settings" + end + # resource path + local_var_path = '/api/v2/incidents/config/global/settings' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'GlobalIncidentSettingsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_global_incident_settings, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#update_global_incident_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update an existing incident. + # + # @see #update_incident_with_http_info + def update_incident(incident_id, body, opts = {}) + data, _status_code, _headers = update_incident_with_http_info(incident_id, body, opts) + data + end + + # Update an existing incident. + # + # Updates an incident. Provide only the attributes that should be updated as this request is a partial update. + # + # @param incident_id [String] The UUID of the incident. + # @param body [IncidentUpdateRequest] Incident Payload. + # @param opts [Hash] the optional parameters + # @option opts [Array] :include Specifies which types of related objects should be included in the response. + # @return [Array<(IncidentResponse, Integer, Hash)>] IncidentResponse data, response status code and response headers + def update_incident_with_http_info(incident_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_incident".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_incident ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.update_incident" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_incident" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_incident, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#update_incident\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update incident attachment. + # + # @see #update_incident_attachment_with_http_info + def update_incident_attachment(incident_id, attachment_id, body, opts = {}) + data, _status_code, _headers = update_incident_attachment_with_http_info(incident_id, attachment_id, body, opts) + data + end + + # Update incident attachment. + # @param incident_id [String] The UUID of the incident. + # @param attachment_id [String] The ID of the attachment. + # @param body [PatchAttachmentRequest] + # @param opts [Hash] the optional parameters + # @option opts [String] :include Resource to include in the response. Supported value: `last_modified_by_user`. + # @return [Array<(Attachment, Integer, Hash)>] Attachment data, response status code and response headers + def update_incident_attachment_with_http_info(incident_id, attachment_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_incident_attachment".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident_attachment") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident_attachment")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_incident_attachment ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.update_incident_attachment" + end + # verify the required parameter 'attachment_id' is set + if @api_client.config.client_side_validation && attachment_id.nil? + fail ArgumentError, "Missing the required parameter 'attachment_id' when calling IncidentsAPI.update_incident_attachment" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_incident_attachment" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/attachments/{attachment_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{attachment_id}', CGI.escape(attachment_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'Attachment' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_incident_attachment, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#update_incident_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update an incident configuration. + # + # @see #update_incident_configuration_with_http_info + def update_incident_configuration(incident_id, body, opts = {}) + data, _status_code, _headers = update_incident_configuration_with_http_info(incident_id, body, opts) + data + end + + # Update an incident configuration. + # + # Update a configuration for an incident. + # + # @param incident_id [String] The UUID of the incident. + # @param body [IncidentConfigurationPatchRequest] Incident configuration patch payload. + # @param opts [Hash] the optional parameters + # @return [Array<(IncidentConfigurationResponse, Integer, Hash)>] IncidentConfigurationResponse data, response status code and response headers + def update_incident_configuration_with_http_info(incident_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_incident_configuration".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident_configuration") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident_configuration")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_incident_configuration ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.update_incident_configuration" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_incident_configuration" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/configurations'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentConfigurationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_incident_configuration, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#update_incident_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update an incident Google Chat configuration. + # + # @see #update_incident_google_chat_configuration_with_http_info + def update_incident_google_chat_configuration(id, body, opts = {}) + data, _status_code, _headers = update_incident_google_chat_configuration_with_http_info(id, body, opts) + data + end + + # Update an incident Google Chat configuration. + # + # Update a Google Chat configuration for incidents. + # + # @param id [UUID] The UUID of the Google Chat configuration. + # @param body [IncidentGoogleChatConfigurationPatchRequest] Google Chat configuration patch payload. + # @param opts [Hash] the optional parameters + # @return [Array<(IncidentGoogleChatConfigurationResponse, Integer, Hash)>] IncidentGoogleChatConfigurationResponse data, response status code and response headers + def update_incident_google_chat_configuration_with_http_info(id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_incident_google_chat_configuration".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident_google_chat_configuration") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident_google_chat_configuration")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_incident_google_chat_configuration ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling IncidentsAPI.update_incident_google_chat_configuration" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_incident_google_chat_configuration" + end + # resource path + local_var_path = '/api/v2/incidents/config/google-chat-configurations/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentGoogleChatConfigurationResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_incident_google_chat_configuration, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#update_incident_google_chat_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update an incident Google Meet configuration. + # + # @see #update_incident_google_meet_configuration_with_http_info + def update_incident_google_meet_configuration(id, body, opts = {}) + data, _status_code, _headers = update_incident_google_meet_configuration_with_http_info(id, body, opts) + data + end + + # Update an incident Google Meet configuration. + # + # Update a Google Meet configuration for incidents. + # + # @param id [UUID] The UUID of the Google Meet configuration. + # @param body [IncidentGoogleMeetConfigurationPatchRequest] Google Meet configuration patch payload. # @param opts [Hash] the optional parameters - # @return [Array<(GlobalIncidentSettingsResponse, Integer, Hash)>] GlobalIncidentSettingsResponse data, response status code and response headers - def update_global_incident_settings_with_http_info(body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.update_global_incident_settings".to_sym] + # @return [Array<(IncidentGoogleMeetConfigurationResponse, Integer, Hash)>] IncidentGoogleMeetConfigurationResponse data, response status code and response headers + def update_incident_google_meet_configuration_with_http_info(id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_incident_google_meet_configuration".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_global_incident_settings") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident_google_meet_configuration") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_global_incident_settings")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident_google_meet_configuration")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_global_incident_settings ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_incident_google_meet_configuration ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling IncidentsAPI.update_incident_google_meet_configuration" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_global_incident_settings" + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_incident_google_meet_configuration" end # resource path - local_var_path = '/api/v2/incidents/config/global/settings' + local_var_path = '/api/v2/incidents/config/google-meet-configurations/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -3486,13 +6033,13 @@ def update_global_incident_settings_with_http_info(body, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'GlobalIncidentSettingsResponse' + return_type = opts[:debug_return_type] || 'IncidentGoogleMeetConfigurationResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :update_global_incident_settings, + :operation => :update_incident_google_meet_configuration, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3504,49 +6051,54 @@ def update_global_incident_settings_with_http_info(body, opts = {}) data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#update_global_incident_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#update_incident_google_meet_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Update an existing incident. + # Update an incident impact. # - # @see #update_incident_with_http_info - def update_incident(incident_id, body, opts = {}) - data, _status_code, _headers = update_incident_with_http_info(incident_id, body, opts) + # @see #update_incident_impact_with_http_info + def update_incident_impact(incident_id, impact_id, body, opts = {}) + data, _status_code, _headers = update_incident_impact_with_http_info(incident_id, impact_id, body, opts) data end - # Update an existing incident. + # Update an incident impact. # - # Updates an incident. Provide only the attributes that should be updated as this request is a partial update. + # Update an incident impact. # # @param incident_id [String] The UUID of the incident. - # @param body [IncidentUpdateRequest] Incident Payload. + # @param impact_id [String] The UUID of the incident impact. + # @param body [IncidentImpactCreateRequest] Incident impact payload. # @param opts [Hash] the optional parameters - # @option opts [Array] :include Specifies which types of related objects should be included in the response. - # @return [Array<(IncidentResponse, Integer, Hash)>] IncidentResponse data, response status code and response headers - def update_incident_with_http_info(incident_id, body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.update_incident".to_sym] + # @option opts [Array] :include Specifies which related resources should be included in the response. + # @return [Array<(IncidentImpactResponse, Integer, Hash)>] IncidentImpactResponse data, response status code and response headers + def update_incident_impact_with_http_info(incident_id, impact_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_incident_impact".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident_impact") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident_impact")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_incident ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_incident_impact ...' end # verify the required parameter 'incident_id' is set if @api_client.config.client_side_validation && incident_id.nil? - fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.update_incident" + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.update_incident_impact" + end + # verify the required parameter 'impact_id' is set + if @api_client.config.client_side_validation && impact_id.nil? + fail ArgumentError, "Missing the required parameter 'impact_id' when calling IncidentsAPI.update_incident_impact" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_incident" + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_incident_impact" end # resource path - local_var_path = '/api/v2/incidents/{incident_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/{incident_id}/impacts/{impact_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{impact_id}', CGI.escape(impact_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} @@ -3566,13 +6118,13 @@ def update_incident_with_http_info(incident_id, body, opts = {}) post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'IncidentResponse' + return_type = opts[:debug_return_type] || 'IncidentImpactResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :update_incident, + :operation => :update_incident_impact, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3582,57 +6134,53 @@ def update_incident_with_http_info(incident_id, body, opts = {}) :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#update_incident\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#update_incident_impact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end - # Update incident attachment. + # Update an incident impact field. # - # @see #update_incident_attachment_with_http_info - def update_incident_attachment(incident_id, attachment_id, body, opts = {}) - data, _status_code, _headers = update_incident_attachment_with_http_info(incident_id, attachment_id, body, opts) + # @see #update_incident_impact_field_with_http_info + def update_incident_impact_field(field_id, body, opts = {}) + data, _status_code, _headers = update_incident_impact_field_with_http_info(field_id, body, opts) data end - # Update incident attachment. - # @param incident_id [String] The UUID of the incident. - # @param attachment_id [String] The ID of the attachment. - # @param body [PatchAttachmentRequest] + # Update an incident impact field. + # + # Update an impact field for incidents. + # + # @param field_id [UUID] The UUID of the impact field. + # @param body [IncidentImpactFieldRequest] Impact field update payload. # @param opts [Hash] the optional parameters - # @option opts [String] :include Resource to include in the response. Supported value: `last_modified_by_user`. - # @return [Array<(Attachment, Integer, Hash)>] Attachment data, response status code and response headers - def update_incident_attachment_with_http_info(incident_id, attachment_id, body, opts = {}) - unstable_enabled = @api_client.config.unstable_operations["v2.update_incident_attachment".to_sym] + # @return [Array<(IncidentImpactFieldResponse, Integer, Hash)>] IncidentImpactFieldResponse data, response status code and response headers + def update_incident_impact_field_with_http_info(field_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_incident_impact_field".to_sym] if unstable_enabled - @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident_attachment") + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident_impact_field") else - raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident_attachment")) + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident_impact_field")) end if @api_client.config.debugging - @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_incident_attachment ...' + @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_incident_impact_field ...' end - # verify the required parameter 'incident_id' is set - if @api_client.config.client_side_validation && incident_id.nil? - fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.update_incident_attachment" - end - # verify the required parameter 'attachment_id' is set - if @api_client.config.client_side_validation && attachment_id.nil? - fail ArgumentError, "Missing the required parameter 'attachment_id' when calling IncidentsAPI.update_incident_attachment" + # verify the required parameter 'field_id' is set + if @api_client.config.client_side_validation && field_id.nil? + fail ArgumentError, "Missing the required parameter 'field_id' when calling IncidentsAPI.update_incident_impact_field" end # verify the required parameter 'body' is set if @api_client.config.client_side_validation && body.nil? - fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_incident_attachment" + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_incident_impact_field" end # resource path - local_var_path = '/api/v2/incidents/{incident_id}/attachments/{attachment_id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{attachment_id}', CGI.escape(attachment_id.to_s).gsub('%2F', '/')) + local_var_path = '/api/v2/incidents/config/impact-fields/{field_id}'.sub('{field_id}', CGI.escape(field_id.to_s).gsub('%2F', '/')) # query parameters query_params = opts[:query_params] || {} - query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} @@ -3648,13 +6196,13 @@ def update_incident_attachment_with_http_info(incident_id, attachment_id, body, post_body = opts[:debug_body] || @api_client.object_to_http_body(body) # return_type - return_type = opts[:debug_return_type] || 'Attachment' + return_type = opts[:debug_return_type] || 'IncidentImpactFieldResponse' # auth_names auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( - :operation => :update_incident_attachment, + :operation => :update_incident_impact_field, :header_params => header_params, :query_params => query_params, :form_params => form_params, @@ -3664,9 +6212,9 @@ def update_incident_attachment_with_http_info(incident_id, attachment_id, body, :api_version => "V2" ) - data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) if @api_client.config.debugging - @api_client.config.logger.debug "API called: IncidentsAPI#update_incident_attachment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + @api_client.config.logger.debug "API called: IncidentsAPI#update_incident_impact_field\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end @@ -3992,6 +6540,84 @@ def update_incident_postmortem_template_with_http_info(template_id, body, opts = return data, status_code, headers end + # Update an incident rule. + # + # @see #update_incident_rule_with_http_info + def update_incident_rule(rule_id, body, opts = {}) + data, _status_code, _headers = update_incident_rule_with_http_info(rule_id, body, opts) + data + end + + # Update an incident rule. + # + # Update an incident rule. + # + # @param rule_id [UUID] The UUID of the incident rule. + # @param body [IncidentRulePatchRequest] Incident rule patch payload. + # @param opts [Hash] the optional parameters + # @return [Array<(IncidentRuleResponse, Integer, Hash)>] IncidentRuleResponse data, response status code and response headers + def update_incident_rule_with_http_info(rule_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_incident_rule".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident_rule") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident_rule")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_incident_rule ...' + end + # verify the required parameter 'rule_id' is set + if @api_client.config.client_side_validation && rule_id.nil? + fail ArgumentError, "Missing the required parameter 'rule_id' when calling IncidentsAPI.update_incident_rule" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_incident_rule" + end + # resource path + local_var_path = '/api/v2/incidents/config/rules/{rule_id}'.sub('{rule_id}', CGI.escape(rule_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentRuleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_incident_rule, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#update_incident_rule\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update an incident todo. # # @see #update_incident_todo_with_http_info @@ -4232,5 +6858,168 @@ def update_incident_user_defined_field_with_http_info(field_id, body, opts = {}) end return data, status_code, headers end + + # Update an incident user-defined role. + # + # @see #update_incident_user_defined_role_with_http_info + def update_incident_user_defined_role(role_id, body, opts = {}) + data, _status_code, _headers = update_incident_user_defined_role_with_http_info(role_id, body, opts) + data + end + + # Update an incident user-defined role. + # + # Update an existing user-defined role for incidents. + # + # @param role_id [UUID] The UUID of the incident user-defined role. + # @param body [IncidentUserDefinedRolePatchRequest] + # @param opts [Hash] the optional parameters + # @option opts [String] :include Comma-separated list of related resources to include in the response. + # @return [Array<(IncidentUserDefinedRoleResponse, Integer, Hash)>] IncidentUserDefinedRoleResponse data, response status code and response headers + def update_incident_user_defined_role_with_http_info(role_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_incident_user_defined_role".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_incident_user_defined_role") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_incident_user_defined_role")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_incident_user_defined_role ...' + end + # verify the required parameter 'role_id' is set + if @api_client.config.client_side_validation && role_id.nil? + fail ArgumentError, "Missing the required parameter 'role_id' when calling IncidentsAPI.update_incident_user_defined_role" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_incident_user_defined_role" + end + # resource path + local_var_path = '/api/v2/incidents/config/user-defined-roles/{role_id}'.sub('{role_id}', CGI.escape(role_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'include'] = opts[:'include'] if !opts[:'include'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentUserDefinedRoleResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_incident_user_defined_role, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#update_incident_user_defined_role\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update an incident timestamp override. + # + # @see #update_timestamp_override_with_http_info + def update_timestamp_override(incident_id, id, body, opts = {}) + data, _status_code, _headers = update_timestamp_override_with_http_info(incident_id, id, body, opts) + data + end + + # Update an incident timestamp override. + # + # Update a timestamp override for an incident. + # + # @param incident_id [String] The UUID of the incident. + # @param id [UUID] The UUID of the timestamp override. + # @param body [IncidentTimestampOverridePatchRequest] Timestamp override patch payload. + # @param opts [Hash] the optional parameters + # @return [Array<(IncidentTimestampOverrideResponse, Integer, Hash)>] IncidentTimestampOverrideResponse data, response status code and response headers + def update_timestamp_override_with_http_info(incident_id, id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_timestamp_override".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_timestamp_override") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_timestamp_override")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: IncidentsAPI.update_timestamp_override ...' + end + # verify the required parameter 'incident_id' is set + if @api_client.config.client_side_validation && incident_id.nil? + fail ArgumentError, "Missing the required parameter 'incident_id' when calling IncidentsAPI.update_timestamp_override" + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling IncidentsAPI.update_timestamp_override" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling IncidentsAPI.update_timestamp_override" + end + # resource path + local_var_path = '/api/v2/incidents/{incident_id}/timestamp-overrides/{id}'.sub('{incident_id}', CGI.escape(incident_id.to_s).gsub('%2F', '/')).sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'IncidentTimestampOverrideResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_timestamp_override, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: IncidentsAPI#update_timestamp_override\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/datadog_api_client/v2/models/incident_ai_postmortem_data_attributes_response.rb b/lib/datadog_api_client/v2/models/incident_ai_postmortem_data_attributes_response.rb new file mode 100644 index 000000000000..ffaaf8744ae6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_ai_postmortem_data_attributes_response.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an AI-generated incident postmortem. + class IncidentAIPostmortemDataAttributesResponse + include BaseGenericModel + + # Action items to prevent recurrence. + attr_accessor :action_items + + # The impact of the incident on customers. + attr_accessor :customer_impact + + # An executive summary of the incident. + attr_accessor :executive_summary + + # Key insights from the incident. + attr_accessor :key_insights + + # Key timeline events during the incident. + attr_accessor :key_timeline + + # Lessons learned from the incident. + attr_accessor :lessons_learned + + # An overview of the affected systems. + attr_accessor :system_overview + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'action_items' => :'action_items', + :'customer_impact' => :'customer_impact', + :'executive_summary' => :'executive_summary', + :'key_insights' => :'key_insights', + :'key_timeline' => :'key_timeline', + :'lessons_learned' => :'lessons_learned', + :'system_overview' => :'system_overview' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'action_items' => :'String', + :'customer_impact' => :'String', + :'executive_summary' => :'String', + :'key_insights' => :'String', + :'key_timeline' => :'String', + :'lessons_learned' => :'String', + :'system_overview' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentAIPostmortemDataAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'action_items') + self.action_items = attributes[:'action_items'] + end + + if attributes.key?(:'customer_impact') + self.customer_impact = attributes[:'customer_impact'] + end + + if attributes.key?(:'executive_summary') + self.executive_summary = attributes[:'executive_summary'] + end + + if attributes.key?(:'key_insights') + self.key_insights = attributes[:'key_insights'] + end + + if attributes.key?(:'key_timeline') + self.key_timeline = attributes[:'key_timeline'] + end + + if attributes.key?(:'lessons_learned') + self.lessons_learned = attributes[:'lessons_learned'] + end + + if attributes.key?(:'system_overview') + self.system_overview = attributes[:'system_overview'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + action_items == o.action_items && + customer_impact == o.customer_impact && + executive_summary == o.executive_summary && + key_insights == o.key_insights && + key_timeline == o.key_timeline && + lessons_learned == o.lessons_learned && + system_overview == o.system_overview && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [action_items, customer_impact, executive_summary, key_insights, key_timeline, lessons_learned, system_overview, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_ai_postmortem_data_response.rb b/lib/datadog_api_client/v2/models/incident_ai_postmortem_data_response.rb new file mode 100644 index 000000000000..d657e34ab9fb --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_ai_postmortem_data_response.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AI postmortem data in a response. + class IncidentAIPostmortemDataResponse + include BaseGenericModel + + # Attributes of an AI-generated incident postmortem. + attr_reader :attributes + + # The incident identifier. + attr_reader :id + + # AI postmortem response resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentAIPostmortemDataAttributesResponse', + :'id' => :'UUID', + :'type' => :'IncidentAIPostmortemResponseType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentAIPostmortemDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_ai_postmortem_response.rb b/lib/datadog_api_client/v2/models/incident_ai_postmortem_response.rb new file mode 100644 index 000000000000..3525aabc5b3e --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_ai_postmortem_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with an AI-generated incident postmortem. + class IncidentAIPostmortemResponse + include BaseGenericModel + + # AI postmortem data in a response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentAIPostmortemDataResponse' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentAIPostmortemResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_ai_postmortem_response_type.rb b/lib/datadog_api_client/v2/models/incident_ai_postmortem_response_type.rb new file mode 100644 index 000000000000..9d5d73ff2d19 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_ai_postmortem_response_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # AI postmortem response resource type. + class IncidentAIPostmortemResponseType + include BaseEnumModel + + GET_INCIDENT_AI_POSTMORTEM_RESPONSE = "get_incident_ai_postmortem_response".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_configuration_data_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_configuration_data_attributes_request.rb new file mode 100644 index 000000000000..9195f8df33a2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_configuration_data_attributes_request.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating an incident configuration. + class IncidentConfigurationDataAttributesRequest + include BaseGenericModel + + # Whether to execute integrations for this incident. + attr_accessor :execute_integrations + + # Whether to execute notification rules for this incident. + attr_accessor :execute_notification_rules + + # Whether to include this incident in analytics. + attr_accessor :include_in_analytics + + # Whether to include this incident in search results. + attr_accessor :include_in_search + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'execute_integrations' => :'execute_integrations', + :'execute_notification_rules' => :'execute_notification_rules', + :'include_in_analytics' => :'include_in_analytics', + :'include_in_search' => :'include_in_search' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'execute_integrations' => :'Boolean', + :'execute_notification_rules' => :'Boolean', + :'include_in_analytics' => :'Boolean', + :'include_in_search' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentConfigurationDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'execute_integrations') + self.execute_integrations = attributes[:'execute_integrations'] + end + + if attributes.key?(:'execute_notification_rules') + self.execute_notification_rules = attributes[:'execute_notification_rules'] + end + + if attributes.key?(:'include_in_analytics') + self.include_in_analytics = attributes[:'include_in_analytics'] + end + + if attributes.key?(:'include_in_search') + self.include_in_search = attributes[:'include_in_search'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + execute_integrations == o.execute_integrations && + execute_notification_rules == o.execute_notification_rules && + include_in_analytics == o.include_in_analytics && + include_in_search == o.include_in_search && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [execute_integrations, execute_notification_rules, include_in_analytics, include_in_search, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_configuration_data_attributes_response.rb b/lib/datadog_api_client/v2/models/incident_configuration_data_attributes_response.rb new file mode 100644 index 000000000000..2e74da072423 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_configuration_data_attributes_response.rb @@ -0,0 +1,205 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an incident configuration in a response. + class IncidentConfigurationDataAttributesResponse + include BaseGenericModel + + # Timestamp when the configuration was created. + attr_reader :created_at + + # Whether integrations are executed for this incident. + attr_accessor :execute_integrations + + # Whether notification rules are executed for this incident. + attr_accessor :execute_notification_rules + + # The incident identifier. + attr_reader :incident_id + + # Whether this incident is included in analytics. + attr_accessor :include_in_analytics + + # Whether this incident is included in search results. + attr_accessor :include_in_search + + # Timestamp when the configuration was last modified. + attr_reader :modified_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'execute_integrations' => :'execute_integrations', + :'execute_notification_rules' => :'execute_notification_rules', + :'incident_id' => :'incident_id', + :'include_in_analytics' => :'include_in_analytics', + :'include_in_search' => :'include_in_search', + :'modified_at' => :'modified_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'execute_integrations' => :'Boolean', + :'execute_notification_rules' => :'Boolean', + :'incident_id' => :'String', + :'include_in_analytics' => :'Boolean', + :'include_in_search' => :'Boolean', + :'modified_at' => :'Time' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentConfigurationDataAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'execute_integrations') + self.execute_integrations = attributes[:'execute_integrations'] + end + + if attributes.key?(:'execute_notification_rules') + self.execute_notification_rules = attributes[:'execute_notification_rules'] + end + + if attributes.key?(:'incident_id') + self.incident_id = attributes[:'incident_id'] + end + + if attributes.key?(:'include_in_analytics') + self.include_in_analytics = attributes[:'include_in_analytics'] + end + + if attributes.key?(:'include_in_search') + self.include_in_search = attributes[:'include_in_search'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @incident_id.nil? + return false if @modified_at.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param incident_id [Object] Object to be assigned + # @!visibility private + def incident_id=(incident_id) + if incident_id.nil? + fail ArgumentError, 'invalid value for "incident_id", incident_id cannot be nil.' + end + @incident_id = incident_id + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + execute_integrations == o.execute_integrations && + execute_notification_rules == o.execute_notification_rules && + incident_id == o.incident_id && + include_in_analytics == o.include_in_analytics && + include_in_search == o.include_in_search && + modified_at == o.modified_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, execute_integrations, execute_notification_rules, incident_id, include_in_analytics, include_in_search, modified_at, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_configuration_data_request.rb b/lib/datadog_api_client/v2/models/incident_configuration_data_request.rb new file mode 100644 index 000000000000..d45e08badae5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_configuration_data_request.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Incident configuration data in a create request. + class IncidentConfigurationDataRequest + include BaseGenericModel + + # Attributes for creating an incident configuration. + attr_accessor :attributes + + # Incident configuration resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentConfigurationDataAttributesRequest', + :'type' => :'IncidentConfigurationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentConfigurationDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_configuration_data_response.rb b/lib/datadog_api_client/v2/models/incident_configuration_data_response.rb new file mode 100644 index 000000000000..bdcd05fc5d2f --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_configuration_data_response.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Incident configuration data in a response. + class IncidentConfigurationDataResponse + include BaseGenericModel + + # Attributes of an incident configuration in a response. + attr_reader :attributes + + # The incident configuration identifier. + attr_reader :id + + # Relationships for an incident configuration. + attr_accessor :relationships + + # Incident configuration resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentConfigurationDataAttributesResponse', + :'id' => :'UUID', + :'relationships' => :'IncidentConfigurationRelationships', + :'type' => :'IncidentConfigurationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentConfigurationDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_configuration_patch_data_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_configuration_patch_data_attributes_request.rb new file mode 100644 index 000000000000..b054ceda34a3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_configuration_patch_data_attributes_request.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for patching an incident configuration. All fields are optional. + class IncidentConfigurationPatchDataAttributesRequest + include BaseGenericModel + + # Whether to execute integrations for this incident. + attr_accessor :execute_integrations + + # Whether to execute notification rules for this incident. + attr_accessor :execute_notification_rules + + # Whether to include this incident in analytics. + attr_accessor :include_in_analytics + + # Whether to include this incident in search results. + attr_accessor :include_in_search + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'execute_integrations' => :'execute_integrations', + :'execute_notification_rules' => :'execute_notification_rules', + :'include_in_analytics' => :'include_in_analytics', + :'include_in_search' => :'include_in_search' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'execute_integrations' => :'Boolean', + :'execute_notification_rules' => :'Boolean', + :'include_in_analytics' => :'Boolean', + :'include_in_search' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentConfigurationPatchDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'execute_integrations') + self.execute_integrations = attributes[:'execute_integrations'] + end + + if attributes.key?(:'execute_notification_rules') + self.execute_notification_rules = attributes[:'execute_notification_rules'] + end + + if attributes.key?(:'include_in_analytics') + self.include_in_analytics = attributes[:'include_in_analytics'] + end + + if attributes.key?(:'include_in_search') + self.include_in_search = attributes[:'include_in_search'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + execute_integrations == o.execute_integrations && + execute_notification_rules == o.execute_notification_rules && + include_in_analytics == o.include_in_analytics && + include_in_search == o.include_in_search && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [execute_integrations, execute_notification_rules, include_in_analytics, include_in_search, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_configuration_patch_data_request.rb b/lib/datadog_api_client/v2/models/incident_configuration_patch_data_request.rb new file mode 100644 index 000000000000..a72302c36d3d --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_configuration_patch_data_request.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Incident configuration data in a patch request. + class IncidentConfigurationPatchDataRequest + include BaseGenericModel + + # Attributes for patching an incident configuration. All fields are optional. + attr_accessor :attributes + + # The incident configuration identifier. + attr_reader :id + + # Incident configuration resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentConfigurationPatchDataAttributesRequest', + :'id' => :'UUID', + :'type' => :'IncidentConfigurationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentConfigurationPatchDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_configuration_patch_request.rb b/lib/datadog_api_client/v2/models/incident_configuration_patch_request.rb new file mode 100644 index 000000000000..acd4a2e36676 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_configuration_patch_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for patching an incident configuration. + class IncidentConfigurationPatchRequest + include BaseGenericModel + + # Incident configuration data in a patch request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentConfigurationPatchDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentConfigurationPatchRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_configuration_relationships.rb b/lib/datadog_api_client/v2/models/incident_configuration_relationships.rb new file mode 100644 index 000000000000..d205b69840a7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_configuration_relationships.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships for an incident configuration. + class IncidentConfigurationRelationships + include BaseGenericModel + + # Relationship to user. + attr_accessor :created_by_user + + # Relationship to user. + attr_accessor :last_modified_by_user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by_user' => :'created_by_user', + :'last_modified_by_user' => :'last_modified_by_user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by_user' => :'RelationshipToUser', + :'last_modified_by_user' => :'RelationshipToUser' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentConfigurationRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_by_user') + self.created_by_user = attributes[:'created_by_user'] + end + + if attributes.key?(:'last_modified_by_user') + self.last_modified_by_user = attributes[:'last_modified_by_user'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_by_user == o.created_by_user && + last_modified_by_user == o.last_modified_by_user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_by_user, last_modified_by_user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_configuration_request.rb b/lib/datadog_api_client/v2/models/incident_configuration_request.rb new file mode 100644 index 000000000000..2da9f8c4f8c6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_configuration_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for creating an incident configuration. + class IncidentConfigurationRequest + include BaseGenericModel + + # Incident configuration data in a create request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentConfigurationDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentConfigurationRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_configuration_response.rb b/lib/datadog_api_client/v2/models/incident_configuration_response.rb new file mode 100644 index 000000000000..9c0ed20b53fb --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_configuration_response.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with an incident configuration. + class IncidentConfigurationResponse + include BaseGenericModel + + # Incident configuration data in a response. + attr_reader :data + + # Included related resources. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentConfigurationDataResponse', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentConfigurationResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_configuration_type.rb b/lib/datadog_api_client/v2/models/incident_configuration_type.rb new file mode 100644 index 000000000000..7fa650d473a8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_configuration_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Incident configuration resource type. + class IncidentConfigurationType + include BaseEnumModel + + INCIDENTS_CONFIGURATIONS = "incidents_configurations".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_create_on_call_page_data_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_create_on_call_page_data_attributes_request.rb new file mode 100644 index 000000000000..908ba0b0833f --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_create_on_call_page_data_attributes_request.rb @@ -0,0 +1,159 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating an on-call page from an incident. + class IncidentCreateOnCallPageDataAttributesRequest + include BaseGenericModel + + # The description of the page. + attr_accessor :description + + # A reference to an incident role for a page. + attr_accessor :role + + # List of affected services. + attr_accessor :services + + # List of tags for the page. + attr_accessor :tags + + # The target recipient for a page. + attr_accessor :target + + # The title of the page. + attr_accessor :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'role' => :'role', + :'services' => :'services', + :'tags' => :'tags', + :'target' => :'target', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'role' => :'IncidentPageRoleReference', + :'services' => :'Array', + :'tags' => :'Array', + :'target' => :'IncidentPageTarget', + :'title' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentCreateOnCallPageDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'role') + self.role = attributes[:'role'] + end + + if attributes.key?(:'services') + if (value = attributes[:'services']).is_a?(Array) + self.services = value + end + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'target') + self.target = attributes[:'target'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + role == o.role && + services == o.services && + tags == o.tags && + target == o.target && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, role, services, tags, target, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_create_on_call_page_data_request.rb b/lib/datadog_api_client/v2/models/incident_create_on_call_page_data_request.rb new file mode 100644 index 000000000000..3f6d79c563e2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_create_on_call_page_data_request.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # On-call page data in a create request. + class IncidentCreateOnCallPageDataRequest + include BaseGenericModel + + # Attributes for creating an on-call page from an incident. + attr_reader :attributes + + # Resource type for a page creation request. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentCreateOnCallPageDataAttributesRequest', + :'type' => :'IncidentCreatePageFromIncidentType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentCreateOnCallPageDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_create_on_call_page_request.rb b/lib/datadog_api_client/v2/models/incident_create_on_call_page_request.rb new file mode 100644 index 000000000000..5100765f5e43 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_create_on_call_page_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for creating an on-call page from an incident. + class IncidentCreateOnCallPageRequest + include BaseGenericModel + + # On-call page data in a create request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentCreateOnCallPageDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentCreateOnCallPageRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_create_page_from_incident_data_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_create_page_from_incident_data_attributes_request.rb new file mode 100644 index 000000000000..7566ddf50c7c --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_create_page_from_incident_data_attributes_request.rb @@ -0,0 +1,169 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating a page from an incident. + class IncidentCreatePageFromIncidentDataAttributesRequest + include BaseGenericModel + + # The description of the page. + attr_accessor :description + + # The public ID of the incident. + attr_accessor :incident_public_id + + # A reference to an incident role for a page. + attr_accessor :role + + # List of affected services. + attr_accessor :services + + # List of tags for the page. + attr_accessor :tags + + # The target recipient for a page. + attr_accessor :target + + # The title of the page. + attr_accessor :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'incident_public_id' => :'incident_public_id', + :'role' => :'role', + :'services' => :'services', + :'tags' => :'tags', + :'target' => :'target', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'incident_public_id' => :'String', + :'role' => :'IncidentPageRoleReference', + :'services' => :'Array', + :'tags' => :'Array', + :'target' => :'IncidentPageTarget', + :'title' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentCreatePageFromIncidentDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'incident_public_id') + self.incident_public_id = attributes[:'incident_public_id'] + end + + if attributes.key?(:'role') + self.role = attributes[:'role'] + end + + if attributes.key?(:'services') + if (value = attributes[:'services']).is_a?(Array) + self.services = value + end + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'target') + self.target = attributes[:'target'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + incident_public_id == o.incident_public_id && + role == o.role && + services == o.services && + tags == o.tags && + target == o.target && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, incident_public_id, role, services, tags, target, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_create_page_from_incident_data_request.rb b/lib/datadog_api_client/v2/models/incident_create_page_from_incident_data_request.rb new file mode 100644 index 000000000000..d91fd262843d --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_create_page_from_incident_data_request.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Page data in a create request. + class IncidentCreatePageFromIncidentDataRequest + include BaseGenericModel + + # Attributes for creating a page from an incident. + attr_reader :attributes + + # Resource type for a page creation request. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentCreatePageFromIncidentDataAttributesRequest', + :'type' => :'IncidentCreatePageFromIncidentType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentCreatePageFromIncidentDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_create_page_from_incident_request.rb b/lib/datadog_api_client/v2/models/incident_create_page_from_incident_request.rb new file mode 100644 index 000000000000..e476e0a9450b --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_create_page_from_incident_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for creating a page from an incident. + class IncidentCreatePageFromIncidentRequest + include BaseGenericModel + + # Page data in a create request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentCreatePageFromIncidentDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentCreatePageFromIncidentRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_create_page_from_incident_type.rb b/lib/datadog_api_client/v2/models/incident_create_page_from_incident_type.rb new file mode 100644 index 000000000000..b36edd536427 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_create_page_from_incident_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Resource type for a page creation request. + class IncidentCreatePageFromIncidentType + include BaseEnumModel + + PAGE = "page".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_chat_configuration_data_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_data_attributes_request.rb new file mode 100644 index 000000000000..151f222d312c --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_data_attributes_request.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating a Google Chat configuration. + class IncidentGoogleChatConfigurationDataAttributesRequest + include BaseGenericModel + + # The Google Chat domain ID. + attr_reader :domain_id + + # The template for the Google Chat space name. + attr_reader :space_name_template + + # The target audience ID for the Google Chat space. + attr_reader :space_target_audience_id + + # The time zone for the Google Chat space. + attr_reader :space_time_zone + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'domain_id' => :'domain_id', + :'space_name_template' => :'space_name_template', + :'space_target_audience_id' => :'space_target_audience_id', + :'space_time_zone' => :'space_time_zone' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'domain_id' => :'String', + :'space_name_template' => :'String', + :'space_target_audience_id' => :'String', + :'space_time_zone' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleChatConfigurationDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'domain_id') + self.domain_id = attributes[:'domain_id'] + end + + if attributes.key?(:'space_name_template') + self.space_name_template = attributes[:'space_name_template'] + end + + if attributes.key?(:'space_target_audience_id') + self.space_target_audience_id = attributes[:'space_target_audience_id'] + end + + if attributes.key?(:'space_time_zone') + self.space_time_zone = attributes[:'space_time_zone'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @domain_id.nil? + return false if @space_name_template.nil? + return false if @space_target_audience_id.nil? + return false if @space_time_zone.nil? + true + end + + # Custom attribute writer method with validation + # @param domain_id [Object] Object to be assigned + # @!visibility private + def domain_id=(domain_id) + if domain_id.nil? + fail ArgumentError, 'invalid value for "domain_id", domain_id cannot be nil.' + end + @domain_id = domain_id + end + + # Custom attribute writer method with validation + # @param space_name_template [Object] Object to be assigned + # @!visibility private + def space_name_template=(space_name_template) + if space_name_template.nil? + fail ArgumentError, 'invalid value for "space_name_template", space_name_template cannot be nil.' + end + @space_name_template = space_name_template + end + + # Custom attribute writer method with validation + # @param space_target_audience_id [Object] Object to be assigned + # @!visibility private + def space_target_audience_id=(space_target_audience_id) + if space_target_audience_id.nil? + fail ArgumentError, 'invalid value for "space_target_audience_id", space_target_audience_id cannot be nil.' + end + @space_target_audience_id = space_target_audience_id + end + + # Custom attribute writer method with validation + # @param space_time_zone [Object] Object to be assigned + # @!visibility private + def space_time_zone=(space_time_zone) + if space_time_zone.nil? + fail ArgumentError, 'invalid value for "space_time_zone", space_time_zone cannot be nil.' + end + @space_time_zone = space_time_zone + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + domain_id == o.domain_id && + space_name_template == o.space_name_template && + space_target_audience_id == o.space_target_audience_id && + space_time_zone == o.space_time_zone && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [domain_id, space_name_template, space_target_audience_id, space_time_zone, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_chat_configuration_data_attributes_response.rb b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_data_attributes_response.rb new file mode 100644 index 000000000000..564ef3dd0f3d --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_data_attributes_response.rb @@ -0,0 +1,228 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a Google Chat configuration. + class IncidentGoogleChatConfigurationDataAttributesResponse + include BaseGenericModel + + # Timestamp when the configuration was created. + attr_reader :created_at + + # The Google Chat domain ID. + attr_reader :domain_id + + # Timestamp when the configuration was last modified. + attr_reader :modified_at + + # The template for the Google Chat space name. + attr_reader :space_name_template + + # The target audience ID for the Google Chat space. + attr_reader :space_target_audience_id + + # The time zone for the Google Chat space. + attr_reader :space_time_zone + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'domain_id' => :'domain_id', + :'modified_at' => :'modified_at', + :'space_name_template' => :'space_name_template', + :'space_target_audience_id' => :'space_target_audience_id', + :'space_time_zone' => :'space_time_zone' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'domain_id' => :'String', + :'modified_at' => :'Time', + :'space_name_template' => :'String', + :'space_target_audience_id' => :'String', + :'space_time_zone' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleChatConfigurationDataAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'domain_id') + self.domain_id = attributes[:'domain_id'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'space_name_template') + self.space_name_template = attributes[:'space_name_template'] + end + + if attributes.key?(:'space_target_audience_id') + self.space_target_audience_id = attributes[:'space_target_audience_id'] + end + + if attributes.key?(:'space_time_zone') + self.space_time_zone = attributes[:'space_time_zone'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @domain_id.nil? + return false if @modified_at.nil? + return false if @space_name_template.nil? + return false if @space_target_audience_id.nil? + return false if @space_time_zone.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param domain_id [Object] Object to be assigned + # @!visibility private + def domain_id=(domain_id) + if domain_id.nil? + fail ArgumentError, 'invalid value for "domain_id", domain_id cannot be nil.' + end + @domain_id = domain_id + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param space_name_template [Object] Object to be assigned + # @!visibility private + def space_name_template=(space_name_template) + if space_name_template.nil? + fail ArgumentError, 'invalid value for "space_name_template", space_name_template cannot be nil.' + end + @space_name_template = space_name_template + end + + # Custom attribute writer method with validation + # @param space_target_audience_id [Object] Object to be assigned + # @!visibility private + def space_target_audience_id=(space_target_audience_id) + if space_target_audience_id.nil? + fail ArgumentError, 'invalid value for "space_target_audience_id", space_target_audience_id cannot be nil.' + end + @space_target_audience_id = space_target_audience_id + end + + # Custom attribute writer method with validation + # @param space_time_zone [Object] Object to be assigned + # @!visibility private + def space_time_zone=(space_time_zone) + if space_time_zone.nil? + fail ArgumentError, 'invalid value for "space_time_zone", space_time_zone cannot be nil.' + end + @space_time_zone = space_time_zone + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + domain_id == o.domain_id && + modified_at == o.modified_at && + space_name_template == o.space_name_template && + space_target_audience_id == o.space_target_audience_id && + space_time_zone == o.space_time_zone && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, domain_id, modified_at, space_name_template, space_target_audience_id, space_time_zone, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_chat_configuration_data_request.rb b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_data_request.rb new file mode 100644 index 000000000000..5abc1d233d8f --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_data_request.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Google Chat configuration data in a create request. + class IncidentGoogleChatConfigurationDataRequest + include BaseGenericModel + + # Attributes for creating a Google Chat configuration. + attr_reader :attributes + + # Relationships for a Google Chat configuration create request. + attr_reader :relationships + + # Google Chat configuration resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentGoogleChatConfigurationDataAttributesRequest', + :'relationships' => :'IncidentGoogleChatConfigurationRelationshipsRequest', + :'type' => :'IncidentGoogleChatConfigurationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleChatConfigurationDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @relationships.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param relationships [Object] Object to be assigned + # @!visibility private + def relationships=(relationships) + if relationships.nil? + fail ArgumentError, 'invalid value for "relationships", relationships cannot be nil.' + end + @relationships = relationships + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_chat_configuration_data_response.rb b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_data_response.rb new file mode 100644 index 000000000000..e8cde05adee4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_data_response.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Google Chat configuration data in a response. + class IncidentGoogleChatConfigurationDataResponse + include BaseGenericModel + + # Attributes of a Google Chat configuration. + attr_reader :attributes + + # The configuration identifier. + attr_reader :id + + # Relationships for a Google Chat configuration. + attr_accessor :relationships + + # Google Chat configuration resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentGoogleChatConfigurationDataAttributesResponse', + :'id' => :'UUID', + :'relationships' => :'IncidentGoogleChatConfigurationRelationships', + :'type' => :'IncidentGoogleChatConfigurationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleChatConfigurationDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_chat_configuration_patch_data_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_patch_data_attributes_request.rb new file mode 100644 index 000000000000..54a8068da8ef --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_patch_data_attributes_request.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for patching a Google Chat configuration. All fields are optional. + class IncidentGoogleChatConfigurationPatchDataAttributesRequest + include BaseGenericModel + + # The Google Chat domain ID. + attr_accessor :domain_id + + # The template for the Google Chat space name. + attr_accessor :space_name_template + + # The target audience ID for the Google Chat space. + attr_accessor :space_target_audience_id + + # The time zone for the Google Chat space. + attr_accessor :space_time_zone + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'domain_id' => :'domain_id', + :'space_name_template' => :'space_name_template', + :'space_target_audience_id' => :'space_target_audience_id', + :'space_time_zone' => :'space_time_zone' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'domain_id' => :'String', + :'space_name_template' => :'String', + :'space_target_audience_id' => :'String', + :'space_time_zone' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleChatConfigurationPatchDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'domain_id') + self.domain_id = attributes[:'domain_id'] + end + + if attributes.key?(:'space_name_template') + self.space_name_template = attributes[:'space_name_template'] + end + + if attributes.key?(:'space_target_audience_id') + self.space_target_audience_id = attributes[:'space_target_audience_id'] + end + + if attributes.key?(:'space_time_zone') + self.space_time_zone = attributes[:'space_time_zone'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + domain_id == o.domain_id && + space_name_template == o.space_name_template && + space_target_audience_id == o.space_target_audience_id && + space_time_zone == o.space_time_zone && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [domain_id, space_name_template, space_target_audience_id, space_time_zone, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_chat_configuration_patch_data_request.rb b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_patch_data_request.rb new file mode 100644 index 000000000000..e638579e6ba3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_patch_data_request.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Google Chat configuration data in a patch request. + class IncidentGoogleChatConfigurationPatchDataRequest + include BaseGenericModel + + # Attributes for patching a Google Chat configuration. All fields are optional. + attr_accessor :attributes + + # The configuration identifier. + attr_reader :id + + # Google Chat configuration resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentGoogleChatConfigurationPatchDataAttributesRequest', + :'id' => :'UUID', + :'type' => :'IncidentGoogleChatConfigurationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleChatConfigurationPatchDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_chat_configuration_patch_request.rb b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_patch_request.rb new file mode 100644 index 000000000000..d24a566c566a --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_patch_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for patching a Google Chat configuration. + class IncidentGoogleChatConfigurationPatchRequest + include BaseGenericModel + + # Google Chat configuration data in a patch request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentGoogleChatConfigurationPatchDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleChatConfigurationPatchRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_chat_configuration_relationships.rb b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_relationships.rb new file mode 100644 index 000000000000..3290fcd26bd3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_relationships.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships for a Google Chat configuration. + class IncidentGoogleChatConfigurationRelationships + include BaseGenericModel + + # Relationship to user. + attr_accessor :created_by_user + + # Relationship to an incident type. + attr_accessor :incident_type + + # Relationship to user. + attr_accessor :last_modified_by_user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by_user' => :'created_by_user', + :'incident_type' => :'incident_type', + :'last_modified_by_user' => :'last_modified_by_user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by_user' => :'RelationshipToUser', + :'incident_type' => :'RelationshipToIncidentType', + :'last_modified_by_user' => :'RelationshipToUser' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleChatConfigurationRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_by_user') + self.created_by_user = attributes[:'created_by_user'] + end + + if attributes.key?(:'incident_type') + self.incident_type = attributes[:'incident_type'] + end + + if attributes.key?(:'last_modified_by_user') + self.last_modified_by_user = attributes[:'last_modified_by_user'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_by_user == o.created_by_user && + incident_type == o.incident_type && + last_modified_by_user == o.last_modified_by_user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_by_user, incident_type, last_modified_by_user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_chat_configuration_relationships_request.rb b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_relationships_request.rb new file mode 100644 index 000000000000..a91efb0f9662 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_relationships_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships for a Google Chat configuration create request. + class IncidentGoogleChatConfigurationRelationshipsRequest + include BaseGenericModel + + # Relationship to an incident type. + attr_reader :incident_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'incident_type' => :'incident_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'incident_type' => :'RelationshipToIncidentType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleChatConfigurationRelationshipsRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'incident_type') + self.incident_type = attributes[:'incident_type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @incident_type.nil? + true + end + + # Custom attribute writer method with validation + # @param incident_type [Object] Object to be assigned + # @!visibility private + def incident_type=(incident_type) + if incident_type.nil? + fail ArgumentError, 'invalid value for "incident_type", incident_type cannot be nil.' + end + @incident_type = incident_type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + incident_type == o.incident_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [incident_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_chat_configuration_request.rb b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_request.rb new file mode 100644 index 000000000000..7ea4de2e9afd --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for creating a Google Chat configuration. + class IncidentGoogleChatConfigurationRequest + include BaseGenericModel + + # Google Chat configuration data in a create request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentGoogleChatConfigurationDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleChatConfigurationRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_chat_configuration_response.rb b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_response.rb new file mode 100644 index 000000000000..89700e982904 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_response.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a Google Chat configuration. + class IncidentGoogleChatConfigurationResponse + include BaseGenericModel + + # Google Chat configuration data in a response. + attr_reader :data + + # Included related resources. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentGoogleChatConfigurationDataResponse', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleChatConfigurationResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_chat_configuration_type.rb b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_type.rb new file mode 100644 index 000000000000..d4334ee9c21f --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_chat_configuration_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Google Chat configuration resource type. + class IncidentGoogleChatConfigurationType + include BaseEnumModel + + GOOGLE_CHAT_CONFIGURATIONS = "google_chat_configurations".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_meet_configuration_data_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_data_attributes_request.rb new file mode 100644 index 000000000000..c9ec3437621b --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_data_attributes_request.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating a Google Meet configuration. + class IncidentGoogleMeetConfigurationDataAttributesRequest + include BaseGenericModel + + # Whether to allow manual meeting creation. + attr_reader :allow_manual_meeting_creation + + # Whether to auto-summarize meetings. + attr_reader :auto_summarize + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'allow_manual_meeting_creation' => :'allow_manual_meeting_creation', + :'auto_summarize' => :'auto_summarize' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'allow_manual_meeting_creation' => :'Boolean', + :'auto_summarize' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleMeetConfigurationDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'allow_manual_meeting_creation') + self.allow_manual_meeting_creation = attributes[:'allow_manual_meeting_creation'] + end + + if attributes.key?(:'auto_summarize') + self.auto_summarize = attributes[:'auto_summarize'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @allow_manual_meeting_creation.nil? + return false if @auto_summarize.nil? + true + end + + # Custom attribute writer method with validation + # @param allow_manual_meeting_creation [Object] Object to be assigned + # @!visibility private + def allow_manual_meeting_creation=(allow_manual_meeting_creation) + if allow_manual_meeting_creation.nil? + fail ArgumentError, 'invalid value for "allow_manual_meeting_creation", allow_manual_meeting_creation cannot be nil.' + end + @allow_manual_meeting_creation = allow_manual_meeting_creation + end + + # Custom attribute writer method with validation + # @param auto_summarize [Object] Object to be assigned + # @!visibility private + def auto_summarize=(auto_summarize) + if auto_summarize.nil? + fail ArgumentError, 'invalid value for "auto_summarize", auto_summarize cannot be nil.' + end + @auto_summarize = auto_summarize + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + allow_manual_meeting_creation == o.allow_manual_meeting_creation && + auto_summarize == o.auto_summarize && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [allow_manual_meeting_creation, auto_summarize, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_meet_configuration_data_attributes_response.rb b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_data_attributes_response.rb new file mode 100644 index 000000000000..cd439036c5a2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_data_attributes_response.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a Google Meet configuration. + class IncidentGoogleMeetConfigurationDataAttributesResponse + include BaseGenericModel + + # Whether manual meeting creation is allowed. + attr_reader :allow_manual_meeting_creation + + # Whether meetings are auto-summarized. + attr_reader :auto_summarize + + # Timestamp when the configuration was created. + attr_accessor :created_at + + # Timestamp when the configuration was last modified. + attr_reader :modified_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'allow_manual_meeting_creation' => :'allow_manual_meeting_creation', + :'auto_summarize' => :'auto_summarize', + :'created_at' => :'created_at', + :'modified_at' => :'modified_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'allow_manual_meeting_creation' => :'Boolean', + :'auto_summarize' => :'Boolean', + :'created_at' => :'Time', + :'modified_at' => :'Time' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleMeetConfigurationDataAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'allow_manual_meeting_creation') + self.allow_manual_meeting_creation = attributes[:'allow_manual_meeting_creation'] + end + + if attributes.key?(:'auto_summarize') + self.auto_summarize = attributes[:'auto_summarize'] + end + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @allow_manual_meeting_creation.nil? + return false if @auto_summarize.nil? + return false if @modified_at.nil? + true + end + + # Custom attribute writer method with validation + # @param allow_manual_meeting_creation [Object] Object to be assigned + # @!visibility private + def allow_manual_meeting_creation=(allow_manual_meeting_creation) + if allow_manual_meeting_creation.nil? + fail ArgumentError, 'invalid value for "allow_manual_meeting_creation", allow_manual_meeting_creation cannot be nil.' + end + @allow_manual_meeting_creation = allow_manual_meeting_creation + end + + # Custom attribute writer method with validation + # @param auto_summarize [Object] Object to be assigned + # @!visibility private + def auto_summarize=(auto_summarize) + if auto_summarize.nil? + fail ArgumentError, 'invalid value for "auto_summarize", auto_summarize cannot be nil.' + end + @auto_summarize = auto_summarize + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + allow_manual_meeting_creation == o.allow_manual_meeting_creation && + auto_summarize == o.auto_summarize && + created_at == o.created_at && + modified_at == o.modified_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [allow_manual_meeting_creation, auto_summarize, created_at, modified_at, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_meet_configuration_data_request.rb b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_data_request.rb new file mode 100644 index 000000000000..05ecb2a7f526 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_data_request.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Google Meet configuration data in a create request. + class IncidentGoogleMeetConfigurationDataRequest + include BaseGenericModel + + # Attributes for creating a Google Meet configuration. + attr_reader :attributes + + # Relationships for a Google Meet configuration create request. + attr_reader :relationships + + # Google Meet configuration resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentGoogleMeetConfigurationDataAttributesRequest', + :'relationships' => :'IncidentGoogleMeetConfigurationRelationshipsRequest', + :'type' => :'IncidentGoogleMeetConfigurationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleMeetConfigurationDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @relationships.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param relationships [Object] Object to be assigned + # @!visibility private + def relationships=(relationships) + if relationships.nil? + fail ArgumentError, 'invalid value for "relationships", relationships cannot be nil.' + end + @relationships = relationships + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_meet_configuration_data_response.rb b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_data_response.rb new file mode 100644 index 000000000000..32ed4b061633 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_data_response.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Google Meet configuration data in a response. + class IncidentGoogleMeetConfigurationDataResponse + include BaseGenericModel + + # Attributes of a Google Meet configuration. + attr_reader :attributes + + # The configuration identifier. + attr_reader :id + + # Relationships for a Google Meet configuration. + attr_accessor :relationships + + # Google Meet configuration resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentGoogleMeetConfigurationDataAttributesResponse', + :'id' => :'UUID', + :'relationships' => :'IncidentGoogleMeetConfigurationRelationships', + :'type' => :'IncidentGoogleMeetConfigurationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleMeetConfigurationDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_meet_configuration_patch_data_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_patch_data_attributes_request.rb new file mode 100644 index 000000000000..4e184eb16be4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_patch_data_attributes_request.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for patching a Google Meet configuration. All fields are optional. + class IncidentGoogleMeetConfigurationPatchDataAttributesRequest + include BaseGenericModel + + # Whether to allow manual meeting creation. + attr_accessor :allow_manual_meeting_creation + + # Whether to auto-summarize meetings. + attr_accessor :auto_summarize + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'allow_manual_meeting_creation' => :'allow_manual_meeting_creation', + :'auto_summarize' => :'auto_summarize' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'allow_manual_meeting_creation' => :'Boolean', + :'auto_summarize' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleMeetConfigurationPatchDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'allow_manual_meeting_creation') + self.allow_manual_meeting_creation = attributes[:'allow_manual_meeting_creation'] + end + + if attributes.key?(:'auto_summarize') + self.auto_summarize = attributes[:'auto_summarize'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + allow_manual_meeting_creation == o.allow_manual_meeting_creation && + auto_summarize == o.auto_summarize && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [allow_manual_meeting_creation, auto_summarize, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_meet_configuration_patch_data_request.rb b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_patch_data_request.rb new file mode 100644 index 000000000000..d67fe8625594 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_patch_data_request.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Google Meet configuration data in a patch request. + class IncidentGoogleMeetConfigurationPatchDataRequest + include BaseGenericModel + + # Attributes for patching a Google Meet configuration. All fields are optional. + attr_accessor :attributes + + # The configuration identifier. + attr_reader :id + + # Google Meet configuration resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentGoogleMeetConfigurationPatchDataAttributesRequest', + :'id' => :'UUID', + :'type' => :'IncidentGoogleMeetConfigurationType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleMeetConfigurationPatchDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_meet_configuration_patch_request.rb b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_patch_request.rb new file mode 100644 index 000000000000..63968579eaad --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_patch_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for patching a Google Meet configuration. + class IncidentGoogleMeetConfigurationPatchRequest + include BaseGenericModel + + # Google Meet configuration data in a patch request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentGoogleMeetConfigurationPatchDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleMeetConfigurationPatchRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_meet_configuration_relationships.rb b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_relationships.rb new file mode 100644 index 000000000000..bd1c27e97879 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_relationships.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships for a Google Meet configuration. + class IncidentGoogleMeetConfigurationRelationships + include BaseGenericModel + + # Relationship to user. + attr_accessor :created_by_user + + # Relationship to an incident type. + attr_accessor :incident_type + + # Relationship to user. + attr_accessor :last_modified_by_user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by_user' => :'created_by_user', + :'incident_type' => :'incident_type', + :'last_modified_by_user' => :'last_modified_by_user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by_user' => :'RelationshipToUser', + :'incident_type' => :'RelationshipToIncidentType', + :'last_modified_by_user' => :'RelationshipToUser' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleMeetConfigurationRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_by_user') + self.created_by_user = attributes[:'created_by_user'] + end + + if attributes.key?(:'incident_type') + self.incident_type = attributes[:'incident_type'] + end + + if attributes.key?(:'last_modified_by_user') + self.last_modified_by_user = attributes[:'last_modified_by_user'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_by_user == o.created_by_user && + incident_type == o.incident_type && + last_modified_by_user == o.last_modified_by_user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_by_user, incident_type, last_modified_by_user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_meet_configuration_relationships_request.rb b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_relationships_request.rb new file mode 100644 index 000000000000..a29d79eb480e --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_relationships_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships for a Google Meet configuration create request. + class IncidentGoogleMeetConfigurationRelationshipsRequest + include BaseGenericModel + + # Relationship to an incident type. + attr_reader :incident_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'incident_type' => :'incident_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'incident_type' => :'RelationshipToIncidentType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleMeetConfigurationRelationshipsRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'incident_type') + self.incident_type = attributes[:'incident_type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @incident_type.nil? + true + end + + # Custom attribute writer method with validation + # @param incident_type [Object] Object to be assigned + # @!visibility private + def incident_type=(incident_type) + if incident_type.nil? + fail ArgumentError, 'invalid value for "incident_type", incident_type cannot be nil.' + end + @incident_type = incident_type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + incident_type == o.incident_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [incident_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_meet_configuration_request.rb b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_request.rb new file mode 100644 index 000000000000..8b95a1787062 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for creating a Google Meet configuration. + class IncidentGoogleMeetConfigurationRequest + include BaseGenericModel + + # Google Meet configuration data in a create request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentGoogleMeetConfigurationDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleMeetConfigurationRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_meet_configuration_response.rb b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_response.rb new file mode 100644 index 000000000000..b3180ff85cda --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_response.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a Google Meet configuration. + class IncidentGoogleMeetConfigurationResponse + include BaseGenericModel + + # Google Meet configuration data in a response. + attr_reader :data + + # Included related resources. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentGoogleMeetConfigurationDataResponse', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentGoogleMeetConfigurationResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_google_meet_configuration_type.rb b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_type.rb new file mode 100644 index 000000000000..fd9f973585a4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_google_meet_configuration_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Google Meet configuration resource type. + class IncidentGoogleMeetConfigurationType + include BaseEnumModel + + GOOGLE_MEET_CONFIGURATIONS = "google_meet_configurations".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_impact_field_choice.rb b/lib/datadog_api_client/v2/models/incident_impact_field_choice.rb new file mode 100644 index 000000000000..57d283822e03 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_impact_field_choice.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A choice option for a dropdown or multiselect impact field. + class IncidentImpactFieldChoice + include BaseGenericModel + + # The description of the choice. + attr_accessor :description + + # The display name of the choice. + attr_reader :display_name + + # The value of the choice. + attr_reader :value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'display_name' => :'display_name', + :'value' => :'value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'display_name' => :'String', + :'value' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentImpactFieldChoice` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'value') + self.value = attributes[:'value'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @display_name.nil? + return false if @value.nil? + true + end + + # Custom attribute writer method with validation + # @param display_name [Object] Object to be assigned + # @!visibility private + def display_name=(display_name) + if display_name.nil? + fail ArgumentError, 'invalid value for "display_name", display_name cannot be nil.' + end + @display_name = display_name + end + + # Custom attribute writer method with validation + # @param value [Object] Object to be assigned + # @!visibility private + def value=(value) + if value.nil? + fail ArgumentError, 'invalid value for "value", value cannot be nil.' + end + @value = value + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + display_name == o.display_name && + value == o.value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, display_name, value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_impact_field_data_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_impact_field_data_attributes_request.rb new file mode 100644 index 000000000000..241d1c15ea16 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_impact_field_data_attributes_request.rb @@ -0,0 +1,195 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating an impact field. + class IncidentImpactFieldDataAttributesRequest + include BaseGenericModel + + # The display name of the impact field. + attr_reader :display_name + + # The choices for dropdown or multiselect fields. + attr_accessor :field_choices + + # The type of an impact field. + attr_reader :field_type + + # The normalized name of the impact field (used as identifier). + attr_reader :name + + # The tag key associated with the field (for metrictag type). + attr_accessor :tag_key + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'display_name' => :'display_name', + :'field_choices' => :'field_choices', + :'field_type' => :'field_type', + :'name' => :'name', + :'tag_key' => :'tag_key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'display_name' => :'String', + :'field_choices' => :'Array', + :'field_type' => :'IncidentImpactFieldValueType', + :'name' => :'String', + :'tag_key' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'tag_key', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentImpactFieldDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'field_choices') + if (value = attributes[:'field_choices']).is_a?(Array) + self.field_choices = value + end + end + + if attributes.key?(:'field_type') + self.field_type = attributes[:'field_type'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'tag_key') + self.tag_key = attributes[:'tag_key'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @display_name.nil? + return false if @field_type.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param display_name [Object] Object to be assigned + # @!visibility private + def display_name=(display_name) + if display_name.nil? + fail ArgumentError, 'invalid value for "display_name", display_name cannot be nil.' + end + @display_name = display_name + end + + # Custom attribute writer method with validation + # @param field_type [Object] Object to be assigned + # @!visibility private + def field_type=(field_type) + if field_type.nil? + fail ArgumentError, 'invalid value for "field_type", field_type cannot be nil.' + end + @field_type = field_type + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + display_name == o.display_name && + field_choices == o.field_choices && + field_type == o.field_type && + name == o.name && + tag_key == o.tag_key && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [display_name, field_choices, field_type, name, tag_key, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_impact_field_data_attributes_response.rb b/lib/datadog_api_client/v2/models/incident_impact_field_data_attributes_response.rb new file mode 100644 index 000000000000..8e7c876718f6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_impact_field_data_attributes_response.rb @@ -0,0 +1,195 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an impact field in a response. + class IncidentImpactFieldDataAttributesResponse + include BaseGenericModel + + # The display name of the impact field. + attr_reader :display_name + + # The choices for dropdown or multiselect fields. + attr_accessor :field_choices + + # The type of an impact field. + attr_reader :field_type + + # The normalized name of the impact field. + attr_reader :name + + # The tag key associated with the field. + attr_accessor :tag_key + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'display_name' => :'display_name', + :'field_choices' => :'field_choices', + :'field_type' => :'field_type', + :'name' => :'name', + :'tag_key' => :'tag_key' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'display_name' => :'String', + :'field_choices' => :'Array', + :'field_type' => :'IncidentImpactFieldValueType', + :'name' => :'String', + :'tag_key' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'tag_key', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentImpactFieldDataAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'field_choices') + if (value = attributes[:'field_choices']).is_a?(Array) + self.field_choices = value + end + end + + if attributes.key?(:'field_type') + self.field_type = attributes[:'field_type'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'tag_key') + self.tag_key = attributes[:'tag_key'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @display_name.nil? + return false if @field_type.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param display_name [Object] Object to be assigned + # @!visibility private + def display_name=(display_name) + if display_name.nil? + fail ArgumentError, 'invalid value for "display_name", display_name cannot be nil.' + end + @display_name = display_name + end + + # Custom attribute writer method with validation + # @param field_type [Object] Object to be assigned + # @!visibility private + def field_type=(field_type) + if field_type.nil? + fail ArgumentError, 'invalid value for "field_type", field_type cannot be nil.' + end + @field_type = field_type + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + display_name == o.display_name && + field_choices == o.field_choices && + field_type == o.field_type && + name == o.name && + tag_key == o.tag_key && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [display_name, field_choices, field_type, name, tag_key, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_impact_field_data_request.rb b/lib/datadog_api_client/v2/models/incident_impact_field_data_request.rb new file mode 100644 index 000000000000..aded2e261d44 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_impact_field_data_request.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Impact field data in a create request. + class IncidentImpactFieldDataRequest + include BaseGenericModel + + # Attributes for creating an impact field. + attr_reader :attributes + + # Relationships for an impact field create request. + attr_reader :relationships + + # Impact field resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentImpactFieldDataAttributesRequest', + :'relationships' => :'IncidentImpactFieldRelationshipsRequest', + :'type' => :'IncidentImpactFieldType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentImpactFieldDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @relationships.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param relationships [Object] Object to be assigned + # @!visibility private + def relationships=(relationships) + if relationships.nil? + fail ArgumentError, 'invalid value for "relationships", relationships cannot be nil.' + end + @relationships = relationships + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_impact_field_data_response.rb b/lib/datadog_api_client/v2/models/incident_impact_field_data_response.rb new file mode 100644 index 000000000000..cf18e0beccf0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_impact_field_data_response.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Impact field data in a response. + class IncidentImpactFieldDataResponse + include BaseGenericModel + + # Attributes of an impact field in a response. + attr_reader :attributes + + # The impact field identifier. + attr_reader :id + + # Relationships for an impact field. + attr_accessor :relationships + + # Impact field resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentImpactFieldDataAttributesResponse', + :'id' => :'UUID', + :'relationships' => :'IncidentImpactFieldRelationships', + :'type' => :'IncidentImpactFieldType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentImpactFieldDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_impact_field_relationships.rb b/lib/datadog_api_client/v2/models/incident_impact_field_relationships.rb new file mode 100644 index 000000000000..3c6fb1d42ba4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_impact_field_relationships.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships for an impact field. + class IncidentImpactFieldRelationships + include BaseGenericModel + + # Relationship to user. + attr_accessor :created_by_user + + # Relationship to an incident type. + attr_accessor :incident_type + + # Relationship to user. + attr_accessor :last_modified_by_user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by_user' => :'created_by_user', + :'incident_type' => :'incident_type', + :'last_modified_by_user' => :'last_modified_by_user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by_user' => :'RelationshipToUser', + :'incident_type' => :'RelationshipToIncidentType', + :'last_modified_by_user' => :'RelationshipToUser' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentImpactFieldRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_by_user') + self.created_by_user = attributes[:'created_by_user'] + end + + if attributes.key?(:'incident_type') + self.incident_type = attributes[:'incident_type'] + end + + if attributes.key?(:'last_modified_by_user') + self.last_modified_by_user = attributes[:'last_modified_by_user'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_by_user == o.created_by_user && + incident_type == o.incident_type && + last_modified_by_user == o.last_modified_by_user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_by_user, incident_type, last_modified_by_user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_impact_field_relationships_request.rb b/lib/datadog_api_client/v2/models/incident_impact_field_relationships_request.rb new file mode 100644 index 000000000000..f584ef4a1918 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_impact_field_relationships_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships for an impact field create request. + class IncidentImpactFieldRelationshipsRequest + include BaseGenericModel + + # Relationship to an incident type. + attr_reader :incident_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'incident_type' => :'incident_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'incident_type' => :'RelationshipToIncidentType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentImpactFieldRelationshipsRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'incident_type') + self.incident_type = attributes[:'incident_type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @incident_type.nil? + true + end + + # Custom attribute writer method with validation + # @param incident_type [Object] Object to be assigned + # @!visibility private + def incident_type=(incident_type) + if incident_type.nil? + fail ArgumentError, 'invalid value for "incident_type", incident_type cannot be nil.' + end + @incident_type = incident_type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + incident_type == o.incident_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [incident_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_impact_field_request.rb b/lib/datadog_api_client/v2/models/incident_impact_field_request.rb new file mode 100644 index 000000000000..15f56fc1191d --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_impact_field_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for creating an impact field. + class IncidentImpactFieldRequest + include BaseGenericModel + + # Impact field data in a create request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentImpactFieldDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentImpactFieldRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_impact_field_response.rb b/lib/datadog_api_client/v2/models/incident_impact_field_response.rb new file mode 100644 index 000000000000..bf0fbcf7257a --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_impact_field_response.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a single impact field. + class IncidentImpactFieldResponse + include BaseGenericModel + + # Impact field data in a response. + attr_reader :data + + # Included related resources. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentImpactFieldDataResponse', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentImpactFieldResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_impact_field_type.rb b/lib/datadog_api_client/v2/models/incident_impact_field_type.rb new file mode 100644 index 000000000000..4f1a2243d349 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_impact_field_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Impact field resource type. + class IncidentImpactFieldType + include BaseEnumModel + + IMPACT_FIELDS = "impact_fields".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_impact_field_value_type.rb b/lib/datadog_api_client/v2/models/incident_impact_field_value_type.rb new file mode 100644 index 000000000000..950ff34a71ba --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_impact_field_value_type.rb @@ -0,0 +1,32 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of an impact field. + class IncidentImpactFieldValueType + include BaseEnumModel + + DROPDOWN = "dropdown".freeze + TEXT = "text".freeze + TEXTARRAY = "textarray".freeze + METRICTAG = "metrictag".freeze + NUMBER = "number".freeze + DATETIME = "datetime".freeze + MULTISELECT = "multiselect".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_impact_fields_response.rb b/lib/datadog_api_client/v2/models/incident_impact_fields_response.rb new file mode 100644 index 000000000000..12ca11e48d22 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_impact_fields_response.rb @@ -0,0 +1,137 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a list of impact fields. + class IncidentImpactFieldsResponse + include BaseGenericModel + + # List of impact fields. + attr_reader :data + + # Included related resources. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentImpactFieldsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_on_call_page_data_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_on_call_page_data_attributes_request.rb new file mode 100644 index 000000000000..42e8ba645a16 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_on_call_page_data_attributes_request.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for linking a page to an incident. + class IncidentOnCallPageDataAttributesRequest + include BaseGenericModel + + # The key of the on-call page. + attr_accessor :key + + # The target of an on-call page. + attr_accessor :page_target + + # The team ID associated with the page (deprecated, use page_target instead). + attr_accessor :team_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'key' => :'key', + :'page_target' => :'page_target', + :'team_id' => :'team_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'key' => :'String', + :'page_target' => :'IncidentOnCallPageTarget', + :'team_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentOnCallPageDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'key') + self.key = attributes[:'key'] + end + + if attributes.key?(:'page_target') + self.page_target = attributes[:'page_target'] + end + + if attributes.key?(:'team_id') + self.team_id = attributes[:'team_id'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + key == o.key && + page_target == o.page_target && + team_id == o.team_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [key, page_target, team_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_on_call_page_data_request.rb b/lib/datadog_api_client/v2/models/incident_on_call_page_data_request.rb new file mode 100644 index 000000000000..00b59be0666f --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_on_call_page_data_request.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # On-call page data in a link request. + class IncidentOnCallPageDataRequest + include BaseGenericModel + + # Attributes for linking a page to an incident. + attr_accessor :attributes + + # The ID of the on-call page to link. + attr_reader :id + + # On-call page resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentOnCallPageDataAttributesRequest', + :'id' => :'String', + :'type' => :'IncidentOnCallPageType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentOnCallPageDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_on_call_page_link_request.rb b/lib/datadog_api_client/v2/models/incident_on_call_page_link_request.rb new file mode 100644 index 000000000000..7ab7e244f340 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_on_call_page_link_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for linking an on-call page to an incident. + class IncidentOnCallPageLinkRequest + include BaseGenericModel + + # On-call page data in a link request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentOnCallPageDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentOnCallPageLinkRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_on_call_page_target.rb b/lib/datadog_api_client/v2/models/incident_on_call_page_target.rb new file mode 100644 index 000000000000..5a2d056a3e5f --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_on_call_page_target.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The target of an on-call page. + class IncidentOnCallPageTarget + include BaseGenericModel + + # The identifier of the page target. + attr_reader :identifier + + # The type of the page target. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'identifier' => :'identifier', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'identifier' => :'String', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentOnCallPageTarget` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'identifier') + self.identifier = attributes[:'identifier'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @identifier.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param identifier [Object] Object to be assigned + # @!visibility private + def identifier=(identifier) + if identifier.nil? + fail ArgumentError, 'invalid value for "identifier", identifier cannot be nil.' + end + @identifier = identifier + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + identifier == o.identifier && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [identifier, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_on_call_page_type.rb b/lib/datadog_api_client/v2/models/incident_on_call_page_type.rb new file mode 100644 index 000000000000..851e0024ff42 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_on_call_page_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # On-call page resource type. + class IncidentOnCallPageType + include BaseEnumModel + + PAGE = "page".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_org_settings_data_attributes_response.rb b/lib/datadog_api_client/v2/models/incident_org_settings_data_attributes_response.rb new file mode 100644 index 000000000000..d2f0e43a56f1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_org_settings_data_attributes_response.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an incident org settings resource in a response. + class IncidentOrgSettingsDataAttributesResponse + include BaseGenericModel + + # Timestamp when the settings were created. + attr_reader :created + + # Timestamp when the settings were last modified. + attr_reader :modified + + # The settings configuration for an incident org settings resource. + attr_reader :settings + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created' => :'created', + :'modified' => :'modified', + :'settings' => :'settings' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created' => :'Time', + :'modified' => :'Time', + :'settings' => :'Hash' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentOrgSettingsDataAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created') + self.created = attributes[:'created'] + end + + if attributes.key?(:'modified') + self.modified = attributes[:'modified'] + end + + if attributes.key?(:'settings') + self.settings = attributes[:'settings'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created.nil? + return false if @modified.nil? + return false if @settings.nil? + true + end + + # Custom attribute writer method with validation + # @param created [Object] Object to be assigned + # @!visibility private + def created=(created) + if created.nil? + fail ArgumentError, 'invalid value for "created", created cannot be nil.' + end + @created = created + end + + # Custom attribute writer method with validation + # @param modified [Object] Object to be assigned + # @!visibility private + def modified=(modified) + if modified.nil? + fail ArgumentError, 'invalid value for "modified", modified cannot be nil.' + end + @modified = modified + end + + # Custom attribute writer method with validation + # @param settings [Object] Object to be assigned + # @!visibility private + def settings=(settings) + if settings.nil? + fail ArgumentError, 'invalid value for "settings", settings cannot be nil.' + end + @settings = settings + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created == o.created && + modified == o.modified && + settings == o.settings && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created, modified, settings, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_org_settings_data_response.rb b/lib/datadog_api_client/v2/models/incident_org_settings_data_response.rb new file mode 100644 index 000000000000..0954769b26b2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_org_settings_data_response.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Incident org settings data in a response. + class IncidentOrgSettingsDataResponse + include BaseGenericModel + + # Attributes of an incident org settings resource in a response. + attr_reader :attributes + + # The org settings identifier. + attr_reader :id + + # Relationships for an incident org settings resource. + attr_accessor :relationships + + # Incident org settings resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentOrgSettingsDataAttributesResponse', + :'id' => :'UUID', + :'relationships' => :'IncidentOrgSettingsRelationships', + :'type' => :'IncidentOrgSettingsType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentOrgSettingsDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_org_settings_list_response.rb b/lib/datadog_api_client/v2/models/incident_org_settings_list_response.rb new file mode 100644 index 000000000000..6e37fdc0feae --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_org_settings_list_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a list of incident org settings resources. + class IncidentOrgSettingsListResponse + include BaseGenericModel + + # List of incident org settings resources. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentOrgSettingsListResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_org_settings_relationships.rb b/lib/datadog_api_client/v2/models/incident_org_settings_relationships.rb new file mode 100644 index 000000000000..ea844510b15d --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_org_settings_relationships.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships for an incident org settings resource. + class IncidentOrgSettingsRelationships + include BaseGenericModel + + # Relationship to an incident type. + attr_accessor :incident_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'incident_type' => :'incident_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'incident_type' => :'RelationshipToIncidentType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentOrgSettingsRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'incident_type') + self.incident_type = attributes[:'incident_type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + incident_type == o.incident_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [incident_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_org_settings_response.rb b/lib/datadog_api_client/v2/models/incident_org_settings_response.rb new file mode 100644 index 000000000000..59d9b8539c1d --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_org_settings_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a single incident org settings resource. + class IncidentOrgSettingsResponse + include BaseGenericModel + + # Incident org settings data in a response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentOrgSettingsDataResponse' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentOrgSettingsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_org_settings_type.rb b/lib/datadog_api_client/v2/models/incident_org_settings_type.rb new file mode 100644 index 000000000000..ebbda4866ea1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_org_settings_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Incident org settings resource type. + class IncidentOrgSettingsType + include BaseEnumModel + + INCIDENT_ORG_SETTINGS = "incident_org_settings".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_page_role_reference.rb b/lib/datadog_api_client/v2/models/incident_page_role_reference.rb new file mode 100644 index 000000000000..9088751b07f5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_page_role_reference.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A reference to an incident role for a page. + class IncidentPageRoleReference + include BaseGenericModel + + # The role identifier. + attr_reader :id + + # The type of incident role for a page. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'UUID', + :'type' => :'IncidentPageRoleType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentPageRoleReference` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_page_role_type.rb b/lib/datadog_api_client/v2/models/incident_page_role_type.rb new file mode 100644 index 000000000000..ab818e5bd863 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_page_role_type.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of incident role for a page. + class IncidentPageRoleType + include BaseEnumModel + + INCIDENT_USER_DEFINED_ROLES = "incident_user_defined_roles".freeze + INCIDENT_RESERVED_ROLES = "incident_reserved_roles".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_page_target.rb b/lib/datadog_api_client/v2/models/incident_page_target.rb new file mode 100644 index 000000000000..df5d19556b19 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_page_target.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The target recipient for a page. + class IncidentPageTarget + include BaseGenericModel + + # The identifier of the target (handle, UUID, or user UUID). + attr_reader :identifier + + # The type of target for a page request. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'identifier' => :'identifier', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'identifier' => :'String', + :'type' => :'IncidentPageTargetType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentPageTarget` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'identifier') + self.identifier = attributes[:'identifier'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @identifier.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param identifier [Object] Object to be assigned + # @!visibility private + def identifier=(identifier) + if identifier.nil? + fail ArgumentError, 'invalid value for "identifier", identifier cannot be nil.' + end + @identifier = identifier + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + identifier == o.identifier && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [identifier, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_page_target_type.rb b/lib/datadog_api_client/v2/models/incident_page_target_type.rb new file mode 100644 index 000000000000..68cde4bb9d35 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_page_target_type.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of target for a page request. + class IncidentPageTargetType + include BaseEnumModel + + TEAM_HANDLE = "team_handle".freeze + TEAM_UUID = "team_uuid".freeze + USER_UUID = "user_uuid".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_page_uuid_data_response.rb b/lib/datadog_api_client/v2/models/incident_page_uuid_data_response.rb new file mode 100644 index 000000000000..8ff2fafda1a4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_page_uuid_data_response.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Page UUID data in a response. + class IncidentPageUUIDDataResponse + include BaseGenericModel + + # The UUID of the created page. + attr_reader :id + + # Resource type for a page UUID response. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'UUID', + :'type' => :'IncidentPageUUIDType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentPageUUIDDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_page_uuid_response.rb b/lib/datadog_api_client/v2/models/incident_page_uuid_response.rb new file mode 100644 index 000000000000..73f82d0bdaa9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_page_uuid_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a page UUID. + class IncidentPageUUIDResponse + include BaseGenericModel + + # Page UUID data in a response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentPageUUIDDataResponse' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentPageUUIDResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_page_uuid_type.rb b/lib/datadog_api_client/v2/models/incident_page_uuid_type.rb new file mode 100644 index 000000000000..ffea9730e260 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_page_uuid_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Resource type for a page UUID response. + class IncidentPageUUIDType + include BaseEnumModel + + PAGE_UUID = "page_uuid".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_responder_data_attributes_response.rb b/lib/datadog_api_client/v2/models/incident_responder_data_attributes_response.rb new file mode 100644 index 000000000000..c39b8ee65f68 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_responder_data_attributes_response.rb @@ -0,0 +1,216 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an incident responder in a response. + class IncidentResponderDataAttributesResponse + include BaseGenericModel + + # Timestamp when the responder was created. + attr_reader :created + + # The external ID of the responder. + attr_accessor :external_id + + # The external source of the responder. + attr_accessor :external_source + + # Whether this responder counts toward billing. + attr_reader :is_billable + + # Timestamp when the responder was last active. + attr_accessor :last_active + + # Additional metadata for the responder. + attr_accessor :meta + + # Timestamp when the responder was last modified. + attr_reader :modified + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created' => :'created', + :'external_id' => :'external_id', + :'external_source' => :'external_source', + :'is_billable' => :'is_billable', + :'last_active' => :'last_active', + :'meta' => :'meta', + :'modified' => :'modified' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created' => :'Time', + :'external_id' => :'String', + :'external_source' => :'String', + :'is_billable' => :'Boolean', + :'last_active' => :'Time', + :'meta' => :'Hash', + :'modified' => :'Time' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'external_id', + :'external_source', + :'last_active', + :'meta', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentResponderDataAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created') + self.created = attributes[:'created'] + end + + if attributes.key?(:'external_id') + self.external_id = attributes[:'external_id'] + end + + if attributes.key?(:'external_source') + self.external_source = attributes[:'external_source'] + end + + if attributes.key?(:'is_billable') + self.is_billable = attributes[:'is_billable'] + end + + if attributes.key?(:'last_active') + self.last_active = attributes[:'last_active'] + end + + if attributes.key?(:'meta') + self.meta = attributes[:'meta'] + end + + if attributes.key?(:'modified') + self.modified = attributes[:'modified'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created.nil? + return false if @is_billable.nil? + return false if @modified.nil? + true + end + + # Custom attribute writer method with validation + # @param created [Object] Object to be assigned + # @!visibility private + def created=(created) + if created.nil? + fail ArgumentError, 'invalid value for "created", created cannot be nil.' + end + @created = created + end + + # Custom attribute writer method with validation + # @param is_billable [Object] Object to be assigned + # @!visibility private + def is_billable=(is_billable) + if is_billable.nil? + fail ArgumentError, 'invalid value for "is_billable", is_billable cannot be nil.' + end + @is_billable = is_billable + end + + # Custom attribute writer method with validation + # @param modified [Object] Object to be assigned + # @!visibility private + def modified=(modified) + if modified.nil? + fail ArgumentError, 'invalid value for "modified", modified cannot be nil.' + end + @modified = modified + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created == o.created && + external_id == o.external_id && + external_source == o.external_source && + is_billable == o.is_billable && + last_active == o.last_active && + meta == o.meta && + modified == o.modified && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created, external_id, external_source, is_billable, last_active, meta, modified, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_responder_data_request.rb b/lib/datadog_api_client/v2/models/incident_responder_data_request.rb new file mode 100644 index 000000000000..4c82dabc39dd --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_responder_data_request.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Incident responder data in a create request. + class IncidentResponderDataRequest + include BaseGenericModel + + # Relationships for creating an incident responder. + attr_reader :relationships + + # Incident responder resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'relationships' => :'IncidentResponderRelationshipsRequest', + :'type' => :'IncidentResponderType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentResponderDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @relationships.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param relationships [Object] Object to be assigned + # @!visibility private + def relationships=(relationships) + if relationships.nil? + fail ArgumentError, 'invalid value for "relationships", relationships cannot be nil.' + end + @relationships = relationships + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_responder_data_response.rb b/lib/datadog_api_client/v2/models/incident_responder_data_response.rb new file mode 100644 index 000000000000..a43ef17fc8cd --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_responder_data_response.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Incident responder data in a response. + class IncidentResponderDataResponse + include BaseGenericModel + + # Attributes of an incident responder in a response. + attr_reader :attributes + + # The responder identifier. + attr_reader :id + + # Relationships for an incident responder. + attr_accessor :relationships + + # Incident responder resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentResponderDataAttributesResponse', + :'id' => :'UUID', + :'relationships' => :'IncidentResponderRelationships', + :'type' => :'IncidentResponderType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentResponderDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_responder_relationships.rb b/lib/datadog_api_client/v2/models/incident_responder_relationships.rb new file mode 100644 index 000000000000..fe020c087908 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_responder_relationships.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships for an incident responder. + class IncidentResponderRelationships + include BaseGenericModel + + # Relationship to user. + attr_accessor :created_by + + # Relationship to user. + attr_accessor :last_modified_by + + # Relationship to role assignments for a responder. + attr_accessor :role_assignments + + # Relationship to user. + attr_accessor :user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by' => :'created_by', + :'last_modified_by' => :'last_modified_by', + :'role_assignments' => :'role_assignments', + :'user' => :'user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by' => :'RelationshipToUser', + :'last_modified_by' => :'RelationshipToUser', + :'role_assignments' => :'IncidentResponderRoleAssignmentsRelationship', + :'user' => :'NullableRelationshipToUser' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'user', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentResponderRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'last_modified_by') + self.last_modified_by = attributes[:'last_modified_by'] + end + + if attributes.key?(:'role_assignments') + self.role_assignments = attributes[:'role_assignments'] + end + + if attributes.key?(:'user') + self.user = attributes[:'user'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_by == o.created_by && + last_modified_by == o.last_modified_by && + role_assignments == o.role_assignments && + user == o.user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_by, last_modified_by, role_assignments, user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_responder_relationships_request.rb b/lib/datadog_api_client/v2/models/incident_responder_relationships_request.rb new file mode 100644 index 000000000000..a7783ff046b4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_responder_relationships_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships for creating an incident responder. + class IncidentResponderRelationshipsRequest + include BaseGenericModel + + # Relationship to a user for a responder create request. + attr_reader :user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'user' => :'user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'user' => :'IncidentResponderUserRelationship' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentResponderRelationshipsRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'user') + self.user = attributes[:'user'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @user.nil? + true + end + + # Custom attribute writer method with validation + # @param user [Object] Object to be assigned + # @!visibility private + def user=(user) + if user.nil? + fail ArgumentError, 'invalid value for "user", user cannot be nil.' + end + @user = user + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + user == o.user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_responder_request.rb b/lib/datadog_api_client/v2/models/incident_responder_request.rb new file mode 100644 index 000000000000..de04d1a56a84 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_responder_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for creating an incident responder. + class IncidentResponderRequest + include BaseGenericModel + + # Incident responder data in a create request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentResponderDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentResponderRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_responder_response.rb b/lib/datadog_api_client/v2/models/incident_responder_response.rb new file mode 100644 index 000000000000..c1135355991e --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_responder_response.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a single incident responder. + class IncidentResponderResponse + include BaseGenericModel + + # Incident responder data in a response. + attr_reader :data + + # Included related resources. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentResponderDataResponse', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentResponderResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_responder_role_assignment_relationship_data.rb b/lib/datadog_api_client/v2/models/incident_responder_role_assignment_relationship_data.rb new file mode 100644 index 000000000000..744d4200cacd --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_responder_role_assignment_relationship_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A single role assignment relationship data object. + class IncidentResponderRoleAssignmentRelationshipData + include BaseGenericModel + + # The role assignment identifier. + attr_reader :id + + # The role assignment resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'UUID', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentResponderRoleAssignmentRelationshipData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_responder_role_assignments_relationship.rb b/lib/datadog_api_client/v2/models/incident_responder_role_assignments_relationship.rb new file mode 100644 index 000000000000..04b7261da5a1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_responder_role_assignments_relationship.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to role assignments for a responder. + class IncidentResponderRoleAssignmentsRelationship + include BaseGenericModel + + # List of role assignment relationship data. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentResponderRoleAssignmentsRelationship` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_responder_type.rb b/lib/datadog_api_client/v2/models/incident_responder_type.rb new file mode 100644 index 000000000000..126df12b2f59 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_responder_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Incident responder resource type. + class IncidentResponderType + include BaseEnumModel + + INCIDENT_RESPONDERS = "incident_responders".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_responder_user_relationship.rb b/lib/datadog_api_client/v2/models/incident_responder_user_relationship.rb new file mode 100644 index 000000000000..37bc1b1c60f8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_responder_user_relationship.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to a user for a responder create request. + class IncidentResponderUserRelationship + include BaseGenericModel + + # A user relationship data object for creating a responder. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentResponderUserRelationshipData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentResponderUserRelationship` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_responder_user_relationship_data.rb b/lib/datadog_api_client/v2/models/incident_responder_user_relationship_data.rb new file mode 100644 index 000000000000..af8d9333430e --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_responder_user_relationship_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A user relationship data object for creating a responder. + class IncidentResponderUserRelationshipData + include BaseGenericModel + + # The user identifier. + attr_reader :id + + # The user resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'UUID', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentResponderUserRelationshipData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_responders_response.rb b/lib/datadog_api_client/v2/models/incident_responders_response.rb new file mode 100644 index 000000000000..c22f8d8159c8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_responders_response.rb @@ -0,0 +1,137 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a list of incident responders. + class IncidentRespondersResponse + include BaseGenericModel + + # List of incident responders. + attr_reader :data + + # Included related resources. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentRespondersResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_rule_condition.rb b/lib/datadog_api_client/v2/models/incident_rule_condition.rb new file mode 100644 index 000000000000..65559294dee1 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_rule_condition.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A condition for an incident rule. + class IncidentRuleCondition + include BaseGenericModel + + # The field to match on. + attr_reader :field + + # The values to match. + attr_reader :values + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'field' => :'field', + :'values' => :'values' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'field' => :'String', + :'values' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentRuleCondition` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'field') + self.field = attributes[:'field'] + end + + if attributes.key?(:'values') + if (value = attributes[:'values']).is_a?(Array) + self.values = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @field.nil? + return false if @values.nil? + true + end + + # Custom attribute writer method with validation + # @param field [Object] Object to be assigned + # @!visibility private + def field=(field) + if field.nil? + fail ArgumentError, 'invalid value for "field", field cannot be nil.' + end + @field = field + end + + # Custom attribute writer method with validation + # @param values [Object] Object to be assigned + # @!visibility private + def values=(values) + if values.nil? + fail ArgumentError, 'invalid value for "values", values cannot be nil.' + end + @values = values + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + field == o.field && + values == o.values && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [field, values, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_rule_data_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_rule_data_attributes_request.rb new file mode 100644 index 000000000000..26e7426803d7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_rule_data_attributes_request.rb @@ -0,0 +1,278 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating an incident rule. + class IncidentRuleDataAttributesRequest + include BaseGenericModel + + # A query-based condition for an incident rule. + attr_reader :condition + + # The condition table type. 1 = raw query. + attr_reader :condition_table_type + + # List of field-based conditions. + attr_accessor :conditions + + # Whether the rule is enabled. + attr_reader :enabled + + # The execution type of an incident rule. + attr_reader :execution_type + + # The UUID of the incident type this rule applies to. + attr_accessor :incident_type_uuid + + # Whether any condition (OR logic) should match instead of all (AND logic). + attr_accessor :match_any_condition + + # The task ID for an incident rule. + attr_reader :task_id + + # The JSON-encoded payload for the task. + attr_reader :task_payload + + # The trigger event for an incident rule. + attr_accessor :trigger + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'condition' => :'condition', + :'condition_table_type' => :'condition_table_type', + :'conditions' => :'conditions', + :'enabled' => :'enabled', + :'execution_type' => :'execution_type', + :'incident_type_uuid' => :'incident_type_uuid', + :'match_any_condition' => :'match_any_condition', + :'task_id' => :'task_id', + :'task_payload' => :'task_payload', + :'trigger' => :'trigger' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'condition' => :'IncidentRuleQueryCondition', + :'condition_table_type' => :'Integer', + :'conditions' => :'Array', + :'enabled' => :'Boolean', + :'execution_type' => :'IncidentRuleExecutionType', + :'incident_type_uuid' => :'UUID', + :'match_any_condition' => :'Boolean', + :'task_id' => :'IncidentRuleTaskIDType', + :'task_payload' => :'String', + :'trigger' => :'IncidentRuleTriggerType' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'incident_type_uuid', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentRuleDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'condition') + self.condition = attributes[:'condition'] + end + + if attributes.key?(:'condition_table_type') + self.condition_table_type = attributes[:'condition_table_type'] + end + + if attributes.key?(:'conditions') + if (value = attributes[:'conditions']).is_a?(Array) + self.conditions = value + end + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'execution_type') + self.execution_type = attributes[:'execution_type'] + end + + if attributes.key?(:'incident_type_uuid') + self.incident_type_uuid = attributes[:'incident_type_uuid'] + end + + if attributes.key?(:'match_any_condition') + self.match_any_condition = attributes[:'match_any_condition'] + end + + if attributes.key?(:'task_id') + self.task_id = attributes[:'task_id'] + end + + if attributes.key?(:'task_payload') + self.task_payload = attributes[:'task_payload'] + end + + if attributes.key?(:'trigger') + self.trigger = attributes[:'trigger'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @condition.nil? + return false if @condition_table_type.nil? + return false if @enabled.nil? + return false if @execution_type.nil? + return false if @task_id.nil? + return false if @task_payload.nil? + true + end + + # Custom attribute writer method with validation + # @param condition [Object] Object to be assigned + # @!visibility private + def condition=(condition) + if condition.nil? + fail ArgumentError, 'invalid value for "condition", condition cannot be nil.' + end + @condition = condition + end + + # Custom attribute writer method with validation + # @param condition_table_type [Object] Object to be assigned + # @!visibility private + def condition_table_type=(condition_table_type) + if condition_table_type.nil? + fail ArgumentError, 'invalid value for "condition_table_type", condition_table_type cannot be nil.' + end + @condition_table_type = condition_table_type + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param execution_type [Object] Object to be assigned + # @!visibility private + def execution_type=(execution_type) + if execution_type.nil? + fail ArgumentError, 'invalid value for "execution_type", execution_type cannot be nil.' + end + @execution_type = execution_type + end + + # Custom attribute writer method with validation + # @param task_id [Object] Object to be assigned + # @!visibility private + def task_id=(task_id) + if task_id.nil? + fail ArgumentError, 'invalid value for "task_id", task_id cannot be nil.' + end + @task_id = task_id + end + + # Custom attribute writer method with validation + # @param task_payload [Object] Object to be assigned + # @!visibility private + def task_payload=(task_payload) + if task_payload.nil? + fail ArgumentError, 'invalid value for "task_payload", task_payload cannot be nil.' + end + @task_payload = task_payload + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + condition == o.condition && + condition_table_type == o.condition_table_type && + conditions == o.conditions && + enabled == o.enabled && + execution_type == o.execution_type && + incident_type_uuid == o.incident_type_uuid && + match_any_condition == o.match_any_condition && + task_id == o.task_id && + task_payload == o.task_payload && + trigger == o.trigger && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [condition, condition_table_type, conditions, enabled, execution_type, incident_type_uuid, match_any_condition, task_id, task_payload, trigger, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_rule_data_attributes_response.rb b/lib/datadog_api_client/v2/models/incident_rule_data_attributes_response.rb new file mode 100644 index 000000000000..98a49654f6c0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_rule_data_attributes_response.rb @@ -0,0 +1,268 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an incident rule in a response. + class IncidentRuleDataAttributesResponse + include BaseGenericModel + + # A query-based condition for an incident rule. + attr_accessor :condition + + # The condition table type. + attr_accessor :condition_table_type + + # List of field-based conditions. + attr_accessor :conditions + + # Timestamp when the rule was created. + attr_accessor :created + + # UUID of the user who created the rule. + attr_accessor :created_by_uuid + + # Timestamp when the rule was deleted. + attr_accessor :deleted + + # Whether the rule is enabled. + attr_accessor :enabled + + # The execution type of the rule. + attr_accessor :execution_type + + # The incident settings association UUID. + attr_accessor :incident_settings_association_uuid + + # Whether any condition should match. + attr_accessor :match_any_condition + + # Timestamp when the rule was last modified. + attr_accessor :modified + + # UUID of the user who last modified the rule. + attr_accessor :modified_by_uuid + + # The organization ID. + attr_accessor :org_id + + # The task ID. + attr_accessor :task_id + + # The JSON-encoded task payload. + attr_accessor :task_payload + + # The trigger event for the rule. + attr_accessor :trigger + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'condition' => :'condition', + :'condition_table_type' => :'condition_table_type', + :'conditions' => :'conditions', + :'created' => :'created', + :'created_by_uuid' => :'created_by_uuid', + :'deleted' => :'deleted', + :'enabled' => :'enabled', + :'execution_type' => :'execution_type', + :'incident_settings_association_uuid' => :'incident_settings_association_uuid', + :'match_any_condition' => :'match_any_condition', + :'modified' => :'modified', + :'modified_by_uuid' => :'modified_by_uuid', + :'org_id' => :'org_id', + :'task_id' => :'task_id', + :'task_payload' => :'task_payload', + :'trigger' => :'trigger' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'condition' => :'IncidentRuleQueryCondition', + :'condition_table_type' => :'Integer', + :'conditions' => :'Array', + :'created' => :'Time', + :'created_by_uuid' => :'UUID', + :'deleted' => :'Time', + :'enabled' => :'Boolean', + :'execution_type' => :'Integer', + :'incident_settings_association_uuid' => :'UUID', + :'match_any_condition' => :'Boolean', + :'modified' => :'Time', + :'modified_by_uuid' => :'UUID', + :'org_id' => :'Integer', + :'task_id' => :'String', + :'task_payload' => :'String', + :'trigger' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'deleted', + :'incident_settings_association_uuid', + :'task_id', + :'task_payload', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentRuleDataAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'condition') + self.condition = attributes[:'condition'] + end + + if attributes.key?(:'condition_table_type') + self.condition_table_type = attributes[:'condition_table_type'] + end + + if attributes.key?(:'conditions') + if (value = attributes[:'conditions']).is_a?(Array) + self.conditions = value + end + end + + if attributes.key?(:'created') + self.created = attributes[:'created'] + end + + if attributes.key?(:'created_by_uuid') + self.created_by_uuid = attributes[:'created_by_uuid'] + end + + if attributes.key?(:'deleted') + self.deleted = attributes[:'deleted'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'execution_type') + self.execution_type = attributes[:'execution_type'] + end + + if attributes.key?(:'incident_settings_association_uuid') + self.incident_settings_association_uuid = attributes[:'incident_settings_association_uuid'] + end + + if attributes.key?(:'match_any_condition') + self.match_any_condition = attributes[:'match_any_condition'] + end + + if attributes.key?(:'modified') + self.modified = attributes[:'modified'] + end + + if attributes.key?(:'modified_by_uuid') + self.modified_by_uuid = attributes[:'modified_by_uuid'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + end + + if attributes.key?(:'task_id') + self.task_id = attributes[:'task_id'] + end + + if attributes.key?(:'task_payload') + self.task_payload = attributes[:'task_payload'] + end + + if attributes.key?(:'trigger') + self.trigger = attributes[:'trigger'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + condition == o.condition && + condition_table_type == o.condition_table_type && + conditions == o.conditions && + created == o.created && + created_by_uuid == o.created_by_uuid && + deleted == o.deleted && + enabled == o.enabled && + execution_type == o.execution_type && + incident_settings_association_uuid == o.incident_settings_association_uuid && + match_any_condition == o.match_any_condition && + modified == o.modified && + modified_by_uuid == o.modified_by_uuid && + org_id == o.org_id && + task_id == o.task_id && + task_payload == o.task_payload && + trigger == o.trigger && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [condition, condition_table_type, conditions, created, created_by_uuid, deleted, enabled, execution_type, incident_settings_association_uuid, match_any_condition, modified, modified_by_uuid, org_id, task_id, task_payload, trigger, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_rule_data_request.rb b/lib/datadog_api_client/v2/models/incident_rule_data_request.rb new file mode 100644 index 000000000000..33132ae2372b --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_rule_data_request.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Incident rule data in a create request. + class IncidentRuleDataRequest + include BaseGenericModel + + # Attributes for creating an incident rule. + attr_reader :attributes + + # Incident rule resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentRuleDataAttributesRequest', + :'type' => :'IncidentRuleType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentRuleDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_rule_data_response.rb b/lib/datadog_api_client/v2/models/incident_rule_data_response.rb new file mode 100644 index 000000000000..159acbd6f795 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_rule_data_response.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Incident rule data in a response. + class IncidentRuleDataResponse + include BaseGenericModel + + # Attributes of an incident rule in a response. + attr_reader :attributes + + # The rule identifier. + attr_reader :id + + # Incident rule response resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentRuleDataAttributesResponse', + :'id' => :'UUID', + :'type' => :'IncidentRuleResponseType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentRuleDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_rule_execution_type.rb b/lib/datadog_api_client/v2/models/incident_rule_execution_type.rb new file mode 100644 index 000000000000..dcfd075f0f12 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_rule_execution_type.rb @@ -0,0 +1,27 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The execution type of an incident rule. + class IncidentRuleExecutionType + include BaseEnumModel + + SINGLE_EXECUTION = 1.freeze + MULTI_EXECUTION = 2.freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_rule_patch_data_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_rule_patch_data_attributes_request.rb new file mode 100644 index 000000000000..01643bfdea37 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_rule_patch_data_attributes_request.rb @@ -0,0 +1,147 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for patching an incident rule. All fields are optional. + class IncidentRulePatchDataAttributesRequest + include BaseGenericModel + + # A query-based condition for an incident rule. + attr_accessor :condition + + # List of field-based conditions. + attr_accessor :conditions + + # Whether the rule is enabled. + attr_accessor :enabled + + # The JSON-encoded payload for the task. + attr_accessor :task_payload + + # The trigger event for an incident rule. + attr_accessor :trigger + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'condition' => :'condition', + :'conditions' => :'conditions', + :'enabled' => :'enabled', + :'task_payload' => :'task_payload', + :'trigger' => :'trigger' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'condition' => :'IncidentRuleQueryCondition', + :'conditions' => :'Array', + :'enabled' => :'Boolean', + :'task_payload' => :'String', + :'trigger' => :'IncidentRuleTriggerType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentRulePatchDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'condition') + self.condition = attributes[:'condition'] + end + + if attributes.key?(:'conditions') + if (value = attributes[:'conditions']).is_a?(Array) + self.conditions = value + end + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'task_payload') + self.task_payload = attributes[:'task_payload'] + end + + if attributes.key?(:'trigger') + self.trigger = attributes[:'trigger'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + condition == o.condition && + conditions == o.conditions && + enabled == o.enabled && + task_payload == o.task_payload && + trigger == o.trigger && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [condition, conditions, enabled, task_payload, trigger, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_rule_patch_data_request.rb b/lib/datadog_api_client/v2/models/incident_rule_patch_data_request.rb new file mode 100644 index 000000000000..422d171c682f --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_rule_patch_data_request.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Incident rule data in a patch request. + class IncidentRulePatchDataRequest + include BaseGenericModel + + # Attributes for patching an incident rule. All fields are optional. + attr_accessor :attributes + + # The rule identifier. + attr_reader :id + + # Incident rule resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentRulePatchDataAttributesRequest', + :'id' => :'UUID', + :'type' => :'IncidentRuleType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentRulePatchDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_rule_patch_request.rb b/lib/datadog_api_client/v2/models/incident_rule_patch_request.rb new file mode 100644 index 000000000000..395bdc7cb1c0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_rule_patch_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for patching an incident rule. + class IncidentRulePatchRequest + include BaseGenericModel + + # Incident rule data in a patch request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentRulePatchDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentRulePatchRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_rule_query_condition.rb b/lib/datadog_api_client/v2/models/incident_rule_query_condition.rb new file mode 100644 index 000000000000..c7dd2813112a --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_rule_query_condition.rb @@ -0,0 +1,124 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A query-based condition for an incident rule. + class IncidentRuleQueryCondition + include BaseGenericModel + + # The normalized query string. + attr_accessor :normalized_query + + # The raw query string. + attr_accessor :raw_query + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'normalized_query' => :'normalized_query', + :'raw_query' => :'raw_query' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'normalized_query' => :'String', + :'raw_query' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'normalized_query', + :'raw_query', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentRuleQueryCondition` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'normalized_query') + self.normalized_query = attributes[:'normalized_query'] + end + + if attributes.key?(:'raw_query') + self.raw_query = attributes[:'raw_query'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + normalized_query == o.normalized_query && + raw_query == o.raw_query && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [normalized_query, raw_query, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_rule_request.rb b/lib/datadog_api_client/v2/models/incident_rule_request.rb new file mode 100644 index 000000000000..c484259916eb --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_rule_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for creating an incident rule. + class IncidentRuleRequest + include BaseGenericModel + + # Incident rule data in a create request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentRuleDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentRuleRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_rule_response.rb b/lib/datadog_api_client/v2/models/incident_rule_response.rb new file mode 100644 index 000000000000..12b53004f1be --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_rule_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a single incident rule. + class IncidentRuleResponse + include BaseGenericModel + + # Incident rule data in a response. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentRuleDataResponse' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentRuleResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_rule_response_type.rb b/lib/datadog_api_client/v2/models/incident_rule_response_type.rb new file mode 100644 index 000000000000..1b6dab109ef3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_rule_response_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Incident rule response resource type. + class IncidentRuleResponseType + include BaseEnumModel + + INCIDENTS_RULES = "incidents_rules".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_rule_task_id_type.rb b/lib/datadog_api_client/v2/models/incident_rule_task_id_type.rb new file mode 100644 index 000000000000..bf60d4261a5a --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_rule_task_id_type.rb @@ -0,0 +1,37 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The task ID for an incident rule. + class IncidentRuleTaskIDType + include BaseEnumModel + + JIRA_CREATE_ISSUE_JOB = "jira-create-issue-job".freeze + NOTIFY_INCIDENT_HANDLES_JOB = "notify-incident-handles-job".freeze + SERVICENOW_CREATE_INCIDENT_JOB = "servicenow-create-incident-job".freeze + SLACK_CREATE_CHANNEL_JOB = "slack-create-channel-job".freeze + ZOOM_CREATE_MEETING_JOB = "zoom-create-meeting-job".freeze + GOOGLE_MEET_CREATE_MEETING_JOB = "google-meet-create-meeting-job".freeze + WORKFLOW_AUTOMATION_JOB = "workflow-automation-job".freeze + MS_TEAMS_CREATE_MEETING_JOB = "ms-teams-create-meeting-job".freeze + GOOGLE_CHAT_CREATE_SPACE_JOB = "google-chat-create-space-job".freeze + ZOOM_SUPPRESS_SUMMARIZATION_JOB = "zoom-suppress-summarization-job".freeze + MS_TEAMS_SUPPRESS_SUMMARIZATION_JOB = "ms-teams-suppress-summarization-job".freeze + GOOGLE_MEET_SUPPRESS_SUMMARIZATION_JOB = "google-meet-suppress-summarization-job".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_rule_trigger_type.rb b/lib/datadog_api_client/v2/models/incident_rule_trigger_type.rb new file mode 100644 index 000000000000..1fabd9119f43 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_rule_trigger_type.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The trigger event for an incident rule. + class IncidentRuleTriggerType + include BaseEnumModel + + INCIDENT_SAVED_TRIGGER = "incident_saved_trigger".freeze + INCIDENT_CREATED_TRIGGER = "incident_created_trigger".freeze + INCIDENT_MODIFIED_TRIGGER = "incident_modified_trigger".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_rule_type.rb b/lib/datadog_api_client/v2/models/incident_rule_type.rb new file mode 100644 index 000000000000..35c76063b86c --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_rule_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Incident rule resource type. + class IncidentRuleType + include BaseEnumModel + + INCIDENT_RULES = "incident_rules".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_rules_response.rb b/lib/datadog_api_client/v2/models/incident_rules_response.rb new file mode 100644 index 000000000000..d7bc443ef93b --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_rules_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a list of incident rules. + class IncidentRulesResponse + include BaseGenericModel + + # List of incident rules. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentRulesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_service_now_record_data_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_service_now_record_data_attributes_request.rb new file mode 100644 index 000000000000..049aec684aae --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_service_now_record_data_attributes_request.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating a ServiceNow record for an incident. + class IncidentServiceNowRecordDataAttributesRequest + include BaseGenericModel + + # The ServiceNow assignment group. + attr_reader :assignment_group + + # The ServiceNow configuration item mapping. + attr_reader :configuration_item_mapping + + # The ServiceNow instance name. + attr_reader :instance_name + + # An existing ServiceNow record ID (Sys ID) to link instead of creating a new record. + attr_accessor :record_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assignment_group' => :'assignment_group', + :'configuration_item_mapping' => :'configuration_item_mapping', + :'instance_name' => :'instance_name', + :'record_id' => :'record_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assignment_group' => :'String', + :'configuration_item_mapping' => :'String', + :'instance_name' => :'String', + :'record_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentServiceNowRecordDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'assignment_group') + self.assignment_group = attributes[:'assignment_group'] + end + + if attributes.key?(:'configuration_item_mapping') + self.configuration_item_mapping = attributes[:'configuration_item_mapping'] + end + + if attributes.key?(:'instance_name') + self.instance_name = attributes[:'instance_name'] + end + + if attributes.key?(:'record_id') + self.record_id = attributes[:'record_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @assignment_group.nil? + return false if @configuration_item_mapping.nil? + return false if @instance_name.nil? + true + end + + # Custom attribute writer method with validation + # @param assignment_group [Object] Object to be assigned + # @!visibility private + def assignment_group=(assignment_group) + if assignment_group.nil? + fail ArgumentError, 'invalid value for "assignment_group", assignment_group cannot be nil.' + end + @assignment_group = assignment_group + end + + # Custom attribute writer method with validation + # @param configuration_item_mapping [Object] Object to be assigned + # @!visibility private + def configuration_item_mapping=(configuration_item_mapping) + if configuration_item_mapping.nil? + fail ArgumentError, 'invalid value for "configuration_item_mapping", configuration_item_mapping cannot be nil.' + end + @configuration_item_mapping = configuration_item_mapping + end + + # Custom attribute writer method with validation + # @param instance_name [Object] Object to be assigned + # @!visibility private + def instance_name=(instance_name) + if instance_name.nil? + fail ArgumentError, 'invalid value for "instance_name", instance_name cannot be nil.' + end + @instance_name = instance_name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assignment_group == o.assignment_group && + configuration_item_mapping == o.configuration_item_mapping && + instance_name == o.instance_name && + record_id == o.record_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assignment_group, configuration_item_mapping, instance_name, record_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_service_now_record_data_request.rb b/lib/datadog_api_client/v2/models/incident_service_now_record_data_request.rb new file mode 100644 index 000000000000..ec95975cf6bb --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_service_now_record_data_request.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # ServiceNow record data in a create request. + class IncidentServiceNowRecordDataRequest + include BaseGenericModel + + # Attributes for creating a ServiceNow record for an incident. + attr_reader :attributes + + # ServiceNow record prompt resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentServiceNowRecordDataAttributesRequest', + :'type' => :'IncidentServiceNowRecordPromptType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentServiceNowRecordDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_service_now_record_prompt_type.rb b/lib/datadog_api_client/v2/models/incident_service_now_record_prompt_type.rb new file mode 100644 index 000000000000..a4f3d11af617 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_service_now_record_prompt_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # ServiceNow record prompt resource type. + class IncidentServiceNowRecordPromptType + include BaseEnumModel + + INCIDENT_SERVICENOW_RECORD_PROMPT = "incident_servicenow_record_prompt".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_service_now_record_request.rb b/lib/datadog_api_client/v2/models/incident_service_now_record_request.rb new file mode 100644 index 000000000000..8955b4bd36ef --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_service_now_record_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for creating a ServiceNow record for an incident. + class IncidentServiceNowRecordRequest + include BaseGenericModel + + # ServiceNow record data in a create request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentServiceNowRecordDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentServiceNowRecordRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_data_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_data_attributes_request.rb new file mode 100644 index 000000000000..8e9152315a5f --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_data_attributes_request.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating a timestamp override. + class IncidentTimestampOverrideDataAttributesRequest + include BaseGenericModel + + # The type of timestamp to override. + attr_reader :timestamp_type + + # The overridden timestamp value. + attr_reader :timestamp_value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'timestamp_type' => :'timestamp_type', + :'timestamp_value' => :'timestamp_value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'timestamp_type' => :'IncidentTimestampType', + :'timestamp_value' => :'Time' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverrideDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'timestamp_type') + self.timestamp_type = attributes[:'timestamp_type'] + end + + if attributes.key?(:'timestamp_value') + self.timestamp_value = attributes[:'timestamp_value'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @timestamp_type.nil? + return false if @timestamp_value.nil? + true + end + + # Custom attribute writer method with validation + # @param timestamp_type [Object] Object to be assigned + # @!visibility private + def timestamp_type=(timestamp_type) + if timestamp_type.nil? + fail ArgumentError, 'invalid value for "timestamp_type", timestamp_type cannot be nil.' + end + @timestamp_type = timestamp_type + end + + # Custom attribute writer method with validation + # @param timestamp_value [Object] Object to be assigned + # @!visibility private + def timestamp_value=(timestamp_value) + if timestamp_value.nil? + fail ArgumentError, 'invalid value for "timestamp_value", timestamp_value cannot be nil.' + end + @timestamp_value = timestamp_value + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + timestamp_type == o.timestamp_type && + timestamp_value == o.timestamp_value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [timestamp_type, timestamp_value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_data_attributes_response.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_data_attributes_response.rb new file mode 100644 index 000000000000..340309a03b90 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_data_attributes_response.rb @@ -0,0 +1,225 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of a timestamp override in a response. + class IncidentTimestampOverrideDataAttributesResponse + include BaseGenericModel + + # Timestamp when the override was created. + attr_reader :created_at + + # Timestamp when the override was deleted. + attr_accessor :deleted_at + + # The incident identifier. + attr_reader :incident_id + + # Timestamp when the override was last modified. + attr_reader :modified_at + + # The type of timestamp to override. + attr_reader :timestamp_type + + # The overridden timestamp value. + attr_reader :timestamp_value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'deleted_at' => :'deleted_at', + :'incident_id' => :'incident_id', + :'modified_at' => :'modified_at', + :'timestamp_type' => :'timestamp_type', + :'timestamp_value' => :'timestamp_value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'deleted_at' => :'Time', + :'incident_id' => :'String', + :'modified_at' => :'Time', + :'timestamp_type' => :'IncidentTimestampType', + :'timestamp_value' => :'Time' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'deleted_at', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverrideDataAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'deleted_at') + self.deleted_at = attributes[:'deleted_at'] + end + + if attributes.key?(:'incident_id') + self.incident_id = attributes[:'incident_id'] + end + + if attributes.key?(:'modified_at') + self.modified_at = attributes[:'modified_at'] + end + + if attributes.key?(:'timestamp_type') + self.timestamp_type = attributes[:'timestamp_type'] + end + + if attributes.key?(:'timestamp_value') + self.timestamp_value = attributes[:'timestamp_value'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created_at.nil? + return false if @incident_id.nil? + return false if @modified_at.nil? + return false if @timestamp_type.nil? + return false if @timestamp_value.nil? + true + end + + # Custom attribute writer method with validation + # @param created_at [Object] Object to be assigned + # @!visibility private + def created_at=(created_at) + if created_at.nil? + fail ArgumentError, 'invalid value for "created_at", created_at cannot be nil.' + end + @created_at = created_at + end + + # Custom attribute writer method with validation + # @param incident_id [Object] Object to be assigned + # @!visibility private + def incident_id=(incident_id) + if incident_id.nil? + fail ArgumentError, 'invalid value for "incident_id", incident_id cannot be nil.' + end + @incident_id = incident_id + end + + # Custom attribute writer method with validation + # @param modified_at [Object] Object to be assigned + # @!visibility private + def modified_at=(modified_at) + if modified_at.nil? + fail ArgumentError, 'invalid value for "modified_at", modified_at cannot be nil.' + end + @modified_at = modified_at + end + + # Custom attribute writer method with validation + # @param timestamp_type [Object] Object to be assigned + # @!visibility private + def timestamp_type=(timestamp_type) + if timestamp_type.nil? + fail ArgumentError, 'invalid value for "timestamp_type", timestamp_type cannot be nil.' + end + @timestamp_type = timestamp_type + end + + # Custom attribute writer method with validation + # @param timestamp_value [Object] Object to be assigned + # @!visibility private + def timestamp_value=(timestamp_value) + if timestamp_value.nil? + fail ArgumentError, 'invalid value for "timestamp_value", timestamp_value cannot be nil.' + end + @timestamp_value = timestamp_value + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_at == o.created_at && + deleted_at == o.deleted_at && + incident_id == o.incident_id && + modified_at == o.modified_at && + timestamp_type == o.timestamp_type && + timestamp_value == o.timestamp_value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, deleted_at, incident_id, modified_at, timestamp_type, timestamp_value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_data_request.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_data_request.rb new file mode 100644 index 000000000000..ea258f3c6a9d --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_data_request.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Timestamp override data in a create request. + class IncidentTimestampOverrideDataRequest + include BaseGenericModel + + # Attributes for creating a timestamp override. + attr_reader :attributes + + # Incident timestamp override resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentTimestampOverrideDataAttributesRequest', + :'type' => :'IncidentTimestampOverrideType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverrideDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_data_response.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_data_response.rb new file mode 100644 index 000000000000..a0a5a8a69875 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_data_response.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Timestamp override data in a response. + class IncidentTimestampOverrideDataResponse + include BaseGenericModel + + # Attributes of a timestamp override in a response. + attr_reader :attributes + + # The timestamp override identifier. + attr_reader :id + + # Relationships for a timestamp override. + attr_accessor :relationships + + # Incident timestamp override resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentTimestampOverrideDataAttributesResponse', + :'id' => :'UUID', + :'relationships' => :'IncidentTimestampOverrideRelationships', + :'type' => :'IncidentTimestampOverrideType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverrideDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_data_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_data_attributes_request.rb new file mode 100644 index 000000000000..8d584702606e --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_data_attributes_request.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for patching a timestamp override. All fields are optional. + class IncidentTimestampOverridePatchDataAttributesRequest + include BaseGenericModel + + # The type of timestamp to override. + attr_accessor :timestamp_type + + # The overridden timestamp value. + attr_accessor :timestamp_value + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'timestamp_type' => :'timestamp_type', + :'timestamp_value' => :'timestamp_value' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'timestamp_type' => :'IncidentTimestampType', + :'timestamp_value' => :'Time' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverridePatchDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'timestamp_type') + self.timestamp_type = attributes[:'timestamp_type'] + end + + if attributes.key?(:'timestamp_value') + self.timestamp_value = attributes[:'timestamp_value'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + timestamp_type == o.timestamp_type && + timestamp_value == o.timestamp_value && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [timestamp_type, timestamp_value, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_data_request.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_data_request.rb new file mode 100644 index 000000000000..d438b6dd9df5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_data_request.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Timestamp override data in a patch request. + class IncidentTimestampOverridePatchDataRequest + include BaseGenericModel + + # Attributes for patching a timestamp override. All fields are optional. + attr_accessor :attributes + + # The timestamp override identifier. + attr_reader :id + + # Incident timestamp override resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentTimestampOverridePatchDataAttributesRequest', + :'id' => :'UUID', + :'type' => :'IncidentTimestampOverrideType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverridePatchDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_request.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_request.rb new file mode 100644 index 000000000000..9f4432f5fbb4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_patch_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for patching a timestamp override. + class IncidentTimestampOverridePatchRequest + include BaseGenericModel + + # Timestamp override data in a patch request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentTimestampOverridePatchDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverridePatchRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_relationships.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_relationships.rb new file mode 100644 index 000000000000..3d06b0521ddc --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_relationships.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships for a timestamp override. + class IncidentTimestampOverrideRelationships + include BaseGenericModel + + # Relationship to user. + attr_accessor :created_by_user + + # Relationship to user. + attr_accessor :last_modified_by_user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by_user' => :'created_by_user', + :'last_modified_by_user' => :'last_modified_by_user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by_user' => :'RelationshipToUser', + :'last_modified_by_user' => :'RelationshipToUser' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverrideRelationships` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_by_user') + self.created_by_user = attributes[:'created_by_user'] + end + + if attributes.key?(:'last_modified_by_user') + self.last_modified_by_user = attributes[:'last_modified_by_user'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_by_user == o.created_by_user && + last_modified_by_user == o.last_modified_by_user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_by_user, last_modified_by_user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_request.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_request.rb new file mode 100644 index 000000000000..c1eb33478cee --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request payload for creating a timestamp override. + class IncidentTimestampOverrideRequest + include BaseGenericModel + + # Timestamp override data in a create request. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentTimestampOverrideDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverrideRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_response.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_response.rb new file mode 100644 index 000000000000..2984fddfd4b3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_response.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a single timestamp override. + class IncidentTimestampOverrideResponse + include BaseGenericModel + + # Timestamp override data in a response. + attr_reader :data + + # Included related resources. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentTimestampOverrideDataResponse', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverrideResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_override_type.rb b/lib/datadog_api_client/v2/models/incident_timestamp_override_type.rb new file mode 100644 index 000000000000..a149cf15f880 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_override_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Incident timestamp override resource type. + class IncidentTimestampOverrideType + include BaseEnumModel + + INCIDENTS_TIMESTAMP_OVERRIDES = "incidents_timestamp_overrides".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_overrides_response.rb b/lib/datadog_api_client/v2/models/incident_timestamp_overrides_response.rb new file mode 100644 index 000000000000..7805e9687652 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_overrides_response.rb @@ -0,0 +1,137 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a list of timestamp overrides. + class IncidentTimestampOverridesResponse + include BaseGenericModel + + # List of timestamp overrides. + attr_reader :data + + # Included related resources. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentTimestampOverridesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_timestamp_type.rb b/lib/datadog_api_client/v2/models/incident_timestamp_type.rb new file mode 100644 index 000000000000..e903d06098bd --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_timestamp_type.rb @@ -0,0 +1,29 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The type of timestamp to override. + class IncidentTimestampType + include BaseEnumModel + + CREATED = "created".freeze + DETECTED = "detected".freeze + RESOLVED = "resolved".freeze + DECLARED = "declared".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_user_defined_role_data_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_user_defined_role_data_attributes_request.rb new file mode 100644 index 000000000000..73c5524a0d60 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_user_defined_role_data_attributes_request.rb @@ -0,0 +1,162 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for creating an incident user-defined role. + class IncidentUserDefinedRoleDataAttributesRequest + include BaseGenericModel + + # A description of the user-defined role. + attr_accessor :description + + # The name of the user-defined role. + attr_reader :name + + # Policy configuration for a user-defined role. + attr_reader :policy + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'name' => :'name', + :'policy' => :'policy' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'name' => :'String', + :'policy' => :'IncidentUserDefinedRolePolicy' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'description', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentUserDefinedRoleDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'policy') + self.policy = attributes[:'policy'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @name.nil? + return false if @policy.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param policy [Object] Object to be assigned + # @!visibility private + def policy=(policy) + if policy.nil? + fail ArgumentError, 'invalid value for "policy", policy cannot be nil.' + end + @policy = policy + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + name == o.name && + policy == o.policy && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, name, policy, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_user_defined_role_data_attributes_response.rb b/lib/datadog_api_client/v2/models/incident_user_defined_role_data_attributes_response.rb new file mode 100644 index 000000000000..7b802db091e9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_user_defined_role_data_attributes_response.rb @@ -0,0 +1,204 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an incident user-defined role. + class IncidentUserDefinedRoleDataAttributesResponse + include BaseGenericModel + + # Timestamp when the role was created. + attr_reader :created + + # A description of the user-defined role. + attr_accessor :description + + # Timestamp when the role was last modified. + attr_reader :modified + + # The name of the user-defined role. + attr_reader :name + + # Policy configuration for a user-defined role. + attr_reader :policy + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created' => :'created', + :'description' => :'description', + :'modified' => :'modified', + :'name' => :'name', + :'policy' => :'policy' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created' => :'Time', + :'description' => :'String', + :'modified' => :'Time', + :'name' => :'String', + :'policy' => :'IncidentUserDefinedRolePolicy' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'description', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentUserDefinedRoleDataAttributesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created') + self.created = attributes[:'created'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'modified') + self.modified = attributes[:'modified'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'policy') + self.policy = attributes[:'policy'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @created.nil? + return false if @modified.nil? + return false if @name.nil? + return false if @policy.nil? + true + end + + # Custom attribute writer method with validation + # @param created [Object] Object to be assigned + # @!visibility private + def created=(created) + if created.nil? + fail ArgumentError, 'invalid value for "created", created cannot be nil.' + end + @created = created + end + + # Custom attribute writer method with validation + # @param modified [Object] Object to be assigned + # @!visibility private + def modified=(modified) + if modified.nil? + fail ArgumentError, 'invalid value for "modified", modified cannot be nil.' + end + @modified = modified + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param policy [Object] Object to be assigned + # @!visibility private + def policy=(policy) + if policy.nil? + fail ArgumentError, 'invalid value for "policy", policy cannot be nil.' + end + @policy = policy + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created == o.created && + description == o.description && + modified == o.modified && + name == o.name && + policy == o.policy && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created, description, modified, name, policy, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_user_defined_role_data_request.rb b/lib/datadog_api_client/v2/models/incident_user_defined_role_data_request.rb new file mode 100644 index 000000000000..89db7779eff3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_user_defined_role_data_request.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for creating an incident user-defined role. + class IncidentUserDefinedRoleDataRequest + include BaseGenericModel + + # Attributes for creating an incident user-defined role. + attr_reader :attributes + + # Relationships for creating a user-defined role. + attr_reader :relationships + + # Incident user-defined role resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentUserDefinedRoleDataAttributesRequest', + :'relationships' => :'IncidentUserDefinedRoleRelationshipsRequest', + :'type' => :'IncidentUserDefinedRoleType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentUserDefinedRoleDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @relationships.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param relationships [Object] Object to be assigned + # @!visibility private + def relationships=(relationships) + if relationships.nil? + fail ArgumentError, 'invalid value for "relationships", relationships cannot be nil.' + end + @relationships = relationships + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_user_defined_role_data_response.rb b/lib/datadog_api_client/v2/models/incident_user_defined_role_data_response.rb new file mode 100644 index 000000000000..9025e3e51805 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_user_defined_role_data_response.rb @@ -0,0 +1,175 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for an incident user-defined role response. + class IncidentUserDefinedRoleDataResponse + include BaseGenericModel + + # Attributes of an incident user-defined role. + attr_reader :attributes + + # The ID of the user-defined role. + attr_reader :id + + # Relationships of a user-defined role response. + attr_accessor :relationships + + # Incident user-defined role resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'relationships' => :'relationships', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentUserDefinedRoleDataAttributesResponse', + :'id' => :'UUID', + :'relationships' => :'IncidentUserDefinedRoleRelationshipsResponse', + :'type' => :'IncidentUserDefinedRoleType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentUserDefinedRoleDataResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'relationships') + self.relationships = attributes[:'relationships'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + relationships == o.relationships && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, relationships, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_user_defined_role_incident_type_relationship.rb b/lib/datadog_api_client/v2/models/incident_user_defined_role_incident_type_relationship.rb new file mode 100644 index 000000000000..1b108115df34 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_user_defined_role_incident_type_relationship.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationship to an incident type for a user-defined role. + class IncidentUserDefinedRoleIncidentTypeRelationship + include BaseGenericModel + + # Data for the incident type relationship of a user-defined role. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentUserDefinedRoleIncidentTypeRelationshipData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentUserDefinedRoleIncidentTypeRelationship` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_user_defined_role_incident_type_relationship_data.rb b/lib/datadog_api_client/v2/models/incident_user_defined_role_incident_type_relationship_data.rb new file mode 100644 index 000000000000..ab11baa2abc0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_user_defined_role_incident_type_relationship_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for the incident type relationship of a user-defined role. + class IncidentUserDefinedRoleIncidentTypeRelationshipData + include BaseGenericModel + + # The ID of the incident type. + attr_reader :id + + # The type of the resource. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'id' => :'UUID', + :'type' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentUserDefinedRoleIncidentTypeRelationshipData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_user_defined_role_included_item.rb b/lib/datadog_api_client/v2/models/incident_user_defined_role_included_item.rb new file mode 100644 index 000000000000..95a1b56df95d --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_user_defined_role_included_item.rb @@ -0,0 +1,63 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # A single included resource in a user-defined role response. + module IncidentUserDefinedRoleIncludedItem + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'IncidentUserData', + :'IncidentTypeObject' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_user_defined_role_patch_data_attributes_request.rb b/lib/datadog_api_client/v2/models/incident_user_defined_role_patch_data_attributes_request.rb new file mode 100644 index 000000000000..022d1b68c8c4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_user_defined_role_patch_data_attributes_request.rb @@ -0,0 +1,133 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes for updating an incident user-defined role. + class IncidentUserDefinedRolePatchDataAttributesRequest + include BaseGenericModel + + # A description of the user-defined role. + attr_accessor :description + + # The name of the user-defined role. + attr_accessor :name + + # Policy configuration for a user-defined role. + attr_accessor :policy + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'name' => :'name', + :'policy' => :'policy' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'name' => :'String', + :'policy' => :'IncidentUserDefinedRolePolicy' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'description', + ]) + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentUserDefinedRolePatchDataAttributesRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'policy') + self.policy = attributes[:'policy'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + description == o.description && + name == o.name && + policy == o.policy && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, name, policy, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_user_defined_role_patch_data_request.rb b/lib/datadog_api_client/v2/models/incident_user_defined_role_patch_data_request.rb new file mode 100644 index 000000000000..f3841e4c3822 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_user_defined_role_patch_data_request.rb @@ -0,0 +1,154 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data for updating an incident user-defined role. + class IncidentUserDefinedRolePatchDataRequest + include BaseGenericModel + + # Attributes for updating an incident user-defined role. + attr_accessor :attributes + + # The ID of the user-defined role to update. + attr_reader :id + + # Incident user-defined role resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'IncidentUserDefinedRolePatchDataAttributesRequest', + :'id' => :'UUID', + :'type' => :'IncidentUserDefinedRoleType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentUserDefinedRolePatchDataRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_user_defined_role_patch_request.rb b/lib/datadog_api_client/v2/models/incident_user_defined_role_patch_request.rb new file mode 100644 index 000000000000..35a7aaa26c55 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_user_defined_role_patch_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request for updating an incident user-defined role. + class IncidentUserDefinedRolePatchRequest + include BaseGenericModel + + # Data for updating an incident user-defined role. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentUserDefinedRolePatchDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentUserDefinedRolePatchRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_user_defined_role_policy.rb b/lib/datadog_api_client/v2/models/incident_user_defined_role_policy.rb new file mode 100644 index 000000000000..47155b7051fd --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_user_defined_role_policy.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Policy configuration for a user-defined role. + class IncidentUserDefinedRolePolicy + include BaseGenericModel + + # Whether this role can only be assigned to one responder at a time. + attr_reader :is_single + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'is_single' => :'is_single' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'is_single' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentUserDefinedRolePolicy` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'is_single') + self.is_single = attributes[:'is_single'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @is_single.nil? + true + end + + # Custom attribute writer method with validation + # @param is_single [Object] Object to be assigned + # @!visibility private + def is_single=(is_single) + if is_single.nil? + fail ArgumentError, 'invalid value for "is_single", is_single cannot be nil.' + end + @is_single = is_single + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + is_single == o.is_single && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [is_single, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_user_defined_role_relationships_request.rb b/lib/datadog_api_client/v2/models/incident_user_defined_role_relationships_request.rb new file mode 100644 index 000000000000..833bb61e7c91 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_user_defined_role_relationships_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships for creating a user-defined role. + class IncidentUserDefinedRoleRelationshipsRequest + include BaseGenericModel + + # Relationship to an incident type for a user-defined role. + attr_reader :incident_type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'incident_type' => :'incident_type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'incident_type' => :'IncidentUserDefinedRoleIncidentTypeRelationship' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentUserDefinedRoleRelationshipsRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'incident_type') + self.incident_type = attributes[:'incident_type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @incident_type.nil? + true + end + + # Custom attribute writer method with validation + # @param incident_type [Object] Object to be assigned + # @!visibility private + def incident_type=(incident_type) + if incident_type.nil? + fail ArgumentError, 'invalid value for "incident_type", incident_type cannot be nil.' + end + @incident_type = incident_type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + incident_type == o.incident_type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [incident_type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_user_defined_role_relationships_response.rb b/lib/datadog_api_client/v2/models/incident_user_defined_role_relationships_response.rb new file mode 100644 index 000000000000..17476c716311 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_user_defined_role_relationships_response.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Relationships of a user-defined role response. + class IncidentUserDefinedRoleRelationshipsResponse + include BaseGenericModel + + # Relationship to user. + attr_accessor :created_by_user + + # Relationship to an incident type for a user-defined role. + attr_accessor :incident_type + + # Relationship to user. + attr_accessor :last_modified_by_user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by_user' => :'created_by_user', + :'incident_type' => :'incident_type', + :'last_modified_by_user' => :'last_modified_by_user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by_user' => :'RelationshipToUser', + :'incident_type' => :'IncidentUserDefinedRoleIncidentTypeRelationship', + :'last_modified_by_user' => :'RelationshipToUser' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentUserDefinedRoleRelationshipsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_by_user') + self.created_by_user = attributes[:'created_by_user'] + end + + if attributes.key?(:'incident_type') + self.incident_type = attributes[:'incident_type'] + end + + if attributes.key?(:'last_modified_by_user') + self.last_modified_by_user = attributes[:'last_modified_by_user'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + created_by_user == o.created_by_user && + incident_type == o.incident_type && + last_modified_by_user == o.last_modified_by_user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_by_user, incident_type, last_modified_by_user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_user_defined_role_request.rb b/lib/datadog_api_client/v2/models/incident_user_defined_role_request.rb new file mode 100644 index 000000000000..34366c834121 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_user_defined_role_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request for creating an incident user-defined role. + class IncidentUserDefinedRoleRequest + include BaseGenericModel + + # Data for creating an incident user-defined role. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentUserDefinedRoleDataRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentUserDefinedRoleRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_user_defined_role_response.rb b/lib/datadog_api_client/v2/models/incident_user_defined_role_response.rb new file mode 100644 index 000000000000..a9e867dccd71 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_user_defined_role_response.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a single incident user-defined role. + class IncidentUserDefinedRoleResponse + include BaseGenericModel + + # Data for an incident user-defined role response. + attr_reader :data + + # Included resources for an incident user-defined role response. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'IncidentUserDefinedRoleDataResponse', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentUserDefinedRoleResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/incident_user_defined_role_type.rb b/lib/datadog_api_client/v2/models/incident_user_defined_role_type.rb new file mode 100644 index 000000000000..ca457f6ab365 --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_user_defined_role_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Incident user-defined role resource type. + class IncidentUserDefinedRoleType + include BaseEnumModel + + INCIDENT_USER_DEFINED_ROLES = "incident_user_defined_roles".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/incident_user_defined_roles_response.rb b/lib/datadog_api_client/v2/models/incident_user_defined_roles_response.rb new file mode 100644 index 000000000000..23bdcaf5894d --- /dev/null +++ b/lib/datadog_api_client/v2/models/incident_user_defined_roles_response.rb @@ -0,0 +1,137 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response with a list of incident user-defined roles. + class IncidentUserDefinedRolesResponse + include BaseGenericModel + + # List of incident user-defined role data objects. + attr_reader :data + + # Included resources for an incident user-defined role response. + attr_accessor :included + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data', + :'included' => :'included' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array', + :'included' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::IncidentUserDefinedRolesResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + + if attributes.key?(:'included') + if (value = attributes[:'included']).is_a?(Array) + self.included = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + included == o.included && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, included, additional_properties].hash + end + end +end