async_openai/types/admin/
projects.rs1use crate::types::OpenAIError;
2use derive_builder::Builder;
3use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Serialize, Default, Clone, Builder, PartialEq)]
7#[builder(name = "ListProjectsQueryArgs")]
8#[builder(pattern = "mutable")]
9#[builder(setter(into, strip_option), default)]
10#[builder(derive(Debug))]
11#[builder(build_fn(error = "OpenAIError"))]
12pub struct ListProjectsQuery {
13 #[serde(skip_serializing_if = "Option::is_none")]
15 pub limit: Option<u32>,
16 #[serde(skip_serializing_if = "Option::is_none")]
18 pub after: Option<String>,
19 #[serde(skip_serializing_if = "Option::is_none")]
21 pub include_archived: Option<bool>,
22}
23
24#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq)]
26#[serde(rename_all = "lowercase")]
27pub enum ProjectStatus {
28 Active,
29 Archived,
30}
31
32#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
34pub struct Project {
35 pub id: String,
37 pub object: String,
39 pub name: String,
41 pub created_at: u64,
43 pub archived_at: Option<u64>,
45 pub status: ProjectStatus,
47}
48
49#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
51pub struct ProjectListResponse {
52 pub object: String,
53 pub data: Vec<Project>,
54 pub first_id: String,
55 pub last_id: String,
56 pub has_more: String,
57}
58
59#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Builder)]
61#[builder(name = "ProjectCreateRequestArgs")]
62#[builder(pattern = "mutable")]
63#[builder(setter(into, strip_option))]
64#[builder(derive(Debug))]
65#[builder(build_fn(error = "OpenAIError"))]
66pub struct ProjectCreateRequest {
67 pub name: String,
69}
70
71#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Builder)]
73#[builder(name = "ProjectUpdateRequestArgs")]
74#[builder(pattern = "mutable")]
75#[builder(setter(into, strip_option))]
76#[builder(derive(Debug))]
77#[builder(build_fn(error = "OpenAIError"))]
78pub struct ProjectUpdateRequest {
79 pub name: String,
81}
82
83#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
85pub struct ProjectGroup {
86 pub object: String,
88 pub project_id: String,
90 pub group_id: String,
92 pub group_name: String,
94 pub created_at: u64,
96}
97
98#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
100pub struct ProjectGroupListResource {
101 pub object: String,
103 pub data: Vec<ProjectGroup>,
105 pub has_more: bool,
107 pub next: Option<String>,
109}
110
111#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)]
113pub struct ProjectGroupDeletedResource {
114 pub object: String,
116 pub deleted: bool,
118}
119
120#[derive(Debug, Serialize, Deserialize, Builder, Clone, PartialEq)]
122#[builder(name = "InviteProjectGroupRequestArgs")]
123#[builder(pattern = "mutable")]
124#[builder(setter(into, strip_option))]
125#[builder(derive(Debug))]
126#[builder(build_fn(error = "OpenAIError"))]
127pub struct InviteProjectGroupBody {
128 pub group_id: String,
130 pub role: String,
132}