updateUser method

Future<TUpdateUserResponse> updateUser({
  1. required TUpdateUserBody input,
})

Update a user in an existing organization.

Sign the provided TUpdateUserBody with the client's stamp function and submit the request (POST /public/v1/submit/update_user).

See also: stampUpdateUser.

Implementation

Future<TUpdateUserResponse> updateUser({
  required TUpdateUserBody input,
}) async {
  final body = packActivityBody(
    bodyJson: input.toJson(),
    fallbackOrganizationId: input.organizationId ??
        config.organizationId ??
        (throw Exception(
            "Missing organization ID, please pass in a sub-organizationId or instantiate the client with one.")),
    activityType: 'ACTIVITY_TYPE_UPDATE_USER',
  );
  return await request<Map<String, dynamic>, TUpdateUserResponse>(
      "/public/v1/submit/update_user",
      body,
      (json) => TUpdateUserResponse.fromJson(
          transformActivityResponse(json, 'UpdateUser')));
}