openai_struct/models/admin_api_key.rs
1/*
2 * OpenAI API
3 *
4 * The OpenAI REST API. Please see pub https://platform.openai.com/docs/api-reference for more details.
5 *
6 * OpenAPI spec pub version: 2.3.0
7 *
8 * Generated pub by: https://github.com/swagger-api/swagger-codegen.git
9 */
10
11/// pub AdminApiKey : Represents an individual Admin API key in an org.
12
13#[allow(unused_imports)]
14use serde_json::Value;
15
16/// # on openapi.yaml
17///
18/// ```yaml
19/// AdminApiKey:
20/// type: object
21/// description: Represents an individual Admin API key in an org.
22/// properties:
23/// object:
24/// type: string
25/// example: organization.admin_api_key
26/// description: The object type, which is always `organization.admin_api_key`
27/// x-stainless-const: true
28/// id:
29/// type: string
30/// example: key_abc
31/// description: The identifier, which can be referenced in API endpoints
32/// name:
33/// type: string
34/// example: Administration Key
35/// description: The name of the API key
36/// redacted_value:
37/// type: string
38/// example: sk-admin...def
39/// description: The redacted value of the API key
40/// value:
41/// type: string
42/// example: sk-admin-1234abcd
43/// description: The value of the API key. Only shown on create.
44/// created_at:
45/// type: integer
46/// format: int64
47/// example: 1711471533
48/// description: The Unix timestamp (in seconds) of when the API key was created
49/// last_used_at:
50/// type: integer
51/// format: int64
52/// nullable: true
53/// example: 1711471534
54/// description: The Unix timestamp (in seconds) of when the API key was last used
55/// owner:
56/// type: object
57/// properties:
58/// type:
59/// type: string
60/// example: user
61/// description: Always `user`
62/// object:
63/// type: string
64/// example: organization.user
65/// description: The object type, which is always organization.user
66/// id:
67/// type: string
68/// example: sa_456
69/// description: The identifier, which can be referenced in API endpoints
70/// name:
71/// type: string
72/// example: My Service Account
73/// description: The name of the user
74/// created_at:
75/// type: integer
76/// format: int64
77/// example: 1711471533
78/// description: The Unix timestamp (in seconds) of when the user was created
79/// role:
80/// type: string
81/// example: owner
82/// description: Always `owner`
83/// required:
84/// - object
85/// - redacted_value
86/// - name
87/// - created_at
88/// - last_used_at
89/// - id
90/// - owner
91/// x-oaiMeta:
92/// name: The admin API key object
93/// example: |
94/// {
95/// "object": "organization.admin_api_key",
96/// "id": "key_abc",
97/// "name": "Main Admin Key",
98/// "redacted_value": "sk-admin...xyz",
99/// "created_at": 1711471533,
100/// "last_used_at": 1711471534,
101/// "owner": {
102/// "type": "user",
103/// "object": "organization.user",
104/// "id": "user_123",
105/// "name": "John Doe",
106/// "created_at": 1711471533,
107/// "role": "owner"
108/// }
109/// }
110/// ```
111#[derive(Debug, Serialize, Deserialize)]
112pub struct AdminApiKey {
113 /// The Unix timestamp (in seconds) of when the API key was created
114 #[serde(rename = "created_at")]
115 pub created_at: i64,
116 /// The identifier, which can be referenced in API endpoints
117 #[serde(rename = "id")]
118 pub id: String,
119 /// The Unix timestamp (in seconds) of when the API key was last used
120 #[serde(rename = "last_used_at")]
121 pub last_used_at: i64,
122 /// The name of the API key
123 #[serde(rename = "name")]
124 pub name: String,
125 /// The object type, which is always `organization.admin_api_key`
126 #[serde(default = "default_object")]
127 #[serde(rename = "object")]
128 pub object: String,
129 #[serde(rename = "owner")]
130 pub owner: crate::models::AdminApiKeyOwner,
131 /// The redacted value of the API key
132 #[serde(rename = "redacted_value")]
133 pub redacted_value: String,
134 /// The value of the API key. Only shown on create.
135 #[serde(rename = "value")]
136 pub value: Option<String>,
137}
138
139fn default_object() -> String {
140 "organization.admin_api_key".into()
141}