diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6c5ab835071..88b9510c26a 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -81529,55 +81529,57 @@ components: description: Attributes of user object returned by the API. properties: created_at: - description: Creation time of the user. + description: The ISO 8601 timestamp of when the user account was created. format: date-time type: string disabled: - description: Whether the user is disabled. + description: Whether the user account is deactivated. Disabled users cannot log in. type: boolean email: - description: Email of the user. + description: The email address of the user, used for login and notifications. type: string handle: - description: Handle of the user. + description: The unique handle (username) of the user, typically matching their email prefix. type: string icon: - description: URL of the user's icon. + description: URL of the user's profile icon, typically a Gravatar URL derived from the email address. type: string last_login_time: - description: The last time the user logged in. + description: The ISO 8601 timestamp of the user's most recent login, or null if the user has never logged in. format: date-time nullable: true readOnly: true type: string mfa_enabled: - description: If user has MFA enabled. + description: Whether multi-factor authentication (MFA) is enabled for the user's account. readOnly: true type: boolean modified_at: - description: Time that the user was last modified. + description: The ISO 8601 timestamp of when the user account was last modified. format: date-time type: string name: - description: Name of the user. + description: The full display name of the user as shown in the Datadog UI. nullable: true type: string service_account: - description: Whether the user is a service account. + description: |- + Whether this is a service account rather than a human user. + Service accounts are used for programmatic API access. type: boolean status: - description: Status of the user. + description: The current status of the user account (for example, `Active`, `Pending`, or `Disabled`). type: string title: - description: Title of the user. + description: The job title of the user (for example, "Senior Engineer" or "Product Manager"). nullable: true type: string uuid: - description: UUID of the user. + description: The globally unique identifier (UUID) of the user. readOnly: true type: string verified: - description: Whether the user is verified. + description: Whether the user's email address has been verified. type: boolean type: object UserAttributesStatus: @@ -81979,13 +81981,23 @@ components: description: Attributes of the edited user. properties: disabled: - description: If the user is enabled or disabled. + description: |- + When set to `true`, the user is deactivated and can no longer log in. + When `false`, the user is active. type: boolean email: - description: The email of the user. + description: |- + The email address of the user, used for login and notifications. + Must be a valid email format. type: string name: - description: The name of the user. + description: |- + The full display name of the user as shown in the Datadog UI. + Maximum 55 characters, cannot contain `<` or `>`. + type: string + title: + description: The job title of the user (for example, "Senior Engineer" or "Product Manager"). + nullable: true type: string type: object UserUpdateData: @@ -96714,6 +96726,144 @@ paths: $ref: "#/components/responses/TooManyRequestsResponse" summary: Get all CSM Serverless Agents tags: ["CSM Agents"] + /api/v2/current_user: + get: + description: |- + Get the user associated with the current authentication context. + The response includes the user's profile attributes (name, email, handle, + status, MFA state), along with related resources: the user's organization, + assigned roles with their granted permissions, and team-scoped roles. + No additional permissions are required beyond valid authentication. + operationId: GetCurrentUser + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-15T10:30:00+00:00" + disabled: false + email: jane.doe@example.com + handle: jane.doe + icon: "https://secure.gravatar.com/avatar/abc123" + mfa_enabled: true + modified_at: "2024-06-01T12:00:00+00:00" + name: Jane Doe + service_account: false + status: Active + title: Senior Engineer + verified: true + id: 00000000-0000-9999-0000-000000000000 + type: users + included: [] + schema: + $ref: "#/components/schemas/UserResponse" + description: OK + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Authentication error + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get current user + tags: + - Users + patch: + description: |- + Edit the profile of the currently authenticated user. Updatable fields + include `name`, `title`, `email`, and `disabled` status. The `id` field + in the request body must match the authenticated user's UUID; a mismatch + returns a 422 error. Email address changes are recorded in the audit trail. + Requires the `user_access_manage` permission. + operationId: UpdateCurrentUser + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + email: jane.doe@example.com + name: Jane Doe + title: Staff Engineer + id: 00000000-0000-9999-0000-000000000000 + type: users + schema: + $ref: "#/components/schemas/UserUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-15T10:30:00+00:00" + disabled: false + email: jane.doe@example.com + handle: jane.doe + icon: "https://secure.gravatar.com/avatar/abc123" + mfa_enabled: true + modified_at: "2024-06-01T12:00:00+00:00" + name: Jane Doe + service_account: false + status: Active + title: Staff Engineer + verified: true + id: 00000000-0000-9999-0000-000000000000 + type: users + included: [] + schema: + $ref: "#/components/schemas/UserResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Bad Request + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Authentication error + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Not found + "422": + content: + application/json: + schema: + $ref: "#/components/schemas/APIErrorResponse" + description: Unprocessable Entity + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Update current user + tags: + - Users + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - user_access_manage /api/v2/current_user/application_keys: get: description: List all application keys available for current user diff --git a/examples/v2/users/GetCurrentUser.java b/examples/v2/users/GetCurrentUser.java new file mode 100644 index 00000000000..b890b5957e9 --- /dev/null +++ b/examples/v2/users/GetCurrentUser.java @@ -0,0 +1,24 @@ +// Get current user returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.UsersApi; +import com.datadog.api.client.v2.model.UserResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + UsersApi apiInstance = new UsersApi(defaultClient); + + try { + UserResponse result = apiInstance.getCurrentUser(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UsersApi#getCurrentUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/users/UpdateCurrentUser.java b/examples/v2/users/UpdateCurrentUser.java new file mode 100644 index 00000000000..3192670588a --- /dev/null +++ b/examples/v2/users/UpdateCurrentUser.java @@ -0,0 +1,36 @@ +// Update current user returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.UsersApi; +import com.datadog.api.client.v2.model.UserResponse; +import com.datadog.api.client.v2.model.UserUpdateAttributes; +import com.datadog.api.client.v2.model.UserUpdateData; +import com.datadog.api.client.v2.model.UserUpdateRequest; +import com.datadog.api.client.v2.model.UsersType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + UsersApi apiInstance = new UsersApi(defaultClient); + + UserUpdateRequest body = + new UserUpdateRequest() + .data( + new UserUpdateData() + .attributes(new UserUpdateAttributes().title(null)) + .id("00000000-0000-feed-0000-000000000000") + .type(UsersType.USERS)); + + try { + UserResponse result = apiInstance.updateCurrentUser(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling UsersApi#updateCurrentUser"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/UsersApi.java b/src/main/java/com/datadog/api/client/v2/api/UsersApi.java index 9440a49fabb..2f739044c91 100644 --- a/src/main/java/com/datadog/api/client/v2/api/UsersApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/UsersApi.java @@ -601,6 +601,118 @@ public CompletableFuture> disableUserWithHttpInfoAsync(String null); } + /** + * Get current user. + * + *

