Skip to main content

gproxy_protocol/claude/file_list/
response.rs

1use http::StatusCode;
2use serde::{Deserialize, Serialize};
3
4use crate::claude::types::{BetaErrorResponse, ClaudeResponseHeaders, FileMetadata};
5
6/// Successful body for Claude "List Files" endpoint.
7#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
8pub struct ResponseBody {
9    /// List of file metadata objects.
10    pub data: Vec<FileMetadata>,
11    /// ID of the first file in this page.
12    #[serde(default, skip_serializing_if = "Option::is_none")]
13    pub first_id: Option<String>,
14    /// Whether there are more results available.
15    #[serde(default, skip_serializing_if = "Option::is_none")]
16    pub has_more: Option<bool>,
17    /// ID of the last file in this page.
18    #[serde(default, skip_serializing_if = "Option::is_none")]
19    pub last_id: Option<String>,
20}
21
22/// Full HTTP response for Claude "List Files" endpoint.
23#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
24#[serde(untagged)]
25pub enum ClaudeFileListResponse {
26    Success {
27        #[serde(with = "crate::claude::types::status_code_serde")]
28        stats_code: StatusCode,
29        headers: ClaudeResponseHeaders,
30        body: ResponseBody,
31    },
32    Error {
33        #[serde(with = "crate::claude::types::status_code_serde")]
34        stats_code: StatusCode,
35        headers: ClaudeResponseHeaders,
36        body: BetaErrorResponse,
37    },
38}