Skip to content

Commit daccacc

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 47ad0bea of spec repo
1 parent 78cdf5c commit daccacc

File tree

6 files changed

+113
-4
lines changed

6 files changed

+113
-4
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.5",
7-
"regenerated": "2023-08-03 18:00:20.627837",
8-
"spec_repo_commit": "b1453658"
7+
"regenerated": "2023-08-10 15:42:50.788715",
8+
"spec_repo_commit": "47ad0bea"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.5",
12-
"regenerated": "2023-08-03 18:00:20.651232",
13-
"spec_repo_commit": "b1453658"
12+
"regenerated": "2023-08-10 15:42:50.801474",
13+
"spec_repo_commit": "47ad0bea"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27621,6 +27621,40 @@ paths:
2762127621
tags:
2762227622
- Users
2762327623
x-codegen-request-body-name: body
27624+
/api/v2/users/{user_uuid}/memberships:
27625+
get:
27626+
description: Get a list of memberships for a user
27627+
operationId: GetUserMemberships
27628+
parameters:
27629+
- description: None
27630+
in: path
27631+
name: user_uuid
27632+
required: true
27633+
schema:
27634+
type: string
27635+
responses:
27636+
'200':
27637+
content:
27638+
application/json:
27639+
schema:
27640+
$ref: '#/components/schemas/UserTeamsResponse'
27641+
description: Represents a user's association to a team
27642+
'404':
27643+
content:
27644+
application/json:
27645+
schema:
27646+
$ref: '#/components/schemas/APIErrorResponse'
27647+
description: API error response.
27648+
'429':
27649+
$ref: '#/components/responses/TooManyRequestsResponse'
27650+
security:
27651+
- apiKeyAuth: []
27652+
appKeyAuth: []
27653+
- AuthZ:
27654+
- teams_read
27655+
summary: Get user memberships
27656+
tags:
27657+
- Teams
2762427658
security:
2762527659
- apiKeyAuth: []
2762627660
appKeyAuth: []
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""
2+
Get user memberships returns "Represents a user's association to a team" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.teams_api import TeamsApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = TeamsApi(api_client)
11+
response = api_instance.get_user_memberships(
12+
user_uuid="user_uuid",
13+
)
14+
15+
print(response)

src/datadog_api_client/v2/api/teams_api.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,29 @@ def __init__(self, api_client=None):
334334
api_client=api_client,
335335
)
336336

337+
self._get_user_memberships_endpoint = _Endpoint(
338+
settings={
339+
"response_type": (UserTeamsResponse,),
340+
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
341+
"endpoint_path": "/api/v2/users/{user_uuid}/memberships",
342+
"operation_id": "get_user_memberships",
343+
"http_method": "GET",
344+
"version": "v2",
345+
},
346+
params_map={
347+
"user_uuid": {
348+
"required": True,
349+
"openapi_types": (str,),
350+
"attribute": "user_uuid",
351+
"location": "path",
352+
},
353+
},
354+
headers_map={
355+
"accept": ["application/json"],
356+
},
357+
api_client=api_client,
358+
)
359+
337360
self._list_teams_endpoint = _Endpoint(
338361
settings={
339362
"response_type": (TeamsResponse,),
@@ -739,6 +762,23 @@ def get_team_permission_settings(
739762

740763
return self._get_team_permission_settings_endpoint.call_with_http_info(**kwargs)
741764

765+
def get_user_memberships(
766+
self,
767+
user_uuid: str,
768+
) -> UserTeamsResponse:
769+
"""Get user memberships.
770+
771+
Get a list of memberships for a user
772+
773+
:param user_uuid: None
774+
:type user_uuid: str
775+
:rtype: UserTeamsResponse
776+
"""
777+
kwargs: Dict[str, Any] = {}
778+
kwargs["user_uuid"] = user_uuid
779+
780+
return self._get_user_memberships_endpoint.call_with_http_info(**kwargs)
781+
742782
def list_teams(
743783
self,
744784
*,

tests/v2/features/teams.feature

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,20 @@ Feature: Teams
144144
When the request is sent
145145
Then the response status is 200 Represents a user's association to a team
146146

147+
@generated @skip @team:DataDog/core-app
148+
Scenario: Get user memberships returns "API error response." response
149+
Given new "GetUserMemberships" request
150+
And request contains "user_uuid" parameter from "REPLACE.ME"
151+
When the request is sent
152+
Then the response status is 404 API error response.
153+
154+
@generated @skip @team:DataDog/core-app
155+
Scenario: Get user memberships returns "Represents a user's association to a team" response
156+
Given new "GetUserMemberships" request
157+
And request contains "user_uuid" parameter from "REPLACE.ME"
158+
When the request is sent
159+
Then the response status is 200 Represents a user's association to a team
160+
147161
@team:DataDog/core-app
148162
Scenario: Remove a team link returns "API error response." response
149163
Given new "DeleteTeamLink" request

tests/v2/features/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,5 +1815,11 @@
18151815
"undo": {
18161816
"type": "safe"
18171817
}
1818+
},
1819+
"GetUserMemberships": {
1820+
"tag": "Teams",
1821+
"undo": {
1822+
"type": "safe"
1823+
}
18181824
}
18191825
}

0 commit comments

Comments
 (0)