Skip to main content

gproxy_protocol/claude/skills/
mod.rs

1use serde::{Deserialize, Serialize};
2
3use super::common::{
4    AnthropicBetaHeaders, DeletedSkillObjectType, SkillObjectType, SkillSourceType,
5};
6
7mod versions;
8
9pub use versions::*;
10
11pub type SkillRequestHeaders = AnthropicBetaHeaders;
12
13/// Multipart form fields for `POST /v1/skills`.
14#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
15#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
16pub struct CreateSkillRequestBody {
17    pub files: Vec<String>,
18    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
19    pub rest: serde_json::Map<String, serde_json::Value>,
20}
21
22#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
23#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
24pub struct SkillPath {
25    pub skill_id: String,
26    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
27    pub rest: serde_json::Map<String, serde_json::Value>,
28}
29
30#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
31#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
32pub struct ListSkillsQuery {
33    #[serde(skip_serializing_if = "Option::is_none")]
34    pub limit: Option<u64>,
35    #[serde(skip_serializing_if = "Option::is_none")]
36    pub page: Option<String>,
37    #[serde(skip_serializing_if = "Option::is_none")]
38    pub source: Option<SkillSourceType>,
39    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
40    pub rest: serde_json::Map<String, serde_json::Value>,
41}
42
43#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
44#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
45pub struct SkillObject {
46    pub id: String,
47    pub created_at: String,
48    pub display_title: String,
49    pub latest_version: String,
50    pub source: SkillSourceType,
51    #[serde(rename = "type")]
52    pub type_: SkillObjectType,
53    pub updated_at: String,
54    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
55    pub rest: serde_json::Map<String, serde_json::Value>,
56}
57
58pub type CreateSkillResponseBody = SkillObject;
59pub type RetrieveSkillResponseBody = SkillObject;
60
61#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
62#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
63pub struct ListSkillsResponseBody {
64    pub data: Vec<SkillObject>,
65    pub has_more: bool,
66    pub next_page: Option<String>,
67    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
68    pub rest: serde_json::Map<String, serde_json::Value>,
69}
70
71#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, gproxy_protocol_macros::WireBuilder)]
72#[cfg_attr(not(feature = "exhaustive"), non_exhaustive)]
73pub struct DeleteSkillResponseBody {
74    pub id: String,
75    #[serde(rename = "type")]
76    pub type_: DeletedSkillObjectType,
77    #[serde(default, flatten, skip_serializing_if = "serde_json::Map::is_empty")]
78    pub rest: serde_json::Map<String, serde_json::Value>,
79}