From f10089b41437877a08b67d0478f960139730ca6c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 27 Aug 2026 15:18:04 +0000 Subject: [PATCH] Regenerate client from commit aa00d8d of spec repo --- .generator/schemas/v2/openapi.yaml | 242 +++++++++++++++++- .../v2/model/execution_limit.py | 40 +++ .../v2/model/incident_condition.py | 42 +++ .../v2/model/incident_created_trigger.py | 54 ++++ .../model/incident_created_trigger_wrapper.py | 54 ++++ .../model/incident_impact_created_trigger.py | 64 +++++ ...incident_impact_created_trigger_wrapper.py | 54 ++++ .../model/incident_impact_updated_trigger.py | 64 +++++ ...incident_impact_updated_trigger_wrapper.py | 54 ++++ .../incident_postmortem_updated_trigger.py | 64 +++++ ...dent_postmortem_updated_trigger_wrapper.py | 54 ++++ .../incident_responder_created_trigger.py | 64 +++++ ...ident_responder_created_trigger_wrapper.py | 54 ++++ .../v2/model/incident_saved_trigger.py | 74 ++++++ .../model/incident_saved_trigger_wrapper.py | 54 ++++ .../v2/model/incident_schedule_trigger.py | 68 +++++ .../incident_schedule_trigger_wrapper.py | 54 ++++ .../v2/model/incident_tag_value.py | 40 +++ .../v2/model/incident_trigger.py | 11 +- .../v2/model/serial_execution.py | 33 +++ .../v2/model/slack_reaction_config.py | 48 ++++ .../v2/model/slack_trigger.py | 42 +++ .../v2/model/slack_trigger_wrapper.py | 14 +- src/datadog_api_client/v2/model/spec.py | 18 ++ src/datadog_api_client/v2/model/trigger.py | 45 +++- src/datadog_api_client/v2/models/__init__.py | 44 ++++ 26 files changed, 1441 insertions(+), 8 deletions(-) create mode 100644 src/datadog_api_client/v2/model/execution_limit.py create mode 100644 src/datadog_api_client/v2/model/incident_condition.py create mode 100644 src/datadog_api_client/v2/model/incident_created_trigger.py create mode 100644 src/datadog_api_client/v2/model/incident_created_trigger_wrapper.py create mode 100644 src/datadog_api_client/v2/model/incident_impact_created_trigger.py create mode 100644 src/datadog_api_client/v2/model/incident_impact_created_trigger_wrapper.py create mode 100644 src/datadog_api_client/v2/model/incident_impact_updated_trigger.py create mode 100644 src/datadog_api_client/v2/model/incident_impact_updated_trigger_wrapper.py create mode 100644 src/datadog_api_client/v2/model/incident_postmortem_updated_trigger.py create mode 100644 src/datadog_api_client/v2/model/incident_postmortem_updated_trigger_wrapper.py create mode 100644 src/datadog_api_client/v2/model/incident_responder_created_trigger.py create mode 100644 src/datadog_api_client/v2/model/incident_responder_created_trigger_wrapper.py create mode 100644 src/datadog_api_client/v2/model/incident_saved_trigger.py create mode 100644 src/datadog_api_client/v2/model/incident_saved_trigger_wrapper.py create mode 100644 src/datadog_api_client/v2/model/incident_schedule_trigger.py create mode 100644 src/datadog_api_client/v2/model/incident_schedule_trigger_wrapper.py create mode 100644 src/datadog_api_client/v2/model/incident_tag_value.py create mode 100644 src/datadog_api_client/v2/model/serial_execution.py create mode 100644 src/datadog_api_client/v2/model/slack_reaction_config.py create mode 100644 src/datadog_api_client/v2/model/slack_trigger.py diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index bd7d5e603e..1e4bbeecc8 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -38186,6 +38186,19 @@ components: example: "One or several indexes are missing or invalid. Results hold data from the other indexes." type: string type: object + ExecutionLimit: + description: "The maximum number of times to execute a workflow for an Incident." + properties: + count: + description: "The maximum number of workflow executions." + example: 1 + format: int32 + maximum: 9999 + minimum: 1 + type: integer + required: + - count + type: object ExecutionPolicyActionPattern: description: The set of actions this policy applies to. properties: @@ -47977,6 +47990,15 @@ components: type: string x-enum-varnames: - INCIDENT_ATTACHMENTS + IncidentCondition: + description: "Conditions that determine which Incidents trigger the workflow." + properties: + tagValues: + description: "Incident tags and values used to filter matching Incidents." + items: + $ref: "#/components/schemas/IncidentTagValue" + type: array + type: object IncidentConfigurationDataAttributesRequest: description: Attributes for creating an incident configuration. properties: @@ -48330,6 +48352,25 @@ components: required: - data type: object + IncidentCreatedTrigger: + description: "Trigger a workflow when an Incident is declared." + properties: + incidentType: + description: "The type of Incident that triggers the workflow." + type: string + tagCondition: + $ref: "#/components/schemas/IncidentCondition" + type: object + IncidentCreatedTriggerWrapper: + description: "Schema for an Incident Declared trigger." + properties: + incidentCreatedTrigger: + $ref: "#/components/schemas/IncidentCreatedTrigger" + startStepNames: + $ref: "#/components/schemas/StartStepNames" + required: + - incidentCreatedTrigger + type: object IncidentFieldAttributes: description: Dynamic fields for which selections can be made, with field names as keys. oneOf: @@ -49009,6 +49050,27 @@ components: required: - data type: object + IncidentImpactCreatedTrigger: + description: "Trigger a workflow when an impact is created for an Incident." + properties: + executionLimit: + $ref: "#/components/schemas/ExecutionLimit" + incidentType: + description: "The type of Incident that triggers the workflow." + type: string + tagCondition: + $ref: "#/components/schemas/IncidentCondition" + type: object + IncidentImpactCreatedTriggerWrapper: + description: "Schema for an Incident Impact Created trigger." + properties: + incidentImpactCreatedTrigger: + $ref: "#/components/schemas/IncidentImpactCreatedTrigger" + startStepNames: + $ref: "#/components/schemas/StartStepNames" + required: + - incidentImpactCreatedTrigger + type: object IncidentImpactFieldChoice: description: A choice option for a dropdown or multiselect impact field. properties: @@ -49307,6 +49369,27 @@ components: type: string x-enum-varnames: - INCIDENT_IMPACTS + IncidentImpactUpdatedTrigger: + description: "Trigger a workflow when an impact is updated for an Incident." + properties: + executionLimit: + $ref: "#/components/schemas/ExecutionLimit" + incidentType: + description: "The type of Incident that triggers the workflow." + type: string + tagCondition: + $ref: "#/components/schemas/IncidentCondition" + type: object + IncidentImpactUpdatedTriggerWrapper: + description: "Schema for an Incident Impact Updated trigger." + properties: + incidentImpactUpdatedTrigger: + $ref: "#/components/schemas/IncidentImpactUpdatedTrigger" + startStepNames: + $ref: "#/components/schemas/StartStepNames" + required: + - incidentImpactUpdatedTrigger + type: object IncidentImpactsResponse: description: Response with a list of incident impacts. properties: @@ -50528,6 +50611,27 @@ components: type: string x-enum-varnames: - INCIDENT_POSTMORTEMS + IncidentPostmortemUpdatedTrigger: + description: "Trigger a workflow when a postmortem is updated for an Incident." + properties: + executionLimit: + $ref: "#/components/schemas/ExecutionLimit" + incidentType: + description: "The type of Incident that triggers the workflow." + type: string + tagCondition: + $ref: "#/components/schemas/IncidentCondition" + type: object + IncidentPostmortemUpdatedTriggerWrapper: + description: "Schema for an Incident Postmortem Updated trigger." + properties: + incidentPostmortemUpdatedTrigger: + $ref: "#/components/schemas/IncidentPostmortemUpdatedTrigger" + startStepNames: + $ref: "#/components/schemas/StartStepNames" + required: + - incidentPostmortemUpdatedTrigger + type: object IncidentRelatedObject: description: Object related to an incident. enum: @@ -50558,6 +50662,27 @@ components: type: string x-enum-varnames: - INCIDENTS + IncidentResponderCreatedTrigger: + description: "Trigger a workflow when a responder is created for an Incident." + properties: + executionLimit: + $ref: "#/components/schemas/ExecutionLimit" + incidentType: + description: "The type of Incident that triggers the workflow." + type: string + tagCondition: + $ref: "#/components/schemas/IncidentCondition" + type: object + IncidentResponderCreatedTriggerWrapper: + description: "Schema for an Incident Responder Created trigger." + properties: + incidentResponderCreatedTrigger: + $ref: "#/components/schemas/IncidentResponderCreatedTrigger" + startStepNames: + $ref: "#/components/schemas/StartStepNames" + required: + - incidentResponderCreatedTrigger + type: object IncidentResponderDataAttributesResponse: description: Attributes of an incident responder in a response. properties: @@ -51311,6 +51436,55 @@ components: required: - data type: object + IncidentSavedTrigger: + description: "Trigger a workflow when an Incident is declared or updated." + properties: + executionLimit: + $ref: "#/components/schemas/ExecutionLimit" + incidentType: + description: "The type of Incident that triggers the workflow." + type: string + serialExecution: + $ref: "#/components/schemas/SerialExecution" + tagCondition: + $ref: "#/components/schemas/IncidentCondition" + type: object + IncidentSavedTriggerWrapper: + description: "Schema for an Incident Declared or Updated trigger." + properties: + incidentSavedTrigger: + $ref: "#/components/schemas/IncidentSavedTrigger" + startStepNames: + $ref: "#/components/schemas/StartStepNames" + required: + - incidentSavedTrigger + type: object + IncidentScheduleTrigger: + description: "Trigger a workflow on a schedule for an Incident." + properties: + incidentType: + description: "The type of Incident that triggers the workflow." + type: string + rrule: + description: "The recurrence rule for the schedule, expressed as an iCalendar `RRULE` string." + example: "DTSTART:20241220T151700Z\nRRULE:FREQ=MONTHLY" + minLength: 1 + type: string + tagCondition: + $ref: "#/components/schemas/IncidentCondition" + required: + - rrule + type: object + IncidentScheduleTriggerWrapper: + description: "Schema for an Incident Schedule trigger." + properties: + incidentScheduleTrigger: + $ref: "#/components/schemas/IncidentScheduleTrigger" + startStepNames: + $ref: "#/components/schemas/StartStepNames" + required: + - incidentScheduleTrigger + type: object IncidentSearchResponse: description: Response with incidents and facets. properties: @@ -51604,6 +51778,24 @@ components: - SEV_3 - SEV_4 - SEV_5 + IncidentTagValue: + description: "An Incident tag and its accepted values." + properties: + tag: + description: "The Incident tag to match." + example: "" + type: string + values: + description: "The accepted values for the Incident tag." + example: + - "" + items: + type: string + type: array + required: + - tag + - values + type: object IncidentTimelineCellCreateAttributes: description: The timeline cell's attributes for a create request. oneOf: @@ -52027,6 +52219,9 @@ components: properties: rateLimit: $ref: "#/components/schemas/TriggerRateLimit" + version: + description: "Version of the Incident Manual trigger." + type: string type: object IncidentTriggerWrapper: description: "Schema for an Incident-based trigger." @@ -103703,6 +103898,16 @@ components: - REPLACEMENT_STRING - PARTIAL_REPLACEMENT_FROM_BEGINNING - PARTIAL_REPLACEMENT_FROM_END + SerialExecution: + description: "Whether to execute the workflow serially for an Incident." + properties: + enabled: + description: "Whether serial execution is enabled." + example: false + type: boolean + required: + - enabled + type: object ServiceAccessToken: description: Datadog access token. properties: @@ -106786,12 +106991,38 @@ components: - channel_name - redirect_url type: object + SlackReactionConfig: + description: "Configuration for a Slack emoji reaction trigger." + properties: + reactionEmoji: + description: "The Slack emoji reaction name." + example: L + minLength: 1 + type: string + teamId: + description: "The Slack workspace ID." + example: L + minLength: 1 + type: string + required: + - teamId + - reactionEmoji + type: object + SlackTrigger: + description: "Trigger a workflow from Slack. The workflow must be published." + properties: + reactionTriggers: + description: "Slack emoji reactions that trigger the workflow." + items: + $ref: "#/components/schemas/SlackReactionConfig" + type: array + uniqueItems: true + type: object SlackTriggerWrapper: description: "Schema for a Slack-based trigger." properties: slackTrigger: - description: "Trigger a workflow from Slack. The workflow must be published." - type: object + $ref: "#/components/schemas/SlackTrigger" startStepNames: $ref: "#/components/schemas/StartStepNames" required: @@ -118679,6 +118910,13 @@ components: - $ref: "#/components/schemas/DashboardTriggerWrapper" - $ref: "#/components/schemas/FormTriggerWrapper" - $ref: "#/components/schemas/GithubWebhookTriggerWrapper" + - $ref: "#/components/schemas/IncidentCreatedTriggerWrapper" + - $ref: "#/components/schemas/IncidentImpactCreatedTriggerWrapper" + - $ref: "#/components/schemas/IncidentImpactUpdatedTriggerWrapper" + - $ref: "#/components/schemas/IncidentPostmortemUpdatedTriggerWrapper" + - $ref: "#/components/schemas/IncidentResponderCreatedTriggerWrapper" + - $ref: "#/components/schemas/IncidentSavedTriggerWrapper" + - $ref: "#/components/schemas/IncidentScheduleTriggerWrapper" - $ref: "#/components/schemas/IncidentTriggerWrapper" - $ref: "#/components/schemas/MonitorTriggerWrapper" - $ref: "#/components/schemas/NotebookTriggerWrapper" diff --git a/src/datadog_api_client/v2/model/execution_limit.py b/src/datadog_api_client/v2/model/execution_limit.py new file mode 100644 index 0000000000..e3f143f93f --- /dev/null +++ b/src/datadog_api_client/v2/model/execution_limit.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class ExecutionLimit(ModelNormal): + validations = { + "count": { + "inclusive_maximum": 9999, + "inclusive_minimum": 1, + }, + } + + @cached_property + def openapi_types(_): + return { + "count": (int,), + } + + attribute_map = { + "count": "count", + } + + def __init__(self_, count: int, **kwargs): + """ + The maximum number of times to execute a workflow for an Incident. + + :param count: The maximum number of workflow executions. + :type count: int + """ + super().__init__(kwargs) + + self_.count = count diff --git a/src/datadog_api_client/v2/model/incident_condition.py b/src/datadog_api_client/v2/model/incident_condition.py new file mode 100644 index 0000000000..e1e47aed92 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_condition.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_tag_value import IncidentTagValue + + +class IncidentCondition(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_tag_value import IncidentTagValue + + return { + "tag_values": ([IncidentTagValue],), + } + + attribute_map = { + "tag_values": "tagValues", + } + + def __init__(self_, tag_values: Union[List[IncidentTagValue], UnsetType] = unset, **kwargs): + """ + Conditions that determine which Incidents trigger the workflow. + + :param tag_values: Incident tags and values used to filter matching Incidents. + :type tag_values: [IncidentTagValue], optional + """ + if tag_values is not unset: + kwargs["tag_values"] = tag_values + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/incident_created_trigger.py b/src/datadog_api_client/v2/model/incident_created_trigger.py new file mode 100644 index 0000000000..daff73c558 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_created_trigger.py @@ -0,0 +1,54 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_condition import IncidentCondition + + +class IncidentCreatedTrigger(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_condition import IncidentCondition + + return { + "incident_type": (str,), + "tag_condition": (IncidentCondition,), + } + + attribute_map = { + "incident_type": "incidentType", + "tag_condition": "tagCondition", + } + + def __init__( + self_, + incident_type: Union[str, UnsetType] = unset, + tag_condition: Union[IncidentCondition, UnsetType] = unset, + **kwargs, + ): + """ + Trigger a workflow when an Incident is declared. + + :param incident_type: The type of Incident that triggers the workflow. + :type incident_type: str, optional + + :param tag_condition: Conditions that determine which Incidents trigger the workflow. + :type tag_condition: IncidentCondition, optional + """ + if incident_type is not unset: + kwargs["incident_type"] = incident_type + if tag_condition is not unset: + kwargs["tag_condition"] = tag_condition + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/incident_created_trigger_wrapper.py b/src/datadog_api_client/v2/model/incident_created_trigger_wrapper.py new file mode 100644 index 0000000000..69de54922c --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_created_trigger_wrapper.py @@ -0,0 +1,54 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_created_trigger import IncidentCreatedTrigger + + +class IncidentCreatedTriggerWrapper(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_created_trigger import IncidentCreatedTrigger + + return { + "incident_created_trigger": (IncidentCreatedTrigger,), + "start_step_names": ([str],), + } + + attribute_map = { + "incident_created_trigger": "incidentCreatedTrigger", + "start_step_names": "startStepNames", + } + + def __init__( + self_, + incident_created_trigger: IncidentCreatedTrigger, + start_step_names: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Schema for an Incident Declared trigger. + + :param incident_created_trigger: Trigger a workflow when an Incident is declared. + :type incident_created_trigger: IncidentCreatedTrigger + + :param start_step_names: Names of existing workflow steps that run first after a trigger fires. + :type start_step_names: [str], optional + """ + if start_step_names is not unset: + kwargs["start_step_names"] = start_step_names + super().__init__(kwargs) + + self_.incident_created_trigger = incident_created_trigger diff --git a/src/datadog_api_client/v2/model/incident_impact_created_trigger.py b/src/datadog_api_client/v2/model/incident_impact_created_trigger.py new file mode 100644 index 0000000000..049adc63df --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_impact_created_trigger.py @@ -0,0 +1,64 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.execution_limit import ExecutionLimit + from datadog_api_client.v2.model.incident_condition import IncidentCondition + + +class IncidentImpactCreatedTrigger(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.execution_limit import ExecutionLimit + from datadog_api_client.v2.model.incident_condition import IncidentCondition + + return { + "execution_limit": (ExecutionLimit,), + "incident_type": (str,), + "tag_condition": (IncidentCondition,), + } + + attribute_map = { + "execution_limit": "executionLimit", + "incident_type": "incidentType", + "tag_condition": "tagCondition", + } + + def __init__( + self_, + execution_limit: Union[ExecutionLimit, UnsetType] = unset, + incident_type: Union[str, UnsetType] = unset, + tag_condition: Union[IncidentCondition, UnsetType] = unset, + **kwargs, + ): + """ + Trigger a workflow when an impact is created for an Incident. + + :param execution_limit: The maximum number of times to execute a workflow for an Incident. + :type execution_limit: ExecutionLimit, optional + + :param incident_type: The type of Incident that triggers the workflow. + :type incident_type: str, optional + + :param tag_condition: Conditions that determine which Incidents trigger the workflow. + :type tag_condition: IncidentCondition, optional + """ + if execution_limit is not unset: + kwargs["execution_limit"] = execution_limit + if incident_type is not unset: + kwargs["incident_type"] = incident_type + if tag_condition is not unset: + kwargs["tag_condition"] = tag_condition + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/incident_impact_created_trigger_wrapper.py b/src/datadog_api_client/v2/model/incident_impact_created_trigger_wrapper.py new file mode 100644 index 0000000000..fd60f349f3 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_impact_created_trigger_wrapper.py @@ -0,0 +1,54 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_impact_created_trigger import IncidentImpactCreatedTrigger + + +class IncidentImpactCreatedTriggerWrapper(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_impact_created_trigger import IncidentImpactCreatedTrigger + + return { + "incident_impact_created_trigger": (IncidentImpactCreatedTrigger,), + "start_step_names": ([str],), + } + + attribute_map = { + "incident_impact_created_trigger": "incidentImpactCreatedTrigger", + "start_step_names": "startStepNames", + } + + def __init__( + self_, + incident_impact_created_trigger: IncidentImpactCreatedTrigger, + start_step_names: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Schema for an Incident Impact Created trigger. + + :param incident_impact_created_trigger: Trigger a workflow when an impact is created for an Incident. + :type incident_impact_created_trigger: IncidentImpactCreatedTrigger + + :param start_step_names: Names of existing workflow steps that run first after a trigger fires. + :type start_step_names: [str], optional + """ + if start_step_names is not unset: + kwargs["start_step_names"] = start_step_names + super().__init__(kwargs) + + self_.incident_impact_created_trigger = incident_impact_created_trigger diff --git a/src/datadog_api_client/v2/model/incident_impact_updated_trigger.py b/src/datadog_api_client/v2/model/incident_impact_updated_trigger.py new file mode 100644 index 0000000000..6b1ad93e22 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_impact_updated_trigger.py @@ -0,0 +1,64 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.execution_limit import ExecutionLimit + from datadog_api_client.v2.model.incident_condition import IncidentCondition + + +class IncidentImpactUpdatedTrigger(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.execution_limit import ExecutionLimit + from datadog_api_client.v2.model.incident_condition import IncidentCondition + + return { + "execution_limit": (ExecutionLimit,), + "incident_type": (str,), + "tag_condition": (IncidentCondition,), + } + + attribute_map = { + "execution_limit": "executionLimit", + "incident_type": "incidentType", + "tag_condition": "tagCondition", + } + + def __init__( + self_, + execution_limit: Union[ExecutionLimit, UnsetType] = unset, + incident_type: Union[str, UnsetType] = unset, + tag_condition: Union[IncidentCondition, UnsetType] = unset, + **kwargs, + ): + """ + Trigger a workflow when an impact is updated for an Incident. + + :param execution_limit: The maximum number of times to execute a workflow for an Incident. + :type execution_limit: ExecutionLimit, optional + + :param incident_type: The type of Incident that triggers the workflow. + :type incident_type: str, optional + + :param tag_condition: Conditions that determine which Incidents trigger the workflow. + :type tag_condition: IncidentCondition, optional + """ + if execution_limit is not unset: + kwargs["execution_limit"] = execution_limit + if incident_type is not unset: + kwargs["incident_type"] = incident_type + if tag_condition is not unset: + kwargs["tag_condition"] = tag_condition + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/incident_impact_updated_trigger_wrapper.py b/src/datadog_api_client/v2/model/incident_impact_updated_trigger_wrapper.py new file mode 100644 index 0000000000..58d087bc13 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_impact_updated_trigger_wrapper.py @@ -0,0 +1,54 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_impact_updated_trigger import IncidentImpactUpdatedTrigger + + +class IncidentImpactUpdatedTriggerWrapper(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_impact_updated_trigger import IncidentImpactUpdatedTrigger + + return { + "incident_impact_updated_trigger": (IncidentImpactUpdatedTrigger,), + "start_step_names": ([str],), + } + + attribute_map = { + "incident_impact_updated_trigger": "incidentImpactUpdatedTrigger", + "start_step_names": "startStepNames", + } + + def __init__( + self_, + incident_impact_updated_trigger: IncidentImpactUpdatedTrigger, + start_step_names: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Schema for an Incident Impact Updated trigger. + + :param incident_impact_updated_trigger: Trigger a workflow when an impact is updated for an Incident. + :type incident_impact_updated_trigger: IncidentImpactUpdatedTrigger + + :param start_step_names: Names of existing workflow steps that run first after a trigger fires. + :type start_step_names: [str], optional + """ + if start_step_names is not unset: + kwargs["start_step_names"] = start_step_names + super().__init__(kwargs) + + self_.incident_impact_updated_trigger = incident_impact_updated_trigger diff --git a/src/datadog_api_client/v2/model/incident_postmortem_updated_trigger.py b/src/datadog_api_client/v2/model/incident_postmortem_updated_trigger.py new file mode 100644 index 0000000000..1f53085dbc --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_postmortem_updated_trigger.py @@ -0,0 +1,64 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.execution_limit import ExecutionLimit + from datadog_api_client.v2.model.incident_condition import IncidentCondition + + +class IncidentPostmortemUpdatedTrigger(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.execution_limit import ExecutionLimit + from datadog_api_client.v2.model.incident_condition import IncidentCondition + + return { + "execution_limit": (ExecutionLimit,), + "incident_type": (str,), + "tag_condition": (IncidentCondition,), + } + + attribute_map = { + "execution_limit": "executionLimit", + "incident_type": "incidentType", + "tag_condition": "tagCondition", + } + + def __init__( + self_, + execution_limit: Union[ExecutionLimit, UnsetType] = unset, + incident_type: Union[str, UnsetType] = unset, + tag_condition: Union[IncidentCondition, UnsetType] = unset, + **kwargs, + ): + """ + Trigger a workflow when a postmortem is updated for an Incident. + + :param execution_limit: The maximum number of times to execute a workflow for an Incident. + :type execution_limit: ExecutionLimit, optional + + :param incident_type: The type of Incident that triggers the workflow. + :type incident_type: str, optional + + :param tag_condition: Conditions that determine which Incidents trigger the workflow. + :type tag_condition: IncidentCondition, optional + """ + if execution_limit is not unset: + kwargs["execution_limit"] = execution_limit + if incident_type is not unset: + kwargs["incident_type"] = incident_type + if tag_condition is not unset: + kwargs["tag_condition"] = tag_condition + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/incident_postmortem_updated_trigger_wrapper.py b/src/datadog_api_client/v2/model/incident_postmortem_updated_trigger_wrapper.py new file mode 100644 index 0000000000..759c3d1bc5 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_postmortem_updated_trigger_wrapper.py @@ -0,0 +1,54 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_postmortem_updated_trigger import IncidentPostmortemUpdatedTrigger + + +class IncidentPostmortemUpdatedTriggerWrapper(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_postmortem_updated_trigger import IncidentPostmortemUpdatedTrigger + + return { + "incident_postmortem_updated_trigger": (IncidentPostmortemUpdatedTrigger,), + "start_step_names": ([str],), + } + + attribute_map = { + "incident_postmortem_updated_trigger": "incidentPostmortemUpdatedTrigger", + "start_step_names": "startStepNames", + } + + def __init__( + self_, + incident_postmortem_updated_trigger: IncidentPostmortemUpdatedTrigger, + start_step_names: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Schema for an Incident Postmortem Updated trigger. + + :param incident_postmortem_updated_trigger: Trigger a workflow when a postmortem is updated for an Incident. + :type incident_postmortem_updated_trigger: IncidentPostmortemUpdatedTrigger + + :param start_step_names: Names of existing workflow steps that run first after a trigger fires. + :type start_step_names: [str], optional + """ + if start_step_names is not unset: + kwargs["start_step_names"] = start_step_names + super().__init__(kwargs) + + self_.incident_postmortem_updated_trigger = incident_postmortem_updated_trigger diff --git a/src/datadog_api_client/v2/model/incident_responder_created_trigger.py b/src/datadog_api_client/v2/model/incident_responder_created_trigger.py new file mode 100644 index 0000000000..46323a4d49 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_responder_created_trigger.py @@ -0,0 +1,64 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.execution_limit import ExecutionLimit + from datadog_api_client.v2.model.incident_condition import IncidentCondition + + +class IncidentResponderCreatedTrigger(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.execution_limit import ExecutionLimit + from datadog_api_client.v2.model.incident_condition import IncidentCondition + + return { + "execution_limit": (ExecutionLimit,), + "incident_type": (str,), + "tag_condition": (IncidentCondition,), + } + + attribute_map = { + "execution_limit": "executionLimit", + "incident_type": "incidentType", + "tag_condition": "tagCondition", + } + + def __init__( + self_, + execution_limit: Union[ExecutionLimit, UnsetType] = unset, + incident_type: Union[str, UnsetType] = unset, + tag_condition: Union[IncidentCondition, UnsetType] = unset, + **kwargs, + ): + """ + Trigger a workflow when a responder is created for an Incident. + + :param execution_limit: The maximum number of times to execute a workflow for an Incident. + :type execution_limit: ExecutionLimit, optional + + :param incident_type: The type of Incident that triggers the workflow. + :type incident_type: str, optional + + :param tag_condition: Conditions that determine which Incidents trigger the workflow. + :type tag_condition: IncidentCondition, optional + """ + if execution_limit is not unset: + kwargs["execution_limit"] = execution_limit + if incident_type is not unset: + kwargs["incident_type"] = incident_type + if tag_condition is not unset: + kwargs["tag_condition"] = tag_condition + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/incident_responder_created_trigger_wrapper.py b/src/datadog_api_client/v2/model/incident_responder_created_trigger_wrapper.py new file mode 100644 index 0000000000..3d46940c5c --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_responder_created_trigger_wrapper.py @@ -0,0 +1,54 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_responder_created_trigger import IncidentResponderCreatedTrigger + + +class IncidentResponderCreatedTriggerWrapper(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_responder_created_trigger import IncidentResponderCreatedTrigger + + return { + "incident_responder_created_trigger": (IncidentResponderCreatedTrigger,), + "start_step_names": ([str],), + } + + attribute_map = { + "incident_responder_created_trigger": "incidentResponderCreatedTrigger", + "start_step_names": "startStepNames", + } + + def __init__( + self_, + incident_responder_created_trigger: IncidentResponderCreatedTrigger, + start_step_names: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Schema for an Incident Responder Created trigger. + + :param incident_responder_created_trigger: Trigger a workflow when a responder is created for an Incident. + :type incident_responder_created_trigger: IncidentResponderCreatedTrigger + + :param start_step_names: Names of existing workflow steps that run first after a trigger fires. + :type start_step_names: [str], optional + """ + if start_step_names is not unset: + kwargs["start_step_names"] = start_step_names + super().__init__(kwargs) + + self_.incident_responder_created_trigger = incident_responder_created_trigger diff --git a/src/datadog_api_client/v2/model/incident_saved_trigger.py b/src/datadog_api_client/v2/model/incident_saved_trigger.py new file mode 100644 index 0000000000..839a94a300 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_saved_trigger.py @@ -0,0 +1,74 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.execution_limit import ExecutionLimit + from datadog_api_client.v2.model.serial_execution import SerialExecution + from datadog_api_client.v2.model.incident_condition import IncidentCondition + + +class IncidentSavedTrigger(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.execution_limit import ExecutionLimit + from datadog_api_client.v2.model.serial_execution import SerialExecution + from datadog_api_client.v2.model.incident_condition import IncidentCondition + + return { + "execution_limit": (ExecutionLimit,), + "incident_type": (str,), + "serial_execution": (SerialExecution,), + "tag_condition": (IncidentCondition,), + } + + attribute_map = { + "execution_limit": "executionLimit", + "incident_type": "incidentType", + "serial_execution": "serialExecution", + "tag_condition": "tagCondition", + } + + def __init__( + self_, + execution_limit: Union[ExecutionLimit, UnsetType] = unset, + incident_type: Union[str, UnsetType] = unset, + serial_execution: Union[SerialExecution, UnsetType] = unset, + tag_condition: Union[IncidentCondition, UnsetType] = unset, + **kwargs, + ): + """ + Trigger a workflow when an Incident is declared or updated. + + :param execution_limit: The maximum number of times to execute a workflow for an Incident. + :type execution_limit: ExecutionLimit, optional + + :param incident_type: The type of Incident that triggers the workflow. + :type incident_type: str, optional + + :param serial_execution: Whether to execute the workflow serially for an Incident. + :type serial_execution: SerialExecution, optional + + :param tag_condition: Conditions that determine which Incidents trigger the workflow. + :type tag_condition: IncidentCondition, optional + """ + if execution_limit is not unset: + kwargs["execution_limit"] = execution_limit + if incident_type is not unset: + kwargs["incident_type"] = incident_type + if serial_execution is not unset: + kwargs["serial_execution"] = serial_execution + if tag_condition is not unset: + kwargs["tag_condition"] = tag_condition + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/incident_saved_trigger_wrapper.py b/src/datadog_api_client/v2/model/incident_saved_trigger_wrapper.py new file mode 100644 index 0000000000..a1c29fa5de --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_saved_trigger_wrapper.py @@ -0,0 +1,54 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_saved_trigger import IncidentSavedTrigger + + +class IncidentSavedTriggerWrapper(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_saved_trigger import IncidentSavedTrigger + + return { + "incident_saved_trigger": (IncidentSavedTrigger,), + "start_step_names": ([str],), + } + + attribute_map = { + "incident_saved_trigger": "incidentSavedTrigger", + "start_step_names": "startStepNames", + } + + def __init__( + self_, + incident_saved_trigger: IncidentSavedTrigger, + start_step_names: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Schema for an Incident Declared or Updated trigger. + + :param incident_saved_trigger: Trigger a workflow when an Incident is declared or updated. + :type incident_saved_trigger: IncidentSavedTrigger + + :param start_step_names: Names of existing workflow steps that run first after a trigger fires. + :type start_step_names: [str], optional + """ + if start_step_names is not unset: + kwargs["start_step_names"] = start_step_names + super().__init__(kwargs) + + self_.incident_saved_trigger = incident_saved_trigger diff --git a/src/datadog_api_client/v2/model/incident_schedule_trigger.py b/src/datadog_api_client/v2/model/incident_schedule_trigger.py new file mode 100644 index 0000000000..144d70d235 --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_schedule_trigger.py @@ -0,0 +1,68 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_condition import IncidentCondition + + +class IncidentScheduleTrigger(ModelNormal): + validations = { + "rrule": { + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_condition import IncidentCondition + + return { + "incident_type": (str,), + "rrule": (str,), + "tag_condition": (IncidentCondition,), + } + + attribute_map = { + "incident_type": "incidentType", + "rrule": "rrule", + "tag_condition": "tagCondition", + } + + def __init__( + self_, + rrule: str, + incident_type: Union[str, UnsetType] = unset, + tag_condition: Union[IncidentCondition, UnsetType] = unset, + **kwargs, + ): + """ + Trigger a workflow on a schedule for an Incident. + + :param incident_type: The type of Incident that triggers the workflow. + :type incident_type: str, optional + + :param rrule: The recurrence rule for the schedule, expressed as an iCalendar ``RRULE`` string. + :type rrule: str + + :param tag_condition: Conditions that determine which Incidents trigger the workflow. + :type tag_condition: IncidentCondition, optional + """ + if incident_type is not unset: + kwargs["incident_type"] = incident_type + if tag_condition is not unset: + kwargs["tag_condition"] = tag_condition + super().__init__(kwargs) + + self_.rrule = rrule diff --git a/src/datadog_api_client/v2/model/incident_schedule_trigger_wrapper.py b/src/datadog_api_client/v2/model/incident_schedule_trigger_wrapper.py new file mode 100644 index 0000000000..03f516ae6d --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_schedule_trigger_wrapper.py @@ -0,0 +1,54 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.incident_schedule_trigger import IncidentScheduleTrigger + + +class IncidentScheduleTriggerWrapper(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.incident_schedule_trigger import IncidentScheduleTrigger + + return { + "incident_schedule_trigger": (IncidentScheduleTrigger,), + "start_step_names": ([str],), + } + + attribute_map = { + "incident_schedule_trigger": "incidentScheduleTrigger", + "start_step_names": "startStepNames", + } + + def __init__( + self_, + incident_schedule_trigger: IncidentScheduleTrigger, + start_step_names: Union[List[str], UnsetType] = unset, + **kwargs, + ): + """ + Schema for an Incident Schedule trigger. + + :param incident_schedule_trigger: Trigger a workflow on a schedule for an Incident. + :type incident_schedule_trigger: IncidentScheduleTrigger + + :param start_step_names: Names of existing workflow steps that run first after a trigger fires. + :type start_step_names: [str], optional + """ + if start_step_names is not unset: + kwargs["start_step_names"] = start_step_names + super().__init__(kwargs) + + self_.incident_schedule_trigger = incident_schedule_trigger diff --git a/src/datadog_api_client/v2/model/incident_tag_value.py b/src/datadog_api_client/v2/model/incident_tag_value.py new file mode 100644 index 0000000000..5294fd523e --- /dev/null +++ b/src/datadog_api_client/v2/model/incident_tag_value.py @@ -0,0 +1,40 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class IncidentTagValue(ModelNormal): + @cached_property + def openapi_types(_): + return { + "tag": (str,), + "values": ([str],), + } + + attribute_map = { + "tag": "tag", + "values": "values", + } + + def __init__(self_, tag: str, values: List[str], **kwargs): + """ + An Incident tag and its accepted values. + + :param tag: The Incident tag to match. + :type tag: str + + :param values: The accepted values for the Incident tag. + :type values: [str] + """ + super().__init__(kwargs) + + self_.tag = tag + self_.values = values diff --git a/src/datadog_api_client/v2/model/incident_trigger.py b/src/datadog_api_client/v2/model/incident_trigger.py index 3c523cdd59..b56a9ec373 100644 --- a/src/datadog_api_client/v2/model/incident_trigger.py +++ b/src/datadog_api_client/v2/model/incident_trigger.py @@ -24,19 +24,28 @@ def openapi_types(_): return { "rate_limit": (TriggerRateLimit,), + "version": (str,), } attribute_map = { "rate_limit": "rateLimit", + "version": "version", } - def __init__(self_, rate_limit: Union[TriggerRateLimit, UnsetType] = unset, **kwargs): + def __init__( + self_, rate_limit: Union[TriggerRateLimit, UnsetType] = unset, version: Union[str, UnsetType] = unset, **kwargs + ): """ Trigger a workflow from an Incident. For automatic triggering a handle must be configured and the workflow must be published. :param rate_limit: Defines a rate limit for a trigger. :type rate_limit: TriggerRateLimit, optional + + :param version: Version of the Incident Manual trigger. + :type version: str, optional """ if rate_limit is not unset: kwargs["rate_limit"] = rate_limit + if version is not unset: + kwargs["version"] = version super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/serial_execution.py b/src/datadog_api_client/v2/model/serial_execution.py new file mode 100644 index 0000000000..b31bfec47e --- /dev/null +++ b/src/datadog_api_client/v2/model/serial_execution.py @@ -0,0 +1,33 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class SerialExecution(ModelNormal): + @cached_property + def openapi_types(_): + return { + "enabled": (bool,), + } + + attribute_map = { + "enabled": "enabled", + } + + def __init__(self_, enabled: bool, **kwargs): + """ + Whether to execute the workflow serially for an Incident. + + :param enabled: Whether serial execution is enabled. + :type enabled: bool + """ + super().__init__(kwargs) + + self_.enabled = enabled diff --git a/src/datadog_api_client/v2/model/slack_reaction_config.py b/src/datadog_api_client/v2/model/slack_reaction_config.py new file mode 100644 index 0000000000..43bf68d6a1 --- /dev/null +++ b/src/datadog_api_client/v2/model/slack_reaction_config.py @@ -0,0 +1,48 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, +) + + +class SlackReactionConfig(ModelNormal): + validations = { + "reaction_emoji": { + "min_length": 1, + }, + "team_id": { + "min_length": 1, + }, + } + + @cached_property + def openapi_types(_): + return { + "reaction_emoji": (str,), + "team_id": (str,), + } + + attribute_map = { + "reaction_emoji": "reactionEmoji", + "team_id": "teamId", + } + + def __init__(self_, reaction_emoji: str, team_id: str, **kwargs): + """ + Configuration for a Slack emoji reaction trigger. + + :param reaction_emoji: The Slack emoji reaction name. + :type reaction_emoji: str + + :param team_id: The Slack workspace ID. + :type team_id: str + """ + super().__init__(kwargs) + + self_.reaction_emoji = reaction_emoji + self_.team_id = team_id diff --git a/src/datadog_api_client/v2/model/slack_trigger.py b/src/datadog_api_client/v2/model/slack_trigger.py new file mode 100644 index 0000000000..b4b193135c --- /dev/null +++ b/src/datadog_api_client/v2/model/slack_trigger.py @@ -0,0 +1,42 @@ +# 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 2019-Present Datadog, Inc. +from __future__ import annotations + +from typing import List, Union, TYPE_CHECKING + +from datadog_api_client.model_utils import ( + ModelNormal, + cached_property, + unset, + UnsetType, +) + + +if TYPE_CHECKING: + from datadog_api_client.v2.model.slack_reaction_config import SlackReactionConfig + + +class SlackTrigger(ModelNormal): + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.slack_reaction_config import SlackReactionConfig + + return { + "reaction_triggers": ([SlackReactionConfig],), + } + + attribute_map = { + "reaction_triggers": "reactionTriggers", + } + + def __init__(self_, reaction_triggers: Union[List[SlackReactionConfig], UnsetType] = unset, **kwargs): + """ + Trigger a workflow from Slack. The workflow must be published. + + :param reaction_triggers: Slack emoji reactions that trigger the workflow. + :type reaction_triggers: [SlackReactionConfig], optional + """ + if reaction_triggers is not unset: + kwargs["reaction_triggers"] = reaction_triggers + super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/model/slack_trigger_wrapper.py b/src/datadog_api_client/v2/model/slack_trigger_wrapper.py index a1e2531b3d..bffcfffa7c 100644 --- a/src/datadog_api_client/v2/model/slack_trigger_wrapper.py +++ b/src/datadog_api_client/v2/model/slack_trigger_wrapper.py @@ -3,7 +3,7 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import List, Union +from typing import List, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, @@ -13,11 +13,17 @@ ) +if TYPE_CHECKING: + from datadog_api_client.v2.model.slack_trigger import SlackTrigger + + class SlackTriggerWrapper(ModelNormal): @cached_property def openapi_types(_): + from datadog_api_client.v2.model.slack_trigger import SlackTrigger + return { - "slack_trigger": (dict,), + "slack_trigger": (SlackTrigger,), "start_step_names": ([str],), } @@ -26,12 +32,12 @@ def openapi_types(_): "start_step_names": "startStepNames", } - def __init__(self_, slack_trigger: dict, start_step_names: Union[List[str], UnsetType] = unset, **kwargs): + def __init__(self_, slack_trigger: SlackTrigger, start_step_names: Union[List[str], UnsetType] = unset, **kwargs): """ Schema for a Slack-based trigger. :param slack_trigger: Trigger a workflow from Slack. The workflow must be published. - :type slack_trigger: dict + :type slack_trigger: SlackTrigger :param start_step_names: Names of existing workflow steps that run first after a trigger fires. :type start_step_names: [str], optional diff --git a/src/datadog_api_client/v2/model/spec.py b/src/datadog_api_client/v2/model/spec.py index 285394a3f7..d83832c9c1 100644 --- a/src/datadog_api_client/v2/model/spec.py +++ b/src/datadog_api_client/v2/model/spec.py @@ -30,6 +30,17 @@ from datadog_api_client.v2.model.dashboard_trigger_wrapper import DashboardTriggerWrapper from datadog_api_client.v2.model.form_trigger_wrapper import FormTriggerWrapper from datadog_api_client.v2.model.github_webhook_trigger_wrapper import GithubWebhookTriggerWrapper + from datadog_api_client.v2.model.incident_created_trigger_wrapper import IncidentCreatedTriggerWrapper + from datadog_api_client.v2.model.incident_impact_created_trigger_wrapper import IncidentImpactCreatedTriggerWrapper + from datadog_api_client.v2.model.incident_impact_updated_trigger_wrapper import IncidentImpactUpdatedTriggerWrapper + from datadog_api_client.v2.model.incident_postmortem_updated_trigger_wrapper import ( + IncidentPostmortemUpdatedTriggerWrapper, + ) + from datadog_api_client.v2.model.incident_responder_created_trigger_wrapper import ( + IncidentResponderCreatedTriggerWrapper, + ) + from datadog_api_client.v2.model.incident_saved_trigger_wrapper import IncidentSavedTriggerWrapper + from datadog_api_client.v2.model.incident_schedule_trigger_wrapper import IncidentScheduleTriggerWrapper from datadog_api_client.v2.model.incident_trigger_wrapper import IncidentTriggerWrapper from datadog_api_client.v2.model.monitor_trigger_wrapper import MonitorTriggerWrapper from datadog_api_client.v2.model.notebook_trigger_wrapper import NotebookTriggerWrapper @@ -100,6 +111,13 @@ def __init__( DashboardTriggerWrapper, FormTriggerWrapper, GithubWebhookTriggerWrapper, + IncidentCreatedTriggerWrapper, + IncidentImpactCreatedTriggerWrapper, + IncidentImpactUpdatedTriggerWrapper, + IncidentPostmortemUpdatedTriggerWrapper, + IncidentResponderCreatedTriggerWrapper, + IncidentSavedTriggerWrapper, + IncidentScheduleTriggerWrapper, IncidentTriggerWrapper, MonitorTriggerWrapper, NotebookTriggerWrapper, diff --git a/src/datadog_api_client/v2/model/trigger.py b/src/datadog_api_client/v2/model/trigger.py index 01cff86475..be5dc7699a 100644 --- a/src/datadog_api_client/v2/model/trigger.py +++ b/src/datadog_api_client/v2/model/trigger.py @@ -48,6 +48,27 @@ def __init__(self, **kwargs): :param github_webhook_trigger: Trigger a workflow from a GitHub webhook. To trigger a workflow from GitHub, you must set a `webhookSecret`. In your GitHub Webhook Settings, set the Payload URL to "base_url"/api/v2/workflows/"workflow_id"/webhook?orgId="org_id", select application/json for the content type, and be highly recommend enabling SSL verification for security. The workflow must be published. :type github_webhook_trigger: GithubWebhookTrigger + :param incident_created_trigger: Trigger a workflow when an Incident is declared. + :type incident_created_trigger: IncidentCreatedTrigger + + :param incident_impact_created_trigger: Trigger a workflow when an impact is created for an Incident. + :type incident_impact_created_trigger: IncidentImpactCreatedTrigger + + :param incident_impact_updated_trigger: Trigger a workflow when an impact is updated for an Incident. + :type incident_impact_updated_trigger: IncidentImpactUpdatedTrigger + + :param incident_postmortem_updated_trigger: Trigger a workflow when a postmortem is updated for an Incident. + :type incident_postmortem_updated_trigger: IncidentPostmortemUpdatedTrigger + + :param incident_responder_created_trigger: Trigger a workflow when a responder is created for an Incident. + :type incident_responder_created_trigger: IncidentResponderCreatedTrigger + + :param incident_saved_trigger: Trigger a workflow when an Incident is declared or updated. + :type incident_saved_trigger: IncidentSavedTrigger + + :param incident_schedule_trigger: Trigger a workflow on a schedule for an Incident. + :type incident_schedule_trigger: IncidentScheduleTrigger + :param incident_trigger: Trigger a workflow from an Incident. For automatic triggering a handle must be configured and the workflow must be published. :type incident_trigger: IncidentTrigger @@ -70,7 +91,7 @@ def __init__(self, **kwargs): :type self_service_trigger: dict :param slack_trigger: Trigger a workflow from Slack. The workflow must be published. - :type slack_trigger: dict + :type slack_trigger: SlackTrigger :param software_catalog_trigger: Trigger a workflow from Software Catalog. :type software_catalog_trigger: dict @@ -99,6 +120,21 @@ def _composed_schemas(_): from datadog_api_client.v2.model.dashboard_trigger_wrapper import DashboardTriggerWrapper from datadog_api_client.v2.model.form_trigger_wrapper import FormTriggerWrapper from datadog_api_client.v2.model.github_webhook_trigger_wrapper import GithubWebhookTriggerWrapper + from datadog_api_client.v2.model.incident_created_trigger_wrapper import IncidentCreatedTriggerWrapper + from datadog_api_client.v2.model.incident_impact_created_trigger_wrapper import ( + IncidentImpactCreatedTriggerWrapper, + ) + from datadog_api_client.v2.model.incident_impact_updated_trigger_wrapper import ( + IncidentImpactUpdatedTriggerWrapper, + ) + from datadog_api_client.v2.model.incident_postmortem_updated_trigger_wrapper import ( + IncidentPostmortemUpdatedTriggerWrapper, + ) + from datadog_api_client.v2.model.incident_responder_created_trigger_wrapper import ( + IncidentResponderCreatedTriggerWrapper, + ) + from datadog_api_client.v2.model.incident_saved_trigger_wrapper import IncidentSavedTriggerWrapper + from datadog_api_client.v2.model.incident_schedule_trigger_wrapper import IncidentScheduleTriggerWrapper from datadog_api_client.v2.model.incident_trigger_wrapper import IncidentTriggerWrapper from datadog_api_client.v2.model.monitor_trigger_wrapper import MonitorTriggerWrapper from datadog_api_client.v2.model.notebook_trigger_wrapper import NotebookTriggerWrapper @@ -122,6 +158,13 @@ def _composed_schemas(_): DashboardTriggerWrapper, FormTriggerWrapper, GithubWebhookTriggerWrapper, + IncidentCreatedTriggerWrapper, + IncidentImpactCreatedTriggerWrapper, + IncidentImpactUpdatedTriggerWrapper, + IncidentPostmortemUpdatedTriggerWrapper, + IncidentResponderCreatedTriggerWrapper, + IncidentSavedTriggerWrapper, + IncidentScheduleTriggerWrapper, IncidentTriggerWrapper, MonitorTriggerWrapper, NotebookTriggerWrapper, diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index f88afdca91..592dde8e4e 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -3035,6 +3035,7 @@ from datadog_api_client.v2.model.events_sort_type import EventsSortType from datadog_api_client.v2.model.events_timeseries_query import EventsTimeseriesQuery from datadog_api_client.v2.model.events_warning import EventsWarning +from datadog_api_client.v2.model.execution_limit import ExecutionLimit from datadog_api_client.v2.model.execution_policy_action_pattern import ExecutionPolicyActionPattern from datadog_api_client.v2.model.execution_policy_attributes import ExecutionPolicyAttributes from datadog_api_client.v2.model.execution_policy_create_request import ExecutionPolicyCreateRequest @@ -3758,6 +3759,7 @@ from datadog_api_client.v2.model.incident_ai_postmortem_response import IncidentAIPostmortemResponse from datadog_api_client.v2.model.incident_ai_postmortem_response_type import IncidentAIPostmortemResponseType from datadog_api_client.v2.model.incident_attachment_type import IncidentAttachmentType +from datadog_api_client.v2.model.incident_condition import IncidentCondition from datadog_api_client.v2.model.incident_configuration_data_attributes_request import ( IncidentConfigurationDataAttributesRequest, ) @@ -3792,6 +3794,8 @@ from datadog_api_client.v2.model.incident_create_page_from_incident_type import IncidentCreatePageFromIncidentType from datadog_api_client.v2.model.incident_create_relationships import IncidentCreateRelationships from datadog_api_client.v2.model.incident_create_request import IncidentCreateRequest +from datadog_api_client.v2.model.incident_created_trigger import IncidentCreatedTrigger +from datadog_api_client.v2.model.incident_created_trigger_wrapper import IncidentCreatedTriggerWrapper from datadog_api_client.v2.model.incident_field_attributes import IncidentFieldAttributes from datadog_api_client.v2.model.incident_field_attributes_multiple_value import IncidentFieldAttributesMultipleValue from datadog_api_client.v2.model.incident_field_attributes_single_value import IncidentFieldAttributesSingleValue @@ -3885,6 +3889,8 @@ from datadog_api_client.v2.model.incident_impact_create_attributes import IncidentImpactCreateAttributes from datadog_api_client.v2.model.incident_impact_create_data import IncidentImpactCreateData from datadog_api_client.v2.model.incident_impact_create_request import IncidentImpactCreateRequest +from datadog_api_client.v2.model.incident_impact_created_trigger import IncidentImpactCreatedTrigger +from datadog_api_client.v2.model.incident_impact_created_trigger_wrapper import IncidentImpactCreatedTriggerWrapper from datadog_api_client.v2.model.incident_impact_field_choice import IncidentImpactFieldChoice from datadog_api_client.v2.model.incident_impact_field_data_attributes_request import ( IncidentImpactFieldDataAttributesRequest, @@ -3912,6 +3918,8 @@ from datadog_api_client.v2.model.incident_impact_response import IncidentImpactResponse from datadog_api_client.v2.model.incident_impact_response_data import IncidentImpactResponseData from datadog_api_client.v2.model.incident_impact_type import IncidentImpactType +from datadog_api_client.v2.model.incident_impact_updated_trigger import IncidentImpactUpdatedTrigger +from datadog_api_client.v2.model.incident_impact_updated_trigger_wrapper import IncidentImpactUpdatedTriggerWrapper from datadog_api_client.v2.model.incident_impacts_response import IncidentImpactsResponse from datadog_api_client.v2.model.incident_impacts_type import IncidentImpactsType from datadog_api_client.v2.model.incident_import_field_attributes import IncidentImportFieldAttributes @@ -4039,9 +4047,17 @@ from datadog_api_client.v2.model.incident_page_uuid_response import IncidentPageUUIDResponse from datadog_api_client.v2.model.incident_page_uuid_type import IncidentPageUUIDType from datadog_api_client.v2.model.incident_postmortem_type import IncidentPostmortemType +from datadog_api_client.v2.model.incident_postmortem_updated_trigger import IncidentPostmortemUpdatedTrigger +from datadog_api_client.v2.model.incident_postmortem_updated_trigger_wrapper import ( + IncidentPostmortemUpdatedTriggerWrapper, +) from datadog_api_client.v2.model.incident_related_object import IncidentRelatedObject from datadog_api_client.v2.model.incident_relationship_data import IncidentRelationshipData from datadog_api_client.v2.model.incident_resource_type import IncidentResourceType +from datadog_api_client.v2.model.incident_responder_created_trigger import IncidentResponderCreatedTrigger +from datadog_api_client.v2.model.incident_responder_created_trigger_wrapper import ( + IncidentResponderCreatedTriggerWrapper, +) from datadog_api_client.v2.model.incident_responder_data_attributes_response import ( IncidentResponderDataAttributesResponse, ) @@ -4088,6 +4104,10 @@ from datadog_api_client.v2.model.incident_rule_trigger_type import IncidentRuleTriggerType from datadog_api_client.v2.model.incident_rule_type import IncidentRuleType from datadog_api_client.v2.model.incident_rules_response import IncidentRulesResponse +from datadog_api_client.v2.model.incident_saved_trigger import IncidentSavedTrigger +from datadog_api_client.v2.model.incident_saved_trigger_wrapper import IncidentSavedTriggerWrapper +from datadog_api_client.v2.model.incident_schedule_trigger import IncidentScheduleTrigger +from datadog_api_client.v2.model.incident_schedule_trigger_wrapper import IncidentScheduleTriggerWrapper from datadog_api_client.v2.model.incident_search_response import IncidentSearchResponse from datadog_api_client.v2.model.incident_search_response_attributes import IncidentSearchResponseAttributes from datadog_api_client.v2.model.incident_search_response_data import IncidentSearchResponseData @@ -4114,6 +4134,7 @@ from datadog_api_client.v2.model.incident_service_now_record_prompt_type import IncidentServiceNowRecordPromptType from datadog_api_client.v2.model.incident_service_now_record_request import IncidentServiceNowRecordRequest from datadog_api_client.v2.model.incident_severity import IncidentSeverity +from datadog_api_client.v2.model.incident_tag_value import IncidentTagValue from datadog_api_client.v2.model.incident_timeline_cell_create_attributes import IncidentTimelineCellCreateAttributes from datadog_api_client.v2.model.incident_timeline_cell_markdown_content_type import ( IncidentTimelineCellMarkdownContentType, @@ -9424,6 +9445,7 @@ from datadog_api_client.v2.model.sensitive_data_scanner_text_replacement_type import ( SensitiveDataScannerTextReplacementType, ) +from datadog_api_client.v2.model.serial_execution import SerialExecution from datadog_api_client.v2.model.service_access_token import ServiceAccessToken from datadog_api_client.v2.model.service_access_token_attributes import ServiceAccessTokenAttributes from datadog_api_client.v2.model.service_access_token_create_response import ServiceAccessTokenCreateResponse @@ -9667,6 +9689,8 @@ from datadog_api_client.v2.model.single_entity_context_response import SingleEntityContextResponse from datadog_api_client.v2.model.slack_integration_metadata import SlackIntegrationMetadata from datadog_api_client.v2.model.slack_integration_metadata_channel_item import SlackIntegrationMetadataChannelItem +from datadog_api_client.v2.model.slack_reaction_config import SlackReactionConfig +from datadog_api_client.v2.model.slack_trigger import SlackTrigger from datadog_api_client.v2.model.slack_trigger_wrapper import SlackTriggerWrapper from datadog_api_client.v2.model.slack_user_binding_data import SlackUserBindingData from datadog_api_client.v2.model.slack_user_binding_type import SlackUserBindingType @@ -13432,6 +13456,7 @@ "EventsSortType", "EventsTimeseriesQuery", "EventsWarning", + "ExecutionLimit", "ExecutionPolicyActionPattern", "ExecutionPolicyAttributes", "ExecutionPolicyCreateRequest", @@ -14029,6 +14054,7 @@ "IncidentAIPostmortemResponse", "IncidentAIPostmortemResponseType", "IncidentAttachmentType", + "IncidentCondition", "IncidentConfigurationDataAttributesRequest", "IncidentConfigurationDataAttributesResponse", "IncidentConfigurationDataRequest", @@ -14051,6 +14077,8 @@ "IncidentCreatePageFromIncidentType", "IncidentCreateRelationships", "IncidentCreateRequest", + "IncidentCreatedTrigger", + "IncidentCreatedTriggerWrapper", "IncidentFieldAttributes", "IncidentFieldAttributesMultipleValue", "IncidentFieldAttributesSingleValue", @@ -14098,6 +14126,8 @@ "IncidentImpactCreateAttributes", "IncidentImpactCreateData", "IncidentImpactCreateRequest", + "IncidentImpactCreatedTrigger", + "IncidentImpactCreatedTriggerWrapper", "IncidentImpactFieldChoice", "IncidentImpactFieldDataAttributesRequest", "IncidentImpactFieldDataAttributesResponse", @@ -14119,6 +14149,8 @@ "IncidentImpactResponse", "IncidentImpactResponseData", "IncidentImpactType", + "IncidentImpactUpdatedTrigger", + "IncidentImpactUpdatedTriggerWrapper", "IncidentImpactsResponse", "IncidentImpactsType", "IncidentImportFieldAttributes", @@ -14200,9 +14232,13 @@ "IncidentPageUUIDResponse", "IncidentPageUUIDType", "IncidentPostmortemType", + "IncidentPostmortemUpdatedTrigger", + "IncidentPostmortemUpdatedTriggerWrapper", "IncidentRelatedObject", "IncidentRelationshipData", "IncidentResourceType", + "IncidentResponderCreatedTrigger", + "IncidentResponderCreatedTriggerWrapper", "IncidentResponderDataAttributesResponse", "IncidentResponderDataRequest", "IncidentResponderDataResponse", @@ -14241,6 +14277,10 @@ "IncidentRuleTriggerType", "IncidentRuleType", "IncidentRulesResponse", + "IncidentSavedTrigger", + "IncidentSavedTriggerWrapper", + "IncidentScheduleTrigger", + "IncidentScheduleTriggerWrapper", "IncidentSearchResponse", "IncidentSearchResponseAttributes", "IncidentSearchResponseData", @@ -14259,6 +14299,7 @@ "IncidentServiceNowRecordPromptType", "IncidentServiceNowRecordRequest", "IncidentSeverity", + "IncidentTagValue", "IncidentTimelineCellCreateAttributes", "IncidentTimelineCellMarkdownContentType", "IncidentTimelineCellMarkdownCreateAttributes", @@ -17607,6 +17648,7 @@ "SensitiveDataScannerSuppressions", "SensitiveDataScannerTextReplacement", "SensitiveDataScannerTextReplacementType", + "SerialExecution", "ServiceAccessToken", "ServiceAccessTokenAttributes", "ServiceAccessTokenCreateResponse", @@ -17808,6 +17850,8 @@ "SingleEntityContextResponse", "SlackIntegrationMetadata", "SlackIntegrationMetadataChannelItem", + "SlackReactionConfig", + "SlackTrigger", "SlackTriggerWrapper", "SlackUserBindingData", "SlackUserBindingType",