diff --git a/.apigentools-info b/.apigentools-info index 2e0c8835a5..b2e2b7956c 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-02-21 12:50:36.140864", - "spec_repo_commit": "1ec2d96a" + "regenerated": "2024-02-21 20:20:09.813942", + "spec_repo_commit": "90ae1ed9" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-02-21 12:50:36.176011", - "spec_repo_commit": "1ec2d96a" + "regenerated": "2024-02-21 20:20:09.828646", + "spec_repo_commit": "90ae1ed9" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 35cf1d7425..ccb37d1f31 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -21288,6 +21288,10 @@ components: required: - type type: object + UserTeamIncluded: + description: Included resources related to the team membership + oneOf: + - $ref: '#/components/schemas/User' UserTeamPermission: description: A user's permissions for a given team properties: @@ -21342,6 +21346,11 @@ components: properties: data: $ref: '#/components/schemas/UserTeam' + included: + description: Resources related to the team memberships + items: + $ref: '#/components/schemas/UserTeamIncluded' + type: array type: object UserTeamRole: description: The user's role within the team diff --git a/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index e3c5dec84a..2b83a4a3fc 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -9640,6 +9640,13 @@ user\_team\_create :members: :show-inheritance: +user\_team\_included +-------------------- + +.. automodule:: datadog_api_client.v2.model.user_team_included + :members: + :show-inheritance: + user\_team\_permission ---------------------- diff --git a/src/datadog_api_client/v2/model/user_team_included.py b/src/datadog_api_client/v2/model/user_team_included.py new file mode 100644 index 0000000000..b31a452c10 --- /dev/null +++ b/src/datadog_api_client/v2/model/user_team_included.py @@ -0,0 +1,47 @@ +# 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 ( + ModelComposed, + cached_property, +) + + +class UserTeamIncluded(ModelComposed): + def __init__(self, **kwargs): + """ + Included resources related to the team membership + + :param attributes: Attributes of user object returned by the API. + :type attributes: UserAttributes, optional + + :param id: ID of the user. + :type id: str, optional + + :param relationships: Relationships of the user object returned by the API. + :type relationships: UserResponseRelationships, optional + + :param type: Users resource type. + :type type: UsersType, optional + """ + super().__init__(kwargs) + + @cached_property + def _composed_schemas(_): + # we need this here to make our import statements work + # we must store _composed_schemas in here so the code is only run + # when we invoke this method. If we kept this at the class + # level we would get an error because the class level + # code would be run when this module is imported, and these composed + # classes don't exist yet because their module has not finished + # loading + from datadog_api_client.v2.model.user import User + + return { + "oneOf": [ + User, + ], + } diff --git a/src/datadog_api_client/v2/model/user_team_response.py b/src/datadog_api_client/v2/model/user_team_response.py index 1cbcc5112a..b4aa41a4b0 100644 --- a/src/datadog_api_client/v2/model/user_team_response.py +++ b/src/datadog_api_client/v2/model/user_team_response.py @@ -3,7 +3,7 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations -from typing import Union, TYPE_CHECKING +from typing import List, Union, TYPE_CHECKING from datadog_api_client.model_utils import ( ModelNormal, @@ -15,28 +15,43 @@ if TYPE_CHECKING: from datadog_api_client.v2.model.user_team import UserTeam + from datadog_api_client.v2.model.user_team_included import UserTeamIncluded + from datadog_api_client.v2.model.user import User class UserTeamResponse(ModelNormal): @cached_property def openapi_types(_): from datadog_api_client.v2.model.user_team import UserTeam + from datadog_api_client.v2.model.user_team_included import UserTeamIncluded return { "data": (UserTeam,), + "included": ([UserTeamIncluded],), } attribute_map = { "data": "data", + "included": "included", } - def __init__(self_, data: Union[UserTeam, UnsetType] = unset, **kwargs): + def __init__( + self_, + data: Union[UserTeam, UnsetType] = unset, + included: Union[List[Union[UserTeamIncluded, User]], UnsetType] = unset, + **kwargs, + ): """ Team membership response :param data: A user's relationship with a team :type data: UserTeam, optional + + :param included: Resources related to the team memberships + :type included: [UserTeamIncluded], optional """ if data is not unset: kwargs["data"] = data + if included is not unset: + kwargs["included"] = included super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 2e06926097..d7408692ea 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -1633,6 +1633,7 @@ from datadog_api_client.v2.model.user_team import UserTeam from datadog_api_client.v2.model.user_team_attributes import UserTeamAttributes from datadog_api_client.v2.model.user_team_create import UserTeamCreate +from datadog_api_client.v2.model.user_team_included import UserTeamIncluded from datadog_api_client.v2.model.user_team_permission import UserTeamPermission from datadog_api_client.v2.model.user_team_permission_attributes import UserTeamPermissionAttributes from datadog_api_client.v2.model.user_team_permission_type import UserTeamPermissionType @@ -3036,6 +3037,7 @@ "UserTeam", "UserTeamAttributes", "UserTeamCreate", + "UserTeamIncluded", "UserTeamPermission", "UserTeamPermissionAttributes", "UserTeamPermissionType",