Skip to main content
← Back to kicad-monkey Rust Docs kicad-monkey Rust Crate API Reference

kicad_monkey_contracts/generated/
symbol_plot_request.rs

1/// Error types.
2pub mod error {
3    /// Error from a `TryFrom` or `FromStr` implementation.
4    pub struct ConversionError(::std::borrow::Cow<'static, str>);
5    impl ::std::error::Error for ConversionError {}
6    impl ::std::fmt::Display for ConversionError {
7        fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
8            ::std::fmt::Display::fmt(&self.0, f)
9        }
10    }
11    impl ::std::fmt::Debug for ConversionError {
12        fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
13            ::std::fmt::Debug::fmt(&self.0, f)
14        }
15    }
16    impl From<&'static str> for ConversionError {
17        fn from(value: &'static str) -> Self {
18            Self(value.into())
19        }
20    }
21    impl From<String> for ConversionError {
22        fn from(value: String) -> Self {
23            Self(value.into())
24        }
25    }
26}
27///Library-symbol plot operation. Source bytes are out of band.
28///
29/// <details><summary>JSON schema</summary>
30///
31/// ```json
32///{
33///  "$id": "urn:wavenumber:schema:kicad_monkey.symbol_plot.request:a0",
34///  "title": "Symbol plot request a0",
35///  "description": "Library-symbol plot operation. Source bytes are out of band.",
36///  "type": "object",
37///  "required": [
38///    "style",
39///    "symbol_name",
40///    "type",
41///    "version"
42///  ],
43///  "properties": {
44///    "document_id": {
45///      "type": "string"
46///    },
47///    "source_path": {
48///      "type": "string"
49///    },
50///    "style": {
51///      "type": "integer",
52///      "maximum": 4294967295.0,
53///      "minimum": 0.0
54///    },
55///    "symbol_name": {
56///      "type": "string"
57///    },
58///    "text_variables": {
59///      "description": "Exact-case project variables used only by library-symbol body text.",
60///      "type": "array",
61///      "items": {
62///        "$ref": "#/$defs/SymbolTextVariable"
63///      }
64///    },
65///    "type": {
66///      "type": "string",
67///      "const": "kicad_monkey.symbol_plot.request"
68///    },
69///    "unit": {
70///      "type": "integer",
71///      "maximum": 4294967295.0,
72///      "minimum": 0.0
73///    },
74///    "version": {
75///      "type": "string",
76///      "const": "a0"
77///    }
78///  },
79///  "additionalProperties": false
80///}
81/// ```
82/// </details>
83#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
84#[serde(deny_unknown_fields)]
85pub struct SymbolPlotRequestA0 {
86    #[serde(
87        default,
88        deserialize_with = "crate::deserialize_present_nonnull",
89        skip_serializing_if = "::std::option::Option::is_none"
90    )]
91    pub document_id: ::std::option::Option<::std::string::String>,
92    #[serde(
93        default,
94        deserialize_with = "crate::deserialize_present_nonnull",
95        skip_serializing_if = "::std::option::Option::is_none"
96    )]
97    pub source_path: ::std::option::Option<::std::string::String>,
98    pub style: u32,
99    pub symbol_name: ::std::string::String,
100    ///Exact-case project variables used only by library-symbol body text.
101    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
102    pub text_variables: ::std::vec::Vec<SymbolTextVariable>,
103    #[serde(rename = "type")]
104    pub type_: ::std::string::String,
105    #[serde(
106        default,
107        deserialize_with = "crate::deserialize_present_nonnull",
108        skip_serializing_if = "::std::option::Option::is_none"
109    )]
110    pub unit: ::std::option::Option<u32>,
111    pub version: ::std::string::String,
112}
113///One exact-case project-sidecar variable for library-symbol body text.
114///
115/// <details><summary>JSON schema</summary>
116///
117/// ```json
118///{
119///  "description": "One exact-case project-sidecar variable for library-symbol body text.",
120///  "type": "object",
121///  "required": [
122///    "name",
123///    "value"
124///  ],
125///  "properties": {
126///    "name": {
127///      "type": "string"
128///    },
129///    "value": {
130///      "type": "string"
131///    }
132///  },
133///  "additionalProperties": false
134///}
135/// ```
136/// </details>
137#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
138#[serde(deny_unknown_fields)]
139pub struct SymbolTextVariable {
140    pub name: ::std::string::String,
141    pub value: ::std::string::String,
142}