Skip to main content

gproxy_protocol/claude/model_get/
response.rs

1use http::StatusCode;
2use serde::{Deserialize, Serialize};
3
4use crate::claude::types::{BetaErrorResponse, BetaModelInfo, ClaudeResponseHeaders};
5
6/// Successful body for Claude "Get a Model" endpoint.
7pub type ResponseBody = BetaModelInfo;
8
9/// Full HTTP response for Claude "Get a Model" endpoint.
10#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
11#[serde(untagged)]
12pub enum ClaudeModelGetResponse {
13    Success {
14        /// HTTP status code returned by server (should be `200 OK`).
15        #[serde(with = "crate::claude::types::status_code_serde")]
16        stats_code: StatusCode,
17        /// Response headers.
18        headers: ClaudeResponseHeaders,
19        /// Successful body.
20        body: ResponseBody,
21    },
22    Error {
23        /// HTTP status code returned by server (typically 400/401/403/404/413/429/500/529).
24        #[serde(with = "crate::claude::types::status_code_serde")]
25        stats_code: StatusCode,
26        /// Response headers.
27        headers: ClaudeResponseHeaders,
28        /// Error body.
29        body: BetaErrorResponse,
30    },
31}