Skip to content

Commit caed47e

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 8cde148 of spec repo
1 parent c6f2d42 commit caed47e

8 files changed

Lines changed: 360 additions & 38 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 167 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81676,55 +81676,57 @@ components:
8167681676
description: Attributes of user object returned by the API.
8167781677
properties:
8167881678
created_at:
81679-
description: Creation time of the user.
81679+
description: The ISO 8601 timestamp of when the user account was created.
8168081680
format: date-time
8168181681
type: string
8168281682
disabled:
81683-
description: Whether the user is disabled.
81683+
description: Whether the user account is deactivated. Disabled users cannot log in.
8168481684
type: boolean
8168581685
email:
81686-
description: Email of the user.
81686+
description: The email address of the user, used for login and notifications.
8168781687
type: string
8168881688
handle:
81689-
description: Handle of the user.
81689+
description: The unique handle (username) of the user, typically matching their email prefix.
8169081690
type: string
8169181691
icon:
81692-
description: URL of the user's icon.
81692+
description: URL of the user's profile icon, typically a Gravatar URL derived from the email address.
8169381693
type: string
8169481694
last_login_time:
81695-
description: The last time the user logged in.
81695+
description: The ISO 8601 timestamp of the user's most recent login, or null if the user has never logged in.
8169681696
format: date-time
8169781697
nullable: true
8169881698
readOnly: true
8169981699
type: string
8170081700
mfa_enabled:
81701-
description: If user has MFA enabled.
81701+
description: Whether multi-factor authentication (MFA) is enabled for the user's account.
8170281702
readOnly: true
8170381703
type: boolean
8170481704
modified_at:
81705-
description: Time that the user was last modified.
81705+
description: The ISO 8601 timestamp of when the user account was last modified.
8170681706
format: date-time
8170781707
type: string
8170881708
name:
81709-
description: Name of the user.
81709+
description: The full display name of the user as shown in the Datadog UI.
8171081710
nullable: true
8171181711
type: string
8171281712
service_account:
81713-
description: Whether the user is a service account.
81713+
description: |-
81714+
Whether this is a service account rather than a human user.
81715+
Service accounts are used for programmatic API access.
8171481716
type: boolean
8171581717
status:
81716-
description: Status of the user.
81718+
description: The current status of the user account (for example, `Active`, `Pending`, or `Disabled`).
8171781719
type: string
8171881720
title:
81719-
description: Title of the user.
81721+
description: The job title of the user (for example, "Senior Engineer" or "Product Manager").
8172081722
nullable: true
8172181723
type: string
8172281724
uuid:
81723-
description: UUID of the user.
81725+
description: The globally unique identifier (UUID) of the user.
8172481726
readOnly: true
8172581727
type: string
8172681728
verified:
81727-
description: Whether the user is verified.
81729+
description: Whether the user's email address has been verified.
8172881730
type: boolean
8172981731
type: object
8173081732
UserAttributesStatus:
@@ -82126,13 +82128,23 @@ components:
8212682128
description: Attributes of the edited user.
8212782129
properties:
8212882130
disabled:
82129-
description: If the user is enabled or disabled.
82131+
description: |-
82132+
When set to `true`, the user is deactivated and can no longer log in.
82133+
When `false`, the user is active.
8213082134
type: boolean
8213182135
email:
82132-
description: The email of the user.
82136+
description: |-
82137+
The email address of the user, used for login and notifications.
82138+
Must be a valid email format.
8213382139
type: string
8213482140
name:
82135-
description: The name of the user.
82141+
description: |-
82142+
The full display name of the user as shown in the Datadog UI.
82143+
Maximum 55 characters, cannot contain `<` or `>`.
82144+
type: string
82145+
title:
82146+
description: The job title of the user (for example, "Senior Engineer" or "Product Manager").
82147+
nullable: true
8213682148
type: string
8213782149
type: object
8213882150
UserUpdateData:
@@ -96994,6 +97006,144 @@ paths:
9699497006
$ref: "#/components/responses/TooManyRequestsResponse"
9699597007
summary: Get all CSM Serverless Agents
9699697008
tags: ["CSM Agents"]
97009+
/api/v2/current_user:
97010+
get:
97011+
description: |-
97012+
Get the user associated with the current authentication context.
97013+
The response includes the user's profile attributes (name, email, handle,
97014+
status, MFA state), along with related resources: the user's organization,
97015+
assigned roles with their granted permissions, and team-scoped roles.
97016+
No additional permissions are required beyond valid authentication.
97017+
operationId: GetCurrentUser
97018+
responses:
97019+
"200":
97020+
content:
97021+
application/json:
97022+
examples:
97023+
default:
97024+
value:
97025+
data:
97026+
attributes:
97027+
created_at: "2024-01-15T10:30:00+00:00"
97028+
disabled: false
97029+
email: jane.doe@example.com
97030+
handle: jane.doe
97031+
icon: "https://secure.gravatar.com/avatar/abc123"
97032+
mfa_enabled: true
97033+
modified_at: "2024-06-01T12:00:00+00:00"
97034+
name: Jane Doe
97035+
service_account: false
97036+
status: Active
97037+
title: Senior Engineer
97038+
verified: true
97039+
id: 00000000-0000-9999-0000-000000000000
97040+
type: users
97041+
included: []
97042+
schema:
97043+
$ref: "#/components/schemas/UserResponse"
97044+
description: OK
97045+
"403":
97046+
content:
97047+
application/json:
97048+
schema:
97049+
$ref: "#/components/schemas/APIErrorResponse"
97050+
description: Authentication error
97051+
"429":
97052+
$ref: "#/components/responses/TooManyRequestsResponse"
97053+
security:
97054+
- apiKeyAuth: []
97055+
appKeyAuth: []
97056+
summary: Get current user
97057+
tags:
97058+
- Users
97059+
patch:
97060+
description: |-
97061+
Edit the profile of the currently authenticated user. Updatable fields
97062+
include `name`, `title`, `email`, and `disabled` status. The `id` field
97063+
in the request body must match the authenticated user's UUID; a mismatch
97064+
returns a 422 error. Email address changes are recorded in the audit trail.
97065+
Requires the `user_self_profile_write` permission.
97066+
operationId: UpdateCurrentUser
97067+
requestBody:
97068+
content:
97069+
application/json:
97070+
examples:
97071+
default:
97072+
value:
97073+
data:
97074+
attributes:
97075+
email: jane.doe@example.com
97076+
name: Jane Doe
97077+
title: Staff Engineer
97078+
id: 00000000-0000-9999-0000-000000000000
97079+
type: users
97080+
schema:
97081+
$ref: "#/components/schemas/UserUpdateRequest"
97082+
required: true
97083+
responses:
97084+
"200":
97085+
content:
97086+
application/json:
97087+
examples:
97088+
default:
97089+
value:
97090+
data:
97091+
attributes:
97092+
created_at: "2024-01-15T10:30:00+00:00"
97093+
disabled: false
97094+
email: jane.doe@example.com
97095+
handle: jane.doe
97096+
icon: "https://secure.gravatar.com/avatar/abc123"
97097+
mfa_enabled: true
97098+
modified_at: "2024-06-01T12:00:00+00:00"
97099+
name: Jane Doe
97100+
service_account: false
97101+
status: Active
97102+
title: Staff Engineer
97103+
verified: true
97104+
id: 00000000-0000-9999-0000-000000000000
97105+
type: users
97106+
included: []
97107+
schema:
97108+
$ref: "#/components/schemas/UserResponse"
97109+
description: OK
97110+
"400":
97111+
content:
97112+
application/json:
97113+
schema:
97114+
$ref: "#/components/schemas/APIErrorResponse"
97115+
description: Bad Request
97116+
"403":
97117+
content:
97118+
application/json:
97119+
schema:
97120+
$ref: "#/components/schemas/APIErrorResponse"
97121+
description: Authentication error
97122+
"404":
97123+
content:
97124+
application/json:
97125+
schema:
97126+
$ref: "#/components/schemas/APIErrorResponse"
97127+
description: Not found
97128+
"422":
97129+
content:
97130+
application/json:
97131+
schema:
97132+
$ref: "#/components/schemas/APIErrorResponse"
97133+
description: Unprocessable Entity
97134+
"429":
97135+
$ref: "#/components/responses/TooManyRequestsResponse"
97136+
security:
97137+
- apiKeyAuth: []
97138+
appKeyAuth: []
97139+
summary: Update current user
97140+
tags:
97141+
- Users
97142+
x-codegen-request-body-name: body
97143+
"x-permission":
97144+
operator: OR
97145+
permissions:
97146+
- user_self_profile_write
9699797147
/api/v2/current_user/application_keys:
9699897148
get:
9699997149
description: List all application keys available for current user
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
Get current user returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.users_api import UsersApi
7+
8+
configuration = Configuration()
9+
with ApiClient(configuration) as api_client:
10+
api_instance = UsersApi(api_client)
11+
response = api_instance.get_current_user()
12+
13+
print(response)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"""
2+
Update current user returns "OK" response
3+
"""
4+
5+
from datadog_api_client import ApiClient, Configuration
6+
from datadog_api_client.v2.api.users_api import UsersApi
7+
from datadog_api_client.v2.model.user_update_attributes import UserUpdateAttributes
8+
from datadog_api_client.v2.model.user_update_data import UserUpdateData
9+
from datadog_api_client.v2.model.user_update_request import UserUpdateRequest
10+
from datadog_api_client.v2.model.users_type import UsersType
11+
12+
body = UserUpdateRequest(
13+
data=UserUpdateData(
14+
attributes=UserUpdateAttributes(
15+
title=None,
16+
),
17+
id="00000000-0000-feed-0000-000000000000",
18+
type=UsersType.USERS,
19+
),
20+
)
21+
22+
configuration = Configuration()
23+
with ApiClient(configuration) as api_client:
24+
api_instance = UsersApi(api_client)
25+
response = api_instance.update_current_user(body=body)
26+
27+
print(response)

0 commit comments

Comments
 (0)