Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46414,6 +46414,9 @@ components:
IncidentTypeAttributes:
description: Incident type's attributes.
properties:
configuration:
$ref: "#/components/schemas/IncidentTypeConfiguration"
readOnly: true
createdAt:
description: Timestamp when the incident type was created.
format: date-time
Expand Down Expand Up @@ -46455,6 +46458,53 @@ components:
required:
- name
type: object
IncidentTypeConfiguration:
description: >-
The incident-type-scoped behavior settings. All fields are optional on update. Any field omitted from a PATCH request keeps its current value. This object is read-only on the incident type resource itself and is only mutated through the update (PATCH) endpoint.
properties:
allow_incident_deletion:
default: false
description: Whether incidents of this type can be deleted.
example: false
type: boolean
allow_workflows:
default: true
description: Whether automation workflows can be triggered for incidents of this type.
example: true
type: boolean
create_message:
description: An optional message shown to users when they declare an incident of this type.
example: "Create an incident here"
type: string
disable_out_of_the_box_postmortem_template:
default: false
description: Whether the out-of-the-box postmortem template is disabled for incidents of this type.
example: false
type: boolean
editable_timestamps:
default: false
description: Whether responders can edit incident timestamps for incidents of this type.
example: false
type: boolean
private_incidents:
default: false
description: >-
Whether responders can create private incidents of this type. This is an opt-in setting, distinct from `private_incidents_by_default`, which controls whether incidents are created private automatically.
example: false
type: boolean
private_incidents_by_default:
default: false
description: Whether incidents of this type are created as private by default.
example: false
type: boolean
slug_source:
$ref: "#/components/schemas/IncidentTypeSlugSource"
test_incidents:
default: true
description: Whether incidents of this type are treated as test incidents.
example: true
type: boolean
type: object
IncidentTypeCreateData:
description: Incident type data for a create request.
properties:
Expand Down Expand Up @@ -46549,6 +46599,18 @@ components:
required:
- data
type: object
IncidentTypeSlugSource:
default: default
description: >-
When set to `servicenow`, incidents will display the ServiceNow record ID instead of the public ID. If no ServiceNow integration exists, the public ID will be displayed.
enum:
- default
- servicenow
example: default
type: string
x-enum-varnames:
- DEFAULT
- SERVICENOW
IncidentTypeType:
default: incident_types
description: Incident type resource type.
Expand All @@ -46561,6 +46623,8 @@ components:
IncidentTypeUpdateAttributes:
description: Incident type's attributes for updates.
properties:
configuration:
$ref: "#/components/schemas/IncidentTypeConfiguration"
createdAt:
description: Timestamp when the incident type was created.
format: date-time
Expand Down
14 changes: 14 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18806,6 +18806,13 @@ datadog\_api\_client.v2.model.incident\_type\_attributes module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_type\_configuration module
------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.incident_type_configuration
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_type\_create\_data module
-----------------------------------------------------------------

Expand Down Expand Up @@ -18862,6 +18869,13 @@ datadog\_api\_client.v2.model.incident\_type\_response module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_type\_slug\_source module
-----------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.incident_type_slug_source
:members:
:show-inheritance:

datadog\_api\_client.v2.model.incident\_type\_type module
---------------------------------------------------------

Expand Down
16 changes: 15 additions & 1 deletion src/datadog_api_client/v2/model/incident_type_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import Union
from typing import Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
Expand All @@ -14,10 +14,17 @@
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.incident_type_configuration import IncidentTypeConfiguration


