Skip to content

Commit 0098887

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
and
ci.datadog-api-spec
authored
Add user status to schema and fix escalation policy included (#2536)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent a64d3ad commit 0098887

11 files changed

+323
-26
lines changed

.apigentools-info

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-05-01 18:50:10.700756",
8-
"spec_repo_commit": "7eb88f6a"
7+
"regenerated": "2025-05-02 04:31:14.572410",
8+
"spec_repo_commit": "272cce39"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-05-01 18:50:10.716342",
13-
"spec_repo_commit": "7eb88f6a"
12+
"regenerated": "2025-05-02 04:31:14.659660",
13+
"spec_repo_commit": "272cce39"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

+53-3
Original file line numberDiff line numberDiff line change
@@ -13547,9 +13547,8 @@ components:
1354713547
oneOf:
1354813548
- $ref: '#/components/schemas/TeamReference'
1354913549
- $ref: '#/components/schemas/EscalationPolicyStep'
13550-
- $ref: '#/components/schemas/UserTarget'
13551-
- $ref: '#/components/schemas/ScheduleTarget'
13552-
- $ref: '#/components/schemas/TeamTarget'
13550+
- $ref: '#/components/schemas/EscalationPolicyUser'
13551+
- $ref: '#/components/schemas/ScheduleData'
1355313552
EscalationPolicyStep:
1355413553
description: Represents a single step in an escalation policy, including its
1355513554
attributes, relationships, and resource type.
@@ -13795,6 +13794,44 @@ components:
1379513794
type: string
1379613795
x-enum-varnames:
1379713796
- POLICIES
13797+
EscalationPolicyUser:
13798+
description: Represents a user object in the context of an escalation policy,
13799+
including their `id`, type, and basic attributes.
13800+
properties:
13801+
attributes:
13802+
$ref: '#/components/schemas/EscalationPolicyUserAttributes'
13803+
id:
13804+
description: The unique user identifier.
13805+
type: string
13806+
type:
13807+
$ref: '#/components/schemas/EscalationPolicyUserType'
13808+
required:
13809+
- type
13810+
type: object
13811+
EscalationPolicyUserAttributes:
13812+
description: Provides basic user information for an escalation policy, including
13813+
a name and email address.
13814+
properties:
13815+
email:
13816+
description: The user's email address.
13817+
13818+
type: string
13819+
name:
13820+
description: The user's name.
13821+
example: Jane Doe
13822+
type: string
13823+
status:
13824+
$ref: '#/components/schemas/UserAttributesStatus'
13825+
type: object
13826+
EscalationPolicyUserType:
13827+
default: users
13828+
description: Users resource type.
13829+
enum:
13830+
- users
13831+
example: users
13832+
type: string
13833+
x-enum-varnames:
13834+
- USERS
1379813835
EscalationTarget:
1379913836
description: Represents an escalation target, which can be a team, user, or
1380013837
schedule.
@@ -31730,6 +31767,8 @@ components:
3173031767
description: The user's name.
3173131768
example: Jane Doe
3173231769
type: string
31770+
status:
31771+
$ref: '#/components/schemas/UserAttributesStatus'
3173331772
type: object
3173431773
ScheduleUserType:
3173531774
default: users
@@ -38564,6 +38603,17 @@ components:
3856438603
description: Whether the user is verified.
3856538604
type: boolean
3856638605
type: object
38606+
UserAttributesStatus:
38607+
description: The user's status.
38608+
enum:
38609+
- active
38610+
- deactivated
38611+
- pending
38612+
type: string
38613+
x-enum-varnames:
38614+
- ACTIVE
38615+
- DEACTIVATED
38616+
- PENDING
3856738617
UserCreateAttributes:
3856838618
description: Attributes of the created user.
3856938619
properties:

docs/datadog_api_client.v2.model.rst

+28
Original file line numberDiff line numberDiff line change
@@ -5646,6 +5646,27 @@ datadog\_api\_client.v2.model.escalation\_policy\_update\_request\_data\_type mo
56465646
:members:
56475647
:show-inheritance:
56485648

5649+
datadog\_api\_client.v2.model.escalation\_policy\_user module
5650+
-------------------------------------------------------------
5651+
5652+
.. automodule:: datadog_api_client.v2.model.escalation_policy_user
5653+
:members:
5654+
:show-inheritance:
5655+
5656+
datadog\_api\_client.v2.model.escalation\_policy\_user\_attributes module
5657+
-------------------------------------------------------------------------
5658+
5659+
.. automodule:: datadog_api_client.v2.model.escalation_policy_user_attributes
5660+
:members:
5661+
:show-inheritance:
5662+
5663+
datadog\_api\_client.v2.model.escalation\_policy\_user\_type module
5664+
-------------------------------------------------------------------
5665+
5666+
.. automodule:: datadog_api_client.v2.model.escalation_policy_user_type
5667+
:members:
5668+
:show-inheritance:
5669+
56495670
datadog\_api\_client.v2.model.escalation\_target module
56505671
-------------------------------------------------------
56515672

@@ -16783,6 +16804,13 @@ datadog\_api\_client.v2.model.user\_attributes module
1678316804
:members:
1678416805
:show-inheritance:
1678516806

16807+
datadog\_api\_client.v2.model.user\_attributes\_status module
16808+
-------------------------------------------------------------
16809+
16810+
.. automodule:: datadog_api_client.v2.model.user_attributes_status
16811+
:members:
16812+
:show-inheritance:
16813+
1678616814
datadog\_api\_client.v2.model.user\_create\_attributes module
1678716815
-------------------------------------------------------------
1678816816

src/datadog_api_client/v2/model/escalation_policy.py

+3-11
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
from datadog_api_client.v2.model.escalation_policy_included import EscalationPolicyIncluded
1919
from datadog_api_client.v2.model.team_reference import TeamReference
2020
from datadog_api_client.v2.model.escalation_policy_step import EscalationPolicyStep
21-
from datadog_api_client.v2.model.user_target import UserTarget
22-
from datadog_api_client.v2.model.schedule_target import ScheduleTarget
23-
from datadog_api_client.v2.model.team_target import TeamTarget
21+
from datadog_api_client.v2.model.escalation_policy_user import EscalationPolicyUser
22+
from datadog_api_client.v2.model.schedule_data import ScheduleData
2423

2524

2625
class EscalationPolicy(ModelNormal):
@@ -44,14 +43,7 @@ def __init__(
4443
data: Union[EscalationPolicyData, UnsetType] = unset,
4544
included: Union[
4645
List[
47-
Union[
48-
EscalationPolicyIncluded,
49-
TeamReference,
50-
EscalationPolicyStep,
51-
UserTarget,
52-
ScheduleTarget,
53-
TeamTarget,
54-
]
46+
Union[EscalationPolicyIncluded, TeamReference, EscalationPolicyStep, EscalationPolicyUser, ScheduleData]
5547
],
5648
UnsetType,
5749
] = unset,

src/datadog_api_client/v2/model/escalation_policy_included.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,14 @@ def _composed_schemas(_):
4040
# loading
4141
from datadog_api_client.v2.model.team_reference import TeamReference
4242
from datadog_api_client.v2.model.escalation_policy_step import EscalationPolicyStep
43-
from datadog_api_client.v2.model.user_target import UserTarget
44-
from datadog_api_client.v2.model.schedule_target import ScheduleTarget
45-
from datadog_api_client.v2.model.team_target import TeamTarget
43+
from datadog_api_client.v2.model.escalation_policy_user import EscalationPolicyUser
44+
from datadog_api_client.v2.model.schedule_data import ScheduleData
4645

4746
return {
4847
"oneOf": [
4948
TeamReference,
5049
EscalationPolicyStep,
51-
UserTarget,
52-
ScheduleTarget,
53-
TeamTarget,
50+
EscalationPolicyUser,
51+
ScheduleData,
5452
],
5553
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import Union, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.escalation_policy_user_attributes import EscalationPolicyUserAttributes
18+
from datadog_api_client.v2.model.escalation_policy_user_type import EscalationPolicyUserType
19+
20+
21+
class EscalationPolicyUser(ModelNormal):
22+
@cached_property
23+
def openapi_types(_):
24+
from datadog_api_client.v2.model.escalation_policy_user_attributes import EscalationPolicyUserAttributes
25+
from datadog_api_client.v2.model.escalation_policy_user_type import EscalationPolicyUserType
26+
27+
return {
28+
"attributes": (EscalationPolicyUserAttributes,),
29+
"id": (str,),
30+
"type": (EscalationPolicyUserType,),
31+
}
32+
33+
attribute_map = {
34+
"attributes": "attributes",
35+
"id": "id",
36+
"type": "type",
37+
}
38+
39+
def __init__(
40+
self_,
41+
type: EscalationPolicyUserType,
42+
attributes: Union[EscalationPolicyUserAttributes, UnsetType] = unset,
43+
id: Union[str, UnsetType] = unset,
44+
**kwargs,
45+
):
46+
"""
47+
Represents a user object in the context of an escalation policy, including their ``id`` , type, and basic attributes.
48+
49+
:param attributes: Provides basic user information for an escalation policy, including a name and email address.
50+
:type attributes: EscalationPolicyUserAttributes, optional
51+
52+
:param id: The unique user identifier.
53+
:type id: str, optional
54+
55+
:param type: Users resource type.
56+
:type type: EscalationPolicyUserType
57+
"""
58+
if attributes is not unset:
59+
kwargs["attributes"] = attributes
60+
if id is not unset:
61+
kwargs["id"] = id
62+
super().__init__(kwargs)
63+
64+
self_.type = type
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
from typing import Union, TYPE_CHECKING
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
unset,
12+
UnsetType,
13+
)
14+
15+
16+
if TYPE_CHECKING:
17+
from datadog_api_client.v2.model.user_attributes_status import UserAttributesStatus
18+
19+
20+
class EscalationPolicyUserAttributes(ModelNormal):
21+
@cached_property
22+
def openapi_types(_):
23+
from datadog_api_client.v2.model.user_attributes_status import UserAttributesStatus
24+
25+
return {
26+
"email": (str,),
27+
"name": (str,),
28+
"status": (UserAttributesStatus,),
29+
}
30+
31+
attribute_map = {
32+
"email": "email",
33+
"name": "name",
34+
"status": "status",
35+
}
36+
37+
def __init__(
38+
self_,
39+
email: Union[str, UnsetType] = unset,
40+
name: Union[str, UnsetType] = unset,
41+
status: Union[UserAttributesStatus, UnsetType] = unset,
42+
**kwargs,
43+
):
44+
"""
45+
Provides basic user information for an escalation policy, including a name and email address.
46+
47+
:param email: The user's email address.
48+
:type email: str, optional
49+
50+
:param name: The user's name.
51+
:type name: str, optional
52+
53+
:param status: The user's status.
54+
:type status: UserAttributesStatus, optional
55+
"""
56+
if email is not unset:
57+
kwargs["email"] = email
58+
if name is not unset:
59+
kwargs["name"] = name
60+
if status is not unset:
61+
kwargs["status"] = status
62+
super().__init__(kwargs)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
# This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
# Copyright 2019-Present Datadog, Inc.
4+
from __future__ import annotations
5+
6+
7+
from datadog_api_client.model_utils import (
8+
ModelSimple,
9+
cached_property,
10+
)
11+
12+
from typing import ClassVar
13+
14+
15+
class EscalationPolicyUserType(ModelSimple):
16+
"""
17+
Users resource type.
18+
19+
:param value: If omitted defaults to "users". Must be one of ["users"].
20+
:type value: str
21+
"""
22+
23+
allowed_values = {
24+
"users",
25+
}
26+
USERS: ClassVar["EscalationPolicyUserType"]
27+
28+
@cached_property
29+
def openapi_types(_):
30+
return {
31+
"value": (str,),
32+
}
33+
34+
35+
EscalationPolicyUserType.USERS = EscalationPolicyUserType("users")

0 commit comments

Comments
 (0)