Skip to main content

edgebase_core/generated/
api_core.rs

1//! Auto-generated core API Core — DO NOT EDIT.
2//! Regenerate: npx tsx tools/sdk-codegen/generate.ts
3//! Source: openapi.json (0.1.3)
4
5use crate::Error;
6use crate::HttpClient;
7use serde_json::Value;
8
9fn encode_path_param(value: &str) -> String {
10    urlencoding::encode(value).into_owned()
11}
12
13/// Auto-generated API methods.
14pub struct GeneratedDbApi<'a> {
15    http: &'a HttpClient,
16}
17
18impl<'a> GeneratedDbApi<'a> {
19    pub fn new(http: &'a HttpClient) -> Self {
20        Self { http }
21    }
22
23    /// Health check — GET /api/health
24    pub async fn get_health(&self) -> Result<Value, Error> {
25        self.http.get("/api/health").await
26    }
27
28    /// Sign up with email and password — POST /api/auth/signup
29    pub async fn auth_signup(&self, body: &Value) -> Result<Value, Error> {
30        self.http.post("/api/auth/signup", body).await
31    }
32
33    /// Sign in with email and password — POST /api/auth/signin
34    pub async fn auth_signin(&self, body: &Value) -> Result<Value, Error> {
35        self.http.post("/api/auth/signin", body).await
36    }
37
38    /// Sign in anonymously — POST /api/auth/signin/anonymous
39    pub async fn auth_signin_anonymous(&self, body: &Value) -> Result<Value, Error> {
40        self.http.post("/api/auth/signin/anonymous", body).await
41    }
42
43    /// Send magic link to email — POST /api/auth/signin/magic-link
44    pub async fn auth_signin_magic_link(&self, body: &Value) -> Result<Value, Error> {
45        self.http.post("/api/auth/signin/magic-link", body).await
46    }
47
48    /// Verify magic link token — POST /api/auth/verify-magic-link
49    pub async fn auth_verify_magic_link(&self, body: &Value) -> Result<Value, Error> {
50        self.http.post("/api/auth/verify-magic-link", body).await
51    }
52
53    /// Send OTP SMS to phone number — POST /api/auth/signin/phone
54    pub async fn auth_signin_phone(&self, body: &Value) -> Result<Value, Error> {
55        self.http.post("/api/auth/signin/phone", body).await
56    }
57
58    /// Verify phone OTP and create session — POST /api/auth/verify-phone
59    pub async fn auth_verify_phone(&self, body: &Value) -> Result<Value, Error> {
60        self.http.post("/api/auth/verify-phone", body).await
61    }
62
63    /// Link phone number to existing account — POST /api/auth/link/phone
64    pub async fn auth_link_phone(&self, body: &Value) -> Result<Value, Error> {
65        self.http.post("/api/auth/link/phone", body).await
66    }
67
68    /// Verify OTP and link phone to account — POST /api/auth/verify-link-phone
69    pub async fn auth_verify_link_phone(&self, body: &Value) -> Result<Value, Error> {
70        self.http.post("/api/auth/verify-link-phone", body).await
71    }
72
73    /// Send OTP code to email — POST /api/auth/signin/email-otp
74    pub async fn auth_signin_email_otp(&self, body: &Value) -> Result<Value, Error> {
75        self.http.post("/api/auth/signin/email-otp", body).await
76    }
77
78    /// Verify email OTP and create session — POST /api/auth/verify-email-otp
79    pub async fn auth_verify_email_otp(&self, body: &Value) -> Result<Value, Error> {
80        self.http.post("/api/auth/verify-email-otp", body).await
81    }
82
83    /// Enroll new TOTP factor — POST /api/auth/mfa/totp/enroll
84    pub async fn auth_mfa_totp_enroll(&self) -> Result<Value, Error> {
85        self.http.post("/api/auth/mfa/totp/enroll", &Value::Null).await
86    }
87
88    /// Confirm TOTP enrollment with code — POST /api/auth/mfa/totp/verify
89    pub async fn auth_mfa_totp_verify(&self, body: &Value) -> Result<Value, Error> {
90        self.http.post("/api/auth/mfa/totp/verify", body).await
91    }
92
93    /// Verify MFA code during signin — POST /api/auth/mfa/verify
94    pub async fn auth_mfa_verify(&self, body: &Value) -> Result<Value, Error> {
95        self.http.post("/api/auth/mfa/verify", body).await
96    }
97
98    /// Use recovery code during MFA signin — POST /api/auth/mfa/recovery
99    pub async fn auth_mfa_recovery(&self, body: &Value) -> Result<Value, Error> {
100        self.http.post("/api/auth/mfa/recovery", body).await
101    }
102
103    /// Disable TOTP factor — DELETE /api/auth/mfa/totp
104    pub async fn auth_mfa_totp_delete(&self, body: &Value) -> Result<Value, Error> {
105        self.http.delete_with_body("/api/auth/mfa/totp", body).await
106    }
107
108    /// List MFA factors for authenticated user — GET /api/auth/mfa/factors
109    pub async fn auth_mfa_factors(&self) -> Result<Value, Error> {
110        self.http.get("/api/auth/mfa/factors").await
111    }
112
113    /// Refresh access token — POST /api/auth/refresh
114    pub async fn auth_refresh(&self, body: &Value) -> Result<Value, Error> {
115        self.http.post("/api/auth/refresh", body).await
116    }
117
118    /// Sign out and revoke refresh token — POST /api/auth/signout
119    pub async fn auth_signout(&self, body: &Value) -> Result<Value, Error> {
120        self.http.post("/api/auth/signout", body).await
121    }
122
123    /// Change password for authenticated user — POST /api/auth/change-password
124    pub async fn auth_change_password(&self, body: &Value) -> Result<Value, Error> {
125        self.http.post("/api/auth/change-password", body).await
126    }
127
128    /// Request email change with password confirmation — POST /api/auth/change-email
129    pub async fn auth_change_email(&self, body: &Value) -> Result<Value, Error> {
130        self.http.post("/api/auth/change-email", body).await
131    }
132
133    /// Verify email change token — POST /api/auth/verify-email-change
134    pub async fn auth_verify_email_change(&self, body: &Value) -> Result<Value, Error> {
135        self.http.post("/api/auth/verify-email-change", body).await
136    }
137
138    /// Generate passkey registration options — POST /api/auth/passkeys/register-options
139    pub async fn auth_passkeys_register_options(&self) -> Result<Value, Error> {
140        self.http.post("/api/auth/passkeys/register-options", &Value::Null).await
141    }
142
143    /// Verify and store passkey registration — POST /api/auth/passkeys/register
144    pub async fn auth_passkeys_register(&self, body: &Value) -> Result<Value, Error> {
145        self.http.post("/api/auth/passkeys/register", body).await
146    }
147
148    /// Generate passkey authentication options — POST /api/auth/passkeys/auth-options
149    pub async fn auth_passkeys_auth_options(&self, body: &Value) -> Result<Value, Error> {
150        self.http.post("/api/auth/passkeys/auth-options", body).await
151    }
152
153    /// Authenticate with passkey — POST /api/auth/passkeys/authenticate
154    pub async fn auth_passkeys_authenticate(&self, body: &Value) -> Result<Value, Error> {
155        self.http.post("/api/auth/passkeys/authenticate", body).await
156    }
157
158    /// List passkeys for authenticated user — GET /api/auth/passkeys
159    pub async fn auth_passkeys_list(&self) -> Result<Value, Error> {
160        self.http.get("/api/auth/passkeys").await
161    }
162
163    /// Delete a passkey — DELETE /api/auth/passkeys/{credentialId}
164    pub async fn auth_passkeys_delete(&self, credential_id: &str) -> Result<Value, Error> {
165        self.http.delete(&format!("/api/auth/passkeys/{}", encode_path_param(credential_id))).await
166    }
167
168    /// Get current authenticated user info — GET /api/auth/me
169    pub async fn auth_get_me(&self) -> Result<Value, Error> {
170        self.http.get("/api/auth/me").await
171    }
172
173    /// Update user profile — PATCH /api/auth/profile
174    pub async fn auth_update_profile(&self, body: &Value) -> Result<Value, Error> {
175        self.http.patch("/api/auth/profile", body).await
176    }
177
178    /// List active sessions — GET /api/auth/sessions
179    pub async fn auth_get_sessions(&self) -> Result<Value, Error> {
180        self.http.get("/api/auth/sessions").await
181    }
182
183    /// Delete a session — DELETE /api/auth/sessions/{id}
184    pub async fn auth_delete_session(&self, id: &str) -> Result<Value, Error> {
185        self.http.delete(&format!("/api/auth/sessions/{}", encode_path_param(id))).await
186    }
187
188    /// List linked sign-in identities for the current user — GET /api/auth/identities
189    pub async fn auth_get_identities(&self) -> Result<Value, Error> {
190        self.http.get("/api/auth/identities").await
191    }
192
193    /// Unlink a linked sign-in identity — DELETE /api/auth/identities/{identityId}
194    pub async fn auth_delete_identity(&self, identity_id: &str) -> Result<Value, Error> {
195        self.http.delete(&format!("/api/auth/identities/{}", encode_path_param(identity_id))).await
196    }
197
198    /// Link email and password to existing account — POST /api/auth/link/email
199    pub async fn auth_link_email(&self, body: &Value) -> Result<Value, Error> {
200        self.http.post("/api/auth/link/email", body).await
201    }
202
203    /// Send a verification email to the current authenticated user — POST /api/auth/request-email-verification
204    pub async fn auth_request_email_verification(&self, body: &Value) -> Result<Value, Error> {
205        self.http.post("/api/auth/request-email-verification", body).await
206    }
207
208    /// Verify email address with token — POST /api/auth/verify-email
209    pub async fn auth_verify_email(&self, body: &Value) -> Result<Value, Error> {
210        self.http.post("/api/auth/verify-email", body).await
211    }
212
213    /// Request password reset email — POST /api/auth/request-password-reset
214    pub async fn auth_request_password_reset(&self, body: &Value) -> Result<Value, Error> {
215        self.http.post("/api/auth/request-password-reset", body).await
216    }
217
218    /// Reset password with token — POST /api/auth/reset-password
219    pub async fn auth_reset_password(&self, body: &Value) -> Result<Value, Error> {
220        self.http.post("/api/auth/reset-password", body).await
221    }
222
223    /// Start OAuth redirect — GET /api/auth/oauth/{provider}
224    pub async fn oauth_redirect(&self, provider: &str) -> Result<Value, Error> {
225        self.http.get(&format!("/api/auth/oauth/{}", encode_path_param(provider))).await
226    }
227
228    /// OAuth callback — GET /api/auth/oauth/{provider}/callback
229    pub async fn oauth_callback(&self, provider: &str) -> Result<Value, Error> {
230        self.http.get(&format!("/api/auth/oauth/{}/callback", encode_path_param(provider))).await
231    }
232
233    /// Start OAuth account linking — POST /api/auth/oauth/link/{provider}
234    pub async fn oauth_link_start(&self, provider: &str) -> Result<Value, Error> {
235        self.http.post(&format!("/api/auth/oauth/link/{}", encode_path_param(provider)), &Value::Null).await
236    }
237
238    /// OAuth link callback — GET /api/auth/oauth/link/{provider}/callback
239    pub async fn oauth_link_callback(&self, provider: &str) -> Result<Value, Error> {
240        self.http.get(&format!("/api/auth/oauth/link/{}/callback", encode_path_param(provider))).await
241    }
242
243    /// Count records in dynamic table — GET /api/db/{namespace}/{instanceId}/tables/{table}/count
244    pub async fn db_count_records(&self, namespace: &str, instance_id: &str, table: &str, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
245        self.http.get_with_query(&format!("/api/db/{}/{}/tables/{}/count", encode_path_param(namespace), encode_path_param(instance_id), encode_path_param(table)), query).await
246    }
247
248    /// Search records in dynamic table — GET /api/db/{namespace}/{instanceId}/tables/{table}/search
249    pub async fn db_search_records(&self, namespace: &str, instance_id: &str, table: &str, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
250        self.http.get_with_query(&format!("/api/db/{}/{}/tables/{}/search", encode_path_param(namespace), encode_path_param(instance_id), encode_path_param(table)), query).await
251    }
252
253    /// Get single record from dynamic table — GET /api/db/{namespace}/{instanceId}/tables/{table}/{id}
254    pub async fn db_get_record(&self, namespace: &str, instance_id: &str, table: &str, id: &str, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
255        self.http.get_with_query(&format!("/api/db/{}/{}/tables/{}/{}", encode_path_param(namespace), encode_path_param(instance_id), encode_path_param(table), encode_path_param(id)), query).await
256    }
257
258    /// Update record in dynamic table — PATCH /api/db/{namespace}/{instanceId}/tables/{table}/{id}
259    pub async fn db_update_record(&self, namespace: &str, instance_id: &str, table: &str, id: &str, body: &Value) -> Result<Value, Error> {
260        self.http.patch(&format!("/api/db/{}/{}/tables/{}/{}", encode_path_param(namespace), encode_path_param(instance_id), encode_path_param(table), encode_path_param(id)), body).await
261    }
262
263    /// Delete record from dynamic table — DELETE /api/db/{namespace}/{instanceId}/tables/{table}/{id}
264    pub async fn db_delete_record(&self, namespace: &str, instance_id: &str, table: &str, id: &str) -> Result<Value, Error> {
265        self.http.delete(&format!("/api/db/{}/{}/tables/{}/{}", encode_path_param(namespace), encode_path_param(instance_id), encode_path_param(table), encode_path_param(id))).await
266    }
267
268    /// List records from dynamic table — GET /api/db/{namespace}/{instanceId}/tables/{table}
269    pub async fn db_list_records(&self, namespace: &str, instance_id: &str, table: &str, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
270        self.http.get_with_query(&format!("/api/db/{}/{}/tables/{}", encode_path_param(namespace), encode_path_param(instance_id), encode_path_param(table)), query).await
271    }
272
273    /// Insert record into dynamic table — POST /api/db/{namespace}/{instanceId}/tables/{table}
274    pub async fn db_insert_record(&self, namespace: &str, instance_id: &str, table: &str, body: &Value, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
275        self.http.post_with_query(&format!("/api/db/{}/{}/tables/{}", encode_path_param(namespace), encode_path_param(instance_id), encode_path_param(table)), body, query).await
276    }
277
278    /// Batch insert records into dynamic table — POST /api/db/{namespace}/{instanceId}/tables/{table}/batch
279    pub async fn db_batch_records(&self, namespace: &str, instance_id: &str, table: &str, body: &Value, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
280        self.http.post_with_query(&format!("/api/db/{}/{}/tables/{}/batch", encode_path_param(namespace), encode_path_param(instance_id), encode_path_param(table)), body, query).await
281    }
282
283    /// Batch update/delete records by filter in dynamic table — POST /api/db/{namespace}/{instanceId}/tables/{table}/batch-by-filter
284    pub async fn db_batch_by_filter(&self, namespace: &str, instance_id: &str, table: &str, body: &Value, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
285        self.http.post_with_query(&format!("/api/db/{}/{}/tables/{}/batch-by-filter", encode_path_param(namespace), encode_path_param(instance_id), encode_path_param(table)), body, query).await
286    }
287
288    /// Check database live subscription WebSocket prerequisites — GET /api/db/connect-check
289    pub async fn check_database_subscription_connection(&self, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
290        self.http.get_with_query("/api/db/connect-check", query).await
291    }
292
293    /// Connect to database live subscriptions WebSocket — GET /api/db/subscribe
294    pub async fn connect_database_subscription(&self, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
295        self.http.get_with_query("/api/db/subscribe", query).await
296    }
297
298    /// Get table schema — GET /api/schema
299    pub async fn get_schema(&self) -> Result<Value, Error> {
300        self.http.get("/api/schema").await
301    }
302
303    /// Upload file — POST /api/storage/{bucket}/upload
304    pub async fn upload_file(&self, bucket: &str, body: &Value) -> Result<Value, Error> {
305        self.http.post(&format!("/api/storage/{}/upload", encode_path_param(bucket)), body).await
306    }
307
308    /// Get file metadata — GET /api/storage/{bucket}/{key}/metadata
309    pub async fn get_file_metadata(&self, bucket: &str, key: &str) -> Result<Value, Error> {
310        self.http.get(&format!("/api/storage/{}/{}/metadata", encode_path_param(bucket), encode_path_param(key))).await
311    }
312
313    /// Update file metadata — PATCH /api/storage/{bucket}/{key}/metadata
314    pub async fn update_file_metadata(&self, bucket: &str, key: &str, body: &Value) -> Result<Value, Error> {
315        self.http.patch(&format!("/api/storage/{}/{}/metadata", encode_path_param(bucket), encode_path_param(key)), body).await
316    }
317
318    /// Check if file exists — HEAD /api/storage/{bucket}/{key}
319    pub async fn check_file_exists(&self, bucket: &str, key: &str) -> Result<bool, Error> {
320        self.http.head(&format!("/api/storage/{}/{}", encode_path_param(bucket), encode_path_param(key))).await
321    }
322
323    /// Download file — GET /api/storage/{bucket}/{key}
324    pub async fn download_file(&self, bucket: &str, key: &str) -> Result<Value, Error> {
325        self.http.get(&format!("/api/storage/{}/{}", encode_path_param(bucket), encode_path_param(key))).await
326    }
327
328    /// Delete file — DELETE /api/storage/{bucket}/{key}
329    pub async fn delete_file(&self, bucket: &str, key: &str) -> Result<Value, Error> {
330        self.http.delete(&format!("/api/storage/{}/{}", encode_path_param(bucket), encode_path_param(key))).await
331    }
332
333    /// Get uploaded parts — GET /api/storage/{bucket}/uploads/{uploadId}/parts
334    pub async fn get_upload_parts(&self, bucket: &str, upload_id: &str, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
335        self.http.get_with_query(&format!("/api/storage/{}/uploads/{}/parts", encode_path_param(bucket), encode_path_param(upload_id)), query).await
336    }
337
338    /// List files in bucket — GET /api/storage/{bucket}
339    pub async fn list_files(&self, bucket: &str) -> Result<Value, Error> {
340        self.http.get(&format!("/api/storage/{}", encode_path_param(bucket))).await
341    }
342
343    /// Batch delete files — POST /api/storage/{bucket}/delete-batch
344    pub async fn delete_batch(&self, bucket: &str, body: &Value) -> Result<Value, Error> {
345        self.http.post(&format!("/api/storage/{}/delete-batch", encode_path_param(bucket)), body).await
346    }
347
348    /// Create signed download URL — POST /api/storage/{bucket}/signed-url
349    pub async fn create_signed_download_url(&self, bucket: &str, body: &Value) -> Result<Value, Error> {
350        self.http.post(&format!("/api/storage/{}/signed-url", encode_path_param(bucket)), body).await
351    }
352
353    /// Batch create signed download URLs — POST /api/storage/{bucket}/signed-urls
354    pub async fn create_signed_download_urls(&self, bucket: &str, body: &Value) -> Result<Value, Error> {
355        self.http.post(&format!("/api/storage/{}/signed-urls", encode_path_param(bucket)), body).await
356    }
357
358    /// Create signed upload URL — POST /api/storage/{bucket}/signed-upload-url
359    pub async fn create_signed_upload_url(&self, bucket: &str, body: &Value) -> Result<Value, Error> {
360        self.http.post(&format!("/api/storage/{}/signed-upload-url", encode_path_param(bucket)), body).await
361    }
362
363    /// Start multipart upload — POST /api/storage/{bucket}/multipart/create
364    pub async fn create_multipart_upload(&self, bucket: &str, body: &Value) -> Result<Value, Error> {
365        self.http.post(&format!("/api/storage/{}/multipart/create", encode_path_param(bucket)), body).await
366    }
367
368    /// Upload a part — POST /api/storage/{bucket}/multipart/upload-part
369    pub async fn upload_part(&self, bucket: &str, body: &Value) -> Result<Value, Error> {
370        self.http.post(&format!("/api/storage/{}/multipart/upload-part", encode_path_param(bucket)), body).await
371    }
372
373    /// Complete multipart upload — POST /api/storage/{bucket}/multipart/complete
374    pub async fn complete_multipart_upload(&self, bucket: &str, body: &Value) -> Result<Value, Error> {
375        self.http.post(&format!("/api/storage/{}/multipart/complete", encode_path_param(bucket)), body).await
376    }
377
378    /// Abort multipart upload — POST /api/storage/{bucket}/multipart/abort
379    pub async fn abort_multipart_upload(&self, bucket: &str, body: &Value) -> Result<Value, Error> {
380        self.http.post(&format!("/api/storage/{}/multipart/abort", encode_path_param(bucket)), body).await
381    }
382
383    /// Get public configuration — GET /api/config
384    pub async fn get_config(&self) -> Result<Value, Error> {
385        self.http.get("/api/config").await
386    }
387
388    /// Register push token — POST /api/push/register
389    pub async fn push_register(&self, body: &Value) -> Result<Value, Error> {
390        self.http.post("/api/push/register", body).await
391    }
392
393    /// Unregister push token — POST /api/push/unregister
394    pub async fn push_unregister(&self, body: &Value) -> Result<Value, Error> {
395        self.http.post("/api/push/unregister", body).await
396    }
397
398    /// Subscribe token to topic — POST /api/push/topic/subscribe
399    pub async fn push_topic_subscribe(&self, body: &Value) -> Result<Value, Error> {
400        self.http.post("/api/push/topic/subscribe", body).await
401    }
402
403    /// Unsubscribe token from topic — POST /api/push/topic/unsubscribe
404    pub async fn push_topic_unsubscribe(&self, body: &Value) -> Result<Value, Error> {
405        self.http.post("/api/push/topic/unsubscribe", body).await
406    }
407
408    /// Check room WebSocket connection prerequisites — GET /api/room/connect-check
409    pub async fn check_room_connection(&self, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
410        self.http.get_with_query("/api/room/connect-check", query).await
411    }
412
413    /// Connect to room WebSocket — GET /api/room
414    pub async fn connect_room(&self, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
415        self.http.get_with_query("/api/room", query).await
416    }
417
418    /// Get room metadata — GET /api/room/metadata
419    pub async fn get_room_metadata(&self, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
420        self.http.get_with_query("/api/room/metadata", query).await
421    }
422
423    /// Get the active room realtime media session — GET /api/room/media/realtime/session
424    pub async fn get_room_realtime_session(&self, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
425        self.http.get_with_query("/api/room/media/realtime/session", query).await
426    }
427
428    /// Create a room realtime media session — POST /api/room/media/realtime/session
429    pub async fn create_room_realtime_session(&self, body: &Value, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
430        self.http.post_with_query("/api/room/media/realtime/session", body, query).await
431    }
432
433    /// Generate TURN / ICE credentials for room realtime media — POST /api/room/media/realtime/turn
434    pub async fn create_room_realtime_ice_servers(&self, body: &Value, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
435        self.http.post_with_query("/api/room/media/realtime/turn", body, query).await
436    }
437
438    /// Add realtime media tracks to a room session — POST /api/room/media/realtime/tracks/new
439    pub async fn add_room_realtime_tracks(&self, body: &Value, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
440        self.http.post_with_query("/api/room/media/realtime/tracks/new", body, query).await
441    }
442
443    /// Renegotiate a room realtime media session — PUT /api/room/media/realtime/renegotiate
444    pub async fn renegotiate_room_realtime_session(&self, body: &Value, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
445        self.http.put_with_query("/api/room/media/realtime/renegotiate", body, query).await
446    }
447
448    /// Close room realtime media tracks — PUT /api/room/media/realtime/tracks/close
449    pub async fn close_room_realtime_tracks(&self, body: &Value, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
450        self.http.put_with_query("/api/room/media/realtime/tracks/close", body, query).await
451    }
452
453    /// Track custom events — POST /api/analytics/track
454    pub async fn track_events(&self, body: &Value) -> Result<Value, Error> {
455        self.http.post("/api/analytics/track", body).await
456    }
457
458    /// Count records in a single-instance table — GET /api/db/{namespace}/tables/{table}/count
459    pub async fn db_single_count_records(&self, namespace: &str, table: &str, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
460        self.http.get_with_query(&format!("/api/db/{}/tables/{}/count", encode_path_param(namespace), encode_path_param(table)), query).await
461    }
462
463    /// Search records in a single-instance table — GET /api/db/{namespace}/tables/{table}/search
464    pub async fn db_single_search_records(&self, namespace: &str, table: &str, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
465        self.http.get_with_query(&format!("/api/db/{}/tables/{}/search", encode_path_param(namespace), encode_path_param(table)), query).await
466    }
467
468    /// Get a single record from a single-instance table — GET /api/db/{namespace}/tables/{table}/{id}
469    pub async fn db_single_get_record(&self, namespace: &str, table: &str, id: &str, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
470        self.http.get_with_query(&format!("/api/db/{}/tables/{}/{}", encode_path_param(namespace), encode_path_param(table), encode_path_param(id)), query).await
471    }
472
473    /// Update a record in a single-instance table — PATCH /api/db/{namespace}/tables/{table}/{id}
474    pub async fn db_single_update_record(&self, namespace: &str, table: &str, id: &str, body: &Value) -> Result<Value, Error> {
475        self.http.patch(&format!("/api/db/{}/tables/{}/{}", encode_path_param(namespace), encode_path_param(table), encode_path_param(id)), body).await
476    }
477
478    /// Delete a record from a single-instance table — DELETE /api/db/{namespace}/tables/{table}/{id}
479    pub async fn db_single_delete_record(&self, namespace: &str, table: &str, id: &str) -> Result<Value, Error> {
480        self.http.delete(&format!("/api/db/{}/tables/{}/{}", encode_path_param(namespace), encode_path_param(table), encode_path_param(id))).await
481    }
482
483    /// List records from a single-instance table — GET /api/db/{namespace}/tables/{table}
484    pub async fn db_single_list_records(&self, namespace: &str, table: &str, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
485        self.http.get_with_query(&format!("/api/db/{}/tables/{}", encode_path_param(namespace), encode_path_param(table)), query).await
486    }
487
488    /// Insert a record into a single-instance table — POST /api/db/{namespace}/tables/{table}
489    pub async fn db_single_insert_record(&self, namespace: &str, table: &str, body: &Value, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
490        self.http.post_with_query(&format!("/api/db/{}/tables/{}", encode_path_param(namespace), encode_path_param(table)), body, query).await
491    }
492
493    /// Batch insert records into a single-instance table — POST /api/db/{namespace}/tables/{table}/batch
494    pub async fn db_single_batch_records(&self, namespace: &str, table: &str, body: &Value, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
495        self.http.post_with_query(&format!("/api/db/{}/tables/{}/batch", encode_path_param(namespace), encode_path_param(table)), body, query).await
496    }
497
498    /// Batch update/delete records by filter in a single-instance table — POST /api/db/{namespace}/tables/{table}/batch-by-filter
499    pub async fn db_single_batch_by_filter(&self, namespace: &str, table: &str, body: &Value, query: &std::collections::HashMap<String, String>) -> Result<Value, Error> {
500        self.http.post_with_query(&format!("/api/db/{}/tables/{}/batch-by-filter", encode_path_param(namespace), encode_path_param(table)), body, query).await
501    }
502}
503
504// ─── Path Constants ────────────────────────────────────────────────────────
505
506pub struct ApiPaths;
507
508impl ApiPaths {
509    pub const ADMIN_LOGIN: &'static str = "/admin/api/auth/login";
510    pub const ADMIN_REFRESH: &'static str = "/admin/api/auth/refresh";
511    pub const BACKUP_CLEANUP_PLUGIN: &'static str = "/admin/api/backup/cleanup-plugin";
512    pub const BACKUP_GET_CONFIG: &'static str = "/admin/api/backup/config";
513    pub const BACKUP_DUMP_CONTROL_D1: &'static str = "/admin/api/backup/dump-control-d1";
514    pub const BACKUP_DUMP_D1: &'static str = "/admin/api/backup/dump-d1";
515    pub const BACKUP_DUMP_DATA: &'static str = "/admin/api/backup/dump-data";
516    pub const BACKUP_DUMP_DO: &'static str = "/admin/api/backup/dump-do";
517    pub const BACKUP_DUMP_STORAGE: &'static str = "/admin/api/backup/dump-storage";
518    pub fn backup_export_table(name: &str) -> String {
519        format!("/admin/api/backup/export/{}", name)
520    }
521    pub const BACKUP_LIST_DOS: &'static str = "/admin/api/backup/list-dos";
522    pub const BACKUP_RESTORE_CONTROL_D1: &'static str = "/admin/api/backup/restore-control-d1";
523    pub const BACKUP_RESTORE_D1: &'static str = "/admin/api/backup/restore-d1";
524    pub const BACKUP_RESTORE_DATA: &'static str = "/admin/api/backup/restore-data";
525    pub const BACKUP_RESTORE_DO: &'static str = "/admin/api/backup/restore-do";
526    pub const BACKUP_RESTORE_STORAGE: &'static str = "/admin/api/backup/restore-storage";
527    pub const BACKUP_RESYNC_USERS_PUBLIC: &'static str = "/admin/api/backup/resync-users-public";
528    pub const BACKUP_WIPE_DO: &'static str = "/admin/api/backup/wipe-do";
529    pub const ADMIN_LIST_ADMINS: &'static str = "/admin/api/data/admins";
530    pub const ADMIN_CREATE_ADMIN: &'static str = "/admin/api/data/admins";
531    pub fn admin_delete_admin(id: &str) -> String {
532        format!("/admin/api/data/admins/{}", id)
533    }
534    pub fn admin_change_password(id: &str) -> String {
535        format!("/admin/api/data/admins/{}/password", id)
536    }
537    pub const ADMIN_GET_ANALYTICS: &'static str = "/admin/api/data/analytics";
538    pub const ADMIN_GET_ANALYTICS_EVENTS: &'static str = "/admin/api/data/analytics/events";
539    pub const ADMIN_GET_AUTH_SETTINGS: &'static str = "/admin/api/data/auth/settings";
540    pub const ADMIN_BACKUP_GET_CONFIG: &'static str = "/admin/api/data/backup/config";
541    pub const ADMIN_BACKUP_DUMP_D1: &'static str = "/admin/api/data/backup/dump-d1";
542    pub const ADMIN_BACKUP_DUMP_DO: &'static str = "/admin/api/data/backup/dump-do";
543    pub const ADMIN_BACKUP_LIST_DOS: &'static str = "/admin/api/data/backup/list-dos";
544    pub const ADMIN_BACKUP_RESTORE_D1: &'static str = "/admin/api/data/backup/restore-d1";
545    pub const ADMIN_BACKUP_RESTORE_DO: &'static str = "/admin/api/data/backup/restore-do";
546    pub const ADMIN_CLEANUP_ANON: &'static str = "/admin/api/data/cleanup-anon";
547    pub const ADMIN_GET_CONFIG_INFO: &'static str = "/admin/api/data/config-info";
548    pub const ADMIN_GET_DEV_INFO: &'static str = "/admin/api/data/dev-info";
549    pub const ADMIN_GET_EMAIL_TEMPLATES: &'static str = "/admin/api/data/email/templates";
550    pub const ADMIN_LIST_FUNCTIONS: &'static str = "/admin/api/data/functions";
551    pub const ADMIN_GET_LOGS: &'static str = "/admin/api/data/logs";
552    pub const ADMIN_GET_RECENT_LOGS: &'static str = "/admin/api/data/logs/recent";
553    pub const ADMIN_GET_MONITORING: &'static str = "/admin/api/data/monitoring";
554    pub const ADMIN_GET_OVERVIEW: &'static str = "/admin/api/data/overview";
555    pub const ADMIN_GET_PUSH_LOGS: &'static str = "/admin/api/data/push/logs";
556    pub const ADMIN_TEST_PUSH_SEND: &'static str = "/admin/api/data/push/test-send";
557    pub const ADMIN_GET_PUSH_TOKENS: &'static str = "/admin/api/data/push/tokens";
558    pub const ADMIN_RULES_TEST: &'static str = "/admin/api/data/rules-test";
559    pub const ADMIN_GET_SCHEMA: &'static str = "/admin/api/data/schema";
560    pub const ADMIN_EXECUTE_SQL: &'static str = "/admin/api/data/sql";
561    pub const ADMIN_LIST_BUCKETS: &'static str = "/admin/api/data/storage/buckets";
562    pub fn admin_list_bucket_objects(name: &str) -> String {
563        format!("/admin/api/data/storage/buckets/{}/objects", name)
564    }
565    pub fn admin_get_bucket_object(name: &str, key: &str) -> String {
566        format!("/admin/api/data/storage/buckets/{}/objects/{}", name, key)
567    }
568    pub fn admin_delete_bucket_object(name: &str, key: &str) -> String {
569        format!("/admin/api/data/storage/buckets/{}/objects/{}", name, key)
570    }
571    pub fn admin_create_signed_url(name: &str) -> String {
572        format!("/admin/api/data/storage/buckets/{}/signed-url", name)
573    }
574    pub fn admin_get_bucket_stats(name: &str) -> String {
575        format!("/admin/api/data/storage/buckets/{}/stats", name)
576    }
577    pub fn admin_upload_file(name: &str) -> String {
578        format!("/admin/api/data/storage/buckets/{}/upload", name)
579    }
580    pub const ADMIN_LIST_TABLES: &'static str = "/admin/api/data/tables";
581    pub fn admin_export_table(name: &str) -> String {
582        format!("/admin/api/data/tables/{}/export", name)
583    }
584    pub fn admin_import_table(name: &str) -> String {
585        format!("/admin/api/data/tables/{}/import", name)
586    }
587    pub fn admin_get_table_records(name: &str) -> String {
588        format!("/admin/api/data/tables/{}/records", name)
589    }
590    pub fn admin_create_table_record(name: &str) -> String {
591        format!("/admin/api/data/tables/{}/records", name)
592    }
593    pub fn admin_update_table_record(name: &str, id: &str) -> String {
594        format!("/admin/api/data/tables/{}/records/{}", name, id)
595    }
596    pub fn admin_delete_table_record(name: &str, id: &str) -> String {
597        format!("/admin/api/data/tables/{}/records/{}", name, id)
598    }
599    pub const ADMIN_LIST_USERS: &'static str = "/admin/api/data/users";
600    pub const ADMIN_CREATE_USER: &'static str = "/admin/api/data/users";
601    pub fn admin_get_user(id: &str) -> String {
602        format!("/admin/api/data/users/{}", id)
603    }
604    pub fn admin_update_user(id: &str) -> String {
605        format!("/admin/api/data/users/{}", id)
606    }
607    pub fn admin_delete_user(id: &str) -> String {
608        format!("/admin/api/data/users/{}", id)
609    }
610    pub fn admin_delete_user_mfa(id: &str) -> String {
611        format!("/admin/api/data/users/{}/mfa", id)
612    }
613    pub fn admin_get_user_profile(id: &str) -> String {
614        format!("/admin/api/data/users/{}/profile", id)
615    }
616    pub fn admin_send_password_reset(id: &str) -> String {
617        format!("/admin/api/data/users/{}/send-password-reset", id)
618    }
619    pub fn admin_delete_user_sessions(id: &str) -> String {
620        format!("/admin/api/data/users/{}/sessions", id)
621    }
622    pub const ADMIN_RESET_PASSWORD: &'static str = "/admin/api/internal/reset-password";
623    pub const ADMIN_SETUP: &'static str = "/admin/api/setup";
624    pub const ADMIN_SETUP_STATUS: &'static str = "/admin/api/setup/status";
625    pub const QUERY_CUSTOM_EVENTS: &'static str = "/api/analytics/events";
626    pub const QUERY_ANALYTICS: &'static str = "/api/analytics/query";
627    pub const TRACK_EVENTS: &'static str = "/api/analytics/track";
628    pub const ADMIN_AUTH_LIST_USERS: &'static str = "/api/auth/admin/users";
629    pub const ADMIN_AUTH_CREATE_USER: &'static str = "/api/auth/admin/users";
630    pub fn admin_auth_get_user(id: &str) -> String {
631        format!("/api/auth/admin/users/{}", id)
632    }
633    pub fn admin_auth_update_user(id: &str) -> String {
634        format!("/api/auth/admin/users/{}", id)
635    }
636    pub fn admin_auth_delete_user(id: &str) -> String {
637        format!("/api/auth/admin/users/{}", id)
638    }
639    pub fn admin_auth_set_claims(id: &str) -> String {
640        format!("/api/auth/admin/users/{}/claims", id)
641    }
642    pub fn admin_auth_delete_user_mfa(id: &str) -> String {
643        format!("/api/auth/admin/users/{}/mfa", id)
644    }
645    pub fn admin_auth_revoke_user_sessions(id: &str) -> String {
646        format!("/api/auth/admin/users/{}/revoke", id)
647    }
648    pub const ADMIN_AUTH_IMPORT_USERS: &'static str = "/api/auth/admin/users/import";
649    pub const AUTH_CHANGE_EMAIL: &'static str = "/api/auth/change-email";
650    pub const AUTH_CHANGE_PASSWORD: &'static str = "/api/auth/change-password";
651    pub const AUTH_GET_IDENTITIES: &'static str = "/api/auth/identities";
652    pub fn auth_delete_identity(identity_id: &str) -> String {
653        format!("/api/auth/identities/{}", identity_id)
654    }
655    pub const AUTH_LINK_EMAIL: &'static str = "/api/auth/link/email";
656    pub const AUTH_LINK_PHONE: &'static str = "/api/auth/link/phone";
657    pub const AUTH_GET_ME: &'static str = "/api/auth/me";
658    pub const AUTH_MFA_FACTORS: &'static str = "/api/auth/mfa/factors";
659    pub const AUTH_MFA_RECOVERY: &'static str = "/api/auth/mfa/recovery";
660    pub const AUTH_MFA_TOTP_DELETE: &'static str = "/api/auth/mfa/totp";
661    pub const AUTH_MFA_TOTP_ENROLL: &'static str = "/api/auth/mfa/totp/enroll";
662    pub const AUTH_MFA_TOTP_VERIFY: &'static str = "/api/auth/mfa/totp/verify";
663    pub const AUTH_MFA_VERIFY: &'static str = "/api/auth/mfa/verify";
664    pub fn oauth_redirect(provider: &str) -> String {
665        format!("/api/auth/oauth/{}", provider)
666    }
667    pub fn oauth_callback(provider: &str) -> String {
668        format!("/api/auth/oauth/{}/callback", provider)
669    }
670    pub fn oauth_link_start(provider: &str) -> String {
671        format!("/api/auth/oauth/link/{}", provider)
672    }
673    pub fn oauth_link_callback(provider: &str) -> String {
674        format!("/api/auth/oauth/link/{}/callback", provider)
675    }
676    pub const AUTH_PASSKEYS_LIST: &'static str = "/api/auth/passkeys";
677    pub fn auth_passkeys_delete(credential_id: &str) -> String {
678        format!("/api/auth/passkeys/{}", credential_id)
679    }
680    pub const AUTH_PASSKEYS_AUTH_OPTIONS: &'static str = "/api/auth/passkeys/auth-options";
681    pub const AUTH_PASSKEYS_AUTHENTICATE: &'static str = "/api/auth/passkeys/authenticate";
682    pub const AUTH_PASSKEYS_REGISTER: &'static str = "/api/auth/passkeys/register";
683    pub const AUTH_PASSKEYS_REGISTER_OPTIONS: &'static str = "/api/auth/passkeys/register-options";
684    pub const AUTH_UPDATE_PROFILE: &'static str = "/api/auth/profile";
685    pub const AUTH_REFRESH: &'static str = "/api/auth/refresh";
686    pub const AUTH_REQUEST_EMAIL_VERIFICATION: &'static str = "/api/auth/request-email-verification";
687    pub const AUTH_REQUEST_PASSWORD_RESET: &'static str = "/api/auth/request-password-reset";
688    pub const AUTH_RESET_PASSWORD: &'static str = "/api/auth/reset-password";
689    pub const AUTH_GET_SESSIONS: &'static str = "/api/auth/sessions";
690    pub fn auth_delete_session(id: &str) -> String {
691        format!("/api/auth/sessions/{}", id)
692    }
693    pub const AUTH_SIGNIN: &'static str = "/api/auth/signin";
694    pub const AUTH_SIGNIN_ANONYMOUS: &'static str = "/api/auth/signin/anonymous";
695    pub const AUTH_SIGNIN_EMAIL_OTP: &'static str = "/api/auth/signin/email-otp";
696    pub const AUTH_SIGNIN_MAGIC_LINK: &'static str = "/api/auth/signin/magic-link";
697    pub const AUTH_SIGNIN_PHONE: &'static str = "/api/auth/signin/phone";
698    pub const AUTH_SIGNOUT: &'static str = "/api/auth/signout";
699    pub const AUTH_SIGNUP: &'static str = "/api/auth/signup";
700    pub const AUTH_VERIFY_EMAIL: &'static str = "/api/auth/verify-email";
701    pub const AUTH_VERIFY_EMAIL_CHANGE: &'static str = "/api/auth/verify-email-change";
702    pub const AUTH_VERIFY_EMAIL_OTP: &'static str = "/api/auth/verify-email-otp";
703    pub const AUTH_VERIFY_LINK_PHONE: &'static str = "/api/auth/verify-link-phone";
704    pub const AUTH_VERIFY_MAGIC_LINK: &'static str = "/api/auth/verify-magic-link";
705    pub const AUTH_VERIFY_PHONE: &'static str = "/api/auth/verify-phone";
706    pub const GET_CONFIG: &'static str = "/api/config";
707    pub fn execute_d1_query(database: &str) -> String {
708        format!("/api/d1/{}", database)
709    }
710    pub fn db_list_records(namespace: &str, instance_id: &str, table: &str) -> String {
711        format!("/api/db/{}/{}/tables/{}", namespace, instance_id, table)
712    }
713    pub fn db_insert_record(namespace: &str, instance_id: &str, table: &str) -> String {
714        format!("/api/db/{}/{}/tables/{}", namespace, instance_id, table)
715    }
716    pub fn db_get_record(namespace: &str, instance_id: &str, table: &str, id: &str) -> String {
717        format!("/api/db/{}/{}/tables/{}/{}", namespace, instance_id, table, id)
718    }
719    pub fn db_update_record(namespace: &str, instance_id: &str, table: &str, id: &str) -> String {
720        format!("/api/db/{}/{}/tables/{}/{}", namespace, instance_id, table, id)
721    }
722    pub fn db_delete_record(namespace: &str, instance_id: &str, table: &str, id: &str) -> String {
723        format!("/api/db/{}/{}/tables/{}/{}", namespace, instance_id, table, id)
724    }
725    pub fn db_batch_records(namespace: &str, instance_id: &str, table: &str) -> String {
726        format!("/api/db/{}/{}/tables/{}/batch", namespace, instance_id, table)
727    }
728    pub fn db_batch_by_filter(namespace: &str, instance_id: &str, table: &str) -> String {
729        format!("/api/db/{}/{}/tables/{}/batch-by-filter", namespace, instance_id, table)
730    }
731    pub fn db_count_records(namespace: &str, instance_id: &str, table: &str) -> String {
732        format!("/api/db/{}/{}/tables/{}/count", namespace, instance_id, table)
733    }
734    pub fn db_search_records(namespace: &str, instance_id: &str, table: &str) -> String {
735        format!("/api/db/{}/{}/tables/{}/search", namespace, instance_id, table)
736    }
737    pub fn db_single_list_records(namespace: &str, table: &str) -> String {
738        format!("/api/db/{}/tables/{}", namespace, table)
739    }
740    pub fn db_single_insert_record(namespace: &str, table: &str) -> String {
741        format!("/api/db/{}/tables/{}", namespace, table)
742    }
743    pub fn db_single_get_record(namespace: &str, table: &str, id: &str) -> String {
744        format!("/api/db/{}/tables/{}/{}", namespace, table, id)
745    }
746    pub fn db_single_update_record(namespace: &str, table: &str, id: &str) -> String {
747        format!("/api/db/{}/tables/{}/{}", namespace, table, id)
748    }
749    pub fn db_single_delete_record(namespace: &str, table: &str, id: &str) -> String {
750        format!("/api/db/{}/tables/{}/{}", namespace, table, id)
751    }
752    pub fn db_single_batch_records(namespace: &str, table: &str) -> String {
753        format!("/api/db/{}/tables/{}/batch", namespace, table)
754    }
755    pub fn db_single_batch_by_filter(namespace: &str, table: &str) -> String {
756        format!("/api/db/{}/tables/{}/batch-by-filter", namespace, table)
757    }
758    pub fn db_single_count_records(namespace: &str, table: &str) -> String {
759        format!("/api/db/{}/tables/{}/count", namespace, table)
760    }
761    pub fn db_single_search_records(namespace: &str, table: &str) -> String {
762        format!("/api/db/{}/tables/{}/search", namespace, table)
763    }
764    pub const DATABASE_LIVE_BROADCAST: &'static str = "/api/db/broadcast";
765    pub const CHECK_DATABASE_SUBSCRIPTION_CONNECTION: &'static str = "/api/db/connect-check";
766    pub const CONNECT_DATABASE_SUBSCRIPTION: &'static str = "/api/db/subscribe";
767    pub const GET_HEALTH: &'static str = "/api/health";
768    pub fn kv_operation(namespace: &str) -> String {
769        format!("/api/kv/{}", namespace)
770    }
771    pub const PUSH_BROADCAST: &'static str = "/api/push/broadcast";
772    pub const GET_PUSH_LOGS: &'static str = "/api/push/logs";
773    pub const PUSH_REGISTER: &'static str = "/api/push/register";
774    pub const PUSH_SEND: &'static str = "/api/push/send";
775    pub const PUSH_SEND_MANY: &'static str = "/api/push/send-many";
776    pub const PUSH_SEND_TO_TOKEN: &'static str = "/api/push/send-to-token";
777    pub const PUSH_SEND_TO_TOPIC: &'static str = "/api/push/send-to-topic";
778    pub const GET_PUSH_TOKENS: &'static str = "/api/push/tokens";
779    pub const PUT_PUSH_TOKENS: &'static str = "/api/push/tokens";
780    pub const PATCH_PUSH_TOKENS: &'static str = "/api/push/tokens";
781    pub const PUSH_TOPIC_SUBSCRIBE: &'static str = "/api/push/topic/subscribe";
782    pub const PUSH_TOPIC_UNSUBSCRIBE: &'static str = "/api/push/topic/unsubscribe";
783    pub const PUSH_UNREGISTER: &'static str = "/api/push/unregister";
784    pub const CONNECT_ROOM: &'static str = "/api/room";
785    pub const CHECK_ROOM_CONNECTION: &'static str = "/api/room/connect-check";
786    pub const RENEGOTIATE_ROOM_REALTIME_SESSION: &'static str = "/api/room/media/realtime/renegotiate";
787    pub const GET_ROOM_REALTIME_SESSION: &'static str = "/api/room/media/realtime/session";
788    pub const CREATE_ROOM_REALTIME_SESSION: &'static str = "/api/room/media/realtime/session";
789    pub const CLOSE_ROOM_REALTIME_TRACKS: &'static str = "/api/room/media/realtime/tracks/close";
790    pub const ADD_ROOM_REALTIME_TRACKS: &'static str = "/api/room/media/realtime/tracks/new";
791    pub const CREATE_ROOM_REALTIME_ICE_SERVERS: &'static str = "/api/room/media/realtime/turn";
792    pub const GET_ROOM_METADATA: &'static str = "/api/room/metadata";
793    pub const GET_SCHEMA: &'static str = "/api/schema";
794    pub const EXECUTE_SQL: &'static str = "/api/sql";
795    pub fn list_files(bucket: &str) -> String {
796        format!("/api/storage/{}", bucket)
797    }
798    pub fn check_file_exists(bucket: &str, key: &str) -> String {
799        format!("/api/storage/{}/{}", bucket, key)
800    }
801    pub fn download_file(bucket: &str, key: &str) -> String {
802        format!("/api/storage/{}/{}", bucket, key)
803    }
804    pub fn delete_file(bucket: &str, key: &str) -> String {
805        format!("/api/storage/{}/{}", bucket, key)
806    }
807    pub fn get_file_metadata(bucket: &str, key: &str) -> String {
808        format!("/api/storage/{}/{}/metadata", bucket, key)
809    }
810    pub fn update_file_metadata(bucket: &str, key: &str) -> String {
811        format!("/api/storage/{}/{}/metadata", bucket, key)
812    }
813    pub fn delete_batch(bucket: &str) -> String {
814        format!("/api/storage/{}/delete-batch", bucket)
815    }
816    pub fn abort_multipart_upload(bucket: &str) -> String {
817        format!("/api/storage/{}/multipart/abort", bucket)
818    }
819    pub fn complete_multipart_upload(bucket: &str) -> String {
820        format!("/api/storage/{}/multipart/complete", bucket)
821    }
822    pub fn create_multipart_upload(bucket: &str) -> String {
823        format!("/api/storage/{}/multipart/create", bucket)
824    }
825    pub fn upload_part(bucket: &str) -> String {
826        format!("/api/storage/{}/multipart/upload-part", bucket)
827    }
828    pub fn create_signed_upload_url(bucket: &str) -> String {
829        format!("/api/storage/{}/signed-upload-url", bucket)
830    }
831    pub fn create_signed_download_url(bucket: &str) -> String {
832        format!("/api/storage/{}/signed-url", bucket)
833    }
834    pub fn create_signed_download_urls(bucket: &str) -> String {
835        format!("/api/storage/{}/signed-urls", bucket)
836    }
837    pub fn upload_file(bucket: &str) -> String {
838        format!("/api/storage/{}/upload", bucket)
839    }
840    pub fn get_upload_parts(bucket: &str, upload_id: &str) -> String {
841        format!("/api/storage/{}/uploads/{}/parts", bucket, upload_id)
842    }
843    pub fn vectorize_operation(index: &str) -> String {
844        format!("/api/vectorize/{}", index)
845    }
846}