class IncidentTypeAttributes(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.incident_type_configuration import IncidentTypeConfiguration

return {
"configuration": (IncidentTypeConfiguration,),
"created_at": (datetime,),
"created_by": (str,),
"description": (str,),
Expand All @@ -29,6 +36,7 @@ def openapi_types(_):
}

attribute_map = {
"configuration": "configuration",
"created_at": "createdAt",
"created_by": "createdBy",
"description": "description",
Expand All @@ -49,6 +57,7 @@ def openapi_types(_):
def __init__(
self_,
name: str,
configuration: Union[IncidentTypeConfiguration, UnsetType] = unset,
created_at: Union[datetime, UnsetType] = unset,
created_by: Union[str, UnsetType] = unset,
description: Union[str, UnsetType] = unset,
Expand All @@ -61,6 +70,9 @@ def __init__(
"""
Incident type's attributes.

:param configuration: The incident-type-scoped behavior settings. All fields are optional on update. Any field omitted from a PATCH request keeps its current value. This object is read-only on the incident type resource itself and is only mutated through the update (PATCH) endpoint.
:type configuration: IncidentTypeConfiguration, optional

:param created_at: Timestamp when the incident type was created.
:type created_at: datetime, optional

Expand All @@ -85,6 +97,8 @@ def __init__(
:param prefix: The string that will be prepended to the incident title across the Datadog app.
:type prefix: str, optional
"""
if configuration is not unset:
kwargs["configuration"] = configuration
if created_at is not unset:
kwargs["created_at"] = created_at
if created_by is not unset:
Expand Down
110 changes: 110 additions & 0 deletions src/datadog_api_client/v2/model/incident_type_configuration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# 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_type_slug_source import IncidentTypeSlugSource


class IncidentTypeConfiguration(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.incident_type_slug_source import IncidentTypeSlugSource

return {
"allow_incident_deletion": (bool,),
"allow_workflows": (bool,),
"create_message": (str,),
"disable_out_of_the_box_postmortem_template": (bool,),
"editable_timestamps": (bool,),
"private_incidents": (bool,),
"private_incidents_by_default": (bool,),
"slug_source": (IncidentTypeSlugSource,),
"test_incidents": (bool,),
}

attribute_map = {
"allow_incident_deletion": "allow_incident_deletion",
"allow_workflows": "allow_workflows",
"create_message": "create_message",
"disable_out_of_the_box_postmortem_template": "disable_out_of_the_box_postmortem_template",
"editable_timestamps": "editable_timestamps",
"private_incidents": "private_incidents",
"private_incidents_by_default": "private_incidents_by_default",
"slug_source": "slug_source",
"test_incidents": "test_incidents",
}

def __init__(
self_,
allow_incident_deletion: Union[bool, UnsetType] = unset,
allow_workflows: Union[bool, UnsetType] = unset,
create_message: Union[str, UnsetType] = unset,
disable_out_of_the_box_postmortem_template: Union[bool, UnsetType] = unset,
editable_timestamps: Union[bool, UnsetType] = unset,
private_incidents: Union[bool, UnsetType] = unset,
private_incidents_by_default: Union[bool, UnsetType] = unset,
slug_source: Union[IncidentTypeSlugSource, UnsetType] = unset,
test_incidents: Union[bool, UnsetType] = unset,
**kwargs,
):
"""
The incident-type-scoped behavior settings. All fields are optional on update. Any field omitted from a PATCH request keeps its current value. This object is read-only on the incident type resource itself and is only mutated through the update (PATCH) endpoint.

:param allow_incident_deletion: Whether incidents of this type can be deleted.
:type allow_incident_deletion: bool, optional

:param allow_workflows: Whether automation workflows can be triggered for incidents of this type.
:type allow_workflows: bool, optional

:param create_message: An optional message shown to users when they declare an incident of this type.
:type create_message: str, optional

:param disable_out_of_the_box_postmortem_template: Whether the out-of-the-box postmortem template is disabled for incidents of this type.
:type disable_out_of_the_box_postmortem_template: bool, optional

:param editable_timestamps: Whether responders can edit incident timestamps for incidents of this type.
:type editable_timestamps: bool, optional

:param private_incidents: Whether responders can create private incidents of this type. This is an opt-in setting, distinct from ``private_incidents_by_default`` , which controls whether incidents are created private automatically.
:type private_incidents: bool, optional

:param private_incidents_by_default: Whether incidents of this type are created as private by default.
:type private_incidents_by_default: bool, optional

:param slug_source: When set to ``servicenow`` , incidents will display the ServiceNow record ID instead of the public ID. If no ServiceNow integration exists, the public ID will be displayed.
:type slug_source: IncidentTypeSlugSource, optional

:param test_incidents: Whether incidents of this type are treated as test incidents.
:type test_incidents: bool, optional
"""
if allow_incident_deletion is not unset:
kwargs["allow_incident_deletion"] = allow_incident_deletion
if allow_workflows is not unset:
kwargs["allow_workflows"] = allow_workflows
if create_message is not unset:
kwargs["create_message"] = create_message
if disable_out_of_the_box_postmortem_template is not unset:
kwargs["disable_out_of_the_box_postmortem_template"] = disable_out_of_the_box_postmortem_template
if editable_timestamps is not unset:
kwargs["editable_timestamps"] = editable_timestamps
if private_incidents is not unset:
kwargs["private_incidents"] = private_incidents
if private_incidents_by_default is not unset:
kwargs["private_incidents_by_default"] = private_incidents_by_default
if slug_source is not unset:
kwargs["slug_source"] = slug_source
if test_incidents is not unset:
kwargs["test_incidents"] = test_incidents
super().__init__(kwargs)
38 changes: 38 additions & 0 deletions src/datadog_api_client/v2/model/incident_type_slug_source.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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 (
ModelSimple,
cached_property,
)

from typing import ClassVar


class IncidentTypeSlugSource(ModelSimple):
"""
When set to `servicenow`, incidents will display the ServiceNow record ID instead of the public ID. If no ServiceNow integration exists, the public ID will be displayed.

:param value: If omitted defaults to "default". Must be one of ["default", "servicenow"].
:type value: str
"""

allowed_values = {
"default",
"servicenow",
}
DEFAULT: ClassVar["IncidentTypeSlugSource"]
SERVICENOW: ClassVar["IncidentTypeSlugSource"]

@cached_property
def openapi_types(_):
return {
"value": (str,),
}


IncidentTypeSlugSource.DEFAULT = IncidentTypeSlugSource("default")
IncidentTypeSlugSource.SERVICENOW = IncidentTypeSlugSource("servicenow")
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import Union
from typing import Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
Expand All @@ -14,10 +14,17 @@
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.incident_type_configuration import IncidentTypeConfiguration


class IncidentTypeUpdateAttributes(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.incident_type_configuration import IncidentTypeConfiguration

return {
"configuration": (IncidentTypeConfiguration,),
"created_at": (datetime,),
"created_by": (str,),
"description": (str,),
Expand All @@ -29,6 +36,7 @@ def openapi_types(_):
}

attribute_map = {
"configuration": "configuration",
"created_at": "createdAt",
"created_by": "createdBy",
"description": "description",
Expand All @@ -48,6 +56,7 @@ def openapi_types(_):

def __init__(
self_,
configuration: Union[IncidentTypeConfiguration, UnsetType] = unset,
created_at: Union[datetime, UnsetType] = unset,
created_by: Union[str, UnsetType] = unset,
description: Union[str, UnsetType] = unset,
Expand All @@ -61,6 +70,9 @@ def __init__(
"""
Incident type's attributes for updates.

:param configuration: The incident-type-scoped behavior settings. All fields are optional on update. Any field omitted from a PATCH request keeps its current value. This object is read-only on the incident type resource itself and is only mutated through the update (PATCH) endpoint.
:type configuration: IncidentTypeConfiguration, optional

:param created_at: Timestamp when the incident type was created.
:type created_at: datetime, optional

Expand All @@ -85,6 +97,8 @@ def __init__(
:param prefix: The string that will be prepended to the incident title across the Datadog app.
:type prefix: str, optional
"""
if configuration is not unset:
kwargs["configuration"] = configuration
if created_at is not unset:
kwargs["created_at"] = created_at
if created_by is not unset:
Expand Down
Loading
Loading