Skip to content

Commit b2664c5

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Include user data with team membership resource (#1863)
Co-authored-by: ci.datadog-api-spec <[email protected]> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 0707019 commit b2664c5

File tree

6 files changed

+86
-6
lines changed

6 files changed

+86
-6
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-02-21 12:50:36.140864",
8-
"spec_repo_commit": "1ec2d96a"
7+
"regenerated": "2024-02-21 20:20:09.813942",
8+
"spec_repo_commit": "90ae1ed9"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-02-21 12:50:36.176011",
13-
"spec_repo_commit": "1ec2d96a"
12+
"regenerated": "2024-02-21 20:20:09.828646",
13+
"spec_repo_commit": "90ae1ed9"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21288,6 +21288,10 @@ components:
2128821288
required:
2128921289
- type
2129021290
type: object
21291+
UserTeamIncluded:
21292+
description: Included resources related to the team membership
21293+
oneOf:
21294+
- $ref: '#/components/schemas/User'
2129121295
UserTeamPermission:
2129221296
description: A user's permissions for a given team
2129321297
properties:
@@ -21342,6 +21346,11 @@ components:
2134221346
properties:
2134321347
data:
2134421348
$ref: '#/components/schemas/UserTeam'
21349+
included:
21350+
description: Resources related to the team memberships
21351+
items:
21352+
$ref: '#/components/schemas/UserTeamIncluded'
21353+
type: array
2134521354
type: object
2134621355
UserTeamRole:
2134721356
description: The user's role within the team

docs/datadog_api_client.v2.model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9640,6 +9640,13 @@ user\_team\_create
96409640
:members:
96419641
:show-inheritance:
96429642

9643+
user\_team\_included
9644+
--------------------
9645+
9646+
.. automodule:: datadog_api_client.v2.model.user_team_included
9647+
:members:
9648+
:show-inheritance:
9649+
96439650
user\_team\_permission
96449651
----------------------
96459652

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
ModelComposed,
9+
cached_property,
10+
)
11+
12+
13+
class UserTeamIncluded(ModelComposed):
14+
def __init__(self, **kwargs):
15+
"""
16+
Included resources related to the team membership
17+
18+
:param attributes: Attributes of user object returned by the API.
19+
:type attributes: UserAttributes, optional
20+
21+
:param id: ID of the user.
22+
:type id: str, optional
23+
24+
:param relationships: Relationships of the user object returned by the API.
25+
:type relationships: UserResponseRelationships, optional
26+
27+
:param type: Users resource type.
28+
:type type: UsersType, optional
29+
"""
30+
super().__init__(kwargs)
31+
32+
@cached_property
33+
def _composed_schemas(_):
34+
# we need this here to make our import statements work
35+
# we must store _composed_schemas in here so the code is only run
36+
# when we invoke this method. If we kept this at the class
37+
# level we would get an error because the class level
38+
# code would be run when this module is imported, and these composed
39+
# classes don't exist yet because their module has not finished
40+
# loading
41+
from datadog_api_client.v2.model.user import User
42+
43+
return {
44+
"oneOf": [
45+
User,
46+
],
47+
}

src/datadog_api_client/v2/model/user_team_response.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Copyright 2019-Present Datadog, Inc.
44
from __future__ import annotations
55

6-
from typing import Union, TYPE_CHECKING
6+
from typing import List, Union, TYPE_CHECKING
77

88
from datadog_api_client.model_utils import (
99
ModelNormal,
@@ -15,28 +15,43 @@
1515

1616
if TYPE_CHECKING:
1717
from datadog_api_client.v2.model.user_team import UserTeam
18+
from datadog_api_client.v2.model.user_team_included import UserTeamIncluded
19+
from datadog_api_client.v2.model.user import User
1820

1921

2022
class UserTeamResponse(ModelNormal):
2123
@cached_property
2224
def openapi_types(_):
2325
from datadog_api_client.v2.model.user_team import UserTeam
26+
from datadog_api_client.v2.model.user_team_included import UserTeamIncluded
2427

2528
return {
2629
"data": (UserTeam,),
30+
"included": ([UserTeamIncluded],),
2731
}
2832

2933
attribute_map = {
3034
"data": "data",
35+
"included": "included",
3136
}
3237

33-
def __init__(self_, data: Union[UserTeam, UnsetType] = unset, **kwargs):
38+
def __init__(
39+
self_,
40+
data: Union[UserTeam, UnsetType] = unset,
41+
included: Union[List[Union[UserTeamIncluded, User]], UnsetType] = unset,
42+
**kwargs,
43+
):
3444
"""
3545
Team membership response
3646
3747
:param data: A user's relationship with a team
3848
:type data: UserTeam, optional
49+
50+
:param included: Resources related to the team memberships
51+
:type included: [UserTeamIncluded], optional
3952
"""
4053
if data is not unset:
4154
kwargs["data"] = data
55+
if included is not unset:
56+
kwargs["included"] = included
4257
super().__init__(kwargs)

src/datadog_api_client/v2/models/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,6 +1633,7 @@
16331633
from datadog_api_client.v2.model.user_team import UserTeam
16341634
from datadog_api_client.v2.model.user_team_attributes import UserTeamAttributes
16351635
from datadog_api_client.v2.model.user_team_create import UserTeamCreate
1636+
from datadog_api_client.v2.model.user_team_included import UserTeamIncluded
16361637
from datadog_api_client.v2.model.user_team_permission import UserTeamPermission
16371638
from datadog_api_client.v2.model.user_team_permission_attributes import UserTeamPermissionAttributes
16381639
from datadog_api_client.v2.model.user_team_permission_type import UserTeamPermissionType
@@ -3036,6 +3037,7 @@
30363037
"UserTeam",
30373038
"UserTeamAttributes",
30383039
"UserTeamCreate",
3040+
"UserTeamIncluded",
30393041
"UserTeamPermission",
30403042
"UserTeamPermissionAttributes",
30413043
"UserTeamPermissionType",

0 commit comments

Comments
 (0)