See {@link #getCurrentUserWithHttpInfo}. + * + * @return UserResponse + * @throws ApiException if fails to make API call + */ + public UserResponse getCurrentUser() throws ApiException { + return getCurrentUserWithHttpInfo().getData(); + } + + /** + * Get current user. + * + *

See {@link #getCurrentUserWithHttpInfoAsync}. + * + * @return CompletableFuture<UserResponse> + */ + public CompletableFuture getCurrentUserAsync() { + return getCurrentUserWithHttpInfoAsync() + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get the user associated with the current authentication context. The response includes the + * user's profile attributes (name, email, handle, status, MFA state), along with related + * resources: the user's organization, assigned roles with their granted permissions, and + * team-scoped roles. No additional permissions are required beyond valid authentication. + * + * @return ApiResponse<UserResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Authentication error -
429 Too many requests -
+ */ + public ApiResponse getCurrentUserWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/current_user"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.UsersApi.getCurrentUser", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get current user. + * + *

See {@link #getCurrentUserWithHttpInfo}. + * + * @return CompletableFuture<ApiResponse<UserResponse>> + */ + public CompletableFuture> getCurrentUserWithHttpInfoAsync() { + Object localVarPostBody = null; + // create path and map variables + String localVarPath = "/api/v2/current_user"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.UsersApi.getCurrentUser", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Get a user invitation. * @@ -1585,6 +1697,143 @@ public CompletableFuture> sendInvitationsWi new GenericType() {}); } + /** + * Update current user. + * + *

See {@link #updateCurrentUserWithHttpInfo}. + * + * @param body (required) + * @return UserResponse + * @throws ApiException if fails to make API call + */ + public UserResponse updateCurrentUser(UserUpdateRequest body) throws ApiException { + return updateCurrentUserWithHttpInfo(body).getData(); + } + + /** + * Update current user. + * + *

See {@link #updateCurrentUserWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<UserResponse> + */ + public CompletableFuture updateCurrentUserAsync(UserUpdateRequest body) { + return updateCurrentUserWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Edit the profile of the currently authenticated user. Updatable fields include name + * , title, email, and disabled status. The id + * field in the request body must match the authenticated user's UUID; a mismatch returns + * a 422 error. Email address changes are recorded in the audit trail. Requires the + * user_access_manage permission. + * + * @param body (required) + * @return ApiResponse<UserResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Authentication error -
404 Not found -
422 Unprocessable Entity -
429 Too many requests -
+ */ + public ApiResponse updateCurrentUserWithHttpInfo(UserUpdateRequest body) + throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateCurrentUser"); + } + // create path and map variables + String localVarPath = "/api/v2/current_user"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.UsersApi.updateCurrentUser", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Update current user. + * + *

See {@link #updateCurrentUserWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<UserResponse>> + */ + public CompletableFuture> updateCurrentUserWithHttpInfoAsync( + UserUpdateRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling updateCurrentUser")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/current_user"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.UsersApi.updateCurrentUser", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "PATCH", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + /** * Update a user. * diff --git a/src/main/java/com/datadog/api/client/v2/model/UserAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UserAttributes.java index e1264d262ca..4eeb301ef3f 100644 --- a/src/main/java/com/datadog/api/client/v2/model/UserAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/UserAttributes.java @@ -87,7 +87,7 @@ public UserAttributes createdAt(OffsetDateTime createdAt) { } /** - * Creation time of the user. + * The ISO 8601 timestamp of when the user account was created. * * @return createdAt */ @@ -108,7 +108,7 @@ public UserAttributes disabled(Boolean disabled) { } /** - * Whether the user is disabled. + * Whether the user account is deactivated. Disabled users cannot log in. * * @return disabled */ @@ -129,7 +129,7 @@ public UserAttributes email(String email) { } /** - * Email of the user. + * The email address of the user, used for login and notifications. * * @return email */ @@ -150,7 +150,7 @@ public UserAttributes handle(String handle) { } /** - * Handle of the user. + * The unique handle (username) of the user, typically matching their email prefix. * * @return handle */ @@ -171,7 +171,7 @@ public UserAttributes icon(String icon) { } /** - * URL of the user's icon. + * URL of the user's profile icon, typically a Gravatar URL derived from the email address. * * @return icon */ @@ -187,7 +187,8 @@ public void setIcon(String icon) { } /** - * The last time the user logged in. + * The ISO 8601 timestamp of the user's most recent login, or null if the user has never logged + * in. * * @return lastLoginTime */ @@ -213,7 +214,7 @@ private void setLastLoginTime_JsonNullable(JsonNullable lastLogi } /** - * If user has MFA enabled. + * Whether multi-factor authentication (MFA) is enabled for the user's account. * * @return mfaEnabled */ @@ -230,7 +231,7 @@ public UserAttributes modifiedAt(OffsetDateTime modifiedAt) { } /** - * Time that the user was last modified. + * The ISO 8601 timestamp of when the user account was last modified. * * @return modifiedAt */ @@ -251,7 +252,7 @@ public UserAttributes name(String name) { } /** - * Name of the user. + * The full display name of the user as shown in the Datadog UI. * * @return name */ @@ -282,7 +283,8 @@ public UserAttributes serviceAccount(Boolean serviceAccount) { } /** - * Whether the user is a service account. + * Whether this is a service account rather than a human user. Service accounts are used for + * programmatic API access. * * @return serviceAccount */ @@ -303,7 +305,8 @@ public UserAttributes status(String status) { } /** - * Status of the user. + * The current status of the user account (for example, Active, Pending, + * or Disabled). * * @return status */ @@ -324,7 +327,7 @@ public UserAttributes title(String title) { } /** - * Title of the user. + * The job title of the user (for example, "Senior Engineer" or "Product Manager"). * * @return title */ @@ -350,7 +353,7 @@ public void setTitle(String title) { } /** - * UUID of the user. + * The globally unique identifier (UUID) of the user. * * @return uuid */ @@ -367,7 +370,7 @@ public UserAttributes verified(Boolean verified) { } /** - * Whether the user is verified. + * Whether the user's email address has been verified. * * @return verified */ diff --git a/src/main/java/com/datadog/api/client/v2/model/UserUpdateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/UserUpdateAttributes.java index 0fa38e78188..a614ef896ac 100644 --- a/src/main/java/com/datadog/api/client/v2/model/UserUpdateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/UserUpdateAttributes.java @@ -15,12 +15,14 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; /** Attributes of the edited user. */ @JsonPropertyOrder({ UserUpdateAttributes.JSON_PROPERTY_DISABLED, UserUpdateAttributes.JSON_PROPERTY_EMAIL, - UserUpdateAttributes.JSON_PROPERTY_NAME + UserUpdateAttributes.JSON_PROPERTY_NAME, + UserUpdateAttributes.JSON_PROPERTY_TITLE }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -35,13 +37,17 @@ public class UserUpdateAttributes { public static final String JSON_PROPERTY_NAME = "name"; private String name; + public static final String JSON_PROPERTY_TITLE = "title"; + private JsonNullable title = JsonNullable.undefined(); + public UserUpdateAttributes disabled(Boolean disabled) { this.disabled = disabled; return this; } /** - * If the user is enabled or disabled. + * When set to true, the user is deactivated and can no longer log in. When + * false, the user is active. * * @return disabled */ @@ -62,7 +68,7 @@ public UserUpdateAttributes email(String email) { } /** - * The email of the user. + * The email address of the user, used for login and notifications. Must be a valid email format. * * @return email */ @@ -83,7 +89,8 @@ public UserUpdateAttributes name(String name) { } /** - * The name of the user. + * The full display name of the user as shown in the Datadog UI. Maximum 55 characters, cannot + * contain < or >. * * @return name */ @@ -98,6 +105,37 @@ public void setName(String name) { this.name = name; } + public UserUpdateAttributes title(String title) { + this.title = JsonNullable.of(title); + return this; + } + + /** + * The job title of the user (for example, "Senior Engineer" or "Product Manager"). + * + * @return title + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getTitle() { + return title.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getTitle_JsonNullable() { + return title; + } + + @JsonProperty(JSON_PROPERTY_TITLE) + public void setTitle_JsonNullable(JsonNullable title) { + this.title = title; + } + + public void setTitle(String title) { + this.title = JsonNullable.of(title); + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -157,12 +195,13 @@ public boolean equals(Object o) { return Objects.equals(this.disabled, userUpdateAttributes.disabled) && Objects.equals(this.email, userUpdateAttributes.email) && Objects.equals(this.name, userUpdateAttributes.name) + && Objects.equals(this.title, userUpdateAttributes.title) && Objects.equals(this.additionalProperties, userUpdateAttributes.additionalProperties); } @Override public int hashCode() { - return Objects.hash(disabled, email, name, additionalProperties); + return Objects.hash(disabled, email, name, title, additionalProperties); } @Override @@ -172,6 +211,7 @@ public String toString() { sb.append(" disabled: ").append(toIndentedString(disabled)).append("\n"); sb.append(" email: ").append(toIndentedString(email)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index a3e509a0bcb..72f55d80bcd 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -1506,6 +1506,19 @@ "type": "safe" } }, + "GetCurrentUser": { + "tag": "Users", + "undo": { + "type": "safe" + } + }, + "UpdateCurrentUser": { + "tag": "Users", + "undo": { + "operationId": "GetCurrentUser", + "type": "idempotent" + } + }, "ListCurrentUserApplicationKeys": { "tag": "Key Management", "undo": { diff --git a/src/test/resources/com/datadog/api/client/v2/api/users.feature b/src/test/resources/com/datadog/api/client/v2/api/users.feature index 2fee7ffedce..9d9fa489635 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/users.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/users.feature @@ -118,6 +118,12 @@ Feature: Users Then the response status is 200 OK And the response "data" has length 0 + @generated @skip @team:DataDog/org-management + Scenario: Get current user returns "OK" response + Given new "GetCurrentUser" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/org-management Scenario: Get user details returns "Not found" response Given new "GetUser" request @@ -181,7 +187,7 @@ Feature: Users Scenario: Update a user returns "Bad Request" response Given new "UpdateUser" request And request contains "user_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {}, "id": "00000000-0000-feed-0000-000000000000", "type": "users"}} + And body with value {"data": {"attributes": {"title": null}, "id": "00000000-0000-feed-0000-000000000000", "type": "users"}} When the request is sent Then the response status is 400 Bad Request @@ -219,6 +225,34 @@ Feature: Users Scenario: Update a user returns "Unprocessable Entity" response Given new "UpdateUser" request And request contains "user_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {}, "id": "00000000-0000-feed-0000-000000000000", "type": "users"}} + And body with value {"data": {"attributes": {"title": null}, "id": "00000000-0000-feed-0000-000000000000", "type": "users"}} + When the request is sent + Then the response status is 422 Unprocessable Entity + + @generated @skip @team:DataDog/org-management + Scenario: Update current user returns "Bad Request" response + Given new "UpdateCurrentUser" request + And body with value {"data": {"attributes": {"title": null}, "id": "00000000-0000-feed-0000-000000000000", "type": "users"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/org-management + Scenario: Update current user returns "Not found" response + Given new "UpdateCurrentUser" request + And body with value {"data": {"attributes": {"title": null}, "id": "00000000-0000-feed-0000-000000000000", "type": "users"}} + When the request is sent + Then the response status is 404 Not found + + @generated @skip @team:DataDog/org-management + Scenario: Update current user returns "OK" response + Given new "UpdateCurrentUser" request + And body with value {"data": {"attributes": {"title": null}, "id": "00000000-0000-feed-0000-000000000000", "type": "users"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/org-management + Scenario: Update current user returns "Unprocessable Entity" response + Given new "UpdateCurrentUser" request + And body with value {"data": {"attributes": {"title": null}, "id": "00000000-0000-feed-0000-000000000000", "type": "users"}} When the request is sent Then the response status is 422 Unprocessable Entity