1use crate::types::OpenAIError;
2use derive_builder::Builder;
3use serde::{Deserialize, Serialize};
45use super::OrganizationRole;
67/// Represents an individual `user` within an organization.
8#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
9pub struct User {
10/// The object type, which is always `organization.user`
11pub object: String,
12/// The identifier, which can be referenced in API endpoints
13pub id: String,
14/// The name of the user
15pub name: String,
16/// The email address of the user
17pub email: String,
18/// `owner` or `reader`
19pub role: OrganizationRole,
20/// The Unix timestamp (in seconds) of when the users was added.
21pub added_at: u32,
22}
2324/// A list of `User` objects.
25#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
26pub struct UserListResponse {
27pub object: String,
28pub data: Vec<User>,
29pub first_id: String,
30pub last_id: String,
31pub has_more: bool,
32}
3334#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Builder)]
35#[builder(name = "UserRoleUpdateRequestArgs")]
36#[builder(pattern = "mutable")]
37#[builder(setter(into, strip_option))]
38#[builder(derive(Debug))]
39#[builder(build_fn(error = "OpenAIError"))]
40pub struct UserRoleUpdateRequest {
41/// `owner` or `reader`
42pub role: OrganizationRole,
43}
4445/// Confirmation of the deleted user
46#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
47pub struct UserDeleteResponse {
48pub object: String,
49pub id: String,
50pub deleted: bool,
51}