Skip to content

Commit 6d09803

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Remove user fields that are unsupported by the Incidents API (#2195)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 3696e4d commit 6d09803

File tree

10 files changed

+209
-17
lines changed

10 files changed

+209
-17
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
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": "2024-10-02 20:43:03.737189",
8-
"spec_repo_commit": "76b7b19d"
7+
"regenerated": "2024-10-03 13:53:51.226723",
8+
"spec_repo_commit": "2c46d95c"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-10-02 20:43:03.750932",
13-
"spec_repo_commit": "76b7b19d"
12+
"regenerated": "2024-10-03 13:53:51.241484",
13+
"spec_repo_commit": "2c46d95c"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10930,7 +10930,7 @@ components:
1093010930
IncidentResponseIncludedItem:
1093110931
description: An object related to an incident that is included in the response.
1093210932
oneOf:
10933-
- $ref: '#/components/schemas/User'
10933+
- $ref: '#/components/schemas/IncidentUserData'
1093410934
- $ref: '#/components/schemas/IncidentAttachmentData'
1093510935
IncidentResponseMeta:
1093610936
description: The metadata object containing pagination metadata.
@@ -11869,6 +11869,37 @@ components:
1186911869
required:
1187011870
- data
1187111871
type: object
11872+
IncidentUserAttributes:
11873+
description: Attributes of user object returned by the API.
11874+
properties:
11875+
email:
11876+
description: Email of the user.
11877+
type: string
11878+
handle:
11879+
description: Handle of the user.
11880+
type: string
11881+
icon:
11882+
description: URL of the user's icon.
11883+
type: string
11884+
name:
11885+
description: Name of the user.
11886+
nullable: true
11887+
type: string
11888+
uuid:
11889+
description: UUID of the user.
11890+
type: string
11891+
type: object
11892+
IncidentUserData:
11893+
description: User object returned by the API.
11894+
properties:
11895+
attributes:
11896+
$ref: '#/components/schemas/IncidentUserAttributes'
11897+
id:
11898+
description: ID of the user.
11899+
type: string
11900+
type:
11901+
$ref: '#/components/schemas/UsersType'
11902+
type: object
1187211903
IncidentUserDefinedFieldType:
1187311904
description: The incident user defined fields type.
1187411905
enum:

docs/datadog_api_client.v2.model.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4876,6 +4876,20 @@ datadog\_api\_client.v2.model.incident\_update\_request module
48764876
:members:
48774877
:show-inheritance:
48784878

4879+
datadog\_api\_client.v2.model.incident\_user\_attributes module
4880+
---------------------------------------------------------------
4881+
4882+
.. automodule:: datadog_api_client.v2.model.incident_user_attributes
4883+
:members:
4884+
:show-inheritance:
4885+
4886+
datadog\_api\_client.v2.model.incident\_user\_data module
4887+
---------------------------------------------------------
4888+
4889+
.. automodule:: datadog_api_client.v2.model.incident_user_data
4890+
:members:
4891+
:show-inheritance:
4892+
48794893
datadog\_api\_client.v2.model.incident\_user\_defined\_field\_type module
48804894
-------------------------------------------------------------------------
48814895

src/datadog_api_client/v2/model/incident_response.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
if TYPE_CHECKING:
1717
from datadog_api_client.v2.model.incident_response_data import IncidentResponseData
1818
from datadog_api_client.v2.model.incident_response_included_item import IncidentResponseIncludedItem
19-
from datadog_api_client.v2.model.user import User
19+
from datadog_api_client.v2.model.incident_user_data import IncidentUserData
2020
from datadog_api_client.v2.model.incident_attachment_data import IncidentAttachmentData
2121

2222

@@ -42,7 +42,9 @@ def openapi_types(_):
4242
def __init__(
4343
self_,
4444
data: IncidentResponseData,
45-
included: Union[List[Union[IncidentResponseIncludedItem, User, IncidentAttachmentData]], UnsetType] = unset,
45+
included: Union[
46+
List[Union[IncidentResponseIncludedItem, IncidentUserData, IncidentAttachmentData]], UnsetType
47+
] = unset,
4648
**kwargs,
4749
):
4850
"""

src/datadog_api_client/v2/model/incident_response_included_item.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ def __init__(self, **kwargs):
1616
An object related to an incident that is included in the response.
1717
1818
:param attributes: Attributes of user object returned by the API.
19-
:type attributes: UserAttributes, optional
19+
:type attributes: IncidentUserAttributes, optional
2020
2121
:param id: ID of the user.
2222
:type id: str, optional
2323
24-
:param relationships: Relationships of the user object returned by the API.
25-
:type relationships: UserResponseRelationships, optional
26-
2724
:param type: Users resource type.
2825
:type type: UsersType, optional
26+
27+
:param relationships: The incident attachment's relationships.
28+
:type relationships: IncidentAttachmentRelationships
2929
"""
3030
super().__init__(kwargs)
3131

@@ -38,12 +38,12 @@ def _composed_schemas(_):
3838
# code would be run when this module is imported, and these composed
3939
# classes don't exist yet because their module has not finished
4040
# loading
41-
from datadog_api_client.v2.model.user import User
41+
from datadog_api_client.v2.model.incident_user_data import IncidentUserData
4242
from datadog_api_client.v2.model.incident_attachment_data import IncidentAttachmentData
4343

4444
return {
4545
"oneOf": [
46-
User,
46+
IncidentUserData,
4747
IncidentAttachmentData,
4848
],
4949
}

src/datadog_api_client/v2/model/incident_search_response.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from datadog_api_client.v2.model.incident_search_response_data import IncidentSearchResponseData
1818
from datadog_api_client.v2.model.incident_response_included_item import IncidentResponseIncludedItem
1919
from datadog_api_client.v2.model.incident_search_response_meta import IncidentSearchResponseMeta
20-
from datadog_api_client.v2.model.user import User
20+
from datadog_api_client.v2.model.incident_user_data import IncidentUserData
2121
from datadog_api_client.v2.model.incident_attachment_data import IncidentAttachmentData
2222

2323

@@ -47,7 +47,9 @@ def openapi_types(_):
4747
def __init__(
4848
self_,
4949
data: IncidentSearchResponseData,
50-
included: Union[List[Union[IncidentResponseIncludedItem, User, IncidentAttachmentData]], UnsetType] = unset,
50+
included: Union[
51+
List[Union[IncidentResponseIncludedItem, IncidentUserData, IncidentAttachmentData]], UnsetType
52+
] = unset,
5153
meta: Union[IncidentSearchResponseMeta, UnsetType] = unset,
5254
**kwargs,
5355
):
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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
7+
8+
from datadog_api_client.model_utils import (
9+
ModelNormal,
10+
cached_property,
11+
none_type,
12+
unset,
13+
UnsetType,
14+
)
15+
16+
17+
class IncidentUserAttributes(ModelNormal):
18+
@cached_property
19+
def openapi_types(_):
20+
return {
21+
"email": (str,),
22+
"handle": (str,),
23+
"icon": (str,),
24+
"name": (str, none_type),
25+
"uuid": (str,),
26+
}
27+
28+
attribute_map = {
29+
"email": "email",
30+
"handle": "handle",
31+
"icon": "icon",
32+
"name": "name",
33+
"uuid": "uuid",
34+
}
35+
36+
def __init__(
37+
self_,
38+
email: Union[str, UnsetType] = unset,
39+
handle: Union[str, UnsetType] = unset,
40+
icon: Union[str, UnsetType] = unset,
41+
name: Union[str, none_type, UnsetType] = unset,
42+
uuid: Union[str, UnsetType] = unset,
43+
**kwargs,
44+
):
45+
"""
46+
Attributes of user object returned by the API.
47+
48+
:param email: Email of the user.
49+
:type email: str, optional
50+
51+
:param handle: Handle of the user.
52+
:type handle: str, optional
53+
54+
:param icon: URL of the user's icon.
55+
:type icon: str, optional
56+
57+
:param name: Name of the user.
58+
:type name: str, none_type, optional
59+
60+
:param uuid: UUID of the user.
61+
:type uuid: str, optional
62+
"""
63+
if email is not unset:
64+
kwargs["email"] = email
65+
if handle is not unset:
66+
kwargs["handle"] = handle
67+
if icon is not unset:
68+
kwargs["icon"] = icon
69+
if name is not unset:
70+
kwargs["name"] = name
71+
if uuid is not unset:
72+
kwargs["uuid"] = uuid
73+
super().__init__(kwargs)
Lines changed: 64 additions & 0 deletions
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.incident_user_attributes import IncidentUserAttributes
18+
from datadog_api_client.v2.model.users_type import UsersType
19+
20+
21+
class IncidentUserData(ModelNormal):
22+
@cached_property
23+
def openapi_types(_):
24+
from datadog_api_client.v2.model.incident_user_attributes import IncidentUserAttributes
25+
from datadog_api_client.v2.model.users_type import UsersType
26+
27+
return {
28+
"attributes": (IncidentUserAttributes,),
29+
"id": (str,),
30+
"type": (UsersType,),
31+
}
32+
33+
attribute_map = {
34+
"attributes": "attributes",
35+
"id": "id",
36+
"type": "type",
37+
}
38+
39+
def __init__(
40+
self_,
41+
attributes: Union[IncidentUserAttributes, UnsetType] = unset,
42+
id: Union[str, UnsetType] = unset,
43+
type: Union[UsersType, UnsetType] = unset,
44+
**kwargs,
45+
):
46+
"""
47+
User object returned by the API.
48+
49+
:param attributes: Attributes of user object returned by the API.
50+
:type attributes: IncidentUserAttributes, optional
51+
52+
:param id: ID of the user.
53+
:type id: str, optional
54+
55+
:param type: Users resource type.
56+
:type type: UsersType, optional
57+
"""
58+
if attributes is not unset:
59+
kwargs["attributes"] = attributes
60+
if id is not unset:
61+
kwargs["id"] = id
62+
if type is not unset:
63+
kwargs["type"] = type
64+
super().__init__(kwargs)

src/datadog_api_client/v2/model/incidents_response.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from datadog_api_client.v2.model.incident_response_data import IncidentResponseData
1818
from datadog_api_client.v2.model.incident_response_included_item import IncidentResponseIncludedItem
1919
from datadog_api_client.v2.model.incident_response_meta import IncidentResponseMeta
20-
from datadog_api_client.v2.model.user import User
20+
from datadog_api_client.v2.model.incident_user_data import IncidentUserData
2121
from datadog_api_client.v2.model.incident_attachment_data import IncidentAttachmentData
2222

2323

@@ -47,7 +47,9 @@ def openapi_types(_):
4747
def __init__(
4848
self_,
4949
data: List[IncidentResponseData],
50-
included: Union[List[Union[IncidentResponseIncludedItem, User, IncidentAttachmentData]], UnsetType] = unset,
50+
included: Union[
51+
List[Union[IncidentResponseIncludedItem, IncidentUserData, IncidentAttachmentData]], UnsetType
52+
] = unset,
5153
meta: Union[IncidentResponseMeta, UnsetType] = unset,
5254
**kwargs,
5355
):

src/datadog_api_client/v2/models/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,8 @@
868868
from datadog_api_client.v2.model.incident_update_data import IncidentUpdateData
869869
from datadog_api_client.v2.model.incident_update_relationships import IncidentUpdateRelationships
870870
from datadog_api_client.v2.model.incident_update_request import IncidentUpdateRequest
871+
from datadog_api_client.v2.model.incident_user_attributes import IncidentUserAttributes
872+
from datadog_api_client.v2.model.incident_user_data import IncidentUserData
871873
from datadog_api_client.v2.model.incident_user_defined_field_type import IncidentUserDefinedFieldType
872874
from datadog_api_client.v2.model.incidents_response import IncidentsResponse
873875
from datadog_api_client.v2.model.include_type import IncludeType
@@ -2696,6 +2698,8 @@
26962698
"IncidentUpdateData",
26972699
"IncidentUpdateRelationships",
26982700
"IncidentUpdateRequest",
2701+
"IncidentUserAttributes",
2702+
"IncidentUserData",
26992703
"IncidentUserDefinedFieldType",
27002704
"IncidentsResponse",
27012705
"IncludeType",

0 commit comments

Comments
 (0)