1#![doc = r" This module contains the generated types for the library."]
2#[cfg(feature = "tabled")]
3use tabled::Tabled;
4pub mod base64 {
5 #![doc = " Base64 data that encodes to url safe base64, but can decode from multiple"]
6 #![doc = " base64 implementations to account for various clients and libraries. Compatible"]
7 #![doc = " with serde and JsonSchema."]
8 use std::{convert::TryFrom, fmt};
9
10 use serde::{
11 de::{Error, Unexpected, Visitor},
12 Deserialize, Deserializer, Serialize, Serializer,
13 };
14 static ALLOWED_DECODING_FORMATS: &[data_encoding::Encoding] = &[
15 data_encoding::BASE64,
16 data_encoding::BASE64URL,
17 data_encoding::BASE64URL_NOPAD,
18 data_encoding::BASE64_MIME,
19 data_encoding::BASE64_NOPAD,
20 ];
21 #[derive(Debug, Clone, PartialEq, Eq)]
22 #[doc = " A container for binary that should be base64 encoded in serialisation. In reverse"]
23 #[doc = " when deserializing, will decode from many different types of base64 possible."]
24 pub struct Base64Data(pub Vec<u8>);
25 impl Base64Data {
26 #[doc = " Return is the data is empty."]
27 pub fn is_empty(&self) -> bool {
28 self.0.is_empty()
29 }
30 }
31
32 impl fmt::Display for Base64Data {
33 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
34 write!(f, "{}", data_encoding::BASE64URL_NOPAD.encode(&self.0))
35 }
36 }
37
38 impl From<Base64Data> for Vec<u8> {
39 fn from(data: Base64Data) -> Vec<u8> {
40 data.0
41 }
42 }
43
44 impl From<Vec<u8>> for Base64Data {
45 fn from(data: Vec<u8>) -> Base64Data {
46 Base64Data(data)
47 }
48 }
49
50 impl AsRef<[u8]> for Base64Data {
51 fn as_ref(&self) -> &[u8] {
52 &self.0
53 }
54 }
55
56 impl TryFrom<&str> for Base64Data {
57 type Error = anyhow::Error;
58 fn try_from(v: &str) -> Result<Self, Self::Error> {
59 for config in ALLOWED_DECODING_FORMATS {
60 if let Ok(data) = config.decode(v.as_bytes()) {
61 return Ok(Base64Data(data));
62 }
63 }
64 anyhow::bail!("Could not decode base64 data: {}", v);
65 }
66 }
67
68 struct Base64DataVisitor;
69 impl Visitor<'_> for Base64DataVisitor {
70 type Value = Base64Data;
71 fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
72 write!(formatter, "a base64 encoded string")
73 }
74
75 fn visit_str<E>(self, v: &str) -> Result<Self::Value, E>
76 where
77 E: Error,
78 {
79 for config in ALLOWED_DECODING_FORMATS {
80 if let Ok(data) = config.decode(v.as_bytes()) {
81 return Ok(Base64Data(data));
82 }
83 }
84 Err(serde::de::Error::invalid_value(Unexpected::Str(v), &self))
85 }
86 }
87
88 impl<'de> Deserialize<'de> for Base64Data {
89 fn deserialize<D>(deserializer: D) -> Result<Self, <D as Deserializer<'de>>::Error>
90 where
91 D: Deserializer<'de>,
92 {
93 deserializer.deserialize_str(Base64DataVisitor)
94 }
95 }
96
97 impl Serialize for Base64Data {
98 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
99 where
100 S: Serializer,
101 {
102 let encoded = data_encoding::BASE64URL_NOPAD.encode(&self.0);
103 serializer.serialize_str(&encoded)
104 }
105 }
106
107 impl schemars::JsonSchema for Base64Data {
108 fn schema_name() -> String {
109 "Base64Data".to_string()
110 }
111
112 fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
113 let mut obj = gen.root_schema_for::<String>().schema;
114 obj.format = Some("byte".to_string());
115 schemars::schema::Schema::Object(obj)
116 }
117
118 fn is_referenceable() -> bool {
119 false
120 }
121 }
122
123 #[cfg(test)]
124 mod tests {
125 use std::convert::TryFrom;
126
127 use super::Base64Data;
128 #[test]
129 fn test_base64_try_from() {
130 assert!(Base64Data::try_from("aGVsbG8=").is_ok());
131 assert!(Base64Data::try_from("abcdefghij").is_err());
132 }
133 }
134}
135
136#[cfg(feature = "requests")]
137pub mod multipart {
138 #![doc = " Multipart form data types."]
139 use std::path::PathBuf;
140 #[doc = " An attachement to a multipart form."]
141 #[derive(Debug, Clone, PartialEq, Eq, Hash)]
142 pub struct Attachment {
143 #[doc = " The name of the field."]
144 pub name: String,
145 #[doc = " The file path of the attachment."]
146 pub filepath: Option<PathBuf>,
147 #[doc = " The content type of the attachment."]
148 pub content_type: Option<String>,
149 #[doc = " The data of the attachment."]
150 pub data: Vec<u8>,
151 }
152
153 impl std::convert::TryFrom<Attachment> for reqwest::multipart::Part {
154 type Error = reqwest::Error;
155 fn try_from(attachment: Attachment) -> Result<Self, Self::Error> {
156 let mut part = reqwest::multipart::Part::bytes(attachment.data);
157 if let Some(filepath) = attachment.filepath {
158 part = part.file_name(filepath.to_string_lossy().to_string());
159 }
160 if let Some(content_type) = attachment.content_type {
161 part = part.mime_str(&content_type)?;
162 }
163 Ok(part)
164 }
165 }
166
167 impl std::convert::TryFrom<std::path::PathBuf> for Attachment {
168 type Error = std::io::Error;
169 fn try_from(path: std::path::PathBuf) -> Result<Self, Self::Error> {
170 let content_type = mime_guess::from_path(&path).first_raw();
171 let data = std::fs::read(&path)?;
172 Ok(Attachment {
173 name: "file".to_string(),
174 filepath: Some(path),
175 content_type: content_type.map(|s| s.to_string()),
176 data,
177 })
178 }
179 }
180}
181
182#[cfg(feature = "requests")]
183pub mod paginate {
184 #![doc = " Utility functions used for pagination."]
185 use anyhow::Result;
186 #[doc = " A trait for types that allow pagination."]
187 pub trait Pagination {
188 #[doc = " The item that is paginated."]
189 type Item: serde::de::DeserializeOwned;
190 #[doc = " Returns true if the response has more pages."]
191 fn has_more_pages(&self) -> bool;
192 #[doc = " Returns the next page token."]
193 fn next_page_token(&self) -> Option<String>;
194 #[doc = " Modify a request to get the next page."]
195 fn next_page(
196 &self,
197 req: reqwest::Request,
198 ) -> Result<reqwest::Request, crate::types::error::Error>;
199 #[doc = " Get the items from a page."]
200 fn items(&self) -> Vec<Self::Item>;
201 }
202}
203
204pub mod phone_number {
205 #![doc = " A library to implement phone numbers for our database and JSON serialization and \
206 deserialization."]
207 use std::str::FromStr;
208
209 use schemars::JsonSchema;
210 #[doc = " A phone number."]
211 #[derive(Debug, Default, Clone, PartialEq, Hash, Eq)]
212 pub struct PhoneNumber(pub Option<phonenumber::PhoneNumber>);
213 impl From<phonenumber::PhoneNumber> for PhoneNumber {
214 fn from(id: phonenumber::PhoneNumber) -> PhoneNumber {
215 PhoneNumber(Some(id))
216 }
217 }
218
219 impl AsRef<Option<phonenumber::PhoneNumber>> for PhoneNumber {
220 fn as_ref(&self) -> &Option<phonenumber::PhoneNumber> {
221 &self.0
222 }
223 }
224
225 impl std::ops::Deref for PhoneNumber {
226 type Target = Option<phonenumber::PhoneNumber>;
227 fn deref(&self) -> &Self::Target {
228 &self.0
229 }
230 }
231
232 impl serde::ser::Serialize for PhoneNumber {
233 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
234 where
235 S: serde::ser::Serializer,
236 {
237 serializer.serialize_str(&self.to_string())
238 }
239 }
240
241 impl<'de> serde::de::Deserialize<'de> for PhoneNumber {
242 fn deserialize<D>(deserializer: D) -> Result<PhoneNumber, D::Error>
243 where
244 D: serde::de::Deserializer<'de>,
245 {
246 let s = String::deserialize(deserializer).unwrap_or_default();
247 PhoneNumber::from_str(&s).map_err(serde::de::Error::custom)
248 }
249 }
250
251 impl std::str::FromStr for PhoneNumber {
252 type Err = anyhow::Error;
253 fn from_str(s: &str) -> Result<Self, Self::Err> {
254 if s.trim().is_empty() {
255 return Ok(PhoneNumber(None));
256 }
257 let s = if !s.trim().starts_with('+') {
258 format!("+1{s}")
259 } else {
260 s.to_string()
261 }
262 .replace(['-', '(', ')', ' '], "");
263 Ok(PhoneNumber(Some(phonenumber::parse(None, &s).map_err(
264 |e| anyhow::anyhow!("invalid phone number `{}`: {}", s, e),
265 )?)))
266 }
267 }
268
269 impl std::fmt::Display for PhoneNumber {
270 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
271 let s = if let Some(phone) = &self.0 {
272 phone
273 .format()
274 .mode(phonenumber::Mode::International)
275 .to_string()
276 } else {
277 String::new()
278 };
279 write!(f, "{}", s)
280 }
281 }
282
283 impl JsonSchema for PhoneNumber {
284 fn schema_name() -> String {
285 "PhoneNumber".to_string()
286 }
287
288 fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
289 let mut obj = gen.root_schema_for::<String>().schema;
290 obj.format = Some("phone".to_string());
291 schemars::schema::Schema::Object(obj)
292 }
293
294 fn is_referenceable() -> bool {
295 false
296 }
297 }
298
299 #[cfg(test)]
300 mod test {
301 use pretty_assertions::assert_eq;
302
303 use super::PhoneNumber;
304 #[test]
305 fn test_parse_phone_number() {
306 let mut phone = "+1-555-555-5555";
307 let mut phone_parsed: PhoneNumber =
308 serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
309 let mut expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap()));
310 assert_eq!(phone_parsed, expected);
311 let mut expected_str = "+1 555-555-5555";
312 assert_eq!(expected_str, serde_json::json!(phone_parsed));
313 phone = "555-555-5555";
314 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
315 assert_eq!(phone_parsed, expected);
316 assert_eq!(expected_str, serde_json::json!(phone_parsed));
317 phone = "+1 555-555-5555";
318 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
319 assert_eq!(phone_parsed, expected);
320 assert_eq!(expected_str, serde_json::json!(phone_parsed));
321 phone = "5555555555";
322 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
323 assert_eq!(phone_parsed, expected);
324 assert_eq!(expected_str, serde_json::json!(phone_parsed));
325 phone = "(510) 864-1234";
326 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
327 expected = PhoneNumber(Some(phonenumber::parse(None, "+15108641234").unwrap()));
328 assert_eq!(phone_parsed, expected);
329 expected_str = "+1 510-864-1234";
330 assert_eq!(expected_str, serde_json::json!(phone_parsed));
331 phone = "(510)8641234";
332 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
333 assert_eq!(phone_parsed, expected);
334 expected_str = "+1 510-864-1234";
335 assert_eq!(expected_str, serde_json::json!(phone_parsed));
336 phone = "";
337 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
338 assert_eq!(phone_parsed, PhoneNumber(None));
339 assert_eq!("", serde_json::json!(phone_parsed));
340 phone = "+49 30 1234 1234";
341 phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
342 expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap()));
343 assert_eq!(phone_parsed, expected);
344 expected_str = "+49 30 12341234";
345 assert_eq!(expected_str, serde_json::json!(phone_parsed));
346 }
347 }
348}
349
350#[cfg(feature = "requests")]
351pub mod error {
352 #![doc = " Error methods."]
353 #[doc = " Error produced by generated client methods."]
354 pub enum Error {
355 #[doc = " The request did not conform to API requirements."]
356 InvalidRequest(String),
357 #[cfg(feature = "retry")]
358 #[doc = " A server error either due to the data, or with the connection."]
359 CommunicationError(reqwest_middleware::Error),
360 #[doc = " A request error, caused when building the request."]
361 RequestError(reqwest::Error),
362 #[doc = " An expected response whose deserialization failed."]
363 SerdeError {
364 #[doc = " The error."]
365 error: format_serde_error::SerdeError,
366 #[doc = " The response status."]
367 status: reqwest::StatusCode,
368 },
369 #[doc = " An expected error response."]
370 InvalidResponsePayload {
371 #[cfg(feature = "retry")]
372 #[doc = " The error."]
373 error: reqwest_middleware::Error,
374 #[cfg(not(feature = "retry"))]
375 #[doc = " The error."]
376 error: reqwest::Error,
377 #[doc = " The full response."]
378 response: reqwest::Response,
379 },
380 #[doc = " An error from the server."]
381 Server {
382 #[doc = " The text from the body."]
383 body: String,
384 #[doc = " The response status."]
385 status: reqwest::StatusCode,
386 },
387 #[doc = " A response not listed in the API description. This may represent a"]
388 #[doc = " success or failure response; check `status().is_success()`."]
389 UnexpectedResponse(reqwest::Response),
390 }
391
392 impl Error {
393 #[doc = " Returns the status code, if the error was generated from a response."]
394 pub fn status(&self) -> Option<reqwest::StatusCode> {
395 match self {
396 Error::InvalidRequest(_) => None,
397 Error::RequestError(e) => e.status(),
398 #[cfg(feature = "retry")]
399 Error::CommunicationError(reqwest_middleware::Error::Reqwest(e)) => e.status(),
400 #[cfg(feature = "retry")]
401 Error::CommunicationError(reqwest_middleware::Error::Middleware(_)) => None,
402 Error::SerdeError { error: _, status } => Some(*status),
403 Error::InvalidResponsePayload { error: _, response } => Some(response.status()),
404 Error::Server { body: _, status } => Some(*status),
405 Error::UnexpectedResponse(r) => Some(r.status()),
406 }
407 }
408
409 #[doc = " Creates a new error from a response status and a serde error."]
410 pub fn from_serde_error(
411 e: format_serde_error::SerdeError,
412 status: reqwest::StatusCode,
413 ) -> Self {
414 Self::SerdeError { error: e, status }
415 }
416 }
417
418 #[cfg(feature = "retry")]
419 impl From<reqwest_middleware::Error> for Error {
420 fn from(e: reqwest_middleware::Error) -> Self {
421 Self::CommunicationError(e)
422 }
423 }
424
425 impl From<reqwest::Error> for Error {
426 fn from(e: reqwest::Error) -> Self {
427 Self::RequestError(e)
428 }
429 }
430
431 impl From<serde_json::Error> for Error {
432 fn from(e: serde_json::Error) -> Self {
433 Self::SerdeError {
434 error: format_serde_error::SerdeError::new(String::new(), e),
435 status: reqwest::StatusCode::INTERNAL_SERVER_ERROR,
436 }
437 }
438 }
439
440 impl std::fmt::Display for Error {
441 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
442 match self {
443 Error::InvalidRequest(s) => {
444 write!(f, "Invalid Request: {}", s)
445 }
446 #[cfg(feature = "retry")]
447 Error::CommunicationError(e) => {
448 write!(f, "Communication Error: {}", e)
449 }
450 Error::RequestError(e) => {
451 write!(f, "Request Error: {}", e)
452 }
453 Error::SerdeError { error, status: _ } => {
454 write!(f, "Serde Error: {}", error)
455 }
456 Error::InvalidResponsePayload { error, response: _ } => {
457 write!(f, "Invalid Response Payload: {}", error)
458 }
459 Error::Server { body, status } => {
460 write!(f, "Server Error: {} {}", status, body)
461 }
462 Error::UnexpectedResponse(r) => {
463 write!(f, "Unexpected Response: {:?}", r)
464 }
465 }
466 }
467 }
468
469 impl std::fmt::Debug for Error {
470 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
471 std::fmt::Display::fmt(self, f)
472 }
473 }
474
475 impl std::error::Error for Error {
476 fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
477 match self {
478 #[cfg(feature = "retry")]
479 Error::CommunicationError(e) => Some(e),
480 Error::SerdeError { error, status: _ } => Some(error),
481 Error::InvalidResponsePayload { error, response: _ } => Some(error),
482 _ => None,
483 }
484 }
485 }
486}
487
488#[doc = "An account provider."]
489#[derive(
490 serde :: Serialize,
491 serde :: Deserialize,
492 PartialEq,
493 Hash,
494 Debug,
495 Clone,
496 schemars :: JsonSchema,
497 parse_display :: FromStr,
498 parse_display :: Display,
499)]
500#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
501#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
502pub enum AccountProvider {
503 #[doc = "The Apple account provider."]
504 #[serde(rename = "apple")]
505 #[display("apple")]
506 Apple,
507 #[doc = "The Discord account provider."]
508 #[serde(rename = "discord")]
509 #[display("discord")]
510 Discord,
511 #[doc = "The Google account provider."]
512 #[serde(rename = "google")]
513 #[display("google")]
514 Google,
515 #[doc = "The GitHub account provider."]
516 #[serde(rename = "github")]
517 #[display("github")]
518 Github,
519 #[doc = "The Microsoft account provider."]
520 #[serde(rename = "microsoft")]
521 #[display("microsoft")]
522 Microsoft,
523 #[doc = "The SAML account provider."]
524 #[serde(rename = "saml")]
525 #[display("saml")]
526 Saml,
527 #[doc = "The Tencent QQ account provider."]
528 #[serde(rename = "tencent")]
529 #[display("tencent")]
530 Tencent,
531}
532
533#[doc = "The response from the `AddHoleFromOffset` command."]
534#[derive(
535 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
536)]
537pub struct AddHoleFromOffset {
538 #[doc = "If the offset path splits into multiple paths, this will contain the UUIDs of the \
539 new paths. If the offset path remains as a single path, this will be empty, and the \
540 resulting ID of the (single) new path will be the ID of the `AddHoleFromOffset` \
541 command."]
542 pub entity_ids: Vec<uuid::Uuid>,
543}
544
545impl std::fmt::Display for AddHoleFromOffset {
546 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
547 write!(
548 f,
549 "{}",
550 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
551 )
552 }
553}
554
555#[cfg(feature = "tabled")]
556impl tabled::Tabled for AddHoleFromOffset {
557 const LENGTH: usize = 1;
558 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
559 vec![format!("{:?}", self.entity_ids).into()]
560 }
561
562 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
563 vec!["entity_ids".into()]
564 }
565}
566
567#[doc = "Data for adding a member to an org."]
568#[derive(
569 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
570)]
571pub struct AddOrgMember {
572 #[doc = "The email address of the user to add to the org."]
573 pub email: String,
574 #[doc = "The organization role to give the user."]
575 pub role: UserOrgRole,
576}
577
578impl std::fmt::Display for AddOrgMember {
579 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
580 write!(
581 f,
582 "{}",
583 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
584 )
585 }
586}
587
588#[cfg(feature = "tabled")]
589impl tabled::Tabled for AddOrgMember {
590 const LENGTH: usize = 2;
591 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
592 vec![self.email.clone().into(), format!("{:?}", self.role).into()]
593 }
594
595 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
596 vec!["email".into(), "role".into()]
597 }
598}
599
600#[doc = "Address details."]
601#[derive(
602 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
603)]
604pub struct AddressDetails {
605 #[doc = "The city component."]
606 #[serde(default, skip_serializing_if = "Option::is_none")]
607 pub city: Option<String>,
608 #[doc = "The country component. This is a two-letter ISO country code."]
609 pub country: String,
610 #[doc = "The state component."]
611 #[serde(default, skip_serializing_if = "Option::is_none")]
612 pub state: Option<String>,
613 #[doc = "The first street component."]
614 #[serde(rename = "street1", default, skip_serializing_if = "Option::is_none")]
615 pub street_1: Option<String>,
616 #[doc = "The second street component."]
617 #[serde(rename = "street2", default, skip_serializing_if = "Option::is_none")]
618 pub street_2: Option<String>,
619 #[doc = "The zip component."]
620 #[serde(default, skip_serializing_if = "Option::is_none")]
621 pub zip: Option<String>,
622}
623
624impl std::fmt::Display for AddressDetails {
625 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
626 write!(
627 f,
628 "{}",
629 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
630 )
631 }
632}
633
634#[cfg(feature = "tabled")]
635impl tabled::Tabled for AddressDetails {
636 const LENGTH: usize = 6;
637 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
638 vec![
639 if let Some(city) = &self.city {
640 format!("{:?}", city).into()
641 } else {
642 String::new().into()
643 },
644 self.country.clone().into(),
645 if let Some(state) = &self.state {
646 format!("{:?}", state).into()
647 } else {
648 String::new().into()
649 },
650 if let Some(street_1) = &self.street_1 {
651 format!("{:?}", street_1).into()
652 } else {
653 String::new().into()
654 },
655 if let Some(street_2) = &self.street_2 {
656 format!("{:?}", street_2).into()
657 } else {
658 String::new().into()
659 },
660 if let Some(zip) = &self.zip {
661 format!("{:?}", zip).into()
662 } else {
663 String::new().into()
664 },
665 ]
666 }
667
668 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
669 vec![
670 "city".into(),
671 "country".into(),
672 "state".into(),
673 "street_1".into(),
674 "street_2".into(),
675 "zip".into(),
676 ]
677 }
678}
679
680#[doc = "Edge info struct (useful for maintaining mappings between edges and faces and \
681 adjacent/opposite edges)."]
682#[derive(
683 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
684)]
685pub struct AdjacencyInfo {
686 #[doc = "Adjacent edge and face info."]
687 #[serde(default, skip_serializing_if = "Option::is_none")]
688 pub adjacent_info: Option<EdgeInfo>,
689 #[doc = "Opposite edge and face info."]
690 #[serde(default, skip_serializing_if = "Option::is_none")]
691 pub opposite_info: Option<EdgeInfo>,
692 #[doc = "Original edge id and face info."]
693 #[serde(default, skip_serializing_if = "Option::is_none")]
694 pub original_info: Option<EdgeInfo>,
695}
696
697impl std::fmt::Display for AdjacencyInfo {
698 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
699 write!(
700 f,
701 "{}",
702 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
703 )
704 }
705}
706
707#[cfg(feature = "tabled")]
708impl tabled::Tabled for AdjacencyInfo {
709 const LENGTH: usize = 3;
710 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
711 vec![
712 if let Some(adjacent_info) = &self.adjacent_info {
713 format!("{:?}", adjacent_info).into()
714 } else {
715 String::new().into()
716 },
717 if let Some(opposite_info) = &self.opposite_info {
718 format!("{:?}", opposite_info).into()
719 } else {
720 String::new().into()
721 },
722 if let Some(original_info) = &self.original_info {
723 format!("{:?}", original_info).into()
724 } else {
725 String::new().into()
726 },
727 ]
728 }
729
730 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
731 vec![
732 "adjacent_info".into(),
733 "opposite_info".into(),
734 "original_info".into(),
735 ]
736 }
737}
738
739#[doc = "An angle, with a specific unit."]
740#[derive(
741 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
742)]
743pub struct Angle {
744 #[doc = "What unit is the measurement?"]
745 pub unit: UnitAngle,
746 #[doc = "The size of the angle, measured in the chosen unit."]
747 pub value: f64,
748}
749
750impl std::fmt::Display for Angle {
751 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
752 write!(
753 f,
754 "{}",
755 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
756 )
757 }
758}
759
760#[cfg(feature = "tabled")]
761impl tabled::Tabled for Angle {
762 const LENGTH: usize = 2;
763 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
764 vec![
765 format!("{:?}", self.unit).into(),
766 format!("{:?}", self.value).into(),
767 ]
768 }
769
770 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
771 vec!["unit".into(), "value".into()]
772 }
773}
774
775#[doc = "Annotation line end type"]
776#[derive(
777 serde :: Serialize,
778 serde :: Deserialize,
779 PartialEq,
780 Hash,
781 Debug,
782 Clone,
783 schemars :: JsonSchema,
784 parse_display :: FromStr,
785 parse_display :: Display,
786)]
787#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
788#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
789pub enum AnnotationLineEnd {
790 #[serde(rename = "none")]
791 #[display("none")]
792 None,
793 #[serde(rename = "arrow")]
794 #[display("arrow")]
795 Arrow,
796}
797
798#[doc = "Options for annotation text"]
799#[derive(
800 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
801)]
802pub struct AnnotationLineEndOptions {
803 #[doc = "How to style the end of the annotation line."]
804 pub end: AnnotationLineEnd,
805 #[doc = "How to style the start of the annotation line."]
806 pub start: AnnotationLineEnd,
807}
808
809impl std::fmt::Display for AnnotationLineEndOptions {
810 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
811 write!(
812 f,
813 "{}",
814 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
815 )
816 }
817}
818
819#[cfg(feature = "tabled")]
820impl tabled::Tabled for AnnotationLineEndOptions {
821 const LENGTH: usize = 2;
822 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
823 vec![
824 format!("{:?}", self.end).into(),
825 format!("{:?}", self.start).into(),
826 ]
827 }
828
829 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
830 vec!["end".into(), "start".into()]
831 }
832}
833
834#[doc = "Options for annotations"]
835#[derive(
836 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
837)]
838pub struct AnnotationOptions {
839 #[doc = "Color to render the annotation"]
840 #[serde(default, skip_serializing_if = "Option::is_none")]
841 pub color: Option<Color>,
842 #[doc = "How to style the start and end of the line"]
843 #[serde(default, skip_serializing_if = "Option::is_none")]
844 pub line_ends: Option<AnnotationLineEndOptions>,
845 #[doc = "Width of the annotation's line"]
846 #[serde(default, skip_serializing_if = "Option::is_none")]
847 pub line_width: Option<f64>,
848 #[doc = "Position to put the annotation"]
849 #[serde(default, skip_serializing_if = "Option::is_none")]
850 pub position: Option<Point3D>,
851 #[doc = "Text displayed on the annotation"]
852 #[serde(default, skip_serializing_if = "Option::is_none")]
853 pub text: Option<AnnotationTextOptions>,
854}
855
856impl std::fmt::Display for AnnotationOptions {
857 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
858 write!(
859 f,
860 "{}",
861 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
862 )
863 }
864}
865
866#[cfg(feature = "tabled")]
867impl tabled::Tabled for AnnotationOptions {
868 const LENGTH: usize = 5;
869 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
870 vec![
871 if let Some(color) = &self.color {
872 format!("{:?}", color).into()
873 } else {
874 String::new().into()
875 },
876 if let Some(line_ends) = &self.line_ends {
877 format!("{:?}", line_ends).into()
878 } else {
879 String::new().into()
880 },
881 if let Some(line_width) = &self.line_width {
882 format!("{:?}", line_width).into()
883 } else {
884 String::new().into()
885 },
886 if let Some(position) = &self.position {
887 format!("{:?}", position).into()
888 } else {
889 String::new().into()
890 },
891 if let Some(text) = &self.text {
892 format!("{:?}", text).into()
893 } else {
894 String::new().into()
895 },
896 ]
897 }
898
899 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
900 vec![
901 "color".into(),
902 "line_ends".into(),
903 "line_width".into(),
904 "position".into(),
905 "text".into(),
906 ]
907 }
908}
909
910#[doc = "Horizontal Text alignment"]
911#[derive(
912 serde :: Serialize,
913 serde :: Deserialize,
914 PartialEq,
915 Hash,
916 Debug,
917 Clone,
918 schemars :: JsonSchema,
919 parse_display :: FromStr,
920 parse_display :: Display,
921)]
922#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
923#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
924pub enum AnnotationTextAlignmentX {
925 #[serde(rename = "left")]
926 #[display("left")]
927 Left,
928 #[serde(rename = "center")]
929 #[display("center")]
930 Center,
931 #[serde(rename = "right")]
932 #[display("right")]
933 Right,
934}
935
936#[doc = "Vertical Text alignment"]
937#[derive(
938 serde :: Serialize,
939 serde :: Deserialize,
940 PartialEq,
941 Hash,
942 Debug,
943 Clone,
944 schemars :: JsonSchema,
945 parse_display :: FromStr,
946 parse_display :: Display,
947)]
948#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
949#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
950pub enum AnnotationTextAlignmentY {
951 #[serde(rename = "bottom")]
952 #[display("bottom")]
953 Bottom,
954 #[serde(rename = "center")]
955 #[display("center")]
956 Center,
957 #[serde(rename = "top")]
958 #[display("top")]
959 Top,
960}
961
962#[doc = "Options for annotation text"]
963#[derive(
964 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
965)]
966pub struct AnnotationTextOptions {
967 #[doc = "Text font's point size"]
968 pub point_size: u32,
969 #[doc = "Text displayed on the annotation"]
970 pub text: String,
971 #[doc = "Alignment along the X axis"]
972 pub x: AnnotationTextAlignmentX,
973 #[doc = "Alignment along the Y axis"]
974 pub y: AnnotationTextAlignmentY,
975}
976
977impl std::fmt::Display for AnnotationTextOptions {
978 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
979 write!(
980 f,
981 "{}",
982 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
983 )
984 }
985}
986
987#[cfg(feature = "tabled")]
988impl tabled::Tabled for AnnotationTextOptions {
989 const LENGTH: usize = 4;
990 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
991 vec![
992 format!("{:?}", self.point_size).into(),
993 self.text.clone().into(),
994 format!("{:?}", self.x).into(),
995 format!("{:?}", self.y).into(),
996 ]
997 }
998
999 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1000 vec!["point_size".into(), "text".into(), "x".into(), "y".into()]
1001 }
1002}
1003
1004#[doc = "The type of annotation"]
1005#[derive(
1006 serde :: Serialize,
1007 serde :: Deserialize,
1008 PartialEq,
1009 Hash,
1010 Debug,
1011 Clone,
1012 schemars :: JsonSchema,
1013 parse_display :: FromStr,
1014 parse_display :: Display,
1015)]
1016#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1017#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1018pub enum AnnotationType {
1019 #[doc = "2D annotation type (screen or planar space)"]
1020 #[serde(rename = "t2d")]
1021 #[display("t2d")]
1022 T2D,
1023 #[doc = "3D annotation type"]
1024 #[serde(rename = "t3d")]
1025 #[display("t3d")]
1026 T3D,
1027}
1028
1029#[doc = "A response for a query on the API call table that is grouped by something."]
1030#[derive(
1031 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1032)]
1033pub struct ApiCallQueryGroup {
1034 pub count: i64,
1035 pub query: String,
1036}
1037
1038impl std::fmt::Display for ApiCallQueryGroup {
1039 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1040 write!(
1041 f,
1042 "{}",
1043 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1044 )
1045 }
1046}
1047
1048#[cfg(feature = "tabled")]
1049impl tabled::Tabled for ApiCallQueryGroup {
1050 const LENGTH: usize = 2;
1051 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1052 vec![
1053 format!("{:?}", self.count).into(),
1054 self.query.clone().into(),
1055 ]
1056 }
1057
1058 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1059 vec!["count".into(), "query".into()]
1060 }
1061}
1062
1063#[doc = "The status of an async API call."]
1064#[derive(
1065 serde :: Serialize,
1066 serde :: Deserialize,
1067 PartialEq,
1068 Hash,
1069 Debug,
1070 Clone,
1071 schemars :: JsonSchema,
1072 parse_display :: FromStr,
1073 parse_display :: Display,
1074)]
1075#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1076#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1077pub enum ApiCallStatus {
1078 #[doc = "The async API call is queued."]
1079 #[serde(rename = "queued")]
1080 #[display("queued")]
1081 Queued,
1082 #[doc = "The async API call was uploaded to be converted."]
1083 #[serde(rename = "uploaded")]
1084 #[display("uploaded")]
1085 Uploaded,
1086 #[doc = "The async API call is in progress."]
1087 #[serde(rename = "in_progress")]
1088 #[display("in_progress")]
1089 InProgress,
1090 #[doc = "The async API call has completed."]
1091 #[serde(rename = "completed")]
1092 #[display("completed")]
1093 Completed,
1094 #[doc = "The async API call has failed."]
1095 #[serde(rename = "failed")]
1096 #[display("failed")]
1097 Failed,
1098}
1099
1100#[doc = "An API call with the price.\n\nThis is a join of the `ApiCall` and `ApiCallPrice` tables."]
1101#[derive(
1102 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1103)]
1104pub struct ApiCallWithPrice {
1105 #[doc = "The date and time the API call completed billing."]
1106 #[serde(default, skip_serializing_if = "Option::is_none")]
1107 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
1108 #[doc = "The date and time the API call was created."]
1109 pub created_at: chrono::DateTime<chrono::Utc>,
1110 #[doc = "The duration of the API call."]
1111 #[serde(default, skip_serializing_if = "Option::is_none")]
1112 pub duration: Option<i64>,
1113 #[doc = "The user's email address."]
1114 #[serde(default, skip_serializing_if = "Option::is_none")]
1115 pub email: Option<String>,
1116 #[doc = "The endpoint requested by the API call."]
1117 #[serde(default, skip_serializing_if = "Option::is_none")]
1118 pub endpoint: Option<String>,
1119 #[doc = "The unique identifier for the API call."]
1120 pub id: uuid::Uuid,
1121 #[doc = "The ip address of the origin."]
1122 #[serde(default, skip_serializing_if = "Option::is_none")]
1123 pub ip_address: Option<std::net::IpAddr>,
1124 #[doc = "The HTTP method requested by the API call."]
1125 pub method: Method,
1126 #[doc = "The number of minutes the API call was billed for."]
1127 #[serde(default, skip_serializing_if = "Option::is_none")]
1128 pub minutes: Option<i32>,
1129 #[doc = "The organization ID of the API call if it is billable through an organization."]
1130 #[serde(default, skip_serializing_if = "Option::is_none")]
1131 pub org_id: Option<uuid::Uuid>,
1132 #[doc = "The origin of the API call."]
1133 #[serde(default, skip_serializing_if = "Option::is_none")]
1134 pub origin: Option<String>,
1135 #[doc = "The price of the API call."]
1136 #[serde(default, skip_serializing_if = "Option::is_none")]
1137 pub price: Option<f64>,
1138 #[doc = "The request body sent by the API call."]
1139 #[serde(default, skip_serializing_if = "Option::is_none")]
1140 pub request_body: Option<String>,
1141 #[doc = "The request query params sent by the API call."]
1142 #[serde(default, skip_serializing_if = "Option::is_none")]
1143 pub request_query_params: Option<String>,
1144 #[doc = "The response body returned by the API call. We do not store this information if it \
1145 is above a certain size."]
1146 #[serde(default, skip_serializing_if = "Option::is_none")]
1147 pub response_body: Option<String>,
1148 #[doc = "The date and time the API call started billing."]
1149 #[serde(default, skip_serializing_if = "Option::is_none")]
1150 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
1151 #[doc = "The status code returned by the API call."]
1152 #[serde(default, skip_serializing_if = "Option::is_none")]
1153 pub status_code: Option<i32>,
1154 #[doc = "The Stripe invoice item ID of the API call if it is billable."]
1155 #[serde(default, skip_serializing_if = "Option::is_none")]
1156 pub stripe_invoice_item_id: Option<String>,
1157 #[doc = "The API token that made the API call."]
1158 pub token: uuid::Uuid,
1159 #[doc = "The date and time the API call was last updated."]
1160 pub updated_at: chrono::DateTime<chrono::Utc>,
1161 #[doc = "The user agent of the request."]
1162 pub user_agent: String,
1163 #[doc = "The ID of the user that made the API call."]
1164 pub user_id: uuid::Uuid,
1165}
1166
1167impl std::fmt::Display for ApiCallWithPrice {
1168 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1169 write!(
1170 f,
1171 "{}",
1172 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1173 )
1174 }
1175}
1176
1177#[cfg(feature = "tabled")]
1178impl tabled::Tabled for ApiCallWithPrice {
1179 const LENGTH: usize = 22;
1180 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1181 vec![
1182 if let Some(completed_at) = &self.completed_at {
1183 format!("{:?}", completed_at).into()
1184 } else {
1185 String::new().into()
1186 },
1187 format!("{:?}", self.created_at).into(),
1188 if let Some(duration) = &self.duration {
1189 format!("{:?}", duration).into()
1190 } else {
1191 String::new().into()
1192 },
1193 if let Some(email) = &self.email {
1194 format!("{:?}", email).into()
1195 } else {
1196 String::new().into()
1197 },
1198 if let Some(endpoint) = &self.endpoint {
1199 format!("{:?}", endpoint).into()
1200 } else {
1201 String::new().into()
1202 },
1203 format!("{:?}", self.id).into(),
1204 if let Some(ip_address) = &self.ip_address {
1205 format!("{:?}", ip_address).into()
1206 } else {
1207 String::new().into()
1208 },
1209 format!("{:?}", self.method).into(),
1210 if let Some(minutes) = &self.minutes {
1211 format!("{:?}", minutes).into()
1212 } else {
1213 String::new().into()
1214 },
1215 if let Some(org_id) = &self.org_id {
1216 format!("{:?}", org_id).into()
1217 } else {
1218 String::new().into()
1219 },
1220 if let Some(origin) = &self.origin {
1221 format!("{:?}", origin).into()
1222 } else {
1223 String::new().into()
1224 },
1225 if let Some(price) = &self.price {
1226 format!("{:?}", price).into()
1227 } else {
1228 String::new().into()
1229 },
1230 if let Some(request_body) = &self.request_body {
1231 format!("{:?}", request_body).into()
1232 } else {
1233 String::new().into()
1234 },
1235 if let Some(request_query_params) = &self.request_query_params {
1236 format!("{:?}", request_query_params).into()
1237 } else {
1238 String::new().into()
1239 },
1240 if let Some(response_body) = &self.response_body {
1241 format!("{:?}", response_body).into()
1242 } else {
1243 String::new().into()
1244 },
1245 if let Some(started_at) = &self.started_at {
1246 format!("{:?}", started_at).into()
1247 } else {
1248 String::new().into()
1249 },
1250 if let Some(status_code) = &self.status_code {
1251 format!("{:?}", status_code).into()
1252 } else {
1253 String::new().into()
1254 },
1255 if let Some(stripe_invoice_item_id) = &self.stripe_invoice_item_id {
1256 format!("{:?}", stripe_invoice_item_id).into()
1257 } else {
1258 String::new().into()
1259 },
1260 format!("{:?}", self.token).into(),
1261 format!("{:?}", self.updated_at).into(),
1262 self.user_agent.clone().into(),
1263 format!("{:?}", self.user_id).into(),
1264 ]
1265 }
1266
1267 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1268 vec![
1269 "completed_at".into(),
1270 "created_at".into(),
1271 "duration".into(),
1272 "email".into(),
1273 "endpoint".into(),
1274 "id".into(),
1275 "ip_address".into(),
1276 "method".into(),
1277 "minutes".into(),
1278 "org_id".into(),
1279 "origin".into(),
1280 "price".into(),
1281 "request_body".into(),
1282 "request_query_params".into(),
1283 "response_body".into(),
1284 "started_at".into(),
1285 "status_code".into(),
1286 "stripe_invoice_item_id".into(),
1287 "token".into(),
1288 "updated_at".into(),
1289 "user_agent".into(),
1290 "user_id".into(),
1291 ]
1292 }
1293}
1294
1295#[doc = "A single page of results"]
1296#[derive(
1297 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1298)]
1299pub struct ApiCallWithPriceResultsPage {
1300 #[doc = "list of items on this page of results"]
1301 pub items: Vec<ApiCallWithPrice>,
1302 #[doc = "token used to fetch the next page of results (if any)"]
1303 #[serde(default, skip_serializing_if = "Option::is_none")]
1304 pub next_page: Option<String>,
1305}
1306
1307impl std::fmt::Display for ApiCallWithPriceResultsPage {
1308 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1309 write!(
1310 f,
1311 "{}",
1312 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1313 )
1314 }
1315}
1316
1317#[cfg(feature = "requests")]
1318impl crate::types::paginate::Pagination for ApiCallWithPriceResultsPage {
1319 type Item = ApiCallWithPrice;
1320 fn has_more_pages(&self) -> bool {
1321 self.next_page.is_some()
1322 }
1323
1324 fn next_page_token(&self) -> Option<String> {
1325 self.next_page.clone()
1326 }
1327
1328 fn next_page(
1329 &self,
1330 req: reqwest::Request,
1331 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
1332 let mut req = req.try_clone().ok_or_else(|| {
1333 crate::types::error::Error::InvalidRequest(format!(
1334 "failed to clone request: {:?}",
1335 req
1336 ))
1337 })?;
1338 req.url_mut()
1339 .query_pairs_mut()
1340 .append_pair("next_page", self.next_page.as_deref().unwrap_or(""));
1341 Ok(req)
1342 }
1343
1344 fn items(&self) -> Vec<Self::Item> {
1345 self.items.clone()
1346 }
1347}
1348
1349#[cfg(feature = "tabled")]
1350impl tabled::Tabled for ApiCallWithPriceResultsPage {
1351 const LENGTH: usize = 2;
1352 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1353 vec![
1354 format!("{:?}", self.items).into(),
1355 if let Some(next_page) = &self.next_page {
1356 format!("{:?}", next_page).into()
1357 } else {
1358 String::new().into()
1359 },
1360 ]
1361 }
1362
1363 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1364 vec!["items".into(), "next_page".into()]
1365 }
1366}
1367
1368#[doc = "Types of API endpoints."]
1369#[derive(
1370 serde :: Serialize,
1371 serde :: Deserialize,
1372 PartialEq,
1373 Hash,
1374 Debug,
1375 Clone,
1376 schemars :: JsonSchema,
1377 parse_display :: FromStr,
1378 parse_display :: Display,
1379)]
1380#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1381#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1382pub enum ApiEndpoint {
1383 #[doc = "The modeling API."]
1384 #[serde(rename = "modeling")]
1385 #[display("modeling")]
1386 Modeling,
1387 #[doc = "Machine learning API."]
1388 #[serde(rename = "ml")]
1389 #[display("ml")]
1390 Ml,
1391 #[doc = "File API."]
1392 #[serde(rename = "file")]
1393 #[display("file")]
1394 File,
1395}
1396
1397#[doc = "An error."]
1398#[derive(
1399 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1400)]
1401pub struct ApiError {
1402 #[doc = "The error code."]
1403 pub error_code: ErrorCode,
1404 #[doc = "The error message."]
1405 pub message: String,
1406}
1407
1408impl std::fmt::Display for ApiError {
1409 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1410 write!(
1411 f,
1412 "{}",
1413 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1414 )
1415 }
1416}
1417
1418#[cfg(feature = "tabled")]
1419impl tabled::Tabled for ApiError {
1420 const LENGTH: usize = 2;
1421 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1422 vec![
1423 format!("{:?}", self.error_code).into(),
1424 self.message.clone().into(),
1425 ]
1426 }
1427
1428 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1429 vec!["error_code".into(), "message".into()]
1430 }
1431}
1432
1433#[doc = "An API token.\n\nThese are used to authenticate users with Bearer authentication."]
1434#[derive(
1435 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1436)]
1437pub struct ApiToken {
1438 #[doc = "The date and time the API token was created."]
1439 pub created_at: chrono::DateTime<chrono::Utc>,
1440 #[doc = "The unique identifier for the API token."]
1441 pub id: uuid::Uuid,
1442 #[doc = "If the token is valid. We never delete API tokens, but we can mark them as invalid. \
1443 We save them for ever to preserve the history of the API token."]
1444 pub is_valid: bool,
1445 #[doc = "An optional label for the API token."]
1446 #[serde(default, skip_serializing_if = "Option::is_none")]
1447 pub label: Option<String>,
1448 #[doc = "The API token itself."]
1449 pub token: String,
1450 #[doc = "The date and time the API token was last updated."]
1451 pub updated_at: chrono::DateTime<chrono::Utc>,
1452 #[doc = "The ID of the user that owns the API token."]
1453 pub user_id: uuid::Uuid,
1454}
1455
1456impl std::fmt::Display for ApiToken {
1457 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1458 write!(
1459 f,
1460 "{}",
1461 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1462 )
1463 }
1464}
1465
1466#[cfg(feature = "tabled")]
1467impl tabled::Tabled for ApiToken {
1468 const LENGTH: usize = 7;
1469 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1470 vec![
1471 format!("{:?}", self.created_at).into(),
1472 format!("{:?}", self.id).into(),
1473 format!("{:?}", self.is_valid).into(),
1474 if let Some(label) = &self.label {
1475 format!("{:?}", label).into()
1476 } else {
1477 String::new().into()
1478 },
1479 self.token.clone().into(),
1480 format!("{:?}", self.updated_at).into(),
1481 format!("{:?}", self.user_id).into(),
1482 ]
1483 }
1484
1485 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1486 vec![
1487 "created_at".into(),
1488 "id".into(),
1489 "is_valid".into(),
1490 "label".into(),
1491 "token".into(),
1492 "updated_at".into(),
1493 "user_id".into(),
1494 ]
1495 }
1496}
1497
1498#[doc = "A single page of results"]
1499#[derive(
1500 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1501)]
1502pub struct ApiTokenResultsPage {
1503 #[doc = "list of items on this page of results"]
1504 pub items: Vec<ApiToken>,
1505 #[doc = "token used to fetch the next page of results (if any)"]
1506 #[serde(default, skip_serializing_if = "Option::is_none")]
1507 pub next_page: Option<String>,
1508}
1509
1510impl std::fmt::Display for ApiTokenResultsPage {
1511 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1512 write!(
1513 f,
1514 "{}",
1515 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1516 )
1517 }
1518}
1519
1520#[cfg(feature = "requests")]
1521impl crate::types::paginate::Pagination for ApiTokenResultsPage {
1522 type Item = ApiToken;
1523 fn has_more_pages(&self) -> bool {
1524 self.next_page.is_some()
1525 }
1526
1527 fn next_page_token(&self) -> Option<String> {
1528 self.next_page.clone()
1529 }
1530
1531 fn next_page(
1532 &self,
1533 req: reqwest::Request,
1534 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
1535 let mut req = req.try_clone().ok_or_else(|| {
1536 crate::types::error::Error::InvalidRequest(format!(
1537 "failed to clone request: {:?}",
1538 req
1539 ))
1540 })?;
1541 req.url_mut()
1542 .query_pairs_mut()
1543 .append_pair("next_page", self.next_page.as_deref().unwrap_or(""));
1544 Ok(req)
1545 }
1546
1547 fn items(&self) -> Vec<Self::Item> {
1548 self.items.clone()
1549 }
1550}
1551
1552#[cfg(feature = "tabled")]
1553impl tabled::Tabled for ApiTokenResultsPage {
1554 const LENGTH: usize = 2;
1555 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1556 vec![
1557 format!("{:?}", self.items).into(),
1558 if let Some(next_page) = &self.next_page {
1559 format!("{:?}", next_page).into()
1560 } else {
1561 String::new().into()
1562 },
1563 ]
1564 }
1565
1566 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1567 vec!["items".into(), "next_page".into()]
1568 }
1569}
1570
1571#[doc = "Information about a third party app client."]
1572#[derive(
1573 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1574)]
1575pub struct AppClientInfo {
1576 #[doc = "The URL for consent."]
1577 #[serde(default, skip_serializing_if = "Option::is_none")]
1578 pub url: Option<String>,
1579}
1580
1581impl std::fmt::Display for AppClientInfo {
1582 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1583 write!(
1584 f,
1585 "{}",
1586 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1587 )
1588 }
1589}
1590
1591#[cfg(feature = "tabled")]
1592impl tabled::Tabled for AppClientInfo {
1593 const LENGTH: usize = 1;
1594 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1595 vec![if let Some(url) = &self.url {
1596 format!("{:?}", url).into()
1597 } else {
1598 String::new().into()
1599 }]
1600 }
1601
1602 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1603 vec!["url".into()]
1604 }
1605}
1606
1607#[doc = "An async API call."]
1608#[derive(
1609 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1610)]
1611pub struct AsyncApiCall {
1612 #[doc = "The number of times we've attempted to process this job."]
1613 #[serde(default, skip_serializing_if = "Option::is_none")]
1614 pub attempts: Option<i16>,
1615 #[doc = "The time and date the async API call was completed."]
1616 #[serde(default, skip_serializing_if = "Option::is_none")]
1617 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
1618 #[doc = "The time and date the async API call was created."]
1619 pub created_at: chrono::DateTime<chrono::Utc>,
1620 #[doc = "The error the function returned, if any."]
1621 #[serde(default, skip_serializing_if = "Option::is_none")]
1622 pub error: Option<String>,
1623 #[doc = "The unique identifier of the async API call.\n\nThis is the same as the API call ID."]
1624 pub id: uuid::Uuid,
1625 #[doc = "The JSON input for the API call. These are determined by the endpoint that is run."]
1626 #[serde(default, skip_serializing_if = "Option::is_none")]
1627 pub input: Option<serde_json::Value>,
1628 #[doc = "The JSON output for the API call. These are determined by the endpoint that is run."]
1629 #[serde(default, skip_serializing_if = "Option::is_none")]
1630 pub output: Option<serde_json::Value>,
1631 #[doc = "The time and date the async API call was started."]
1632 #[serde(default, skip_serializing_if = "Option::is_none")]
1633 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
1634 #[doc = "The status of the async API call."]
1635 pub status: ApiCallStatus,
1636 #[doc = "The type of async API call."]
1637 #[serde(rename = "type")]
1638 pub type_: AsyncApiCallType,
1639 #[doc = "The time and date the async API call was last updated."]
1640 pub updated_at: chrono::DateTime<chrono::Utc>,
1641 #[doc = "The user ID of the user who created the async API call."]
1642 pub user_id: uuid::Uuid,
1643 #[doc = "The worker node that is performing or performed the async API call."]
1644 #[serde(default, skip_serializing_if = "Option::is_none")]
1645 pub worker: Option<String>,
1646}
1647
1648impl std::fmt::Display for AsyncApiCall {
1649 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1650 write!(
1651 f,
1652 "{}",
1653 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1654 )
1655 }
1656}
1657
1658#[cfg(feature = "tabled")]
1659impl tabled::Tabled for AsyncApiCall {
1660 const LENGTH: usize = 13;
1661 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1662 vec![
1663 if let Some(attempts) = &self.attempts {
1664 format!("{:?}", attempts).into()
1665 } else {
1666 String::new().into()
1667 },
1668 if let Some(completed_at) = &self.completed_at {
1669 format!("{:?}", completed_at).into()
1670 } else {
1671 String::new().into()
1672 },
1673 format!("{:?}", self.created_at).into(),
1674 if let Some(error) = &self.error {
1675 format!("{:?}", error).into()
1676 } else {
1677 String::new().into()
1678 },
1679 format!("{:?}", self.id).into(),
1680 if let Some(input) = &self.input {
1681 format!("{:?}", input).into()
1682 } else {
1683 String::new().into()
1684 },
1685 if let Some(output) = &self.output {
1686 format!("{:?}", output).into()
1687 } else {
1688 String::new().into()
1689 },
1690 if let Some(started_at) = &self.started_at {
1691 format!("{:?}", started_at).into()
1692 } else {
1693 String::new().into()
1694 },
1695 format!("{:?}", self.status).into(),
1696 format!("{:?}", self.type_).into(),
1697 format!("{:?}", self.updated_at).into(),
1698 format!("{:?}", self.user_id).into(),
1699 if let Some(worker) = &self.worker {
1700 format!("{:?}", worker).into()
1701 } else {
1702 String::new().into()
1703 },
1704 ]
1705 }
1706
1707 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1708 vec![
1709 "attempts".into(),
1710 "completed_at".into(),
1711 "created_at".into(),
1712 "error".into(),
1713 "id".into(),
1714 "input".into(),
1715 "output".into(),
1716 "started_at".into(),
1717 "status".into(),
1718 "type_".into(),
1719 "updated_at".into(),
1720 "user_id".into(),
1721 "worker".into(),
1722 ]
1723 }
1724}
1725
1726#[doc = "The output from the async API call."]
1727#[derive(
1728 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1729)]
1730#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1731#[serde(tag = "type")]
1732pub enum AsyncApiCallOutput {
1733 #[doc = "A file conversion."]
1734 #[serde(rename = "file_conversion")]
1735 FileConversion {
1736 #[doc = "The time and date the API call was completed."]
1737 #[serde(default, skip_serializing_if = "Option::is_none")]
1738 completed_at: Option<chrono::DateTime<chrono::Utc>>,
1739 #[doc = "The time and date the API call was created."]
1740 created_at: chrono::DateTime<chrono::Utc>,
1741 #[doc = "The error the function returned, if any."]
1742 #[serde(default, skip_serializing_if = "Option::is_none")]
1743 error: Option<String>,
1744 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
1745 id: uuid::Uuid,
1746 #[doc = "The output format of the file conversion."]
1747 output_format: FileExportFormat,
1748 #[doc = "The output format options of the file conversion."]
1749 #[serde(default, skip_serializing_if = "Option::is_none")]
1750 output_format_options: Option<OutputFormat3D>,
1751 #[doc = "The converted files (if multiple file conversion), if completed, base64 encoded. \
1752 The key of the map is the path of the output file."]
1753 #[serde(default, skip_serializing_if = "Option::is_none")]
1754 outputs: Option<std::collections::HashMap<String, base64::Base64Data>>,
1755 #[doc = "The source format of the file conversion."]
1756 src_format: FileImportFormat,
1757 #[doc = "The source format options of the file conversion."]
1758 #[serde(default, skip_serializing_if = "Option::is_none")]
1759 src_format_options: Option<InputFormat3D>,
1760 #[doc = "The time and date the API call was started."]
1761 #[serde(default, skip_serializing_if = "Option::is_none")]
1762 started_at: Option<chrono::DateTime<chrono::Utc>>,
1763 #[doc = "The status of the API call."]
1764 status: ApiCallStatus,
1765 #[doc = "The time and date the API call was last updated."]
1766 updated_at: chrono::DateTime<chrono::Utc>,
1767 #[doc = "The user ID of the user who created the API call."]
1768 user_id: uuid::Uuid,
1769 },
1770 #[doc = "File center of mass."]
1771 #[serde(rename = "file_center_of_mass")]
1772 FileCenterOfMass {
1773 #[doc = "The resulting center of mass."]
1774 #[serde(default, skip_serializing_if = "Option::is_none")]
1775 center_of_mass: Option<Point3D>,
1776 #[doc = "The time and date the API call was completed."]
1777 #[serde(default, skip_serializing_if = "Option::is_none")]
1778 completed_at: Option<chrono::DateTime<chrono::Utc>>,
1779 #[doc = "The time and date the API call was created."]
1780 created_at: chrono::DateTime<chrono::Utc>,
1781 #[doc = "The error the function returned, if any."]
1782 #[serde(default, skip_serializing_if = "Option::is_none")]
1783 error: Option<String>,
1784 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
1785 id: uuid::Uuid,
1786 #[doc = "The output unit for the center of mass."]
1787 output_unit: UnitLength,
1788 #[doc = "The source format of the file."]
1789 src_format: FileImportFormat,
1790 #[doc = "The time and date the API call was started."]
1791 #[serde(default, skip_serializing_if = "Option::is_none")]
1792 started_at: Option<chrono::DateTime<chrono::Utc>>,
1793 #[doc = "The status of the API call."]
1794 status: ApiCallStatus,
1795 #[doc = "The time and date the API call was last updated."]
1796 updated_at: chrono::DateTime<chrono::Utc>,
1797 #[doc = "The user ID of the user who created the API call."]
1798 user_id: uuid::Uuid,
1799 },
1800 #[doc = "A file mass."]
1801 #[serde(rename = "file_mass")]
1802 FileMass {
1803 #[doc = "The time and date the API call was completed."]
1804 #[serde(default, skip_serializing_if = "Option::is_none")]
1805 completed_at: Option<chrono::DateTime<chrono::Utc>>,
1806 #[doc = "The time and date the API call was created."]
1807 created_at: chrono::DateTime<chrono::Utc>,
1808 #[doc = "The error the function returned, if any."]
1809 #[serde(default, skip_serializing_if = "Option::is_none")]
1810 error: Option<String>,
1811 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
1812 id: uuid::Uuid,
1813 #[doc = "The resulting mass."]
1814 #[serde(default, skip_serializing_if = "Option::is_none")]
1815 mass: Option<f64>,
1816 #[doc = "The material density as denoted by the user."]
1817 #[serde(default, skip_serializing_if = "Option::is_none")]
1818 material_density: Option<f64>,
1819 #[doc = "The material density unit."]
1820 material_density_unit: UnitDensity,
1821 #[doc = "The output unit for the mass."]
1822 output_unit: UnitMass,
1823 #[doc = "The source format of the file."]
1824 src_format: FileImportFormat,
1825 #[doc = "The time and date the API call was started."]
1826 #[serde(default, skip_serializing_if = "Option::is_none")]
1827 started_at: Option<chrono::DateTime<chrono::Utc>>,
1828 #[doc = "The status of the API call."]
1829 status: ApiCallStatus,
1830 #[doc = "The time and date the API call was last updated."]
1831 updated_at: chrono::DateTime<chrono::Utc>,
1832 #[doc = "The user ID of the user who created the API call."]
1833 user_id: uuid::Uuid,
1834 },
1835 #[doc = "A file volume."]
1836 #[serde(rename = "file_volume")]
1837 FileVolume {
1838 #[doc = "The time and date the API call was completed."]
1839 #[serde(default, skip_serializing_if = "Option::is_none")]
1840 completed_at: Option<chrono::DateTime<chrono::Utc>>,
1841 #[doc = "The time and date the API call was created."]
1842 created_at: chrono::DateTime<chrono::Utc>,
1843 #[doc = "The error the function returned, if any."]
1844 #[serde(default, skip_serializing_if = "Option::is_none")]
1845 error: Option<String>,
1846 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
1847 id: uuid::Uuid,
1848 #[doc = "The output unit for the volume."]
1849 output_unit: UnitVolume,
1850 #[doc = "The source format of the file."]
1851 src_format: FileImportFormat,
1852 #[doc = "The time and date the API call was started."]
1853 #[serde(default, skip_serializing_if = "Option::is_none")]
1854 started_at: Option<chrono::DateTime<chrono::Utc>>,
1855 #[doc = "The status of the API call."]
1856 status: ApiCallStatus,
1857 #[doc = "The time and date the API call was last updated."]
1858 updated_at: chrono::DateTime<chrono::Utc>,
1859 #[doc = "The user ID of the user who created the API call."]
1860 user_id: uuid::Uuid,
1861 #[doc = "The resulting volume."]
1862 #[serde(default, skip_serializing_if = "Option::is_none")]
1863 volume: Option<f64>,
1864 },
1865 #[doc = "A file density."]
1866 #[serde(rename = "file_density")]
1867 FileDensity {
1868 #[doc = "The time and date the API call was completed."]
1869 #[serde(default, skip_serializing_if = "Option::is_none")]
1870 completed_at: Option<chrono::DateTime<chrono::Utc>>,
1871 #[doc = "The time and date the API call was created."]
1872 created_at: chrono::DateTime<chrono::Utc>,
1873 #[doc = "The resulting density."]
1874 #[serde(default, skip_serializing_if = "Option::is_none")]
1875 density: Option<f64>,
1876 #[doc = "The error the function returned, if any."]
1877 #[serde(default, skip_serializing_if = "Option::is_none")]
1878 error: Option<String>,
1879 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
1880 id: uuid::Uuid,
1881 #[doc = "The material mass as denoted by the user."]
1882 #[serde(default, skip_serializing_if = "Option::is_none")]
1883 material_mass: Option<f64>,
1884 #[doc = "The material mass unit."]
1885 material_mass_unit: UnitMass,
1886 #[doc = "The output unit for the density."]
1887 output_unit: UnitDensity,
1888 #[doc = "The source format of the file."]
1889 src_format: FileImportFormat,
1890 #[doc = "The time and date the API call was started."]
1891 #[serde(default, skip_serializing_if = "Option::is_none")]
1892 started_at: Option<chrono::DateTime<chrono::Utc>>,
1893 #[doc = "The status of the API call."]
1894 status: ApiCallStatus,
1895 #[doc = "The time and date the API call was last updated."]
1896 updated_at: chrono::DateTime<chrono::Utc>,
1897 #[doc = "The user ID of the user who created the API call."]
1898 user_id: uuid::Uuid,
1899 },
1900 #[doc = "A file surface area."]
1901 #[serde(rename = "file_surface_area")]
1902 FileSurfaceArea {
1903 #[doc = "The time and date the API call was completed."]
1904 #[serde(default, skip_serializing_if = "Option::is_none")]
1905 completed_at: Option<chrono::DateTime<chrono::Utc>>,
1906 #[doc = "The time and date the API call was created."]
1907 created_at: chrono::DateTime<chrono::Utc>,
1908 #[doc = "The error the function returned, if any."]
1909 #[serde(default, skip_serializing_if = "Option::is_none")]
1910 error: Option<String>,
1911 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
1912 id: uuid::Uuid,
1913 #[doc = "The output unit for the surface area."]
1914 output_unit: UnitArea,
1915 #[doc = "The source format of the file."]
1916 src_format: FileImportFormat,
1917 #[doc = "The time and date the API call was started."]
1918 #[serde(default, skip_serializing_if = "Option::is_none")]
1919 started_at: Option<chrono::DateTime<chrono::Utc>>,
1920 #[doc = "The status of the API call."]
1921 status: ApiCallStatus,
1922 #[doc = "The resulting surface area."]
1923 #[serde(default, skip_serializing_if = "Option::is_none")]
1924 surface_area: Option<f64>,
1925 #[doc = "The time and date the API call was last updated."]
1926 updated_at: chrono::DateTime<chrono::Utc>,
1927 #[doc = "The user ID of the user who created the API call."]
1928 user_id: uuid::Uuid,
1929 },
1930 #[doc = "Text to CAD."]
1931 #[serde(rename = "text_to_cad")]
1932 TextToCad {
1933 #[doc = "The code for the model. This is optional but will be required in the future once \
1934 we are at v1."]
1935 #[serde(default, skip_serializing_if = "Option::is_none")]
1936 code: Option<String>,
1937 #[doc = "The time and date the API call was completed."]
1938 #[serde(default, skip_serializing_if = "Option::is_none")]
1939 completed_at: Option<chrono::DateTime<chrono::Utc>>,
1940 #[doc = "The conversation ID Conversations group different prompts together."]
1941 conversation_id: uuid::Uuid,
1942 #[doc = "The time and date the API call was created."]
1943 created_at: chrono::DateTime<chrono::Utc>,
1944 #[doc = "The error the function returned, if any."]
1945 #[serde(default, skip_serializing_if = "Option::is_none")]
1946 error: Option<String>,
1947 #[doc = "Feedback from the user, if any."]
1948 #[serde(default, skip_serializing_if = "Option::is_none")]
1949 feedback: Option<MlFeedback>,
1950 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
1951 id: uuid::Uuid,
1952 #[doc = "The version of kcl requested."]
1953 #[serde(default, skip_serializing_if = "Option::is_none")]
1954 kcl_version: Option<String>,
1955 #[doc = "The model being used."]
1956 model: TextToCadModel,
1957 #[doc = "The version of the model."]
1958 model_version: String,
1959 #[doc = "The output format of the model."]
1960 output_format: FileExportFormat,
1961 #[doc = "The output of the model in the given file format the user requested, base64 \
1962 encoded. The key of the map is the path of the output file."]
1963 #[serde(default, skip_serializing_if = "Option::is_none")]
1964 outputs: Option<std::collections::HashMap<String, base64::Base64Data>>,
1965 #[doc = "The prompt."]
1966 prompt: String,
1967 #[doc = "The time and date the API call was started."]
1968 #[serde(default, skip_serializing_if = "Option::is_none")]
1969 started_at: Option<chrono::DateTime<chrono::Utc>>,
1970 #[doc = "The status of the API call."]
1971 status: ApiCallStatus,
1972 #[doc = "The time and date the API call was last updated."]
1973 updated_at: chrono::DateTime<chrono::Utc>,
1974 #[doc = "The user ID of the user who created the API call."]
1975 user_id: uuid::Uuid,
1976 },
1977 #[doc = "Text to CAD iteration."]
1978 #[serde(rename = "text_to_cad_iteration")]
1979 TextToCadIteration {
1980 #[doc = "The code for the new model."]
1981 code: String,
1982 #[doc = "The time and date the API call was completed."]
1983 #[serde(default, skip_serializing_if = "Option::is_none")]
1984 completed_at: Option<chrono::DateTime<chrono::Utc>>,
1985 #[doc = "The conversation ID Conversations group different prompts together."]
1986 conversation_id: uuid::Uuid,
1987 #[doc = "The time and date the API call was created."]
1988 created_at: chrono::DateTime<chrono::Utc>,
1989 #[doc = "The error the function returned, if any."]
1990 #[serde(default, skip_serializing_if = "Option::is_none")]
1991 error: Option<String>,
1992 #[doc = "Feedback from the user, if any."]
1993 #[serde(default, skip_serializing_if = "Option::is_none")]
1994 feedback: Option<MlFeedback>,
1995 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
1996 id: uuid::Uuid,
1997 #[doc = "The model being used."]
1998 model: TextToCadModel,
1999 #[doc = "The version of the model."]
2000 model_version: String,
2001 #[doc = "The original source code for the model, previous to the changes."]
2002 original_source_code: String,
2003 #[doc = "The prompt for the overall changes. This is optional if you only want changes on \
2004 specific source ranges."]
2005 #[serde(default, skip_serializing_if = "Option::is_none")]
2006 prompt: Option<String>,
2007 #[doc = "The source ranges the user suggested to change."]
2008 source_ranges: Vec<SourceRangePrompt>,
2009 #[doc = "The time and date the API call was started."]
2010 #[serde(default, skip_serializing_if = "Option::is_none")]
2011 started_at: Option<chrono::DateTime<chrono::Utc>>,
2012 #[doc = "The status of the API call."]
2013 status: ApiCallStatus,
2014 #[doc = "The time and date the API call was last updated."]
2015 updated_at: chrono::DateTime<chrono::Utc>,
2016 #[doc = "The user ID of the user who created the API call."]
2017 user_id: uuid::Uuid,
2018 },
2019 #[doc = "Text to CAD multi-file iteration."]
2020 #[serde(rename = "text_to_cad_multi_file_iteration")]
2021 TextToCadMultiFileIteration {
2022 #[doc = "The time and date the API call was completed."]
2023 #[serde(default, skip_serializing_if = "Option::is_none")]
2024 completed_at: Option<chrono::DateTime<chrono::Utc>>,
2025 #[doc = "The conversation ID Conversations group different prompts together."]
2026 conversation_id: uuid::Uuid,
2027 #[doc = "The time and date the API call was created."]
2028 created_at: chrono::DateTime<chrono::Utc>,
2029 #[doc = "The error the function returned, if any."]
2030 #[serde(default, skip_serializing_if = "Option::is_none")]
2031 error: Option<String>,
2032 #[doc = "Feedback from the user, if any."]
2033 #[serde(default, skip_serializing_if = "Option::is_none")]
2034 feedback: Option<MlFeedback>,
2035 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
2036 id: uuid::Uuid,
2037 #[doc = "The version of kcl to use. If empty, the latest version will be used."]
2038 #[serde(default, skip_serializing_if = "Option::is_none")]
2039 kcl_version: Option<String>,
2040 #[doc = "The model being used."]
2041 model: TextToCadModel,
2042 #[doc = "The version of the model."]
2043 model_version: String,
2044 #[doc = "The output files. Returns a map of the file name to the file contents. The file \
2045 contents are not encoded since kcl files are not binary."]
2046 #[serde(default, skip_serializing_if = "Option::is_none")]
2047 outputs: Option<std::collections::HashMap<String, String>>,
2048 #[doc = "The project name. This is used to tie the prompt to a project. Which helps us \
2049 make our models better over time."]
2050 #[serde(default, skip_serializing_if = "Option::is_none")]
2051 project_name: Option<String>,
2052 #[doc = "The prompt for the overall changes. This is optional if you only want changes on \
2053 specific source ranges. This will apply to all the files."]
2054 #[serde(default, skip_serializing_if = "Option::is_none")]
2055 prompt: Option<String>,
2056 #[doc = "The source ranges the user suggested to change."]
2057 source_ranges: Vec<SourceRangePrompt>,
2058 #[doc = "The time and date the API call was started."]
2059 #[serde(default, skip_serializing_if = "Option::is_none")]
2060 started_at: Option<chrono::DateTime<chrono::Utc>>,
2061 #[doc = "The status of the API call."]
2062 status: ApiCallStatus,
2063 #[doc = "The time and date the API call was last updated."]
2064 updated_at: chrono::DateTime<chrono::Utc>,
2065 #[doc = "The user ID of the user who created the API call."]
2066 user_id: uuid::Uuid,
2067 },
2068}
2069
2070#[doc = "A single page of results"]
2071#[derive(
2072 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2073)]
2074pub struct AsyncApiCallResultsPage {
2075 #[doc = "list of items on this page of results"]
2076 pub items: Vec<AsyncApiCall>,
2077 #[doc = "token used to fetch the next page of results (if any)"]
2078 #[serde(default, skip_serializing_if = "Option::is_none")]
2079 pub next_page: Option<String>,
2080}
2081
2082impl std::fmt::Display for AsyncApiCallResultsPage {
2083 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2084 write!(
2085 f,
2086 "{}",
2087 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2088 )
2089 }
2090}
2091
2092#[cfg(feature = "requests")]
2093impl crate::types::paginate::Pagination for AsyncApiCallResultsPage {
2094 type Item = AsyncApiCall;
2095 fn has_more_pages(&self) -> bool {
2096 self.next_page.is_some()
2097 }
2098
2099 fn next_page_token(&self) -> Option<String> {
2100 self.next_page.clone()
2101 }
2102
2103 fn next_page(
2104 &self,
2105 req: reqwest::Request,
2106 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
2107 let mut req = req.try_clone().ok_or_else(|| {
2108 crate::types::error::Error::InvalidRequest(format!(
2109 "failed to clone request: {:?}",
2110 req
2111 ))
2112 })?;
2113 req.url_mut()
2114 .query_pairs_mut()
2115 .append_pair("next_page", self.next_page.as_deref().unwrap_or(""));
2116 Ok(req)
2117 }
2118
2119 fn items(&self) -> Vec<Self::Item> {
2120 self.items.clone()
2121 }
2122}
2123
2124#[cfg(feature = "tabled")]
2125impl tabled::Tabled for AsyncApiCallResultsPage {
2126 const LENGTH: usize = 2;
2127 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2128 vec![
2129 format!("{:?}", self.items).into(),
2130 if let Some(next_page) = &self.next_page {
2131 format!("{:?}", next_page).into()
2132 } else {
2133 String::new().into()
2134 },
2135 ]
2136 }
2137
2138 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2139 vec!["items".into(), "next_page".into()]
2140 }
2141}
2142
2143#[doc = "The type of async API call."]
2144#[derive(
2145 serde :: Serialize,
2146 serde :: Deserialize,
2147 PartialEq,
2148 Hash,
2149 Debug,
2150 Clone,
2151 schemars :: JsonSchema,
2152 parse_display :: FromStr,
2153 parse_display :: Display,
2154)]
2155#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
2156#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
2157pub enum AsyncApiCallType {
2158 #[doc = "File conversion."]
2159 #[serde(rename = "file_conversion")]
2160 #[display("file_conversion")]
2161 FileConversion,
2162 #[doc = "File volume."]
2163 #[serde(rename = "file_volume")]
2164 #[display("file_volume")]
2165 FileVolume,
2166 #[doc = "File center of mass."]
2167 #[serde(rename = "file_center_of_mass")]
2168 #[display("file_center_of_mass")]
2169 FileCenterOfMass,
2170 #[doc = "File mass."]
2171 #[serde(rename = "file_mass")]
2172 #[display("file_mass")]
2173 FileMass,
2174 #[doc = "File density."]
2175 #[serde(rename = "file_density")]
2176 #[display("file_density")]
2177 FileDensity,
2178 #[doc = "File surface area."]
2179 #[serde(rename = "file_surface_area")]
2180 #[display("file_surface_area")]
2181 FileSurfaceArea,
2182 #[doc = "Text to CAD."]
2183 #[serde(rename = "text_to_cad")]
2184 #[display("text_to_cad")]
2185 TextToCad,
2186 #[doc = "Text to CAD iteration."]
2187 #[serde(rename = "text_to_cad_iteration")]
2188 #[display("text_to_cad_iteration")]
2189 TextToCadIteration,
2190 #[doc = "Text to CAD multi-file iteration."]
2191 #[serde(rename = "text_to_cad_multi_file_iteration")]
2192 #[display("text_to_cad_multi_file_iteration")]
2193 TextToCadMultiFileIteration,
2194}
2195
2196#[doc = "The response from the `/auth/api-key` endpoint."]
2197#[derive(
2198 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2199)]
2200pub struct AuthApiKeyResponse {
2201 #[doc = "The session token"]
2202 pub session_token: String,
2203}
2204
2205impl std::fmt::Display for AuthApiKeyResponse {
2206 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2207 write!(
2208 f,
2209 "{}",
2210 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2211 )
2212 }
2213}
2214
2215#[cfg(feature = "tabled")]
2216impl tabled::Tabled for AuthApiKeyResponse {
2217 const LENGTH: usize = 1;
2218 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2219 vec![self.session_token.clone().into()]
2220 }
2221
2222 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2223 vec!["session_token".into()]
2224 }
2225}
2226
2227#[doc = "The authentication callback from the OAuth 2.0 client. This is typically posted to the \
2228 redirect URL as query params after authenticating."]
2229#[derive(
2230 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2231)]
2232pub struct AuthCallback {
2233 #[doc = "The authorization code."]
2234 #[serde(default, skip_serializing_if = "Option::is_none")]
2235 pub code: Option<String>,
2236 #[doc = "For Apple only, a JSON web token containing the user’s identity information."]
2237 #[serde(default, skip_serializing_if = "Option::is_none")]
2238 pub id_token: Option<String>,
2239 #[doc = "The state that we had passed in through the user consent URL."]
2240 #[serde(default, skip_serializing_if = "Option::is_none")]
2241 pub state: Option<String>,
2242 #[doc = "For Apple only, a JSON string containing the data requested in the scope property. \
2243 The returned data is in the following format: `{ \"name\": { \"firstName\": string, \
2244 \"lastName\": string }, \"email\": string }`"]
2245 #[serde(default, skip_serializing_if = "Option::is_none")]
2246 pub user: Option<String>,
2247}
2248
2249impl std::fmt::Display for AuthCallback {
2250 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2251 write!(
2252 f,
2253 "{}",
2254 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2255 )
2256 }
2257}
2258
2259#[cfg(feature = "tabled")]
2260impl tabled::Tabled for AuthCallback {
2261 const LENGTH: usize = 4;
2262 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2263 vec![
2264 if let Some(code) = &self.code {
2265 format!("{:?}", code).into()
2266 } else {
2267 String::new().into()
2268 },
2269 if let Some(id_token) = &self.id_token {
2270 format!("{:?}", id_token).into()
2271 } else {
2272 String::new().into()
2273 },
2274 if let Some(state) = &self.state {
2275 format!("{:?}", state).into()
2276 } else {
2277 String::new().into()
2278 },
2279 if let Some(user) = &self.user {
2280 format!("{:?}", user).into()
2281 } else {
2282 String::new().into()
2283 },
2284 ]
2285 }
2286
2287 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2288 vec![
2289 "code".into(),
2290 "id_token".into(),
2291 "state".into(),
2292 "user".into(),
2293 ]
2294 }
2295}
2296
2297#[doc = "Co-ordinate axis specifier.\n\nSee [cglearn.eu] for background reading.\n\n[cglearn.eu]: https://cglearn.eu/pub/computer-graphics/introduction-to-geometry#material-coordinate-systems-1"]
2298#[derive(
2299 serde :: Serialize,
2300 serde :: Deserialize,
2301 PartialEq,
2302 Hash,
2303 Debug,
2304 Clone,
2305 schemars :: JsonSchema,
2306 parse_display :: FromStr,
2307 parse_display :: Display,
2308)]
2309#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
2310#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
2311pub enum Axis {
2312 #[doc = "'Y' axis."]
2313 #[serde(rename = "y")]
2314 #[display("y")]
2315 Y,
2316 #[doc = "'Z' axis."]
2317 #[serde(rename = "z")]
2318 #[display("z")]
2319 Z,
2320}
2321
2322#[doc = "An [`Axis`] paired with a [`Direction`]."]
2323#[derive(
2324 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2325)]
2326pub struct AxisDirectionPair {
2327 #[doc = "Axis specifier."]
2328 pub axis: Axis,
2329 #[doc = "Specifies which direction the axis is pointing."]
2330 pub direction: Direction,
2331}
2332
2333impl std::fmt::Display for AxisDirectionPair {
2334 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2335 write!(
2336 f,
2337 "{}",
2338 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2339 )
2340 }
2341}
2342
2343#[cfg(feature = "tabled")]
2344impl tabled::Tabled for AxisDirectionPair {
2345 const LENGTH: usize = 2;
2346 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2347 vec![
2348 format!("{:?}", self.axis).into(),
2349 format!("{:?}", self.direction).into(),
2350 ]
2351 }
2352
2353 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2354 vec!["axis".into(), "direction".into()]
2355 }
2356}
2357
2358#[doc = "Websocket responses can either be successful or unsuccessful. Slightly different schemas \
2359 in either case."]
2360#[derive(
2361 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2362)]
2363pub struct BatchResponse {
2364 #[doc = "Response to the modeling command."]
2365 #[serde(default, skip_serializing_if = "Option::is_none")]
2366 pub response: Option<OkModelingCmdResponse>,
2367 #[doc = "Errors that occurred during the modeling command."]
2368 #[serde(default, skip_serializing_if = "Option::is_none")]
2369 pub errors: Option<Vec<ApiError>>,
2370}
2371
2372impl std::fmt::Display for BatchResponse {
2373 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2374 write!(
2375 f,
2376 "{}",
2377 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2378 )
2379 }
2380}
2381
2382#[cfg(feature = "tabled")]
2383impl tabled::Tabled for BatchResponse {
2384 const LENGTH: usize = 2;
2385 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2386 vec![
2387 if let Some(response) = &self.response {
2388 format!("{:?}", response).into()
2389 } else {
2390 String::new().into()
2391 },
2392 if let Some(errors) = &self.errors {
2393 format!("{:?}", errors).into()
2394 } else {
2395 String::new().into()
2396 },
2397 ]
2398 }
2399
2400 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2401 vec!["response".into(), "errors".into()]
2402 }
2403}
2404
2405#[doc = "The billing information for payments."]
2406#[derive(
2407 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2408)]
2409pub struct BillingInfo {
2410 #[doc = "The address of the customer."]
2411 #[serde(default, skip_serializing_if = "Option::is_none")]
2412 pub address: Option<AddressDetails>,
2413 #[doc = "The name of the customer."]
2414 #[serde(default, skip_serializing_if = "Option::is_none")]
2415 pub name: Option<String>,
2416 #[doc = "The phone for the customer."]
2417 #[serde(default, skip_serializing_if = "Option::is_none")]
2418 pub phone: phone_number::PhoneNumber,
2419}
2420
2421impl std::fmt::Display for BillingInfo {
2422 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2423 write!(
2424 f,
2425 "{}",
2426 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2427 )
2428 }
2429}
2430
2431#[cfg(feature = "tabled")]
2432impl tabled::Tabled for BillingInfo {
2433 const LENGTH: usize = 3;
2434 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2435 vec![
2436 if let Some(address) = &self.address {
2437 format!("{:?}", address).into()
2438 } else {
2439 String::new().into()
2440 },
2441 if let Some(name) = &self.name {
2442 format!("{:?}", name).into()
2443 } else {
2444 String::new().into()
2445 },
2446 format!("{:?}", self.phone).into(),
2447 ]
2448 }
2449
2450 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2451 vec!["address".into(), "name".into(), "phone".into()]
2452 }
2453}
2454
2455#[doc = "The reason for blocking a user."]
2456#[derive(
2457 serde :: Serialize,
2458 serde :: Deserialize,
2459 PartialEq,
2460 Hash,
2461 Debug,
2462 Clone,
2463 schemars :: JsonSchema,
2464 parse_display :: FromStr,
2465 parse_display :: Display,
2466)]
2467#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
2468#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
2469pub enum BlockReason {
2470 #[doc = "The user is missing a payment method and has exceeded their free API call credits \
2471 for the month."]
2472 #[serde(rename = "missing_payment_method")]
2473 #[display("missing_payment_method")]
2474 MissingPaymentMethod,
2475 #[doc = "The users payment method has failed."]
2476 #[serde(rename = "payment_method_failed")]
2477 #[display("payment_method_failed")]
2478 PaymentMethodFailed,
2479}
2480
2481#[doc = "The response from the 'BooleanIntersection'."]
2482#[derive(
2483 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2484)]
2485pub struct BooleanIntersection {
2486 #[doc = "If the operation produced just one solid, then its ID will be the ID of the modeling \
2487 command request. But if any extra solids are produced, then their IDs will be \
2488 included here."]
2489 #[serde(default, skip_serializing_if = "Option::is_none")]
2490 pub extra_solid_ids: Option<Vec<uuid::Uuid>>,
2491}
2492
2493impl std::fmt::Display for BooleanIntersection {
2494 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2495 write!(
2496 f,
2497 "{}",
2498 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2499 )
2500 }
2501}
2502
2503#[cfg(feature = "tabled")]
2504impl tabled::Tabled for BooleanIntersection {
2505 const LENGTH: usize = 1;
2506 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2507 vec![if let Some(extra_solid_ids) = &self.extra_solid_ids {
2508 format!("{:?}", extra_solid_ids).into()
2509 } else {
2510 String::new().into()
2511 }]
2512 }
2513
2514 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2515 vec!["extra_solid_ids".into()]
2516 }
2517}
2518
2519#[doc = "The response from the 'BooleanSubtract'."]
2520#[derive(
2521 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2522)]
2523pub struct BooleanSubtract {
2524 #[doc = "If the operation produced just one solid, then its ID will be the ID of the modeling \
2525 command request. But if any extra solids are produced, then their IDs will be \
2526 included here."]
2527 #[serde(default, skip_serializing_if = "Option::is_none")]
2528 pub extra_solid_ids: Option<Vec<uuid::Uuid>>,
2529}
2530
2531impl std::fmt::Display for BooleanSubtract {
2532 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2533 write!(
2534 f,
2535 "{}",
2536 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2537 )
2538 }
2539}
2540
2541#[cfg(feature = "tabled")]
2542impl tabled::Tabled for BooleanSubtract {
2543 const LENGTH: usize = 1;
2544 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2545 vec![if let Some(extra_solid_ids) = &self.extra_solid_ids {
2546 format!("{:?}", extra_solid_ids).into()
2547 } else {
2548 String::new().into()
2549 }]
2550 }
2551
2552 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2553 vec!["extra_solid_ids".into()]
2554 }
2555}
2556
2557#[doc = "The response from the 'BooleanUnion'."]
2558#[derive(
2559 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2560)]
2561pub struct BooleanUnion {
2562 #[doc = "If the operation produced just one solid, then its ID will be the ID of the modeling \
2563 command request. But if any extra solids are produced, then their IDs will be \
2564 included here."]
2565 #[serde(default, skip_serializing_if = "Option::is_none")]
2566 pub extra_solid_ids: Option<Vec<uuid::Uuid>>,
2567}
2568
2569impl std::fmt::Display for BooleanUnion {
2570 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2571 write!(
2572 f,
2573 "{}",
2574 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2575 )
2576 }
2577}
2578
2579#[cfg(feature = "tabled")]
2580impl tabled::Tabled for BooleanUnion {
2581 const LENGTH: usize = 1;
2582 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2583 vec![if let Some(extra_solid_ids) = &self.extra_solid_ids {
2584 format!("{:?}", extra_solid_ids).into()
2585 } else {
2586 String::new().into()
2587 }]
2588 }
2589
2590 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2591 vec!["extra_solid_ids".into()]
2592 }
2593}
2594
2595#[doc = "The response from the `CameraDragEnd` command."]
2596#[derive(
2597 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2598)]
2599pub struct CameraDragEnd {
2600 #[doc = "Camera settings"]
2601 pub settings: CameraSettings,
2602}
2603
2604impl std::fmt::Display for CameraDragEnd {
2605 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2606 write!(
2607 f,
2608 "{}",
2609 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2610 )
2611 }
2612}
2613
2614#[cfg(feature = "tabled")]
2615impl tabled::Tabled for CameraDragEnd {
2616 const LENGTH: usize = 1;
2617 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2618 vec![format!("{:?}", self.settings).into()]
2619 }
2620
2621 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2622 vec!["settings".into()]
2623 }
2624}
2625
2626#[doc = "The type of camera drag interaction."]
2627#[derive(
2628 serde :: Serialize,
2629 serde :: Deserialize,
2630 PartialEq,
2631 Hash,
2632 Debug,
2633 Clone,
2634 schemars :: JsonSchema,
2635 parse_display :: FromStr,
2636 parse_display :: Display,
2637)]
2638#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
2639#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
2640pub enum CameraDragInteractionType {
2641 #[doc = "Camera pan"]
2642 #[serde(rename = "pan")]
2643 #[display("pan")]
2644 Pan,
2645 #[doc = "Camera rotate (spherical camera revolve/orbit)"]
2646 #[serde(rename = "rotate")]
2647 #[display("rotate")]
2648 Rotate,
2649 #[doc = "Camera rotate (trackball with 3 degrees of freedom)"]
2650 #[serde(rename = "rotatetrackball")]
2651 #[display("rotatetrackball")]
2652 Rotatetrackball,
2653 #[doc = "Camera zoom (increase or decrease distance to reference point center)"]
2654 #[serde(rename = "zoom")]
2655 #[display("zoom")]
2656 Zoom,
2657}
2658
2659#[doc = "The response from the `CameraDragMove` command. Note this is an \"unreliable\" channel \
2660 message, so this data may need more data like a \"sequence\""]
2661#[derive(
2662 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2663)]
2664pub struct CameraDragMove {
2665 #[doc = "Camera settings"]
2666 pub settings: CameraSettings,
2667}
2668
2669impl std::fmt::Display for CameraDragMove {
2670 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2671 write!(
2672 f,
2673 "{}",
2674 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2675 )
2676 }
2677}
2678
2679#[cfg(feature = "tabled")]
2680impl tabled::Tabled for CameraDragMove {
2681 const LENGTH: usize = 1;
2682 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2683 vec![format!("{:?}", self.settings).into()]
2684 }
2685
2686 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2687 vec!["settings".into()]
2688 }
2689}
2690
2691#[doc = "The response from the `CameraDragStart` endpoint."]
2692#[derive(
2693 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2694)]
2695pub struct CameraDragStart {}
2696
2697impl std::fmt::Display for CameraDragStart {
2698 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2699 write!(
2700 f,
2701 "{}",
2702 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2703 )
2704 }
2705}
2706
2707#[cfg(feature = "tabled")]
2708impl tabled::Tabled for CameraDragStart {
2709 const LENGTH: usize = 0;
2710 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2711 vec![]
2712 }
2713
2714 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2715 vec![]
2716 }
2717}
2718
2719#[doc = "A type of camera movement applied after certain camera operations"]
2720#[derive(
2721 serde :: Serialize,
2722 serde :: Deserialize,
2723 PartialEq,
2724 Hash,
2725 Debug,
2726 Clone,
2727 schemars :: JsonSchema,
2728 parse_display :: FromStr,
2729 parse_display :: Display,
2730)]
2731#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
2732#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
2733pub enum CameraMovement {
2734 #[doc = "Adjusts the camera position during the camera operation"]
2735 #[serde(rename = "vantage")]
2736 #[display("vantage")]
2737 Vantage,
2738 #[doc = "Keeps the camera position in place"]
2739 #[serde(rename = "none")]
2740 #[display("none")]
2741 None,
2742}
2743
2744#[doc = "Camera settings including position, center, fov etc"]
2745#[derive(
2746 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2747)]
2748pub struct CameraSettings {
2749 #[doc = "Camera's look-at center (center-pos gives viewing vector)"]
2750 pub center: Point3D,
2751 #[doc = "Camera's field-of-view angle (if ortho is false)"]
2752 #[serde(default, skip_serializing_if = "Option::is_none")]
2753 pub fov_y: Option<f64>,
2754 #[doc = "The Camera's orientation (in the form of a quaternion)"]
2755 pub orientation: Point4D,
2756 #[doc = "Whether or not the camera is in ortho mode"]
2757 pub ortho: bool,
2758 #[doc = "The camera's ortho scale (derived from viewing distance if ortho is true)"]
2759 #[serde(default, skip_serializing_if = "Option::is_none")]
2760 pub ortho_scale: Option<f64>,
2761 #[doc = "Camera position (vantage)"]
2762 pub pos: Point3D,
2763 #[doc = "Camera's world-space up vector"]
2764 pub up: Point3D,
2765}
2766
2767impl std::fmt::Display for CameraSettings {
2768 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2769 write!(
2770 f,
2771 "{}",
2772 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2773 )
2774 }
2775}
2776
2777#[cfg(feature = "tabled")]
2778impl tabled::Tabled for CameraSettings {
2779 const LENGTH: usize = 7;
2780 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2781 vec![
2782 format!("{:?}", self.center).into(),
2783 if let Some(fov_y) = &self.fov_y {
2784 format!("{:?}", fov_y).into()
2785 } else {
2786 String::new().into()
2787 },
2788 format!("{:?}", self.orientation).into(),
2789 format!("{:?}", self.ortho).into(),
2790 if let Some(ortho_scale) = &self.ortho_scale {
2791 format!("{:?}", ortho_scale).into()
2792 } else {
2793 String::new().into()
2794 },
2795 format!("{:?}", self.pos).into(),
2796 format!("{:?}", self.up).into(),
2797 ]
2798 }
2799
2800 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2801 vec![
2802 "center".into(),
2803 "fov_y".into(),
2804 "orientation".into(),
2805 "ortho".into(),
2806 "ortho_scale".into(),
2807 "pos".into(),
2808 "up".into(),
2809 ]
2810 }
2811}
2812
2813#[derive(
2814 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2815)]
2816pub struct CameraViewState {
2817 pub eye_offset: f64,
2818 pub fov_y: f64,
2819 pub is_ortho: bool,
2820 pub ortho_scale_enabled: bool,
2821 pub ortho_scale_factor: f64,
2822 #[doc = "A point in 3D space"]
2823 pub pivot_position: Point3D,
2824 #[doc = "A point in homogeneous (4D) space"]
2825 pub pivot_rotation: Point4D,
2826 pub world_coord_system: WorldCoordinateSystem,
2827}
2828
2829impl std::fmt::Display for CameraViewState {
2830 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2831 write!(
2832 f,
2833 "{}",
2834 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2835 )
2836 }
2837}
2838
2839#[cfg(feature = "tabled")]
2840impl tabled::Tabled for CameraViewState {
2841 const LENGTH: usize = 8;
2842 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2843 vec![
2844 format!("{:?}", self.eye_offset).into(),
2845 format!("{:?}", self.fov_y).into(),
2846 format!("{:?}", self.is_ortho).into(),
2847 format!("{:?}", self.ortho_scale_enabled).into(),
2848 format!("{:?}", self.ortho_scale_factor).into(),
2849 format!("{:?}", self.pivot_position).into(),
2850 format!("{:?}", self.pivot_rotation).into(),
2851 format!("{:?}", self.world_coord_system).into(),
2852 ]
2853 }
2854
2855 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2856 vec![
2857 "eye_offset".into(),
2858 "fov_y".into(),
2859 "is_ortho".into(),
2860 "ortho_scale_enabled".into(),
2861 "ortho_scale_factor".into(),
2862 "pivot_position".into(),
2863 "pivot_rotation".into(),
2864 "world_coord_system".into(),
2865 ]
2866 }
2867}
2868
2869#[doc = "The card details of a payment method."]
2870#[derive(
2871 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2872)]
2873pub struct CardDetails {
2874 #[doc = "Card brand.\n\nCan be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, \
2875 `visa`, or `unknown`."]
2876 #[serde(default, skip_serializing_if = "Option::is_none")]
2877 pub brand: Option<String>,
2878 #[doc = "Checks on Card address and CVC if provided."]
2879 #[serde(default, skip_serializing_if = "Option::is_none")]
2880 pub checks: Option<PaymentMethodCardChecks>,
2881 #[doc = "Two-letter ISO code representing the country of the card."]
2882 #[serde(default, skip_serializing_if = "Option::is_none")]
2883 pub country: Option<String>,
2884 #[doc = "Two-digit number representing the card's expiration month."]
2885 #[serde(default, skip_serializing_if = "Option::is_none")]
2886 pub exp_month: Option<i64>,
2887 #[doc = "Four-digit number representing the card's expiration year."]
2888 #[serde(default, skip_serializing_if = "Option::is_none")]
2889 pub exp_year: Option<i64>,
2890 #[doc = "Uniquely identifies this particular card number."]
2891 #[serde(default, skip_serializing_if = "Option::is_none")]
2892 pub fingerprint: Option<String>,
2893 #[doc = "Card funding type.\n\nCan be `credit`, `debit`, `prepaid`, or `unknown`."]
2894 #[serde(default, skip_serializing_if = "Option::is_none")]
2895 pub funding: Option<String>,
2896 #[doc = "The last four digits of the card."]
2897 #[serde(rename = "last4", default, skip_serializing_if = "Option::is_none")]
2898 pub last_4: Option<String>,
2899}
2900
2901impl std::fmt::Display for CardDetails {
2902 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2903 write!(
2904 f,
2905 "{}",
2906 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2907 )
2908 }
2909}
2910
2911#[cfg(feature = "tabled")]
2912impl tabled::Tabled for CardDetails {
2913 const LENGTH: usize = 8;
2914 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2915 vec![
2916 if let Some(brand) = &self.brand {
2917 format!("{:?}", brand).into()
2918 } else {
2919 String::new().into()
2920 },
2921 if let Some(checks) = &self.checks {
2922 format!("{:?}", checks).into()
2923 } else {
2924 String::new().into()
2925 },
2926 if let Some(country) = &self.country {
2927 format!("{:?}", country).into()
2928 } else {
2929 String::new().into()
2930 },
2931 if let Some(exp_month) = &self.exp_month {
2932 format!("{:?}", exp_month).into()
2933 } else {
2934 String::new().into()
2935 },
2936 if let Some(exp_year) = &self.exp_year {
2937 format!("{:?}", exp_year).into()
2938 } else {
2939 String::new().into()
2940 },
2941 if let Some(fingerprint) = &self.fingerprint {
2942 format!("{:?}", fingerprint).into()
2943 } else {
2944 String::new().into()
2945 },
2946 if let Some(funding) = &self.funding {
2947 format!("{:?}", funding).into()
2948 } else {
2949 String::new().into()
2950 },
2951 if let Some(last_4) = &self.last_4 {
2952 format!("{:?}", last_4).into()
2953 } else {
2954 String::new().into()
2955 },
2956 ]
2957 }
2958
2959 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2960 vec![
2961 "brand".into(),
2962 "checks".into(),
2963 "country".into(),
2964 "exp_month".into(),
2965 "exp_year".into(),
2966 "fingerprint".into(),
2967 "funding".into(),
2968 "last_4".into(),
2969 ]
2970 }
2971}
2972
2973#[doc = "The center of mass response."]
2974#[derive(
2975 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2976)]
2977pub struct CenterOfMass {
2978 #[doc = "The center of mass."]
2979 pub center_of_mass: Point3D,
2980 #[doc = "The output unit for the center of mass."]
2981 pub output_unit: UnitLength,
2982}
2983
2984impl std::fmt::Display for CenterOfMass {
2985 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2986 write!(
2987 f,
2988 "{}",
2989 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2990 )
2991 }
2992}
2993
2994#[cfg(feature = "tabled")]
2995impl tabled::Tabled for CenterOfMass {
2996 const LENGTH: usize = 2;
2997 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2998 vec![
2999 format!("{:?}", self.center_of_mass).into(),
3000 format!("{:?}", self.output_unit).into(),
3001 ]
3002 }
3003
3004 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3005 vec!["center_of_mass".into(), "output_unit".into()]
3006 }
3007}
3008
3009#[doc = "ClientMetrics contains information regarding the state of the peer."]
3010#[derive(
3011 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3012)]
3013pub struct ClientMetrics {
3014 #[doc = "The height of the inbound video stream in pixels.\n\nhttps://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-frameheight"]
3015 #[serde(default, skip_serializing_if = "Option::is_none")]
3016 pub rtc_frame_height: Option<u32>,
3017 #[doc = "The width of the inbound video stream in pixels.\n\nhttps://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-framewidth"]
3018 #[serde(default, skip_serializing_if = "Option::is_none")]
3019 pub rtc_frame_width: Option<u32>,
3020 #[doc = "Counter of the number of WebRTC frames that the client has decoded from the inbound video stream.\n\nhttps://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-freezecount"]
3021 #[serde(default, skip_serializing_if = "Option::is_none")]
3022 pub rtc_frames_decoded: Option<u64>,
3023 #[doc = "Counter of the number of WebRTC frames the client has dropped from the inbound video stream.\n\nhttps://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-framesdropped"]
3024 #[serde(default, skip_serializing_if = "Option::is_none")]
3025 pub rtc_frames_dropped: Option<u32>,
3026 #[doc = "Current number of frames being rendered in the last second. A good target is 60 frames per second, but it can fluctuate depending on network conditions.\n\nhttps://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-freezecount"]
3027 #[serde(default, skip_serializing_if = "Option::is_none")]
3028 pub rtc_frames_per_second: Option<u8>,
3029 #[doc = "Counter of the number of WebRTC frames that the client has received from the inbound video stream.\n\nhttps://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-freezecount"]
3030 #[serde(default, skip_serializing_if = "Option::is_none")]
3031 pub rtc_frames_received: Option<u64>,
3032 #[doc = "Number of times the inbound video playback has frozen. This is usually due to network conditions.\n\nhttps://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-freezecount"]
3033 #[serde(default, skip_serializing_if = "Option::is_none")]
3034 pub rtc_freeze_count: Option<u32>,
3035 #[doc = "Amount of \"jitter\" in the inbound video stream. Network latency is the time it takes a packet to traverse the network. The amount that the latency varies is the jitter. Video latency is the time it takes to render a frame sent by the server (including network latency). A low jitter means the video latency can be reduced without impacting smooth playback. High jitter means clients will increase video latency to ensure smooth playback.\n\nhttps://www.w3.org/TR/webrtc-stats/#dom-rtcreceivedrtpstreamstats-jitter"]
3036 #[serde(default, skip_serializing_if = "Option::is_none")]
3037 pub rtc_jitter_sec: Option<f64>,
3038 #[doc = "Number of \"key frames\" decoded in the inbound h.264 stream. A key frame is an expensive (bandwidth-wise) \"full image\" of the video frame. Data after the keyframe become -- effectively -- \"diff\" operations on that key frame. The Engine will only send a keyframe if required, which is an indication that some of the \"diffs\" have been lost, usually an indication of poor network conditions. We like this metric to understand times when the connection has had to recover.\n\nhttps://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-keyframesdecoded"]
3039 #[serde(default, skip_serializing_if = "Option::is_none")]
3040 pub rtc_keyframes_decoded: Option<u32>,
3041 #[doc = "Amount of packets lost in the inbound video stream.\n\nhttps://www.w3.org/TR/webrtc-stats/#dom-rtcreceivedrtpstreamstats-packetslost"]
3042 #[serde(default, skip_serializing_if = "Option::is_none")]
3043 pub rtc_packets_lost: Option<u32>,
3044 #[doc = "Count of the total number of video pauses experienced by this receiver.\n\nhttps://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-pausecount"]
3045 #[serde(default, skip_serializing_if = "Option::is_none")]
3046 pub rtc_pause_count: Option<u32>,
3047 #[doc = "Count the total number of Picture Loss Indication (PLI) packets.\n\nhttps://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-plicount"]
3048 #[serde(default, skip_serializing_if = "Option::is_none")]
3049 pub rtc_pli_count: Option<u32>,
3050 #[doc = "Total duration of pauses in seconds.\n\nThis is the \"ping\" between the client and the STUN server. Not to be confused with the E2E RTT documented [here](https://www.w3.org/TR/webrtc-stats/#dom-rtcremoteinboundrtpstreamstats-roundtriptime)\n\nhttps://www.w3.org/TR/webrtc-stats/#dom-rtcicecandidatepairstats-currentroundtriptime"]
3051 #[serde(default, skip_serializing_if = "Option::is_none")]
3052 pub rtc_stun_rtt_sec: Option<f64>,
3053 #[doc = "Number of seconds of frozen video the user has been subjected to.\n\nhttps://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-totalfreezesduration"]
3054 #[serde(default, skip_serializing_if = "Option::is_none")]
3055 pub rtc_total_freezes_duration_sec: Option<f64>,
3056 #[doc = "Count of the total number of video pauses experienced by this receiver.\n\nhttps://www.w3.org/TR/webrtc-stats/#dom-rtcinboundrtpstreamstats-totalpausesduration"]
3057 #[serde(default, skip_serializing_if = "Option::is_none")]
3058 pub rtc_total_pauses_duration_sec: Option<f64>,
3059}
3060
3061impl std::fmt::Display for ClientMetrics {
3062 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3063 write!(
3064 f,
3065 "{}",
3066 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3067 )
3068 }
3069}
3070
3071#[cfg(feature = "tabled")]
3072impl tabled::Tabled for ClientMetrics {
3073 const LENGTH: usize = 15;
3074 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3075 vec![
3076 if let Some(rtc_frame_height) = &self.rtc_frame_height {
3077 format!("{:?}", rtc_frame_height).into()
3078 } else {
3079 String::new().into()
3080 },
3081 if let Some(rtc_frame_width) = &self.rtc_frame_width {
3082 format!("{:?}", rtc_frame_width).into()
3083 } else {
3084 String::new().into()
3085 },
3086 if let Some(rtc_frames_decoded) = &self.rtc_frames_decoded {
3087 format!("{:?}", rtc_frames_decoded).into()
3088 } else {
3089 String::new().into()
3090 },
3091 if let Some(rtc_frames_dropped) = &self.rtc_frames_dropped {
3092 format!("{:?}", rtc_frames_dropped).into()
3093 } else {
3094 String::new().into()
3095 },
3096 if let Some(rtc_frames_per_second) = &self.rtc_frames_per_second {
3097 format!("{:?}", rtc_frames_per_second).into()
3098 } else {
3099 String::new().into()
3100 },
3101 if let Some(rtc_frames_received) = &self.rtc_frames_received {
3102 format!("{:?}", rtc_frames_received).into()
3103 } else {
3104 String::new().into()
3105 },
3106 if let Some(rtc_freeze_count) = &self.rtc_freeze_count {
3107 format!("{:?}", rtc_freeze_count).into()
3108 } else {
3109 String::new().into()
3110 },
3111 if let Some(rtc_jitter_sec) = &self.rtc_jitter_sec {
3112 format!("{:?}", rtc_jitter_sec).into()
3113 } else {
3114 String::new().into()
3115 },
3116 if let Some(rtc_keyframes_decoded) = &self.rtc_keyframes_decoded {
3117 format!("{:?}", rtc_keyframes_decoded).into()
3118 } else {
3119 String::new().into()
3120 },
3121 if let Some(rtc_packets_lost) = &self.rtc_packets_lost {
3122 format!("{:?}", rtc_packets_lost).into()
3123 } else {
3124 String::new().into()
3125 },
3126 if let Some(rtc_pause_count) = &self.rtc_pause_count {
3127 format!("{:?}", rtc_pause_count).into()
3128 } else {
3129 String::new().into()
3130 },
3131 if let Some(rtc_pli_count) = &self.rtc_pli_count {
3132 format!("{:?}", rtc_pli_count).into()
3133 } else {
3134 String::new().into()
3135 },
3136 if let Some(rtc_stun_rtt_sec) = &self.rtc_stun_rtt_sec {
3137 format!("{:?}", rtc_stun_rtt_sec).into()
3138 } else {
3139 String::new().into()
3140 },
3141 if let Some(rtc_total_freezes_duration_sec) = &self.rtc_total_freezes_duration_sec {
3142 format!("{:?}", rtc_total_freezes_duration_sec).into()
3143 } else {
3144 String::new().into()
3145 },
3146 if let Some(rtc_total_pauses_duration_sec) = &self.rtc_total_pauses_duration_sec {
3147 format!("{:?}", rtc_total_pauses_duration_sec).into()
3148 } else {
3149 String::new().into()
3150 },
3151 ]
3152 }
3153
3154 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3155 vec![
3156 "rtc_frame_height".into(),
3157 "rtc_frame_width".into(),
3158 "rtc_frames_decoded".into(),
3159 "rtc_frames_dropped".into(),
3160 "rtc_frames_per_second".into(),
3161 "rtc_frames_received".into(),
3162 "rtc_freeze_count".into(),
3163 "rtc_jitter_sec".into(),
3164 "rtc_keyframes_decoded".into(),
3165 "rtc_packets_lost".into(),
3166 "rtc_pause_count".into(),
3167 "rtc_pli_count".into(),
3168 "rtc_stun_rtt_sec".into(),
3169 "rtc_total_freezes_duration_sec".into(),
3170 "rtc_total_pauses_duration_sec".into(),
3171 ]
3172 }
3173}
3174
3175#[doc = "The response from the `ClosePath` command."]
3176#[derive(
3177 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3178)]
3179pub struct ClosePath {
3180 #[doc = "The UUID of the lone face of the resulting solid2D."]
3181 pub face_id: uuid::Uuid,
3182}
3183
3184impl std::fmt::Display for ClosePath {
3185 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3186 write!(
3187 f,
3188 "{}",
3189 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3190 )
3191 }
3192}
3193
3194#[cfg(feature = "tabled")]
3195impl tabled::Tabled for ClosePath {
3196 const LENGTH: usize = 1;
3197 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3198 vec![format!("{:?}", self.face_id).into()]
3199 }
3200
3201 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3202 vec!["face_id".into()]
3203 }
3204}
3205
3206#[doc = "Output of the code being executed.\n\n<details><summary>JSON schema</summary>\n\n```json \
3207 { \"description\": \"Output of the code being executed.\", \"type\": \"object\", \
3208 \"properties\": { \"output_files\": { \"description\": \"The contents of the files \
3209 requested if they were passed.\", \"type\": \"array\", \"items\": { \"$ref\": \
3210 \"#/components/schemas/OutputFile\" } }, \"stderr\": { \"description\": \"The stderr of \
3211 the code.\", \"default\": \"\", \"type\": \"string\" }, \"stdout\": { \"description\": \
3212 \"The stdout of the code.\", \"default\": \"\", \"type\": \"string\" } } } ``` </details>"]
3213#[derive(
3214 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3215)]
3216pub struct CodeOutput {
3217 #[doc = "The contents of the files requested if they were passed."]
3218 #[serde(default, skip_serializing_if = "Option::is_none")]
3219 pub output_files: Option<Vec<OutputFile>>,
3220 #[doc = "The stderr of the code."]
3221 #[serde(default, skip_serializing_if = "Option::is_none")]
3222 pub stderr: Option<String>,
3223 #[doc = "The stdout of the code."]
3224 #[serde(default, skip_serializing_if = "Option::is_none")]
3225 pub stdout: Option<String>,
3226}
3227
3228impl std::fmt::Display for CodeOutput {
3229 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3230 write!(
3231 f,
3232 "{}",
3233 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3234 )
3235 }
3236}
3237
3238#[cfg(feature = "tabled")]
3239impl tabled::Tabled for CodeOutput {
3240 const LENGTH: usize = 3;
3241 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3242 vec![
3243 if let Some(output_files) = &self.output_files {
3244 format!("{:?}", output_files).into()
3245 } else {
3246 String::new().into()
3247 },
3248 if let Some(stderr) = &self.stderr {
3249 format!("{:?}", stderr).into()
3250 } else {
3251 String::new().into()
3252 },
3253 if let Some(stdout) = &self.stdout {
3254 format!("{:?}", stdout).into()
3255 } else {
3256 String::new().into()
3257 },
3258 ]
3259 }
3260
3261 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3262 vec!["output_files".into(), "stderr".into(), "stdout".into()]
3263 }
3264}
3265
3266#[doc = "An RGBA color"]
3267#[derive(
3268 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3269)]
3270pub struct Color {
3271 #[doc = "Alpha"]
3272 pub a: f64,
3273 #[doc = "Blue"]
3274 pub b: f64,
3275 #[doc = "Green"]
3276 pub g: f64,
3277 #[doc = "Red"]
3278 pub r: f64,
3279}
3280
3281impl std::fmt::Display for Color {
3282 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3283 write!(
3284 f,
3285 "{}",
3286 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3287 )
3288 }
3289}
3290
3291#[cfg(feature = "tabled")]
3292impl tabled::Tabled for Color {
3293 const LENGTH: usize = 4;
3294 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3295 vec![
3296 format!("{:?}", self.a).into(),
3297 format!("{:?}", self.b).into(),
3298 format!("{:?}", self.g).into(),
3299 format!("{:?}", self.r).into(),
3300 ]
3301 }
3302
3303 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3304 vec!["a".into(), "b".into(), "g".into(), "r".into()]
3305 }
3306}
3307
3308#[doc = "Struct to contain the edge information of a wall of an extrude/rotate/loft/sweep."]
3309#[derive(
3310 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3311)]
3312pub struct ComplementaryEdges {
3313 #[doc = "Every edge that shared one common vertex with the original edge."]
3314 pub adjacent_ids: Vec<uuid::Uuid>,
3315 #[doc = "The opposite edge has no common vertices with the original edge. A wall may not have \
3316 an opposite edge (i.e. a revolve that touches the axis of rotation)."]
3317 #[serde(default, skip_serializing_if = "Option::is_none")]
3318 pub opposite_id: Option<uuid::Uuid>,
3319}
3320
3321impl std::fmt::Display for ComplementaryEdges {
3322 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3323 write!(
3324 f,
3325 "{}",
3326 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3327 )
3328 }
3329}
3330
3331#[cfg(feature = "tabled")]
3332impl tabled::Tabled for ComplementaryEdges {
3333 const LENGTH: usize = 2;
3334 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3335 vec![
3336 format!("{:?}", self.adjacent_ids).into(),
3337 if let Some(opposite_id) = &self.opposite_id {
3338 format!("{:?}", opposite_id).into()
3339 } else {
3340 String::new().into()
3341 },
3342 ]
3343 }
3344
3345 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3346 vec!["adjacent_ids".into(), "opposite_id".into()]
3347 }
3348}
3349
3350#[doc = "Container that holds a translate, rotate and scale. Defaults to no change, everything \
3351 stays the same (i.e. the identity function)."]
3352#[derive(
3353 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3354)]
3355pub struct ComponentTransform {
3356 #[doc = "Rotate component of the transform. The rotation is specified as an axis and an angle \
3357 (xyz are the components of the axis, w is the angle in degrees)."]
3358 #[serde(default, skip_serializing_if = "Option::is_none")]
3359 pub rotate_angle_axis: Option<TransformByForPoint4D>,
3360 #[doc = "Rotate component of the transform. The rotation is specified as a roll, pitch, yaw."]
3361 #[serde(default, skip_serializing_if = "Option::is_none")]
3362 pub rotate_rpy: Option<TransformByForPoint3D>,
3363 #[doc = "Scale component of the transform."]
3364 #[serde(default, skip_serializing_if = "Option::is_none")]
3365 pub scale: Option<TransformByForPoint3D>,
3366 #[doc = "Translate component of the transform."]
3367 #[serde(default, skip_serializing_if = "Option::is_none")]
3368 pub translate: Option<TransformByForPoint3D>,
3369}
3370
3371impl std::fmt::Display for ComponentTransform {
3372 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3373 write!(
3374 f,
3375 "{}",
3376 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3377 )
3378 }
3379}
3380
3381#[cfg(feature = "tabled")]
3382impl tabled::Tabled for ComponentTransform {
3383 const LENGTH: usize = 4;
3384 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3385 vec![
3386 if let Some(rotate_angle_axis) = &self.rotate_angle_axis {
3387 format!("{:?}", rotate_angle_axis).into()
3388 } else {
3389 String::new().into()
3390 },
3391 if let Some(rotate_rpy) = &self.rotate_rpy {
3392 format!("{:?}", rotate_rpy).into()
3393 } else {
3394 String::new().into()
3395 },
3396 if let Some(scale) = &self.scale {
3397 format!("{:?}", scale).into()
3398 } else {
3399 String::new().into()
3400 },
3401 if let Some(translate) = &self.translate {
3402 format!("{:?}", translate).into()
3403 } else {
3404 String::new().into()
3405 },
3406 ]
3407 }
3408
3409 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3410 vec![
3411 "rotate_angle_axis".into(),
3412 "rotate_rpy".into(),
3413 "scale".into(),
3414 "translate".into(),
3415 ]
3416 }
3417}
3418
3419#[doc = "A conversation composed of many ML prompts."]
3420#[derive(
3421 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3422)]
3423pub struct Conversation {
3424 #[doc = "The date and time the conversation was created."]
3425 pub created_at: chrono::DateTime<chrono::Utc>,
3426 #[doc = "The prompt that started this conversation."]
3427 pub first_prompt: String,
3428 #[doc = "The unique identifier for the conversation."]
3429 pub id: uuid::Uuid,
3430 #[doc = "The date and time the conversation was last updated."]
3431 pub updated_at: chrono::DateTime<chrono::Utc>,
3432 #[doc = "The user ID of the user who created the conversation."]
3433 pub user_id: uuid::Uuid,
3434}
3435
3436impl std::fmt::Display for Conversation {
3437 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3438 write!(
3439 f,
3440 "{}",
3441 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3442 )
3443 }
3444}
3445
3446#[cfg(feature = "tabled")]
3447impl tabled::Tabled for Conversation {
3448 const LENGTH: usize = 5;
3449 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3450 vec![
3451 format!("{:?}", self.created_at).into(),
3452 self.first_prompt.clone().into(),
3453 format!("{:?}", self.id).into(),
3454 format!("{:?}", self.updated_at).into(),
3455 format!("{:?}", self.user_id).into(),
3456 ]
3457 }
3458
3459 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3460 vec![
3461 "created_at".into(),
3462 "first_prompt".into(),
3463 "id".into(),
3464 "updated_at".into(),
3465 "user_id".into(),
3466 ]
3467 }
3468}
3469
3470#[doc = "A single page of results"]
3471#[derive(
3472 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3473)]
3474pub struct ConversationResultsPage {
3475 #[doc = "list of items on this page of results"]
3476 pub items: Vec<Conversation>,
3477 #[doc = "token used to fetch the next page of results (if any)"]
3478 #[serde(default, skip_serializing_if = "Option::is_none")]
3479 pub next_page: Option<String>,
3480}
3481
3482impl std::fmt::Display for ConversationResultsPage {
3483 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3484 write!(
3485 f,
3486 "{}",
3487 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3488 )
3489 }
3490}
3491
3492#[cfg(feature = "requests")]
3493impl crate::types::paginate::Pagination for ConversationResultsPage {
3494 type Item = Conversation;
3495 fn has_more_pages(&self) -> bool {
3496 self.next_page.is_some()
3497 }
3498
3499 fn next_page_token(&self) -> Option<String> {
3500 self.next_page.clone()
3501 }
3502
3503 fn next_page(
3504 &self,
3505 req: reqwest::Request,
3506 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
3507 let mut req = req.try_clone().ok_or_else(|| {
3508 crate::types::error::Error::InvalidRequest(format!(
3509 "failed to clone request: {:?}",
3510 req
3511 ))
3512 })?;
3513 req.url_mut()
3514 .query_pairs_mut()
3515 .append_pair("next_page", self.next_page.as_deref().unwrap_or(""));
3516 Ok(req)
3517 }
3518
3519 fn items(&self) -> Vec<Self::Item> {
3520 self.items.clone()
3521 }
3522}
3523
3524#[cfg(feature = "tabled")]
3525impl tabled::Tabled for ConversationResultsPage {
3526 const LENGTH: usize = 2;
3527 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3528 vec![
3529 format!("{:?}", self.items).into(),
3530 if let Some(next_page) = &self.next_page {
3531 format!("{:?}", next_page).into()
3532 } else {
3533 String::new().into()
3534 },
3535 ]
3536 }
3537
3538 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3539 vec!["items".into(), "next_page".into()]
3540 }
3541}
3542
3543#[doc = "Describes the file to convert (src) and what it should be converted into (output)."]
3544#[derive(
3545 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3546)]
3547pub struct ConversionParams {
3548 #[doc = "Describes the output file(s)."]
3549 pub output_format: OutputFormat3D,
3550 #[doc = "Describes the input file(s)."]
3551 pub src_format: InputFormat3D,
3552}
3553
3554impl std::fmt::Display for ConversionParams {
3555 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3556 write!(
3557 f,
3558 "{}",
3559 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3560 )
3561 }
3562}
3563
3564#[cfg(feature = "tabled")]
3565impl tabled::Tabled for ConversionParams {
3566 const LENGTH: usize = 2;
3567 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3568 vec![
3569 format!("{:?}", self.output_format).into(),
3570 format!("{:?}", self.src_format).into(),
3571 ]
3572 }
3573
3574 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3575 vec!["output_format".into(), "src_format".into()]
3576 }
3577}
3578
3579#[doc = "The resource representing a Coupon."]
3580#[derive(
3581 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3582)]
3583pub struct Coupon {
3584 #[doc = "Amount (in the `currency` specified) that will be taken off the subtotal of any \
3585 invoices for this customer."]
3586 #[serde(default, skip_serializing_if = "Option::is_none")]
3587 pub amount_off: Option<f64>,
3588 #[doc = "Always true for a deleted object."]
3589 #[serde(default)]
3590 pub deleted: bool,
3591 #[doc = "Unique identifier for the object."]
3592 #[serde(default, skip_serializing_if = "Option::is_none")]
3593 pub id: Option<String>,
3594 #[doc = "Set of key-value pairs."]
3595 #[serde(default, skip_serializing_if = "Option::is_none")]
3596 pub metadata: Option<std::collections::HashMap<String, String>>,
3597 #[doc = "Name of the coupon displayed to customers on, for instance invoices, or \
3598 receipts.\n\nBy default the `id` is shown if `name` is not set."]
3599 #[serde(default, skip_serializing_if = "Option::is_none")]
3600 pub name: Option<String>,
3601 #[doc = "Percent that will be taken off the subtotal of any invoices for this customer for \
3602 the duration of the coupon.\n\nFor example, a coupon with percent_off of 50 will \
3603 make a %s100 invoice %s50 instead."]
3604 #[serde(default, skip_serializing_if = "Option::is_none")]
3605 pub percent_off: Option<f64>,
3606}
3607
3608impl std::fmt::Display for Coupon {
3609 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3610 write!(
3611 f,
3612 "{}",
3613 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3614 )
3615 }
3616}
3617
3618#[cfg(feature = "tabled")]
3619impl tabled::Tabled for Coupon {
3620 const LENGTH: usize = 6;
3621 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3622 vec![
3623 if let Some(amount_off) = &self.amount_off {
3624 format!("{:?}", amount_off).into()
3625 } else {
3626 String::new().into()
3627 },
3628 format!("{:?}", self.deleted).into(),
3629 if let Some(id) = &self.id {
3630 format!("{:?}", id).into()
3631 } else {
3632 String::new().into()
3633 },
3634 if let Some(metadata) = &self.metadata {
3635 format!("{:?}", metadata).into()
3636 } else {
3637 String::new().into()
3638 },
3639 if let Some(name) = &self.name {
3640 format!("{:?}", name).into()
3641 } else {
3642 String::new().into()
3643 },
3644 if let Some(percent_off) = &self.percent_off {
3645 format!("{:?}", percent_off).into()
3646 } else {
3647 String::new().into()
3648 },
3649 ]
3650 }
3651
3652 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3653 vec![
3654 "amount_off".into(),
3655 "deleted".into(),
3656 "id".into(),
3657 "metadata".into(),
3658 "name".into(),
3659 "percent_off".into(),
3660 ]
3661 }
3662}
3663
3664#[doc = "Request to create a shortlink."]
3665#[derive(
3666 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3667)]
3668pub struct CreateShortlinkRequest {
3669 #[doc = "The password for the shortlink, if you want to restrict access to it. This can only \
3670 be set if your subscription allows for it. Otherwise, it will return an error. When \
3671 you access the link it will be required to enter this password through basic auth. \
3672 The username will be `{anything}` and the password will be the password you set here."]
3673 #[serde(default, skip_serializing_if = "Option::is_none")]
3674 pub password: Option<String>,
3675 #[doc = "If the shortlink should be restricted to the user's organization to view. This only \
3676 applies to org shortlinks. If you are creating a user shortlink and you are not a \
3677 member of a team or enterprise and you try to set this to true, it will fail."]
3678 #[serde(default)]
3679 pub restrict_to_org: bool,
3680 #[doc = "The URL to redirect back to."]
3681 pub url: String,
3682}
3683
3684impl std::fmt::Display for CreateShortlinkRequest {
3685 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3686 write!(
3687 f,
3688 "{}",
3689 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3690 )
3691 }
3692}
3693
3694#[cfg(feature = "tabled")]
3695impl tabled::Tabled for CreateShortlinkRequest {
3696 const LENGTH: usize = 3;
3697 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3698 vec![
3699 if let Some(password) = &self.password {
3700 format!("{:?}", password).into()
3701 } else {
3702 String::new().into()
3703 },
3704 format!("{:?}", self.restrict_to_org).into(),
3705 self.url.clone().into(),
3706 ]
3707 }
3708
3709 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3710 vec!["password".into(), "restrict_to_org".into(), "url".into()]
3711 }
3712}
3713
3714#[doc = "Response from creating a shortlink."]
3715#[derive(
3716 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3717)]
3718pub struct CreateShortlinkResponse {
3719 #[doc = "The key for this url. This is what you use to update or delete the specific \
3720 shortlink."]
3721 pub key: String,
3722 #[doc = "The shortened url."]
3723 pub url: String,
3724}
3725
3726impl std::fmt::Display for CreateShortlinkResponse {
3727 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3728 write!(
3729 f,
3730 "{}",
3731 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3732 )
3733 }
3734}
3735
3736#[cfg(feature = "tabled")]
3737impl tabled::Tabled for CreateShortlinkResponse {
3738 const LENGTH: usize = 2;
3739 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3740 vec![self.key.clone().into(), self.url.clone().into()]
3741 }
3742
3743 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3744 vec!["key".into(), "url".into()]
3745 }
3746}
3747
3748#[doc = "The data for subscribing a user to the newsletter."]
3749#[derive(
3750 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3751)]
3752pub struct CrmData {
3753 #[doc = "The industry of the user."]
3754 #[serde(default, skip_serializing_if = "Option::is_none")]
3755 pub cad_industry: Option<String>,
3756 #[doc = "The user type."]
3757 #[serde(default, skip_serializing_if = "Option::is_none")]
3758 pub cad_user_type: Option<String>,
3759 #[doc = "The user count of the user."]
3760 #[serde(default, skip_serializing_if = "Option::is_none")]
3761 pub number_of_cad_users: Option<String>,
3762}
3763
3764impl std::fmt::Display for CrmData {
3765 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3766 write!(
3767 f,
3768 "{}",
3769 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3770 )
3771 }
3772}
3773
3774#[cfg(feature = "tabled")]
3775impl tabled::Tabled for CrmData {
3776 const LENGTH: usize = 3;
3777 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3778 vec![
3779 if let Some(cad_industry) = &self.cad_industry {
3780 format!("{:?}", cad_industry).into()
3781 } else {
3782 String::new().into()
3783 },
3784 if let Some(cad_user_type) = &self.cad_user_type {
3785 format!("{:?}", cad_user_type).into()
3786 } else {
3787 String::new().into()
3788 },
3789 if let Some(number_of_cad_users) = &self.number_of_cad_users {
3790 format!("{:?}", number_of_cad_users).into()
3791 } else {
3792 String::new().into()
3793 },
3794 ]
3795 }
3796
3797 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3798 vec![
3799 "cad_industry".into(),
3800 "cad_user_type".into(),
3801 "number_of_cad_users".into(),
3802 ]
3803 }
3804}
3805
3806#[doc = "The response from the `CurveGetControlPoints` command."]
3807#[derive(
3808 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3809)]
3810pub struct CurveGetControlPoints {
3811 #[doc = "Control points in the curve."]
3812 pub control_points: Vec<Point3D>,
3813}
3814
3815impl std::fmt::Display for CurveGetControlPoints {
3816 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3817 write!(
3818 f,
3819 "{}",
3820 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3821 )
3822 }
3823}
3824
3825#[cfg(feature = "tabled")]
3826impl tabled::Tabled for CurveGetControlPoints {
3827 const LENGTH: usize = 1;
3828 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3829 vec![format!("{:?}", self.control_points).into()]
3830 }
3831
3832 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3833 vec!["control_points".into()]
3834 }
3835}
3836
3837#[doc = "Endpoints of a curve"]
3838#[derive(
3839 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3840)]
3841pub struct CurveGetEndPoints {
3842 #[doc = "End"]
3843 pub end: Point3D,
3844 #[doc = "Start"]
3845 pub start: Point3D,
3846}
3847
3848impl std::fmt::Display for CurveGetEndPoints {
3849 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3850 write!(
3851 f,
3852 "{}",
3853 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3854 )
3855 }
3856}
3857
3858#[cfg(feature = "tabled")]
3859impl tabled::Tabled for CurveGetEndPoints {
3860 const LENGTH: usize = 2;
3861 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3862 vec![
3863 format!("{:?}", self.end).into(),
3864 format!("{:?}", self.start).into(),
3865 ]
3866 }
3867
3868 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3869 vec!["end".into(), "start".into()]
3870 }
3871}
3872
3873#[doc = "The response from the `CurveGetType` command."]
3874#[derive(
3875 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3876)]
3877pub struct CurveGetType {
3878 #[doc = "Curve type"]
3879 pub curve_type: CurveType,
3880}
3881
3882impl std::fmt::Display for CurveGetType {
3883 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3884 write!(
3885 f,
3886 "{}",
3887 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3888 )
3889 }
3890}
3891
3892#[cfg(feature = "tabled")]
3893impl tabled::Tabled for CurveGetType {
3894 const LENGTH: usize = 1;
3895 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3896 vec![format!("{:?}", self.curve_type).into()]
3897 }
3898
3899 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3900 vec!["curve_type".into()]
3901 }
3902}
3903
3904#[doc = "The response from the `CurveSetConstraint` endpoint."]
3905#[derive(
3906 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3907)]
3908pub struct CurveSetConstraint {}
3909
3910impl std::fmt::Display for CurveSetConstraint {
3911 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
3912 write!(
3913 f,
3914 "{}",
3915 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
3916 )
3917 }
3918}
3919
3920#[cfg(feature = "tabled")]
3921impl tabled::Tabled for CurveSetConstraint {
3922 const LENGTH: usize = 0;
3923 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
3924 vec![]
3925 }
3926
3927 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
3928 vec![]
3929 }
3930}
3931
3932#[doc = "The type of Curve (embedded within path)"]
3933#[derive(
3934 serde :: Serialize,
3935 serde :: Deserialize,
3936 PartialEq,
3937 Hash,
3938 Debug,
3939 Clone,
3940 schemars :: JsonSchema,
3941 parse_display :: FromStr,
3942 parse_display :: Display,
3943)]
3944#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
3945#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
3946pub enum CurveType {
3947 #[serde(rename = "line")]
3948 #[display("line")]
3949 Line,
3950 #[serde(rename = "arc")]
3951 #[display("arc")]
3952 Arc,
3953 #[serde(rename = "nurbs")]
3954 #[display("nurbs")]
3955 Nurbs,
3956}
3957
3958#[doc = "The resource representing a payment \"Customer\"."]
3959#[derive(
3960 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
3961)]
3962pub struct Customer {
3963 #[doc = "The customer's address."]
3964 #[serde(default, skip_serializing_if = "Option::is_none")]
3965 pub address: Option<AddressDetails>,
3966 #[doc = "Current balance, if any, being stored on the customer in the payments service.\n\nIf \
3967 negative, the customer has credit to apply to their next invoice. If positive, the \
3968 customer has an amount owed that will be added to their next invoice. The balance \
3969 does not refer to any unpaid invoices; it solely takes into account amounts that \
3970 have yet to be successfully applied to any invoice. This balance is only taken into \
3971 account as invoices are finalized."]
3972 #[serde(default, skip_serializing_if = "Option::is_none")]
3973 pub balance: Option<f64>,
3974 #[doc = "Time at which the object was created."]
3975 pub created_at: chrono::DateTime<chrono::Utc>,
3976 #[doc = "Three-letter ISO code for the currency the customer can be charged in for recurring \
3977 billing purposes."]
3978 #[serde(default, skip_serializing_if = "Option::is_none")]
3979 pub currency: Option<String>,
3980 #[doc = "When the customer's latest invoice is billed by charging automatically, `delinquent` \
3981 is `true` if the invoice's latest charge failed.\n\nWhen the customer's latest \
3982 invoice is billed by sending an invoice, `delinquent` is `true` if the invoice isn't \
3983 paid by its due date. If an invoice is marked uncollectible by dunning, \
3984 `delinquent` doesn't get reset to `false`."]
3985 #[serde(default)]
3986 pub delinquent: bool,
3987 #[doc = "The customer's email address."]
3988 #[serde(default, skip_serializing_if = "Option::is_none")]
3989 pub email: Option<String>,
3990 #[doc = "Unique identifier for the object."]
3991 #[serde(default, skip_serializing_if = "Option::is_none")]
3992 pub id: Option<String>,
3993 #[doc = "Set of key-value pairs."]
3994 #[serde(default, skip_serializing_if = "Option::is_none")]
3995 pub metadata: Option<std::collections::HashMap<String, String>>,
3996 #[doc = "The customer's full name or business name."]
3997 #[serde(default, skip_serializing_if = "Option::is_none")]
3998 pub name: Option<String>,
3999 #[doc = "The customer's phone number."]
4000 #[serde(default, skip_serializing_if = "Option::is_none")]
4001 pub phone: phone_number::PhoneNumber,
4002}
4003
4004impl std::fmt::Display for Customer {
4005 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4006 write!(
4007 f,
4008 "{}",
4009 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4010 )
4011 }
4012}
4013
4014#[cfg(feature = "tabled")]
4015impl tabled::Tabled for Customer {
4016 const LENGTH: usize = 10;
4017 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4018 vec![
4019 if let Some(address) = &self.address {
4020 format!("{:?}", address).into()
4021 } else {
4022 String::new().into()
4023 },
4024 if let Some(balance) = &self.balance {
4025 format!("{:?}", balance).into()
4026 } else {
4027 String::new().into()
4028 },
4029 format!("{:?}", self.created_at).into(),
4030 if let Some(currency) = &self.currency {
4031 format!("{:?}", currency).into()
4032 } else {
4033 String::new().into()
4034 },
4035 format!("{:?}", self.delinquent).into(),
4036 if let Some(email) = &self.email {
4037 format!("{:?}", email).into()
4038 } else {
4039 String::new().into()
4040 },
4041 if let Some(id) = &self.id {
4042 format!("{:?}", id).into()
4043 } else {
4044 String::new().into()
4045 },
4046 if let Some(metadata) = &self.metadata {
4047 format!("{:?}", metadata).into()
4048 } else {
4049 String::new().into()
4050 },
4051 if let Some(name) = &self.name {
4052 format!("{:?}", name).into()
4053 } else {
4054 String::new().into()
4055 },
4056 format!("{:?}", self.phone).into(),
4057 ]
4058 }
4059
4060 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4061 vec![
4062 "address".into(),
4063 "balance".into(),
4064 "created_at".into(),
4065 "currency".into(),
4066 "delinquent".into(),
4067 "email".into(),
4068 "id".into(),
4069 "metadata".into(),
4070 "name".into(),
4071 "phone".into(),
4072 ]
4073 }
4074}
4075
4076#[doc = "A balance for a customer.\n\nThis holds information about the financial balance for the \
4077 customer."]
4078#[derive(
4079 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4080)]
4081pub struct CustomerBalance {
4082 #[doc = "The date and time the balance was created."]
4083 pub created_at: chrono::DateTime<chrono::Utc>,
4084 #[doc = "The unique identifier for the balance."]
4085 pub id: uuid::Uuid,
4086 #[doc = "The mapping id of the user or org."]
4087 pub map_id: uuid::Uuid,
4088 #[doc = "The enterprise price for the Modeling App subscription, if they are on the \
4089 enterprise plan."]
4090 #[serde(default, skip_serializing_if = "Option::is_none")]
4091 pub modeling_app_enterprise_price: Option<SubscriptionTierPrice>,
4092 #[doc = "The number of monthly API credits remaining in the balance. This is the number of \
4093 credits remaining in the balance.\n\nBoth the monetary value and the number of \
4094 credits are returned, but they reflect the same value in the database."]
4095 pub monthly_api_credits_remaining: u64,
4096 #[doc = "The monetary value of the monthly API credits remaining in the balance. This gets \
4097 re-upped every month, but if the credits are not used for a month they do not carry \
4098 over to the next month.\n\nBoth the monetary value and the number of credits are \
4099 returned, but they reflect the same value in the database."]
4100 pub monthly_api_credits_remaining_monetary_value: f64,
4101 #[doc = "The number of stable API credits remaining in the balance. These do not get reset or \
4102 re-upped every month. This is separate from the monthly credits. Credits will first \
4103 pull from the monthly credits, then the stable credits. Stable just means that they \
4104 do not get reset every month. A user will have stable credits if a Zoo employee \
4105 granted them credits.\n\nBoth the monetary value and the number of credits are \
4106 returned, but they reflect the same value in the database."]
4107 pub stable_api_credits_remaining: u64,
4108 #[doc = "The monetary value of stable API credits remaining in the balance. These do not get \
4109 reset or re-upped every month. This is separate from the monthly credits. Credits \
4110 will first pull from the monthly credits, then the stable credits. Stable just means \
4111 that they do not get reset every month. A user will have stable credits if a Zoo \
4112 employee granted them credits.\n\nBoth the monetary value and the number of credits \
4113 are returned, but they reflect the same value in the database."]
4114 pub stable_api_credits_remaining_monetary_value: f64,
4115 #[doc = "Details about the subscription."]
4116 #[serde(default, skip_serializing_if = "Option::is_none")]
4117 pub subscription_details: Option<ZooProductSubscriptions>,
4118 #[doc = "The subscription ID for the user."]
4119 #[serde(default, skip_serializing_if = "Option::is_none")]
4120 pub subscription_id: Option<String>,
4121 #[doc = "This includes any outstanding, draft, or open invoices and any pending invoice \
4122 items. This does not include any credits the customer has on their account. This \
4123 amount is only returned if requested from the api."]
4124 #[serde(default, skip_serializing_if = "Option::is_none")]
4125 pub total_due: Option<f64>,
4126 #[doc = "The date and time the balance was last updated."]
4127 pub updated_at: chrono::DateTime<chrono::Utc>,
4128}
4129
4130impl std::fmt::Display for CustomerBalance {
4131 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4132 write!(
4133 f,
4134 "{}",
4135 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4136 )
4137 }
4138}
4139
4140#[cfg(feature = "tabled")]
4141impl tabled::Tabled for CustomerBalance {
4142 const LENGTH: usize = 12;
4143 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4144 vec![
4145 format!("{:?}", self.created_at).into(),
4146 format!("{:?}", self.id).into(),
4147 format!("{:?}", self.map_id).into(),
4148 if let Some(modeling_app_enterprise_price) = &self.modeling_app_enterprise_price {
4149 format!("{:?}", modeling_app_enterprise_price).into()
4150 } else {
4151 String::new().into()
4152 },
4153 format!("{:?}", self.monthly_api_credits_remaining).into(),
4154 format!("{:?}", self.monthly_api_credits_remaining_monetary_value).into(),
4155 format!("{:?}", self.stable_api_credits_remaining).into(),
4156 format!("{:?}", self.stable_api_credits_remaining_monetary_value).into(),
4157 if let Some(subscription_details) = &self.subscription_details {
4158 format!("{:?}", subscription_details).into()
4159 } else {
4160 String::new().into()
4161 },
4162 if let Some(subscription_id) = &self.subscription_id {
4163 format!("{:?}", subscription_id).into()
4164 } else {
4165 String::new().into()
4166 },
4167 if let Some(total_due) = &self.total_due {
4168 format!("{:?}", total_due).into()
4169 } else {
4170 String::new().into()
4171 },
4172 format!("{:?}", self.updated_at).into(),
4173 ]
4174 }
4175
4176 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4177 vec![
4178 "created_at".into(),
4179 "id".into(),
4180 "map_id".into(),
4181 "modeling_app_enterprise_price".into(),
4182 "monthly_api_credits_remaining".into(),
4183 "monthly_api_credits_remaining_monetary_value".into(),
4184 "stable_api_credits_remaining".into(),
4185 "stable_api_credits_remaining_monetary_value".into(),
4186 "subscription_details".into(),
4187 "subscription_id".into(),
4188 "total_due".into(),
4189 "updated_at".into(),
4190 ]
4191 }
4192}
4193
4194#[doc = "What strategy (algorithm) should be used for cutting? Defaults to Automatic."]
4195#[derive(
4196 serde :: Serialize,
4197 serde :: Deserialize,
4198 PartialEq,
4199 Hash,
4200 Debug,
4201 Clone,
4202 schemars :: JsonSchema,
4203 parse_display :: FromStr,
4204 parse_display :: Display,
4205)]
4206#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4207#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4208pub enum CutStrategy {
4209 #[doc = "Basic fillet cut. This has limitations, like the filletted edges can't touch each \
4210 other. But it's very fast and simple."]
4211 #[serde(rename = "basic")]
4212 #[display("basic")]
4213 Basic,
4214 #[doc = "More complicated fillet cut. It works for more use-cases, like edges that touch each \
4215 other. But it's slower than the Basic method."]
4216 #[serde(rename = "csg")]
4217 #[display("csg")]
4218 Csg,
4219 #[doc = "Tries the Basic method, and if that doesn't work, tries the CSG strategy."]
4220 #[serde(rename = "automatic")]
4221 #[display("automatic")]
4222 Automatic,
4223}
4224
4225#[doc = "What kind of cut to do"]
4226#[derive(
4227 serde :: Serialize,
4228 serde :: Deserialize,
4229 PartialEq,
4230 Hash,
4231 Debug,
4232 Clone,
4233 schemars :: JsonSchema,
4234 parse_display :: FromStr,
4235 parse_display :: Display,
4236)]
4237#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4238#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4239pub enum CutType {
4240 #[doc = "Round off an edge."]
4241 #[serde(rename = "fillet")]
4242 #[display("fillet")]
4243 Fillet,
4244 #[doc = "Cut away an edge."]
4245 #[serde(rename = "chamfer")]
4246 #[display("chamfer")]
4247 Chamfer,
4248}
4249
4250#[doc = "The response from the `DefaultCameraCenterToScene` endpoint."]
4251#[derive(
4252 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4253)]
4254pub struct DefaultCameraCenterToScene {}
4255
4256impl std::fmt::Display for DefaultCameraCenterToScene {
4257 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4258 write!(
4259 f,
4260 "{}",
4261 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4262 )
4263 }
4264}
4265
4266#[cfg(feature = "tabled")]
4267impl tabled::Tabled for DefaultCameraCenterToScene {
4268 const LENGTH: usize = 0;
4269 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4270 vec![]
4271 }
4272
4273 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4274 vec![]
4275 }
4276}
4277
4278#[doc = "The response from the `DefaultCameraCenterToSelection` endpoint."]
4279#[derive(
4280 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4281)]
4282pub struct DefaultCameraCenterToSelection {}
4283
4284impl std::fmt::Display for DefaultCameraCenterToSelection {
4285 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4286 write!(
4287 f,
4288 "{}",
4289 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4290 )
4291 }
4292}
4293
4294#[cfg(feature = "tabled")]
4295impl tabled::Tabled for DefaultCameraCenterToSelection {
4296 const LENGTH: usize = 0;
4297 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4298 vec![]
4299 }
4300
4301 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4302 vec![]
4303 }
4304}
4305
4306#[doc = "The response from the `DefaultCameraFocusOn` command."]
4307#[derive(
4308 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4309)]
4310pub struct DefaultCameraFocusOn {}
4311
4312impl std::fmt::Display for DefaultCameraFocusOn {
4313 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4314 write!(
4315 f,
4316 "{}",
4317 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4318 )
4319 }
4320}
4321
4322#[cfg(feature = "tabled")]
4323impl tabled::Tabled for DefaultCameraFocusOn {
4324 const LENGTH: usize = 0;
4325 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4326 vec![]
4327 }
4328
4329 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4330 vec![]
4331 }
4332}
4333
4334#[doc = "The response from the `DefaultCameraGetSettings` command."]
4335#[derive(
4336 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4337)]
4338pub struct DefaultCameraGetSettings {
4339 #[doc = "Camera settings"]
4340 pub settings: CameraSettings,
4341}
4342
4343impl std::fmt::Display for DefaultCameraGetSettings {
4344 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4345 write!(
4346 f,
4347 "{}",
4348 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4349 )
4350 }
4351}
4352
4353#[cfg(feature = "tabled")]
4354impl tabled::Tabled for DefaultCameraGetSettings {
4355 const LENGTH: usize = 1;
4356 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4357 vec![format!("{:?}", self.settings).into()]
4358 }
4359
4360 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4361 vec!["settings".into()]
4362 }
4363}
4364
4365#[doc = "The response from the `DefaultCameraGetView` command."]
4366#[derive(
4367 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4368)]
4369pub struct DefaultCameraGetView {
4370 #[doc = "Camera view state"]
4371 pub view: CameraViewState,
4372}
4373
4374impl std::fmt::Display for DefaultCameraGetView {
4375 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4376 write!(
4377 f,
4378 "{}",
4379 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4380 )
4381 }
4382}
4383
4384#[cfg(feature = "tabled")]
4385impl tabled::Tabled for DefaultCameraGetView {
4386 const LENGTH: usize = 1;
4387 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4388 vec![format!("{:?}", self.view).into()]
4389 }
4390
4391 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4392 vec!["view".into()]
4393 }
4394}
4395
4396#[doc = "The response from the `DefaultCameraLookAt` endpoint."]
4397#[derive(
4398 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4399)]
4400pub struct DefaultCameraLookAt {}
4401
4402impl std::fmt::Display for DefaultCameraLookAt {
4403 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4404 write!(
4405 f,
4406 "{}",
4407 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4408 )
4409 }
4410}
4411
4412#[cfg(feature = "tabled")]
4413impl tabled::Tabled for DefaultCameraLookAt {
4414 const LENGTH: usize = 0;
4415 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4416 vec![]
4417 }
4418
4419 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4420 vec![]
4421 }
4422}
4423
4424#[doc = "The response from the `DefaultCameraPerspectiveSettings` endpoint."]
4425#[derive(
4426 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4427)]
4428pub struct DefaultCameraPerspectiveSettings {}
4429
4430impl std::fmt::Display for DefaultCameraPerspectiveSettings {
4431 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4432 write!(
4433 f,
4434 "{}",
4435 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4436 )
4437 }
4438}
4439
4440#[cfg(feature = "tabled")]
4441impl tabled::Tabled for DefaultCameraPerspectiveSettings {
4442 const LENGTH: usize = 0;
4443 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4444 vec![]
4445 }
4446
4447 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4448 vec![]
4449 }
4450}
4451
4452#[doc = "The response from the `DefaultCameraSetOrthographic` endpoint."]
4453#[derive(
4454 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4455)]
4456pub struct DefaultCameraSetOrthographic {}
4457
4458impl std::fmt::Display for DefaultCameraSetOrthographic {
4459 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4460 write!(
4461 f,
4462 "{}",
4463 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4464 )
4465 }
4466}
4467
4468#[cfg(feature = "tabled")]
4469impl tabled::Tabled for DefaultCameraSetOrthographic {
4470 const LENGTH: usize = 0;
4471 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4472 vec![]
4473 }
4474
4475 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4476 vec![]
4477 }
4478}
4479
4480#[doc = "The response from the `DefaultCameraSetPerspective` endpoint."]
4481#[derive(
4482 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4483)]
4484pub struct DefaultCameraSetPerspective {}
4485
4486impl std::fmt::Display for DefaultCameraSetPerspective {
4487 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4488 write!(
4489 f,
4490 "{}",
4491 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4492 )
4493 }
4494}
4495
4496#[cfg(feature = "tabled")]
4497impl tabled::Tabled for DefaultCameraSetPerspective {
4498 const LENGTH: usize = 0;
4499 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4500 vec![]
4501 }
4502
4503 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4504 vec![]
4505 }
4506}
4507
4508#[doc = "The response from the `DefaultCameraSetView` command."]
4509#[derive(
4510 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4511)]
4512pub struct DefaultCameraSetView {}
4513
4514impl std::fmt::Display for DefaultCameraSetView {
4515 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4516 write!(
4517 f,
4518 "{}",
4519 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4520 )
4521 }
4522}
4523
4524#[cfg(feature = "tabled")]
4525impl tabled::Tabled for DefaultCameraSetView {
4526 const LENGTH: usize = 0;
4527 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4528 vec![]
4529 }
4530
4531 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4532 vec![]
4533 }
4534}
4535
4536#[doc = "The response from the `DefaultCameraZoom` command."]
4537#[derive(
4538 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4539)]
4540pub struct DefaultCameraZoom {
4541 #[doc = "Camera settings"]
4542 pub settings: CameraSettings,
4543}
4544
4545impl std::fmt::Display for DefaultCameraZoom {
4546 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4547 write!(
4548 f,
4549 "{}",
4550 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4551 )
4552 }
4553}
4554
4555#[cfg(feature = "tabled")]
4556impl tabled::Tabled for DefaultCameraZoom {
4557 const LENGTH: usize = 1;
4558 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4559 vec![format!("{:?}", self.settings).into()]
4560 }
4561
4562 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4563 vec!["settings".into()]
4564 }
4565}
4566
4567#[doc = "The density response."]
4568#[derive(
4569 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4570)]
4571pub struct Density {
4572 #[doc = "The density."]
4573 pub density: f64,
4574 #[doc = "The output unit for the density."]
4575 pub output_unit: UnitDensity,
4576}
4577
4578impl std::fmt::Display for Density {
4579 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4580 write!(
4581 f,
4582 "{}",
4583 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4584 )
4585 }
4586}
4587
4588#[cfg(feature = "tabled")]
4589impl tabled::Tabled for Density {
4590 const LENGTH: usize = 2;
4591 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4592 vec![
4593 format!("{:?}", self.density).into(),
4594 format!("{:?}", self.output_unit).into(),
4595 ]
4596 }
4597
4598 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4599 vec!["density".into(), "output_unit".into()]
4600 }
4601}
4602
4603#[doc = "The DER encoded key pair."]
4604#[derive(
4605 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4606)]
4607pub struct DerEncodedKeyPair {
4608 #[doc = "The request signing private key (pem file)."]
4609 pub private_key: base64::Base64Data,
4610 #[doc = "The request signing public certificate (pem file)."]
4611 pub public_cert: base64::Base64Data,
4612}
4613
4614impl std::fmt::Display for DerEncodedKeyPair {
4615 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4616 write!(
4617 f,
4618 "{}",
4619 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4620 )
4621 }
4622}
4623
4624#[cfg(feature = "tabled")]
4625impl tabled::Tabled for DerEncodedKeyPair {
4626 const LENGTH: usize = 2;
4627 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4628 vec![
4629 format!("{:?}", self.private_key).into(),
4630 format!("{:?}", self.public_cert).into(),
4631 ]
4632 }
4633
4634 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4635 vec!["private_key".into(), "public_cert".into()]
4636 }
4637}
4638
4639#[doc = "The form for a device access token request."]
4640#[derive(
4641 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4642)]
4643pub struct DeviceAccessTokenRequestForm {
4644 #[doc = "The client ID."]
4645 pub client_id: uuid::Uuid,
4646 #[doc = "The device code."]
4647 pub device_code: uuid::Uuid,
4648 #[doc = "The grant type."]
4649 pub grant_type: Oauth2GrantType,
4650}
4651
4652impl std::fmt::Display for DeviceAccessTokenRequestForm {
4653 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4654 write!(
4655 f,
4656 "{}",
4657 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4658 )
4659 }
4660}
4661
4662#[cfg(feature = "tabled")]
4663impl tabled::Tabled for DeviceAccessTokenRequestForm {
4664 const LENGTH: usize = 3;
4665 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4666 vec![
4667 format!("{:?}", self.client_id).into(),
4668 format!("{:?}", self.device_code).into(),
4669 format!("{:?}", self.grant_type).into(),
4670 ]
4671 }
4672
4673 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4674 vec![
4675 "client_id".into(),
4676 "device_code".into(),
4677 "grant_type".into(),
4678 ]
4679 }
4680}
4681
4682#[doc = "The request parameters to confirm the `user_code` for the OAuth 2.0 Device Authorization \
4683 Grant."]
4684#[derive(
4685 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4686)]
4687pub struct DeviceAuthConfirmParams {
4688 #[doc = "The user code."]
4689 pub user_code: String,
4690}
4691
4692impl std::fmt::Display for DeviceAuthConfirmParams {
4693 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4694 write!(
4695 f,
4696 "{}",
4697 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4698 )
4699 }
4700}
4701
4702#[cfg(feature = "tabled")]
4703impl tabled::Tabled for DeviceAuthConfirmParams {
4704 const LENGTH: usize = 1;
4705 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4706 vec![self.user_code.clone().into()]
4707 }
4708
4709 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4710 vec!["user_code".into()]
4711 }
4712}
4713
4714#[doc = "The request parameters for the OAuth 2.0 Device Authorization Grant flow."]
4715#[derive(
4716 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4717)]
4718pub struct DeviceAuthRequestForm {
4719 #[doc = "The client ID."]
4720 pub client_id: uuid::Uuid,
4721}
4722
4723impl std::fmt::Display for DeviceAuthRequestForm {
4724 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4725 write!(
4726 f,
4727 "{}",
4728 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4729 )
4730 }
4731}
4732
4733#[cfg(feature = "tabled")]
4734impl tabled::Tabled for DeviceAuthRequestForm {
4735 const LENGTH: usize = 1;
4736 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4737 vec![format!("{:?}", self.client_id).into()]
4738 }
4739
4740 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4741 vec!["client_id".into()]
4742 }
4743}
4744
4745#[doc = "Specifies the sign of a co-ordinate axis."]
4746#[derive(
4747 serde :: Serialize,
4748 serde :: Deserialize,
4749 PartialEq,
4750 Hash,
4751 Debug,
4752 Clone,
4753 schemars :: JsonSchema,
4754 parse_display :: FromStr,
4755 parse_display :: Display,
4756)]
4757#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4758#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4759pub enum Direction {
4760 #[doc = "Increasing numbers."]
4761 #[serde(rename = "positive")]
4762 #[display("positive")]
4763 Positive,
4764 #[doc = "Decreasing numbers."]
4765 #[serde(rename = "negative")]
4766 #[display("negative")]
4767 Negative,
4768}
4769
4770#[doc = "The response from the `DisableDryRun` endpoint."]
4771#[derive(
4772 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4773)]
4774pub struct DisableDryRun {}
4775
4776impl std::fmt::Display for DisableDryRun {
4777 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4778 write!(
4779 f,
4780 "{}",
4781 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4782 )
4783 }
4784}
4785
4786#[cfg(feature = "tabled")]
4787impl tabled::Tabled for DisableDryRun {
4788 const LENGTH: usize = 0;
4789 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4790 vec![]
4791 }
4792
4793 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4794 vec![]
4795 }
4796}
4797
4798#[doc = "The resource representing a Discount."]
4799#[derive(
4800 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4801)]
4802pub struct Discount {
4803 #[doc = "The coupon that applied to create this discount."]
4804 pub coupon: Coupon,
4805}
4806
4807impl std::fmt::Display for Discount {
4808 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4809 write!(
4810 f,
4811 "{}",
4812 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4813 )
4814 }
4815}
4816
4817#[cfg(feature = "tabled")]
4818impl tabled::Tabled for Discount {
4819 const LENGTH: usize = 1;
4820 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4821 vec![format!("{:?}", self.coupon).into()]
4822 }
4823
4824 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4825 vec!["coupon".into()]
4826 }
4827}
4828
4829#[doc = "A discount code for a store."]
4830#[derive(
4831 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4832)]
4833pub struct DiscountCode {
4834 #[doc = "The code for the discount."]
4835 pub code: String,
4836 #[doc = "The date the discount code expires."]
4837 #[serde(default, skip_serializing_if = "Option::is_none")]
4838 pub expires_at: Option<chrono::DateTime<chrono::Utc>>,
4839 #[doc = "The percent off for the discount."]
4840 pub percent_off: u32,
4841}
4842
4843impl std::fmt::Display for DiscountCode {
4844 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4845 write!(
4846 f,
4847 "{}",
4848 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4849 )
4850 }
4851}
4852
4853#[cfg(feature = "tabled")]
4854impl tabled::Tabled for DiscountCode {
4855 const LENGTH: usize = 3;
4856 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4857 vec![
4858 self.code.clone().into(),
4859 if let Some(expires_at) = &self.expires_at {
4860 format!("{:?}", expires_at).into()
4861 } else {
4862 String::new().into()
4863 },
4864 format!("{:?}", self.percent_off).into(),
4865 ]
4866 }
4867
4868 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4869 vec!["code".into(), "expires_at".into(), "percent_off".into()]
4870 }
4871}
4872
4873#[doc = "The type of distance Distances can vary depending on the objects used as input."]
4874#[derive(
4875 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4876)]
4877#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4878#[serde(tag = "type")]
4879pub enum DistanceType {
4880 #[doc = "Euclidean Distance."]
4881 #[serde(rename = "euclidean")]
4882 Euclidean {},
4883 #[doc = "The distance between objects along the specified axis"]
4884 #[serde(rename = "on_axis")]
4885 OnAxis {
4886 #[doc = "Global axis"]
4887 axis: GlobalAxis,
4888 },
4889}
4890
4891#[doc = "Export storage."]
4892#[derive(
4893 serde :: Serialize,
4894 serde :: Deserialize,
4895 PartialEq,
4896 Hash,
4897 Debug,
4898 Clone,
4899 schemars :: JsonSchema,
4900 parse_display :: FromStr,
4901 parse_display :: Display,
4902)]
4903#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
4904#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
4905pub enum DxfStorage {
4906 #[doc = "Plaintext encoding.\n\nThis is the default setting."]
4907 #[serde(rename = "ascii")]
4908 #[display("ascii")]
4909 Ascii,
4910 #[doc = "Binary encoding."]
4911 #[serde(rename = "binary")]
4912 #[display("binary")]
4913 Binary,
4914}
4915
4916#[doc = "A list of faces for a specific edge."]
4917#[derive(
4918 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4919)]
4920pub struct EdgeInfo {
4921 #[doc = "The UUID of the id."]
4922 pub edge_id: uuid::Uuid,
4923 #[doc = "The faces of each edge."]
4924 pub faces: Vec<uuid::Uuid>,
4925}
4926
4927impl std::fmt::Display for EdgeInfo {
4928 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4929 write!(
4930 f,
4931 "{}",
4932 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4933 )
4934 }
4935}
4936
4937#[cfg(feature = "tabled")]
4938impl tabled::Tabled for EdgeInfo {
4939 const LENGTH: usize = 2;
4940 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4941 vec![
4942 format!("{:?}", self.edge_id).into(),
4943 format!("{:?}", self.faces).into(),
4944 ]
4945 }
4946
4947 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4948 vec!["edge_id".into(), "faces".into()]
4949 }
4950}
4951
4952#[doc = "The response from the `EdgeLinesVisible` endpoint."]
4953#[derive(
4954 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4955)]
4956pub struct EdgeLinesVisible {}
4957
4958impl std::fmt::Display for EdgeLinesVisible {
4959 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4960 write!(
4961 f,
4962 "{}",
4963 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4964 )
4965 }
4966}
4967
4968#[cfg(feature = "tabled")]
4969impl tabled::Tabled for EdgeLinesVisible {
4970 const LENGTH: usize = 0;
4971 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
4972 vec![]
4973 }
4974
4975 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
4976 vec![]
4977 }
4978}
4979
4980#[doc = "The body of the form for email authentication."]
4981#[derive(
4982 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
4983)]
4984pub struct EmailAuthenticationForm {
4985 #[doc = "The URL to redirect back to after we have authenticated."]
4986 #[serde(default, skip_serializing_if = "Option::is_none")]
4987 pub callback_url: Option<String>,
4988 #[doc = "The user's email."]
4989 pub email: String,
4990}
4991
4992impl std::fmt::Display for EmailAuthenticationForm {
4993 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
4994 write!(
4995 f,
4996 "{}",
4997 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
4998 )
4999 }
5000}
5001
5002#[cfg(feature = "tabled")]
5003impl tabled::Tabled for EmailAuthenticationForm {
5004 const LENGTH: usize = 2;
5005 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5006 vec![
5007 if let Some(callback_url) = &self.callback_url {
5008 format!("{:?}", callback_url).into()
5009 } else {
5010 String::new().into()
5011 },
5012 self.email.clone().into(),
5013 ]
5014 }
5015
5016 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5017 vec!["callback_url".into(), "email".into()]
5018 }
5019}
5020
5021#[doc = "The response from the `EnableDryRun` endpoint."]
5022#[derive(
5023 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5024)]
5025pub struct EnableDryRun {}
5026
5027impl std::fmt::Display for EnableDryRun {
5028 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5029 write!(
5030 f,
5031 "{}",
5032 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5033 )
5034 }
5035}
5036
5037#[cfg(feature = "tabled")]
5038impl tabled::Tabled for EnableDryRun {
5039 const LENGTH: usize = 0;
5040 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5041 vec![]
5042 }
5043
5044 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5045 vec![]
5046 }
5047}
5048
5049#[doc = "The response from the `EnableSketchMode` endpoint."]
5050#[derive(
5051 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5052)]
5053pub struct EnableSketchMode {}
5054
5055impl std::fmt::Display for EnableSketchMode {
5056 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5057 write!(
5058 f,
5059 "{}",
5060 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5061 )
5062 }
5063}
5064
5065#[cfg(feature = "tabled")]
5066impl tabled::Tabled for EnableSketchMode {
5067 const LENGTH: usize = 0;
5068 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5069 vec![]
5070 }
5071
5072 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5073 vec![]
5074 }
5075}
5076
5077#[doc = "The response of the `EngineUtilEvaluatePath` endpoint"]
5078#[derive(
5079 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5080)]
5081pub struct EngineUtilEvaluatePath {
5082 #[doc = "The evaluated path curve position"]
5083 pub pos: Point3D,
5084}
5085
5086impl std::fmt::Display for EngineUtilEvaluatePath {
5087 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5088 write!(
5089 f,
5090 "{}",
5091 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5092 )
5093 }
5094}
5095
5096#[cfg(feature = "tabled")]
5097impl tabled::Tabled for EngineUtilEvaluatePath {
5098 const LENGTH: usize = 1;
5099 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5100 vec![format!("{:?}", self.pos).into()]
5101 }
5102
5103 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5104 vec!["pos".into()]
5105 }
5106}
5107
5108#[doc = "The price for an enterprise subscription."]
5109#[derive(
5110 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5111)]
5112#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
5113#[serde(tag = "type")]
5114pub enum EnterpriseSubscriptionTierPrice {
5115 #[doc = "A flat price that we publicly list."]
5116 #[serde(rename = "flat")]
5117 Flat {
5118 #[doc = "The interval the price is charged."]
5119 interval: PlanInterval,
5120 #[doc = "The price."]
5121 price: f64,
5122 },
5123 #[doc = "A per user price that we publicly list."]
5124 #[serde(rename = "per_user")]
5125 PerUser {
5126 #[doc = "The interval the price is charged."]
5127 interval: PlanInterval,
5128 #[doc = "The price."]
5129 price: f64,
5130 },
5131}
5132
5133#[doc = "The response from the `EntityCircularPattern` command."]
5134#[derive(
5135 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5136)]
5137pub struct EntityCircularPattern {
5138 #[doc = "The Face, edge, and entity ids of the patterned entities."]
5139 #[serde(default, skip_serializing_if = "Option::is_none")]
5140 pub entity_face_edge_ids: Option<Vec<FaceEdgeInfo>>,
5141}
5142
5143impl std::fmt::Display for EntityCircularPattern {
5144 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5145 write!(
5146 f,
5147 "{}",
5148 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5149 )
5150 }
5151}
5152
5153#[cfg(feature = "tabled")]
5154impl tabled::Tabled for EntityCircularPattern {
5155 const LENGTH: usize = 1;
5156 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5157 vec![
5158 if let Some(entity_face_edge_ids) = &self.entity_face_edge_ids {
5159 format!("{:?}", entity_face_edge_ids).into()
5160 } else {
5161 String::new().into()
5162 },
5163 ]
5164 }
5165
5166 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5167 vec!["entity_face_edge_ids".into()]
5168 }
5169}
5170
5171#[doc = "The response from the `EntityClone` command."]
5172#[derive(
5173 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5174)]
5175pub struct EntityClone {
5176 #[doc = "The Face and Edge Ids of the cloned entity."]
5177 #[serde(default, skip_serializing_if = "Option::is_none")]
5178 pub face_edge_ids: Option<Vec<FaceEdgeInfo>>,
5179}
5180
5181impl std::fmt::Display for EntityClone {
5182 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5183 write!(
5184 f,
5185 "{}",
5186 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5187 )
5188 }
5189}
5190
5191#[cfg(feature = "tabled")]
5192impl tabled::Tabled for EntityClone {
5193 const LENGTH: usize = 1;
5194 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5195 vec![if let Some(face_edge_ids) = &self.face_edge_ids {
5196 format!("{:?}", face_edge_ids).into()
5197 } else {
5198 String::new().into()
5199 }]
5200 }
5201
5202 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5203 vec!["face_edge_ids".into()]
5204 }
5205}
5206
5207#[doc = "The response from the `EntityFade` endpoint."]
5208#[derive(
5209 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5210)]
5211pub struct EntityFade {}
5212
5213impl std::fmt::Display for EntityFade {
5214 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5215 write!(
5216 f,
5217 "{}",
5218 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5219 )
5220 }
5221}
5222
5223#[cfg(feature = "tabled")]
5224impl tabled::Tabled for EntityFade {
5225 const LENGTH: usize = 0;
5226 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5227 vec![]
5228 }
5229
5230 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5231 vec![]
5232 }
5233}
5234
5235#[doc = "The response from the `EntityGetAllChildUuids` command."]
5236#[derive(
5237 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5238)]
5239pub struct EntityGetAllChildUuids {
5240 #[doc = "The UUIDs of the child entities."]
5241 pub entity_ids: Vec<uuid::Uuid>,
5242}
5243
5244impl std::fmt::Display for EntityGetAllChildUuids {
5245 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5246 write!(
5247 f,
5248 "{}",
5249 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5250 )
5251 }
5252}
5253
5254#[cfg(feature = "tabled")]
5255impl tabled::Tabled for EntityGetAllChildUuids {
5256 const LENGTH: usize = 1;
5257 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5258 vec![format!("{:?}", self.entity_ids).into()]
5259 }
5260
5261 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5262 vec!["entity_ids".into()]
5263 }
5264}
5265
5266#[doc = "The response from the `EntityGetChildUuid` command."]
5267#[derive(
5268 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5269)]
5270pub struct EntityGetChildUuid {
5271 #[doc = "The UUID of the child entity."]
5272 pub entity_id: uuid::Uuid,
5273}
5274
5275impl std::fmt::Display for EntityGetChildUuid {
5276 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5277 write!(
5278 f,
5279 "{}",
5280 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5281 )
5282 }
5283}
5284
5285#[cfg(feature = "tabled")]
5286impl tabled::Tabled for EntityGetChildUuid {
5287 const LENGTH: usize = 1;
5288 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5289 vec![format!("{:?}", self.entity_id).into()]
5290 }
5291
5292 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5293 vec!["entity_id".into()]
5294 }
5295}
5296
5297#[doc = "The response from the `EntitiesGetDistance` command."]
5298#[derive(
5299 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5300)]
5301pub struct EntityGetDistance {
5302 #[doc = "The maximum distance between the input entities."]
5303 pub max_distance: f64,
5304 #[doc = "The minimum distance between the input entities."]
5305 pub min_distance: f64,
5306}
5307
5308impl std::fmt::Display for EntityGetDistance {
5309 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5310 write!(
5311 f,
5312 "{}",
5313 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5314 )
5315 }
5316}
5317
5318#[cfg(feature = "tabled")]
5319impl tabled::Tabled for EntityGetDistance {
5320 const LENGTH: usize = 2;
5321 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5322 vec![
5323 format!("{:?}", self.max_distance).into(),
5324 format!("{:?}", self.min_distance).into(),
5325 ]
5326 }
5327
5328 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5329 vec!["max_distance".into(), "min_distance".into()]
5330 }
5331}
5332
5333#[doc = "The response from the `EntityGetNumChildren` command."]
5334#[derive(
5335 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5336)]
5337pub struct EntityGetNumChildren {
5338 #[doc = "The number of children the entity has."]
5339 pub num: u32,
5340}
5341
5342impl std::fmt::Display for EntityGetNumChildren {
5343 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5344 write!(
5345 f,
5346 "{}",
5347 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5348 )
5349 }
5350}
5351
5352#[cfg(feature = "tabled")]
5353impl tabled::Tabled for EntityGetNumChildren {
5354 const LENGTH: usize = 1;
5355 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5356 vec![format!("{:?}", self.num).into()]
5357 }
5358
5359 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5360 vec!["num".into()]
5361 }
5362}
5363
5364#[doc = "The response from the `EntityGetParentId` command."]
5365#[derive(
5366 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5367)]
5368pub struct EntityGetParentId {
5369 #[doc = "The UUID of the parent entity."]
5370 pub entity_id: uuid::Uuid,
5371}
5372
5373impl std::fmt::Display for EntityGetParentId {
5374 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5375 write!(
5376 f,
5377 "{}",
5378 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5379 )
5380 }
5381}
5382
5383#[cfg(feature = "tabled")]
5384impl tabled::Tabled for EntityGetParentId {
5385 const LENGTH: usize = 1;
5386 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5387 vec![format!("{:?}", self.entity_id).into()]
5388 }
5389
5390 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5391 vec!["entity_id".into()]
5392 }
5393}
5394
5395#[doc = "The response from the `EntityGetSketchPaths` command."]
5396#[derive(
5397 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5398)]
5399pub struct EntityGetSketchPaths {
5400 #[doc = "The UUIDs of the sketch paths."]
5401 pub entity_ids: Vec<uuid::Uuid>,
5402}
5403
5404impl std::fmt::Display for EntityGetSketchPaths {
5405 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5406 write!(
5407 f,
5408 "{}",
5409 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5410 )
5411 }
5412}
5413
5414#[cfg(feature = "tabled")]
5415impl tabled::Tabled for EntityGetSketchPaths {
5416 const LENGTH: usize = 1;
5417 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5418 vec![format!("{:?}", self.entity_ids).into()]
5419 }
5420
5421 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5422 vec!["entity_ids".into()]
5423 }
5424}
5425
5426#[doc = "The response from the `EntityLinearPattern` command."]
5427#[derive(
5428 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5429)]
5430pub struct EntityLinearPattern {
5431 #[doc = "The Face, edge, and entity ids of the patterned entities."]
5432 #[serde(default, skip_serializing_if = "Option::is_none")]
5433 pub entity_face_edge_ids: Option<Vec<FaceEdgeInfo>>,
5434}
5435
5436impl std::fmt::Display for EntityLinearPattern {
5437 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5438 write!(
5439 f,
5440 "{}",
5441 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5442 )
5443 }
5444}
5445
5446#[cfg(feature = "tabled")]
5447impl tabled::Tabled for EntityLinearPattern {
5448 const LENGTH: usize = 1;
5449 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5450 vec![
5451 if let Some(entity_face_edge_ids) = &self.entity_face_edge_ids {
5452 format!("{:?}", entity_face_edge_ids).into()
5453 } else {
5454 String::new().into()
5455 },
5456 ]
5457 }
5458
5459 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5460 vec!["entity_face_edge_ids".into()]
5461 }
5462}
5463
5464#[doc = "The response from the `EntityLinearPatternTransform` command."]
5465#[derive(
5466 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5467)]
5468pub struct EntityLinearPatternTransform {
5469 #[doc = "The Face, edge, and entity ids of the patterned entities."]
5470 #[serde(default, skip_serializing_if = "Option::is_none")]
5471 pub entity_face_edge_ids: Option<Vec<FaceEdgeInfo>>,
5472}
5473
5474impl std::fmt::Display for EntityLinearPatternTransform {
5475 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5476 write!(
5477 f,
5478 "{}",
5479 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5480 )
5481 }
5482}
5483
5484#[cfg(feature = "tabled")]
5485impl tabled::Tabled for EntityLinearPatternTransform {
5486 const LENGTH: usize = 1;
5487 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5488 vec![
5489 if let Some(entity_face_edge_ids) = &self.entity_face_edge_ids {
5490 format!("{:?}", entity_face_edge_ids).into()
5491 } else {
5492 String::new().into()
5493 },
5494 ]
5495 }
5496
5497 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5498 vec!["entity_face_edge_ids".into()]
5499 }
5500}
5501
5502#[doc = "The response from the `EntityMakeHelix` endpoint."]
5503#[derive(
5504 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5505)]
5506pub struct EntityMakeHelix {}
5507
5508impl std::fmt::Display for EntityMakeHelix {
5509 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5510 write!(
5511 f,
5512 "{}",
5513 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5514 )
5515 }
5516}
5517
5518#[cfg(feature = "tabled")]
5519impl tabled::Tabled for EntityMakeHelix {
5520 const LENGTH: usize = 0;
5521 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5522 vec![]
5523 }
5524
5525 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5526 vec![]
5527 }
5528}
5529
5530#[doc = "The response from the `EntityMakeHelixFromEdge` endpoint."]
5531#[derive(
5532 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5533)]
5534pub struct EntityMakeHelixFromEdge {}
5535
5536impl std::fmt::Display for EntityMakeHelixFromEdge {
5537 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5538 write!(
5539 f,
5540 "{}",
5541 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5542 )
5543 }
5544}
5545
5546#[cfg(feature = "tabled")]
5547impl tabled::Tabled for EntityMakeHelixFromEdge {
5548 const LENGTH: usize = 0;
5549 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5550 vec![]
5551 }
5552
5553 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5554 vec![]
5555 }
5556}
5557
5558#[doc = "The response from the `EntityMakeHelixFromParams` endpoint."]
5559#[derive(
5560 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5561)]
5562pub struct EntityMakeHelixFromParams {}
5563
5564impl std::fmt::Display for EntityMakeHelixFromParams {
5565 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5566 write!(
5567 f,
5568 "{}",
5569 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5570 )
5571 }
5572}
5573
5574#[cfg(feature = "tabled")]
5575impl tabled::Tabled for EntityMakeHelixFromParams {
5576 const LENGTH: usize = 0;
5577 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5578 vec![]
5579 }
5580
5581 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5582 vec![]
5583 }
5584}
5585
5586#[doc = "The response from the `EntityMirror` endpoint."]
5587#[derive(
5588 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5589)]
5590pub struct EntityMirror {
5591 #[doc = "The Face, edge, and entity ids of the patterned entities."]
5592 #[serde(default, skip_serializing_if = "Option::is_none")]
5593 pub entity_face_edge_ids: Option<Vec<FaceEdgeInfo>>,
5594}
5595
5596impl std::fmt::Display for EntityMirror {
5597 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5598 write!(
5599 f,
5600 "{}",
5601 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5602 )
5603 }
5604}
5605
5606#[cfg(feature = "tabled")]
5607impl tabled::Tabled for EntityMirror {
5608 const LENGTH: usize = 1;
5609 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5610 vec![
5611 if let Some(entity_face_edge_ids) = &self.entity_face_edge_ids {
5612 format!("{:?}", entity_face_edge_ids).into()
5613 } else {
5614 String::new().into()
5615 },
5616 ]
5617 }
5618
5619 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5620 vec!["entity_face_edge_ids".into()]
5621 }
5622}
5623
5624#[doc = "The response from the `EntityMirrorAcrossEdge` endpoint."]
5625#[derive(
5626 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5627)]
5628pub struct EntityMirrorAcrossEdge {
5629 #[doc = "The Face, edge, and entity ids of the patterned entities."]
5630 #[serde(default, skip_serializing_if = "Option::is_none")]
5631 pub entity_face_edge_ids: Option<Vec<FaceEdgeInfo>>,
5632}
5633
5634impl std::fmt::Display for EntityMirrorAcrossEdge {
5635 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5636 write!(
5637 f,
5638 "{}",
5639 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5640 )
5641 }
5642}
5643
5644#[cfg(feature = "tabled")]
5645impl tabled::Tabled for EntityMirrorAcrossEdge {
5646 const LENGTH: usize = 1;
5647 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5648 vec![
5649 if let Some(entity_face_edge_ids) = &self.entity_face_edge_ids {
5650 format!("{:?}", entity_face_edge_ids).into()
5651 } else {
5652 String::new().into()
5653 },
5654 ]
5655 }
5656
5657 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5658 vec!["entity_face_edge_ids".into()]
5659 }
5660}
5661
5662#[doc = "The response from the `EntitySetOpacity` endpoint."]
5663#[derive(
5664 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5665)]
5666pub struct EntitySetOpacity {}
5667
5668impl std::fmt::Display for EntitySetOpacity {
5669 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5670 write!(
5671 f,
5672 "{}",
5673 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5674 )
5675 }
5676}
5677
5678#[cfg(feature = "tabled")]
5679impl tabled::Tabled for EntitySetOpacity {
5680 const LENGTH: usize = 0;
5681 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5682 vec![]
5683 }
5684
5685 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5686 vec![]
5687 }
5688}
5689
5690#[doc = "The type of entity"]
5691#[derive(
5692 serde :: Serialize,
5693 serde :: Deserialize,
5694 PartialEq,
5695 Hash,
5696 Debug,
5697 Clone,
5698 schemars :: JsonSchema,
5699 parse_display :: FromStr,
5700 parse_display :: Display,
5701)]
5702#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
5703#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
5704pub enum EntityType {
5705 #[serde(rename = "entity")]
5706 #[display("entity")]
5707 Entity,
5708 #[serde(rename = "object")]
5709 #[display("object")]
5710 Object,
5711 #[serde(rename = "path")]
5712 #[display("path")]
5713 Path,
5714 #[serde(rename = "curve")]
5715 #[display("curve")]
5716 Curve,
5717 #[serde(rename = "solid2d")]
5718 #[display("solid2d")]
5719 Solid2D,
5720 #[serde(rename = "solid3d")]
5721 #[display("solid3d")]
5722 Solid3D,
5723 #[serde(rename = "edge")]
5724 #[display("edge")]
5725 Edge,
5726 #[serde(rename = "face")]
5727 #[display("face")]
5728 Face,
5729 #[serde(rename = "plane")]
5730 #[display("plane")]
5731 Plane,
5732 #[serde(rename = "vertex")]
5733 #[display("vertex")]
5734 Vertex,
5735}
5736
5737#[doc = "Error information from a response."]
5738#[derive(
5739 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5740)]
5741pub struct Error {
5742 #[serde(default, skip_serializing_if = "Option::is_none")]
5743 pub error_code: Option<String>,
5744 pub message: String,
5745 pub request_id: String,
5746}
5747
5748impl std::fmt::Display for Error {
5749 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5750 write!(
5751 f,
5752 "{}",
5753 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5754 )
5755 }
5756}
5757
5758#[cfg(feature = "tabled")]
5759impl tabled::Tabled for Error {
5760 const LENGTH: usize = 3;
5761 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5762 vec![
5763 if let Some(error_code) = &self.error_code {
5764 format!("{:?}", error_code).into()
5765 } else {
5766 String::new().into()
5767 },
5768 self.message.clone().into(),
5769 self.request_id.clone().into(),
5770 ]
5771 }
5772
5773 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5774 vec!["error_code".into(), "message".into(), "request_id".into()]
5775 }
5776}
5777
5778#[doc = "The type of error sent by the KittyCAD API."]
5779#[derive(
5780 serde :: Serialize,
5781 serde :: Deserialize,
5782 PartialEq,
5783 Hash,
5784 Debug,
5785 Clone,
5786 schemars :: JsonSchema,
5787 parse_display :: FromStr,
5788 parse_display :: Display,
5789)]
5790#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
5791#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
5792pub enum ErrorCode {
5793 #[doc = "Graphics engine failed to complete request, consider retrying"]
5794 #[serde(rename = "internal_engine")]
5795 #[display("internal_engine")]
5796 InternalEngine,
5797 #[doc = "API failed to complete request, consider retrying"]
5798 #[serde(rename = "internal_api")]
5799 #[display("internal_api")]
5800 InternalApi,
5801 #[doc = "User requested something geometrically or graphically impossible. Don't retry this \
5802 request, as it's inherently impossible. Instead, read the error message and change \
5803 your request."]
5804 #[serde(rename = "bad_request")]
5805 #[display("bad_request")]
5806 BadRequest,
5807 #[doc = "Auth token is missing from the request"]
5808 #[serde(rename = "auth_token_missing")]
5809 #[display("auth_token_missing")]
5810 AuthTokenMissing,
5811 #[doc = "Auth token is invalid in some way (expired, incorrect format, etc)"]
5812 #[serde(rename = "auth_token_invalid")]
5813 #[display("auth_token_invalid")]
5814 AuthTokenInvalid,
5815 #[doc = "Client sent invalid JSON."]
5816 #[serde(rename = "invalid_json")]
5817 #[display("invalid_json")]
5818 InvalidJson,
5819 #[doc = "Client sent invalid BSON."]
5820 #[serde(rename = "invalid_bson")]
5821 #[display("invalid_bson")]
5822 InvalidBson,
5823 #[doc = "Client sent a message which is not accepted over this protocol."]
5824 #[serde(rename = "wrong_protocol")]
5825 #[display("wrong_protocol")]
5826 WrongProtocol,
5827 #[doc = "Problem sending data between client and KittyCAD API."]
5828 #[serde(rename = "connection_problem")]
5829 #[display("connection_problem")]
5830 ConnectionProblem,
5831 #[doc = "Client sent a Websocket message type which the KittyCAD API does not handle."]
5832 #[serde(rename = "message_type_not_accepted")]
5833 #[display("message_type_not_accepted")]
5834 MessageTypeNotAccepted,
5835 #[doc = "Client sent a Websocket message intended for WebRTC but it was configured as a \
5836 WebRTC connection."]
5837 #[serde(rename = "message_type_not_accepted_for_web_r_t_c")]
5838 #[display("message_type_not_accepted_for_web_r_t_c")]
5839 MessageTypeNotAcceptedForWebRTC,
5840}
5841
5842#[derive(
5843 serde :: Serialize,
5844 serde :: Deserialize,
5845 PartialEq,
5846 Hash,
5847 Debug,
5848 Clone,
5849 schemars :: JsonSchema,
5850 parse_display :: FromStr,
5851 parse_display :: Display,
5852)]
5853#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
5854#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
5855#[derive(Default)]
5856pub enum Type {
5857 #[serde(rename = "modeling_app_event")]
5858 #[display("modeling_app_event")]
5859 #[default]
5860 ModelingAppEvent,
5861}
5862
5863
5864#[doc = "An event related to modeling app files"]
5865#[derive(
5866 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5867)]
5868pub struct Event {
5869 #[doc = "Attachment URI for where the attachment is stored."]
5870 #[serde(default, skip_serializing_if = "Option::is_none")]
5871 pub attachment_uri: Option<String>,
5872 #[doc = "Time this event was created."]
5873 pub created_at: chrono::DateTime<chrono::Utc>,
5874 #[doc = "The specific event type from the modeling app."]
5875 pub event_type: ModelingAppEventType,
5876 #[doc = "Time the associated attachment was last compiled."]
5877 #[serde(default, skip_serializing_if = "Option::is_none")]
5878 pub last_compiled_at: Option<chrono::DateTime<chrono::Utc>>,
5879 #[doc = "Project descriptino as given by the user."]
5880 #[serde(default, skip_serializing_if = "Option::is_none")]
5881 pub project_description: Option<String>,
5882 #[doc = "Project name as given by the user."]
5883 pub project_name: String,
5884 #[doc = "The source app for this event, uuid that is unique to the app."]
5885 pub source_id: uuid::Uuid,
5886 #[serde(rename = "type")]
5887 pub type_: Type,
5888 #[doc = "An anonymous user id generated client-side."]
5889 pub user_id: String,
5890}
5891
5892impl std::fmt::Display for Event {
5893 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5894 write!(
5895 f,
5896 "{}",
5897 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5898 )
5899 }
5900}
5901
5902#[cfg(feature = "tabled")]
5903impl tabled::Tabled for Event {
5904 const LENGTH: usize = 9;
5905 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5906 vec![
5907 if let Some(attachment_uri) = &self.attachment_uri {
5908 format!("{:?}", attachment_uri).into()
5909 } else {
5910 String::new().into()
5911 },
5912 format!("{:?}", self.created_at).into(),
5913 format!("{:?}", self.event_type).into(),
5914 if let Some(last_compiled_at) = &self.last_compiled_at {
5915 format!("{:?}", last_compiled_at).into()
5916 } else {
5917 String::new().into()
5918 },
5919 if let Some(project_description) = &self.project_description {
5920 format!("{:?}", project_description).into()
5921 } else {
5922 String::new().into()
5923 },
5924 self.project_name.clone().into(),
5925 format!("{:?}", self.source_id).into(),
5926 format!("{:?}", self.type_).into(),
5927 self.user_id.clone().into(),
5928 ]
5929 }
5930
5931 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5932 vec![
5933 "attachment_uri".into(),
5934 "created_at".into(),
5935 "event_type".into(),
5936 "last_compiled_at".into(),
5937 "project_description".into(),
5938 "project_name".into(),
5939 "source_id".into(),
5940 "type_".into(),
5941 "user_id".into(),
5942 ]
5943 }
5944}
5945
5946#[doc = "The response from the `Export` endpoint."]
5947#[derive(
5948 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5949)]
5950pub struct Export {
5951 #[doc = "The files that were exported."]
5952 pub files: Vec<ExportFile>,
5953}
5954
5955impl std::fmt::Display for Export {
5956 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5957 write!(
5958 f,
5959 "{}",
5960 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5961 )
5962 }
5963}
5964
5965#[cfg(feature = "tabled")]
5966impl tabled::Tabled for Export {
5967 const LENGTH: usize = 1;
5968 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
5969 vec![format!("{:?}", self.files).into()]
5970 }
5971
5972 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
5973 vec!["files".into()]
5974 }
5975}
5976
5977#[doc = "The response from the `Export2d` endpoint."]
5978#[derive(
5979 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
5980)]
5981pub struct Export2D {
5982 #[doc = "The files that were exported."]
5983 pub files: Vec<ExportFile>,
5984}
5985
5986impl std::fmt::Display for Export2D {
5987 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
5988 write!(
5989 f,
5990 "{}",
5991 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
5992 )
5993 }
5994}
5995
5996#[cfg(feature = "tabled")]
5997impl tabled::Tabled for Export2D {
5998 const LENGTH: usize = 1;
5999 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6000 vec![format!("{:?}", self.files).into()]
6001 }
6002
6003 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6004 vec!["files".into()]
6005 }
6006}
6007
6008#[doc = "The response from the `Export3d` endpoint."]
6009#[derive(
6010 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6011)]
6012pub struct Export3D {
6013 #[doc = "The files that were exported."]
6014 pub files: Vec<ExportFile>,
6015}
6016
6017impl std::fmt::Display for Export3D {
6018 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6019 write!(
6020 f,
6021 "{}",
6022 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6023 )
6024 }
6025}
6026
6027#[cfg(feature = "tabled")]
6028impl tabled::Tabled for Export3D {
6029 const LENGTH: usize = 1;
6030 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6031 vec![format!("{:?}", self.files).into()]
6032 }
6033
6034 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6035 vec!["files".into()]
6036 }
6037}
6038
6039#[doc = "A file to be exported to the client."]
6040#[derive(
6041 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6042)]
6043pub struct ExportFile {
6044 #[doc = "The contents of the file, base64 encoded."]
6045 pub contents: base64::Base64Data,
6046 #[doc = "The name of the file."]
6047 pub name: String,
6048}
6049
6050impl std::fmt::Display for ExportFile {
6051 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6052 write!(
6053 f,
6054 "{}",
6055 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6056 )
6057 }
6058}
6059
6060#[cfg(feature = "tabled")]
6061impl tabled::Tabled for ExportFile {
6062 const LENGTH: usize = 2;
6063 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6064 vec![
6065 format!("{:?}", self.contents).into(),
6066 self.name.clone().into(),
6067 ]
6068 }
6069
6070 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6071 vec!["contents".into(), "name".into()]
6072 }
6073}
6074
6075#[doc = "The response from the `ExtendPath` endpoint."]
6076#[derive(
6077 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6078)]
6079pub struct ExtendPath {}
6080
6081impl std::fmt::Display for ExtendPath {
6082 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6083 write!(
6084 f,
6085 "{}",
6086 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6087 )
6088 }
6089}
6090
6091#[cfg(feature = "tabled")]
6092impl tabled::Tabled for ExtendPath {
6093 const LENGTH: usize = 0;
6094 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6095 vec![]
6096 }
6097
6098 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6099 vec![]
6100 }
6101}
6102
6103#[doc = "Extended user information.\n\nThis is mostly used for internal purposes. It returns a \
6104 mapping of the user's information, including that of our third party services we use for \
6105 users: Stripe"]
6106#[derive(
6107 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6108)]
6109pub struct ExtendedUser {
6110 #[doc = "If the user should be blocked and the reason why."]
6111 #[serde(default, skip_serializing_if = "Option::is_none")]
6112 pub block: Option<BlockReason>,
6113 #[doc = "If we can train on the user's data. If the user is a member of an organization, the \
6114 organization's setting will override this."]
6115 #[serde(default)]
6116 pub can_train_on_data: bool,
6117 #[doc = "The user's company."]
6118 #[serde(default, skip_serializing_if = "Option::is_none")]
6119 pub company: Option<String>,
6120 #[doc = "The date and time the user was created."]
6121 pub created_at: chrono::DateTime<chrono::Utc>,
6122 #[doc = "If the user is scheduled for deletion"]
6123 #[serde(default)]
6124 pub deletion_scheduled: bool,
6125 #[doc = "The user's Discord handle."]
6126 #[serde(default, skip_serializing_if = "Option::is_none")]
6127 pub discord: Option<String>,
6128 #[doc = "The email address of the user."]
6129 #[serde(default, skip_serializing_if = "Option::is_none")]
6130 pub email: Option<String>,
6131 #[doc = "The date and time the email address was verified."]
6132 #[serde(default, skip_serializing_if = "Option::is_none")]
6133 pub email_verified: Option<chrono::DateTime<chrono::Utc>>,
6134 #[doc = "The user's first name."]
6135 #[serde(default, skip_serializing_if = "Option::is_none")]
6136 pub first_name: Option<String>,
6137 #[doc = "The user's GitHub handle."]
6138 #[serde(default, skip_serializing_if = "Option::is_none")]
6139 pub github: Option<String>,
6140 #[doc = "The user's Hubspot ID. This is mostly used for internal mapping."]
6141 #[serde(default, skip_serializing_if = "Option::is_none")]
6142 pub hubspot_contact_id: Option<String>,
6143 #[doc = "The unique identifier for the user."]
6144 pub id: uuid::Uuid,
6145 #[doc = "The image avatar for the user. This is a URL."]
6146 pub image: String,
6147 #[doc = "If the user has finished onboarding."]
6148 #[serde(default)]
6149 pub is_onboarded: bool,
6150 #[doc = "If the user is tied to a service account."]
6151 #[serde(default)]
6152 pub is_service_account: bool,
6153 #[doc = "The user's last name."]
6154 #[serde(default, skip_serializing_if = "Option::is_none")]
6155 pub last_name: Option<String>,
6156 #[doc = "The name of the user. This is auto populated at first from the authentication \
6157 provider (if there was a name). It can be updated by the user by updating their \
6158 `first_name` and `last_name` fields."]
6159 #[serde(default, skip_serializing_if = "Option::is_none")]
6160 pub name: Option<String>,
6161 #[doc = "The user's phone number."]
6162 #[serde(default, skip_serializing_if = "Option::is_none")]
6163 pub phone: phone_number::PhoneNumber,
6164 #[doc = "The user's Stripe ID. This is mostly used for internal mapping."]
6165 #[serde(default, skip_serializing_if = "Option::is_none")]
6166 pub stripe_id: Option<String>,
6167 #[doc = "The date and time the user was last updated."]
6168 pub updated_at: chrono::DateTime<chrono::Utc>,
6169}
6170
6171impl std::fmt::Display for ExtendedUser {
6172 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6173 write!(
6174 f,
6175 "{}",
6176 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6177 )
6178 }
6179}
6180
6181#[cfg(feature = "tabled")]
6182impl tabled::Tabled for ExtendedUser {
6183 const LENGTH: usize = 20;
6184 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6185 vec![
6186 if let Some(block) = &self.block {
6187 format!("{:?}", block).into()
6188 } else {
6189 String::new().into()
6190 },
6191 format!("{:?}", self.can_train_on_data).into(),
6192 if let Some(company) = &self.company {
6193 format!("{:?}", company).into()
6194 } else {
6195 String::new().into()
6196 },
6197 format!("{:?}", self.created_at).into(),
6198 format!("{:?}", self.deletion_scheduled).into(),
6199 if let Some(discord) = &self.discord {
6200 format!("{:?}", discord).into()
6201 } else {
6202 String::new().into()
6203 },
6204 if let Some(email) = &self.email {
6205 format!("{:?}", email).into()
6206 } else {
6207 String::new().into()
6208 },
6209 if let Some(email_verified) = &self.email_verified {
6210 format!("{:?}", email_verified).into()
6211 } else {
6212 String::new().into()
6213 },
6214 if let Some(first_name) = &self.first_name {
6215 format!("{:?}", first_name).into()
6216 } else {
6217 String::new().into()
6218 },
6219 if let Some(github) = &self.github {
6220 format!("{:?}", github).into()
6221 } else {
6222 String::new().into()
6223 },
6224 if let Some(hubspot_contact_id) = &self.hubspot_contact_id {
6225 format!("{:?}", hubspot_contact_id).into()
6226 } else {
6227 String::new().into()
6228 },
6229 format!("{:?}", self.id).into(),
6230 self.image.clone().into(),
6231 format!("{:?}", self.is_onboarded).into(),
6232 format!("{:?}", self.is_service_account).into(),
6233 if let Some(last_name) = &self.last_name {
6234 format!("{:?}", last_name).into()
6235 } else {
6236 String::new().into()
6237 },
6238 if let Some(name) = &self.name {
6239 format!("{:?}", name).into()
6240 } else {
6241 String::new().into()
6242 },
6243 format!("{:?}", self.phone).into(),
6244 if let Some(stripe_id) = &self.stripe_id {
6245 format!("{:?}", stripe_id).into()
6246 } else {
6247 String::new().into()
6248 },
6249 format!("{:?}", self.updated_at).into(),
6250 ]
6251 }
6252
6253 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6254 vec![
6255 "block".into(),
6256 "can_train_on_data".into(),
6257 "company".into(),
6258 "created_at".into(),
6259 "deletion_scheduled".into(),
6260 "discord".into(),
6261 "email".into(),
6262 "email_verified".into(),
6263 "first_name".into(),
6264 "github".into(),
6265 "hubspot_contact_id".into(),
6266 "id".into(),
6267 "image".into(),
6268 "is_onboarded".into(),
6269 "is_service_account".into(),
6270 "last_name".into(),
6271 "name".into(),
6272 "phone".into(),
6273 "stripe_id".into(),
6274 "updated_at".into(),
6275 ]
6276 }
6277}
6278
6279#[doc = "A single page of results"]
6280#[derive(
6281 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6282)]
6283pub struct ExtendedUserResultsPage {
6284 #[doc = "list of items on this page of results"]
6285 pub items: Vec<ExtendedUser>,
6286 #[doc = "token used to fetch the next page of results (if any)"]
6287 #[serde(default, skip_serializing_if = "Option::is_none")]
6288 pub next_page: Option<String>,
6289}
6290
6291impl std::fmt::Display for ExtendedUserResultsPage {
6292 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6293 write!(
6294 f,
6295 "{}",
6296 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6297 )
6298 }
6299}
6300
6301#[cfg(feature = "requests")]
6302impl crate::types::paginate::Pagination for ExtendedUserResultsPage {
6303 type Item = ExtendedUser;
6304 fn has_more_pages(&self) -> bool {
6305 self.next_page.is_some()
6306 }
6307
6308 fn next_page_token(&self) -> Option<String> {
6309 self.next_page.clone()
6310 }
6311
6312 fn next_page(
6313 &self,
6314 req: reqwest::Request,
6315 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
6316 let mut req = req.try_clone().ok_or_else(|| {
6317 crate::types::error::Error::InvalidRequest(format!(
6318 "failed to clone request: {:?}",
6319 req
6320 ))
6321 })?;
6322 req.url_mut()
6323 .query_pairs_mut()
6324 .append_pair("next_page", self.next_page.as_deref().unwrap_or(""));
6325 Ok(req)
6326 }
6327
6328 fn items(&self) -> Vec<Self::Item> {
6329 self.items.clone()
6330 }
6331}
6332
6333#[cfg(feature = "tabled")]
6334impl tabled::Tabled for ExtendedUserResultsPage {
6335 const LENGTH: usize = 2;
6336 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6337 vec![
6338 format!("{:?}", self.items).into(),
6339 if let Some(next_page) = &self.next_page {
6340 format!("{:?}", next_page).into()
6341 } else {
6342 String::new().into()
6343 },
6344 ]
6345 }
6346
6347 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6348 vec!["items".into(), "next_page".into()]
6349 }
6350}
6351
6352#[doc = "The response from the `Extrude` endpoint."]
6353#[derive(
6354 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6355)]
6356pub struct Extrude {}
6357
6358impl std::fmt::Display for Extrude {
6359 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6360 write!(
6361 f,
6362 "{}",
6363 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6364 )
6365 }
6366}
6367
6368#[cfg(feature = "tabled")]
6369impl tabled::Tabled for Extrude {
6370 const LENGTH: usize = 0;
6371 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6372 vec![]
6373 }
6374
6375 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6376 vec![]
6377 }
6378}
6379
6380#[doc = "Extrusion method determining if the extrusion will be part of the existing object or an \
6381 entirely new object."]
6382#[derive(
6383 serde :: Serialize,
6384 serde :: Deserialize,
6385 PartialEq,
6386 Hash,
6387 Debug,
6388 Clone,
6389 schemars :: JsonSchema,
6390 parse_display :: FromStr,
6391 parse_display :: Display,
6392)]
6393#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
6394#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
6395pub enum ExtrudeMethod {
6396 #[doc = "Create a new object that is not connected to the object it is extruded from. This \
6397 will result in two objects after the operation."]
6398 #[serde(rename = "new")]
6399 #[display("new")]
6400 New,
6401 #[doc = "This extrusion will be part of object it is extruded from. This will result in one \
6402 object after the operation."]
6403 #[serde(rename = "merge")]
6404 #[display("merge")]
6405 Merge,
6406}
6407
6408#[doc = "IDs for the extruded faces."]
6409#[derive(
6410 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6411)]
6412pub struct ExtrudedFaceInfo {
6413 #[doc = "The face made from the original 2D shape being extruded. If the solid is extruded \
6414 from a shape which already has an ID (e.g. extruding something which was sketched on \
6415 a face), this doesn't need to be sent."]
6416 #[serde(default, skip_serializing_if = "Option::is_none")]
6417 pub bottom: Option<uuid::Uuid>,
6418 #[doc = "Any intermediate sides between the top and bottom."]
6419 pub sides: Vec<SideFace>,
6420 #[doc = "Top face of the extrusion (parallel and further away from the original 2D shape \
6421 being extruded)."]
6422 pub top: uuid::Uuid,
6423}
6424
6425impl std::fmt::Display for ExtrudedFaceInfo {
6426 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6427 write!(
6428 f,
6429 "{}",
6430 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6431 )
6432 }
6433}
6434
6435#[cfg(feature = "tabled")]
6436impl tabled::Tabled for ExtrudedFaceInfo {
6437 const LENGTH: usize = 3;
6438 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6439 vec![
6440 if let Some(bottom) = &self.bottom {
6441 format!("{:?}", bottom).into()
6442 } else {
6443 String::new().into()
6444 },
6445 format!("{:?}", self.sides).into(),
6446 format!("{:?}", self.top).into(),
6447 ]
6448 }
6449
6450 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6451 vec!["bottom".into(), "sides".into(), "top".into()]
6452 }
6453}
6454
6455#[doc = "Possible types of faces which can be extruded from a 3D solid."]
6456#[derive(
6457 serde :: Serialize,
6458 serde :: Deserialize,
6459 PartialEq,
6460 Hash,
6461 Debug,
6462 Clone,
6463 schemars :: JsonSchema,
6464 parse_display :: FromStr,
6465 parse_display :: Display,
6466)]
6467#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
6468#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
6469pub enum ExtrusionFaceCapType {
6470 #[doc = "Uncapped."]
6471 #[serde(rename = "none")]
6472 #[display("none")]
6473 None,
6474 #[doc = "Capped on top."]
6475 #[serde(rename = "top")]
6476 #[display("top")]
6477 Top,
6478 #[doc = "Capped below."]
6479 #[serde(rename = "bottom")]
6480 #[display("bottom")]
6481 Bottom,
6482 #[doc = "Capped on both ends."]
6483 #[serde(rename = "both")]
6484 #[display("both")]
6485 Both,
6486}
6487
6488#[doc = "Extrusion face info struct (useful for maintaining mappings between source path segment \
6489 ids and extrusion faces)"]
6490#[derive(
6491 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6492)]
6493pub struct ExtrusionFaceInfo {
6494 #[doc = "Whether or not this extrusion face is a top/bottom cap face or not. Note that \
6495 top/bottom cap faces will not have associated curve IDs."]
6496 pub cap: ExtrusionFaceCapType,
6497 #[doc = "Path component (curve) UUID."]
6498 #[serde(default, skip_serializing_if = "Option::is_none")]
6499 pub curve_id: Option<uuid::Uuid>,
6500 #[doc = "Face uuid."]
6501 #[serde(default, skip_serializing_if = "Option::is_none")]
6502 pub face_id: Option<uuid::Uuid>,
6503}
6504
6505impl std::fmt::Display for ExtrusionFaceInfo {
6506 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6507 write!(
6508 f,
6509 "{}",
6510 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6511 )
6512 }
6513}
6514
6515#[cfg(feature = "tabled")]
6516impl tabled::Tabled for ExtrusionFaceInfo {
6517 const LENGTH: usize = 3;
6518 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6519 vec![
6520 format!("{:?}", self.cap).into(),
6521 if let Some(curve_id) = &self.curve_id {
6522 format!("{:?}", curve_id).into()
6523 } else {
6524 String::new().into()
6525 },
6526 if let Some(face_id) = &self.face_id {
6527 format!("{:?}", face_id).into()
6528 } else {
6529 String::new().into()
6530 },
6531 ]
6532 }
6533
6534 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6535 vec!["cap".into(), "curve_id".into(), "face_id".into()]
6536 }
6537}
6538
6539#[doc = "Faces and edges id info (most used in identifying geometry in patterned and mirrored \
6540 objects)."]
6541#[derive(
6542 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6543)]
6544pub struct FaceEdgeInfo {
6545 #[doc = "The edges of each object."]
6546 pub edges: Vec<uuid::Uuid>,
6547 #[doc = "The faces of each object."]
6548 pub faces: Vec<uuid::Uuid>,
6549 #[doc = "The UUID of the object."]
6550 pub object_id: uuid::Uuid,
6551}
6552
6553impl std::fmt::Display for FaceEdgeInfo {
6554 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6555 write!(
6556 f,
6557 "{}",
6558 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6559 )
6560 }
6561}
6562
6563#[cfg(feature = "tabled")]
6564impl tabled::Tabled for FaceEdgeInfo {
6565 const LENGTH: usize = 3;
6566 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6567 vec![
6568 format!("{:?}", self.edges).into(),
6569 format!("{:?}", self.faces).into(),
6570 format!("{:?}", self.object_id).into(),
6571 ]
6572 }
6573
6574 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6575 vec!["edges".into(), "faces".into(), "object_id".into()]
6576 }
6577}
6578
6579#[doc = "The 3D center of mass on the surface"]
6580#[derive(
6581 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6582)]
6583pub struct FaceGetCenter {
6584 #[doc = "The 3D position on the surface center of mass"]
6585 pub pos: Point3D,
6586}
6587
6588impl std::fmt::Display for FaceGetCenter {
6589 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6590 write!(
6591 f,
6592 "{}",
6593 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6594 )
6595 }
6596}
6597
6598#[cfg(feature = "tabled")]
6599impl tabled::Tabled for FaceGetCenter {
6600 const LENGTH: usize = 1;
6601 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6602 vec![format!("{:?}", self.pos).into()]
6603 }
6604
6605 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6606 vec!["pos".into()]
6607 }
6608}
6609
6610#[doc = "The gradient (dFdu, dFdv) + normal vector on a brep face"]
6611#[derive(
6612 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6613)]
6614pub struct FaceGetGradient {
6615 #[doc = "dFdu"]
6616 pub df_du: Point3D,
6617 #[doc = "dFdv"]
6618 pub df_dv: Point3D,
6619 #[doc = "Normal (||dFdu x dFdv||)"]
6620 pub normal: Point3D,
6621}
6622
6623impl std::fmt::Display for FaceGetGradient {
6624 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6625 write!(
6626 f,
6627 "{}",
6628 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6629 )
6630 }
6631}
6632
6633#[cfg(feature = "tabled")]
6634impl tabled::Tabled for FaceGetGradient {
6635 const LENGTH: usize = 3;
6636 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6637 vec![
6638 format!("{:?}", self.df_du).into(),
6639 format!("{:?}", self.df_dv).into(),
6640 format!("{:?}", self.normal).into(),
6641 ]
6642 }
6643
6644 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6645 vec!["df_du".into(), "df_dv".into(), "normal".into()]
6646 }
6647}
6648
6649#[doc = "The 3D position on the surface that was evaluated"]
6650#[derive(
6651 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6652)]
6653pub struct FaceGetPosition {
6654 #[doc = "The 3D position on the surface that was evaluated"]
6655 pub pos: Point3D,
6656}
6657
6658impl std::fmt::Display for FaceGetPosition {
6659 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6660 write!(
6661 f,
6662 "{}",
6663 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6664 )
6665 }
6666}
6667
6668#[cfg(feature = "tabled")]
6669impl tabled::Tabled for FaceGetPosition {
6670 const LENGTH: usize = 1;
6671 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6672 vec![format!("{:?}", self.pos).into()]
6673 }
6674
6675 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6676 vec!["pos".into()]
6677 }
6678}
6679
6680#[doc = "Surface-local planar axes (if available)"]
6681#[derive(
6682 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6683)]
6684pub struct FaceIsPlanar {
6685 #[doc = "plane's origin"]
6686 #[serde(default, skip_serializing_if = "Option::is_none")]
6687 pub origin: Option<Point3D>,
6688 #[doc = "plane's local x-axis"]
6689 #[serde(default, skip_serializing_if = "Option::is_none")]
6690 pub x_axis: Option<Point3D>,
6691 #[doc = "plane's local y-axis"]
6692 #[serde(default, skip_serializing_if = "Option::is_none")]
6693 pub y_axis: Option<Point3D>,
6694 #[doc = "plane's local z-axis (normal)"]
6695 #[serde(default, skip_serializing_if = "Option::is_none")]
6696 pub z_axis: Option<Point3D>,
6697}
6698
6699impl std::fmt::Display for FaceIsPlanar {
6700 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6701 write!(
6702 f,
6703 "{}",
6704 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6705 )
6706 }
6707}
6708
6709#[cfg(feature = "tabled")]
6710impl tabled::Tabled for FaceIsPlanar {
6711 const LENGTH: usize = 4;
6712 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6713 vec![
6714 if let Some(origin) = &self.origin {
6715 format!("{:?}", origin).into()
6716 } else {
6717 String::new().into()
6718 },
6719 if let Some(x_axis) = &self.x_axis {
6720 format!("{:?}", x_axis).into()
6721 } else {
6722 String::new().into()
6723 },
6724 if let Some(y_axis) = &self.y_axis {
6725 format!("{:?}", y_axis).into()
6726 } else {
6727 String::new().into()
6728 },
6729 if let Some(z_axis) = &self.z_axis {
6730 format!("{:?}", z_axis).into()
6731 } else {
6732 String::new().into()
6733 },
6734 ]
6735 }
6736
6737 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6738 vec![
6739 "origin".into(),
6740 "x_axis".into(),
6741 "y_axis".into(),
6742 "z_axis".into(),
6743 ]
6744 }
6745}
6746
6747#[doc = "Unsuccessful Websocket response."]
6748#[derive(
6749 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6750)]
6751pub struct FailureWebSocketResponse {
6752 #[doc = "The errors that occurred."]
6753 pub errors: Vec<ApiError>,
6754 #[doc = "Which request this is a response to. If the request was a modeling command, this is \
6755 the modeling command ID. If no request ID was sent, this will be null."]
6756 #[serde(default, skip_serializing_if = "Option::is_none")]
6757 pub request_id: Option<uuid::Uuid>,
6758 #[doc = "Always false"]
6759 pub success: bool,
6760}
6761
6762impl std::fmt::Display for FailureWebSocketResponse {
6763 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6764 write!(
6765 f,
6766 "{}",
6767 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6768 )
6769 }
6770}
6771
6772#[cfg(feature = "tabled")]
6773impl tabled::Tabled for FailureWebSocketResponse {
6774 const LENGTH: usize = 3;
6775 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6776 vec![
6777 format!("{:?}", self.errors).into(),
6778 if let Some(request_id) = &self.request_id {
6779 format!("{:?}", request_id).into()
6780 } else {
6781 String::new().into()
6782 },
6783 format!("{:?}", self.success).into(),
6784 ]
6785 }
6786
6787 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6788 vec!["errors".into(), "request_id".into(), "success".into()]
6789 }
6790}
6791
6792#[doc = "Describes the storage format of an FBX file."]
6793#[derive(
6794 serde :: Serialize,
6795 serde :: Deserialize,
6796 PartialEq,
6797 Hash,
6798 Debug,
6799 Clone,
6800 schemars :: JsonSchema,
6801 parse_display :: FromStr,
6802 parse_display :: Display,
6803)]
6804#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
6805#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
6806pub enum FbxStorage {
6807 #[doc = "ASCII FBX encoding."]
6808 #[serde(rename = "ascii")]
6809 #[display("ascii")]
6810 Ascii,
6811 #[doc = "Binary FBX encoding."]
6812 #[serde(rename = "binary")]
6813 #[display("binary")]
6814 Binary,
6815}
6816
6817#[doc = "A file center of mass result."]
6818#[derive(
6819 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6820)]
6821pub struct FileCenterOfMass {
6822 #[doc = "The resulting center of mass."]
6823 #[serde(default, skip_serializing_if = "Option::is_none")]
6824 pub center_of_mass: Option<Point3D>,
6825 #[doc = "The time and date the API call was completed."]
6826 #[serde(default, skip_serializing_if = "Option::is_none")]
6827 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
6828 #[doc = "The time and date the API call was created."]
6829 pub created_at: chrono::DateTime<chrono::Utc>,
6830 #[doc = "The error the function returned, if any."]
6831 #[serde(default, skip_serializing_if = "Option::is_none")]
6832 pub error: Option<String>,
6833 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
6834 pub id: uuid::Uuid,
6835 #[doc = "The output unit for the center of mass."]
6836 pub output_unit: UnitLength,
6837 #[doc = "The source format of the file."]
6838 pub src_format: FileImportFormat,
6839 #[doc = "The time and date the API call was started."]
6840 #[serde(default, skip_serializing_if = "Option::is_none")]
6841 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
6842 #[doc = "The status of the API call."]
6843 pub status: ApiCallStatus,
6844 #[doc = "The time and date the API call was last updated."]
6845 pub updated_at: chrono::DateTime<chrono::Utc>,
6846 #[doc = "The user ID of the user who created the API call."]
6847 pub user_id: uuid::Uuid,
6848}
6849
6850impl std::fmt::Display for FileCenterOfMass {
6851 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6852 write!(
6853 f,
6854 "{}",
6855 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6856 )
6857 }
6858}
6859
6860#[cfg(feature = "tabled")]
6861impl tabled::Tabled for FileCenterOfMass {
6862 const LENGTH: usize = 11;
6863 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6864 vec![
6865 if let Some(center_of_mass) = &self.center_of_mass {
6866 format!("{:?}", center_of_mass).into()
6867 } else {
6868 String::new().into()
6869 },
6870 if let Some(completed_at) = &self.completed_at {
6871 format!("{:?}", completed_at).into()
6872 } else {
6873 String::new().into()
6874 },
6875 format!("{:?}", self.created_at).into(),
6876 if let Some(error) = &self.error {
6877 format!("{:?}", error).into()
6878 } else {
6879 String::new().into()
6880 },
6881 format!("{:?}", self.id).into(),
6882 format!("{:?}", self.output_unit).into(),
6883 format!("{:?}", self.src_format).into(),
6884 if let Some(started_at) = &self.started_at {
6885 format!("{:?}", started_at).into()
6886 } else {
6887 String::new().into()
6888 },
6889 format!("{:?}", self.status).into(),
6890 format!("{:?}", self.updated_at).into(),
6891 format!("{:?}", self.user_id).into(),
6892 ]
6893 }
6894
6895 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
6896 vec![
6897 "center_of_mass".into(),
6898 "completed_at".into(),
6899 "created_at".into(),
6900 "error".into(),
6901 "id".into(),
6902 "output_unit".into(),
6903 "src_format".into(),
6904 "started_at".into(),
6905 "status".into(),
6906 "updated_at".into(),
6907 "user_id".into(),
6908 ]
6909 }
6910}
6911
6912#[doc = "A file conversion."]
6913#[derive(
6914 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
6915)]
6916pub struct FileConversion {
6917 #[doc = "The time and date the API call was completed."]
6918 #[serde(default, skip_serializing_if = "Option::is_none")]
6919 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
6920 #[doc = "The time and date the API call was created."]
6921 pub created_at: chrono::DateTime<chrono::Utc>,
6922 #[doc = "The error the function returned, if any."]
6923 #[serde(default, skip_serializing_if = "Option::is_none")]
6924 pub error: Option<String>,
6925 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
6926 pub id: uuid::Uuid,
6927 #[doc = "The output format of the file conversion."]
6928 pub output_format: FileExportFormat,
6929 #[doc = "The output format options of the file conversion."]
6930 #[serde(default, skip_serializing_if = "Option::is_none")]
6931 pub output_format_options: Option<OutputFormat3D>,
6932 #[doc = "The converted files (if multiple file conversion), if completed, base64 encoded. The \
6933 key of the map is the path of the output file."]
6934 #[serde(default, skip_serializing_if = "Option::is_none")]
6935 pub outputs: Option<std::collections::HashMap<String, base64::Base64Data>>,
6936 #[doc = "The source format of the file conversion."]
6937 pub src_format: FileImportFormat,
6938 #[doc = "The source format options of the file conversion."]
6939 #[serde(default, skip_serializing_if = "Option::is_none")]
6940 pub src_format_options: Option<InputFormat3D>,
6941 #[doc = "The time and date the API call was started."]
6942 #[serde(default, skip_serializing_if = "Option::is_none")]
6943 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
6944 #[doc = "The status of the API call."]
6945 pub status: ApiCallStatus,
6946 #[doc = "The time and date the API call was last updated."]
6947 pub updated_at: chrono::DateTime<chrono::Utc>,
6948 #[doc = "The user ID of the user who created the API call."]
6949 pub user_id: uuid::Uuid,
6950}
6951
6952impl std::fmt::Display for FileConversion {
6953 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
6954 write!(
6955 f,
6956 "{}",
6957 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
6958 )
6959 }
6960}
6961
6962#[cfg(feature = "tabled")]
6963impl tabled::Tabled for FileConversion {
6964 const LENGTH: usize = 13;
6965 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
6966 vec![
6967 if let Some(completed_at) = &self.completed_at {
6968 format!("{:?}", completed_at).into()
6969 } else {
6970 String::new().into()
6971 },
6972 format!("{:?}", self.created_at).into(),
6973 if let Some(error) = &self.error {
6974 format!("{:?}", error).into()
6975 } else {
6976 String::new().into()
6977 },
6978 format!("{:?}", self.id).into(),
6979 format!("{:?}", self.output_format).into(),
6980 if let Some(output_format_options) = &self.output_format_options {
6981 format!("{:?}", output_format_options).into()
6982 } else {
6983 String::new().into()
6984 },
6985 if let Some(outputs) = &self.outputs {
6986 format!("{:?}", outputs).into()
6987 } else {
6988 String::new().into()
6989 },
6990 format!("{:?}", self.src_format).into(),
6991 if let Some(src_format_options) = &self.src_format_options {
6992 format!("{:?}", src_format_options).into()
6993 } else {
6994 String::new().into()
6995 },
6996 if let Some(started_at) = &self.started_at {
6997 format!("{:?}", started_at).into()
6998 } else {
6999 String::new().into()
7000 },
7001 format!("{:?}", self.status).into(),
7002 format!("{:?}", self.updated_at).into(),
7003 format!("{:?}", self.user_id).into(),
7004 ]
7005 }
7006
7007 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7008 vec![
7009 "completed_at".into(),
7010 "created_at".into(),
7011 "error".into(),
7012 "id".into(),
7013 "output_format".into(),
7014 "output_format_options".into(),
7015 "outputs".into(),
7016 "src_format".into(),
7017 "src_format_options".into(),
7018 "started_at".into(),
7019 "status".into(),
7020 "updated_at".into(),
7021 "user_id".into(),
7022 ]
7023 }
7024}
7025
7026#[doc = "A file density result."]
7027#[derive(
7028 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7029)]
7030pub struct FileDensity {
7031 #[doc = "The time and date the API call was completed."]
7032 #[serde(default, skip_serializing_if = "Option::is_none")]
7033 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
7034 #[doc = "The time and date the API call was created."]
7035 pub created_at: chrono::DateTime<chrono::Utc>,
7036 #[doc = "The resulting density."]
7037 #[serde(default, skip_serializing_if = "Option::is_none")]
7038 pub density: Option<f64>,
7039 #[doc = "The error the function returned, if any."]
7040 #[serde(default, skip_serializing_if = "Option::is_none")]
7041 pub error: Option<String>,
7042 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
7043 pub id: uuid::Uuid,
7044 #[doc = "The material mass as denoted by the user."]
7045 #[serde(default, skip_serializing_if = "Option::is_none")]
7046 pub material_mass: Option<f64>,
7047 #[doc = "The material mass unit."]
7048 pub material_mass_unit: UnitMass,
7049 #[doc = "The output unit for the density."]
7050 pub output_unit: UnitDensity,
7051 #[doc = "The source format of the file."]
7052 pub src_format: FileImportFormat,
7053 #[doc = "The time and date the API call was started."]
7054 #[serde(default, skip_serializing_if = "Option::is_none")]
7055 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
7056 #[doc = "The status of the API call."]
7057 pub status: ApiCallStatus,
7058 #[doc = "The time and date the API call was last updated."]
7059 pub updated_at: chrono::DateTime<chrono::Utc>,
7060 #[doc = "The user ID of the user who created the API call."]
7061 pub user_id: uuid::Uuid,
7062}
7063
7064impl std::fmt::Display for FileDensity {
7065 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7066 write!(
7067 f,
7068 "{}",
7069 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7070 )
7071 }
7072}
7073
7074#[cfg(feature = "tabled")]
7075impl tabled::Tabled for FileDensity {
7076 const LENGTH: usize = 13;
7077 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7078 vec![
7079 if let Some(completed_at) = &self.completed_at {
7080 format!("{:?}", completed_at).into()
7081 } else {
7082 String::new().into()
7083 },
7084 format!("{:?}", self.created_at).into(),
7085 if let Some(density) = &self.density {
7086 format!("{:?}", density).into()
7087 } else {
7088 String::new().into()
7089 },
7090 if let Some(error) = &self.error {
7091 format!("{:?}", error).into()
7092 } else {
7093 String::new().into()
7094 },
7095 format!("{:?}", self.id).into(),
7096 if let Some(material_mass) = &self.material_mass {
7097 format!("{:?}", material_mass).into()
7098 } else {
7099 String::new().into()
7100 },
7101 format!("{:?}", self.material_mass_unit).into(),
7102 format!("{:?}", self.output_unit).into(),
7103 format!("{:?}", self.src_format).into(),
7104 if let Some(started_at) = &self.started_at {
7105 format!("{:?}", started_at).into()
7106 } else {
7107 String::new().into()
7108 },
7109 format!("{:?}", self.status).into(),
7110 format!("{:?}", self.updated_at).into(),
7111 format!("{:?}", self.user_id).into(),
7112 ]
7113 }
7114
7115 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7116 vec![
7117 "completed_at".into(),
7118 "created_at".into(),
7119 "density".into(),
7120 "error".into(),
7121 "id".into(),
7122 "material_mass".into(),
7123 "material_mass_unit".into(),
7124 "output_unit".into(),
7125 "src_format".into(),
7126 "started_at".into(),
7127 "status".into(),
7128 "updated_at".into(),
7129 "user_id".into(),
7130 ]
7131 }
7132}
7133
7134#[doc = "The valid types of output file formats."]
7135#[derive(
7136 serde :: Serialize,
7137 serde :: Deserialize,
7138 PartialEq,
7139 Hash,
7140 Debug,
7141 Clone,
7142 schemars :: JsonSchema,
7143 parse_display :: FromStr,
7144 parse_display :: Display,
7145)]
7146#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
7147#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
7148pub enum FileExportFormat {
7149 #[doc = "Autodesk Filmbox (FBX) format. <https://en.wikipedia.org/wiki/FBX>"]
7150 #[serde(rename = "fbx")]
7151 #[display("fbx")]
7152 Fbx,
7153 #[doc = "Binary glTF 2.0.\n\nThis is a single binary with .glb extension.\n\nThis is better \
7154 if you want a compressed format as opposed to the human readable glTF that lacks \
7155 compression."]
7156 #[serde(rename = "glb")]
7157 #[display("glb")]
7158 Glb,
7159 #[doc = "glTF 2.0. Embedded glTF 2.0 (pretty printed).\n\nSingle JSON file with .gltf \
7160 extension binary data encoded as base64 data URIs.\n\nThe JSON contents are pretty \
7161 printed.\n\nIt is human readable, single file, and you can view the diff easily in a \
7162 git commit."]
7163 #[serde(rename = "gltf")]
7164 #[display("gltf")]
7165 Gltf,
7166 #[doc = "The OBJ file format. <https://en.wikipedia.org/wiki/Wavefront_.obj_file> It may or \
7167 may not have an an attached material (mtl // mtllib) within the file, but we \
7168 interact with it as if it does not."]
7169 #[serde(rename = "obj")]
7170 #[display("obj")]
7171 Obj,
7172 #[doc = "The PLY file format. <https://en.wikipedia.org/wiki/PLY_(file_format)>"]
7173 #[serde(rename = "ply")]
7174 #[display("ply")]
7175 Ply,
7176 #[doc = "The STEP file format. <https://en.wikipedia.org/wiki/ISO_10303-21>"]
7177 #[serde(rename = "step")]
7178 #[display("step")]
7179 Step,
7180 #[doc = "The STL file format. <https://en.wikipedia.org/wiki/STL_(file_format)>"]
7181 #[serde(rename = "stl")]
7182 #[display("stl")]
7183 Stl,
7184}
7185
7186#[doc = "The valid types of source file formats."]
7187#[derive(
7188 serde :: Serialize,
7189 serde :: Deserialize,
7190 PartialEq,
7191 Hash,
7192 Debug,
7193 Clone,
7194 schemars :: JsonSchema,
7195 parse_display :: FromStr,
7196 parse_display :: Display,
7197)]
7198#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
7199#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
7200pub enum FileImportFormat {
7201 #[doc = "Autodesk Filmbox (FBX) format. <https://en.wikipedia.org/wiki/FBX>"]
7202 #[serde(rename = "fbx")]
7203 #[display("fbx")]
7204 Fbx,
7205 #[doc = "glTF 2.0."]
7206 #[serde(rename = "gltf")]
7207 #[display("gltf")]
7208 Gltf,
7209 #[doc = "The OBJ file format. <https://en.wikipedia.org/wiki/Wavefront_.obj_file> It may or \
7210 may not have an an attached material (mtl // mtllib) within the file, but we \
7211 interact with it as if it does not."]
7212 #[serde(rename = "obj")]
7213 #[display("obj")]
7214 Obj,
7215 #[doc = "The PLY file format. <https://en.wikipedia.org/wiki/PLY_(file_format)>"]
7216 #[serde(rename = "ply")]
7217 #[display("ply")]
7218 Ply,
7219 #[doc = "SolidWorks part (SLDPRT) format."]
7220 #[serde(rename = "sldprt")]
7221 #[display("sldprt")]
7222 Sldprt,
7223 #[doc = "The STEP file format. <https://en.wikipedia.org/wiki/ISO_10303-21>"]
7224 #[serde(rename = "step")]
7225 #[display("step")]
7226 Step,
7227 #[doc = "The STL file format. <https://en.wikipedia.org/wiki/STL_(file_format)>"]
7228 #[serde(rename = "stl")]
7229 #[display("stl")]
7230 Stl,
7231}
7232
7233#[doc = "A file mass result."]
7234#[derive(
7235 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7236)]
7237pub struct FileMass {
7238 #[doc = "The time and date the API call was completed."]
7239 #[serde(default, skip_serializing_if = "Option::is_none")]
7240 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
7241 #[doc = "The time and date the API call was created."]
7242 pub created_at: chrono::DateTime<chrono::Utc>,
7243 #[doc = "The error the function returned, if any."]
7244 #[serde(default, skip_serializing_if = "Option::is_none")]
7245 pub error: Option<String>,
7246 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
7247 pub id: uuid::Uuid,
7248 #[doc = "The resulting mass."]
7249 #[serde(default, skip_serializing_if = "Option::is_none")]
7250 pub mass: Option<f64>,
7251 #[doc = "The material density as denoted by the user."]
7252 #[serde(default, skip_serializing_if = "Option::is_none")]
7253 pub material_density: Option<f64>,
7254 #[doc = "The material density unit."]
7255 pub material_density_unit: UnitDensity,
7256 #[doc = "The output unit for the mass."]
7257 pub output_unit: UnitMass,
7258 #[doc = "The source format of the file."]
7259 pub src_format: FileImportFormat,
7260 #[doc = "The time and date the API call was started."]
7261 #[serde(default, skip_serializing_if = "Option::is_none")]
7262 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
7263 #[doc = "The status of the API call."]
7264 pub status: ApiCallStatus,
7265 #[doc = "The time and date the API call was last updated."]
7266 pub updated_at: chrono::DateTime<chrono::Utc>,
7267 #[doc = "The user ID of the user who created the API call."]
7268 pub user_id: uuid::Uuid,
7269}
7270
7271impl std::fmt::Display for FileMass {
7272 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7273 write!(
7274 f,
7275 "{}",
7276 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7277 )
7278 }
7279}
7280
7281#[cfg(feature = "tabled")]
7282impl tabled::Tabled for FileMass {
7283 const LENGTH: usize = 13;
7284 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7285 vec![
7286 if let Some(completed_at) = &self.completed_at {
7287 format!("{:?}", completed_at).into()
7288 } else {
7289 String::new().into()
7290 },
7291 format!("{:?}", self.created_at).into(),
7292 if let Some(error) = &self.error {
7293 format!("{:?}", error).into()
7294 } else {
7295 String::new().into()
7296 },
7297 format!("{:?}", self.id).into(),
7298 if let Some(mass) = &self.mass {
7299 format!("{:?}", mass).into()
7300 } else {
7301 String::new().into()
7302 },
7303 if let Some(material_density) = &self.material_density {
7304 format!("{:?}", material_density).into()
7305 } else {
7306 String::new().into()
7307 },
7308 format!("{:?}", self.material_density_unit).into(),
7309 format!("{:?}", self.output_unit).into(),
7310 format!("{:?}", self.src_format).into(),
7311 if let Some(started_at) = &self.started_at {
7312 format!("{:?}", started_at).into()
7313 } else {
7314 String::new().into()
7315 },
7316 format!("{:?}", self.status).into(),
7317 format!("{:?}", self.updated_at).into(),
7318 format!("{:?}", self.user_id).into(),
7319 ]
7320 }
7321
7322 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7323 vec![
7324 "completed_at".into(),
7325 "created_at".into(),
7326 "error".into(),
7327 "id".into(),
7328 "mass".into(),
7329 "material_density".into(),
7330 "material_density_unit".into(),
7331 "output_unit".into(),
7332 "src_format".into(),
7333 "started_at".into(),
7334 "status".into(),
7335 "updated_at".into(),
7336 "user_id".into(),
7337 ]
7338 }
7339}
7340
7341#[doc = "A file surface area result."]
7342#[derive(
7343 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7344)]
7345pub struct FileSurfaceArea {
7346 #[doc = "The time and date the API call was completed."]
7347 #[serde(default, skip_serializing_if = "Option::is_none")]
7348 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
7349 #[doc = "The time and date the API call was created."]
7350 pub created_at: chrono::DateTime<chrono::Utc>,
7351 #[doc = "The error the function returned, if any."]
7352 #[serde(default, skip_serializing_if = "Option::is_none")]
7353 pub error: Option<String>,
7354 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
7355 pub id: uuid::Uuid,
7356 #[doc = "The output unit for the surface area."]
7357 pub output_unit: UnitArea,
7358 #[doc = "The source format of the file."]
7359 pub src_format: FileImportFormat,
7360 #[doc = "The time and date the API call was started."]
7361 #[serde(default, skip_serializing_if = "Option::is_none")]
7362 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
7363 #[doc = "The status of the API call."]
7364 pub status: ApiCallStatus,
7365 #[doc = "The resulting surface area."]
7366 #[serde(default, skip_serializing_if = "Option::is_none")]
7367 pub surface_area: Option<f64>,
7368 #[doc = "The time and date the API call was last updated."]
7369 pub updated_at: chrono::DateTime<chrono::Utc>,
7370 #[doc = "The user ID of the user who created the API call."]
7371 pub user_id: uuid::Uuid,
7372}
7373
7374impl std::fmt::Display for FileSurfaceArea {
7375 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7376 write!(
7377 f,
7378 "{}",
7379 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7380 )
7381 }
7382}
7383
7384#[cfg(feature = "tabled")]
7385impl tabled::Tabled for FileSurfaceArea {
7386 const LENGTH: usize = 11;
7387 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7388 vec![
7389 if let Some(completed_at) = &self.completed_at {
7390 format!("{:?}", completed_at).into()
7391 } else {
7392 String::new().into()
7393 },
7394 format!("{:?}", self.created_at).into(),
7395 if let Some(error) = &self.error {
7396 format!("{:?}", error).into()
7397 } else {
7398 String::new().into()
7399 },
7400 format!("{:?}", self.id).into(),
7401 format!("{:?}", self.output_unit).into(),
7402 format!("{:?}", self.src_format).into(),
7403 if let Some(started_at) = &self.started_at {
7404 format!("{:?}", started_at).into()
7405 } else {
7406 String::new().into()
7407 },
7408 format!("{:?}", self.status).into(),
7409 if let Some(surface_area) = &self.surface_area {
7410 format!("{:?}", surface_area).into()
7411 } else {
7412 String::new().into()
7413 },
7414 format!("{:?}", self.updated_at).into(),
7415 format!("{:?}", self.user_id).into(),
7416 ]
7417 }
7418
7419 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7420 vec![
7421 "completed_at".into(),
7422 "created_at".into(),
7423 "error".into(),
7424 "id".into(),
7425 "output_unit".into(),
7426 "src_format".into(),
7427 "started_at".into(),
7428 "status".into(),
7429 "surface_area".into(),
7430 "updated_at".into(),
7431 "user_id".into(),
7432 ]
7433 }
7434}
7435
7436#[doc = "A file volume result."]
7437#[derive(
7438 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7439)]
7440pub struct FileVolume {
7441 #[doc = "The time and date the API call was completed."]
7442 #[serde(default, skip_serializing_if = "Option::is_none")]
7443 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
7444 #[doc = "The time and date the API call was created."]
7445 pub created_at: chrono::DateTime<chrono::Utc>,
7446 #[doc = "The error the function returned, if any."]
7447 #[serde(default, skip_serializing_if = "Option::is_none")]
7448 pub error: Option<String>,
7449 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
7450 pub id: uuid::Uuid,
7451 #[doc = "The output unit for the volume."]
7452 pub output_unit: UnitVolume,
7453 #[doc = "The source format of the file."]
7454 pub src_format: FileImportFormat,
7455 #[doc = "The time and date the API call was started."]
7456 #[serde(default, skip_serializing_if = "Option::is_none")]
7457 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
7458 #[doc = "The status of the API call."]
7459 pub status: ApiCallStatus,
7460 #[doc = "The time and date the API call was last updated."]
7461 pub updated_at: chrono::DateTime<chrono::Utc>,
7462 #[doc = "The user ID of the user who created the API call."]
7463 pub user_id: uuid::Uuid,
7464 #[doc = "The resulting volume."]
7465 #[serde(default, skip_serializing_if = "Option::is_none")]
7466 pub volume: Option<f64>,
7467}
7468
7469impl std::fmt::Display for FileVolume {
7470 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7471 write!(
7472 f,
7473 "{}",
7474 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7475 )
7476 }
7477}
7478
7479#[cfg(feature = "tabled")]
7480impl tabled::Tabled for FileVolume {
7481 const LENGTH: usize = 11;
7482 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7483 vec![
7484 if let Some(completed_at) = &self.completed_at {
7485 format!("{:?}", completed_at).into()
7486 } else {
7487 String::new().into()
7488 },
7489 format!("{:?}", self.created_at).into(),
7490 if let Some(error) = &self.error {
7491 format!("{:?}", error).into()
7492 } else {
7493 String::new().into()
7494 },
7495 format!("{:?}", self.id).into(),
7496 format!("{:?}", self.output_unit).into(),
7497 format!("{:?}", self.src_format).into(),
7498 if let Some(started_at) = &self.started_at {
7499 format!("{:?}", started_at).into()
7500 } else {
7501 String::new().into()
7502 },
7503 format!("{:?}", self.status).into(),
7504 format!("{:?}", self.updated_at).into(),
7505 format!("{:?}", self.user_id).into(),
7506 if let Some(volume) = &self.volume {
7507 format!("{:?}", volume).into()
7508 } else {
7509 String::new().into()
7510 },
7511 ]
7512 }
7513
7514 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7515 vec![
7516 "completed_at".into(),
7517 "created_at".into(),
7518 "error".into(),
7519 "id".into(),
7520 "output_unit".into(),
7521 "src_format".into(),
7522 "started_at".into(),
7523 "status".into(),
7524 "updated_at".into(),
7525 "user_id".into(),
7526 "volume".into(),
7527 ]
7528 }
7529}
7530
7531#[doc = "The response from the `GetEntityType` command."]
7532#[derive(
7533 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7534)]
7535pub struct GetEntityType {
7536 #[doc = "The type of the entity."]
7537 pub entity_type: EntityType,
7538}
7539
7540impl std::fmt::Display for GetEntityType {
7541 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7542 write!(
7543 f,
7544 "{}",
7545 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7546 )
7547 }
7548}
7549
7550#[cfg(feature = "tabled")]
7551impl tabled::Tabled for GetEntityType {
7552 const LENGTH: usize = 1;
7553 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7554 vec![format!("{:?}", self.entity_type).into()]
7555 }
7556
7557 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7558 vec!["entity_type".into()]
7559 }
7560}
7561
7562#[doc = "The response from the `GetNumObjects` command."]
7563#[derive(
7564 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7565)]
7566pub struct GetNumObjects {
7567 #[doc = "The number of objects in the scene."]
7568 pub num_objects: u32,
7569}
7570
7571impl std::fmt::Display for GetNumObjects {
7572 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7573 write!(
7574 f,
7575 "{}",
7576 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7577 )
7578 }
7579}
7580
7581#[cfg(feature = "tabled")]
7582impl tabled::Tabled for GetNumObjects {
7583 const LENGTH: usize = 1;
7584 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7585 vec![format!("{:?}", self.num_objects).into()]
7586 }
7587
7588 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7589 vec!["num_objects".into()]
7590 }
7591}
7592
7593#[doc = "The plane for sketch mode."]
7594#[derive(
7595 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7596)]
7597pub struct GetSketchModePlane {
7598 #[doc = "The origin."]
7599 pub origin: Point3D,
7600 #[doc = "The x axis."]
7601 pub x_axis: Point3D,
7602 #[doc = "The y axis."]
7603 pub y_axis: Point3D,
7604 #[doc = "The z axis (normal)."]
7605 pub z_axis: Point3D,
7606}
7607
7608impl std::fmt::Display for GetSketchModePlane {
7609 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7610 write!(
7611 f,
7612 "{}",
7613 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7614 )
7615 }
7616}
7617
7618#[cfg(feature = "tabled")]
7619impl tabled::Tabled for GetSketchModePlane {
7620 const LENGTH: usize = 4;
7621 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7622 vec![
7623 format!("{:?}", self.origin).into(),
7624 format!("{:?}", self.x_axis).into(),
7625 format!("{:?}", self.y_axis).into(),
7626 format!("{:?}", self.z_axis).into(),
7627 ]
7628 }
7629
7630 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7631 vec![
7632 "origin".into(),
7633 "x_axis".into(),
7634 "y_axis".into(),
7635 "z_axis".into(),
7636 ]
7637 }
7638}
7639
7640#[doc = "The global axes."]
7641#[derive(
7642 serde :: Serialize,
7643 serde :: Deserialize,
7644 PartialEq,
7645 Hash,
7646 Debug,
7647 Clone,
7648 schemars :: JsonSchema,
7649 parse_display :: FromStr,
7650 parse_display :: Display,
7651)]
7652#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
7653#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
7654pub enum GlobalAxis {
7655 #[doc = "The X axis"]
7656 #[serde(rename = "x")]
7657 #[display("x")]
7658 X,
7659 #[doc = "The Y axis"]
7660 #[serde(rename = "y")]
7661 #[display("y")]
7662 Y,
7663 #[doc = "The Z axis"]
7664 #[serde(rename = "z")]
7665 #[display("z")]
7666 Z,
7667}
7668
7669#[doc = "Describes the presentation style of the glTF JSON."]
7670#[derive(
7671 serde :: Serialize,
7672 serde :: Deserialize,
7673 PartialEq,
7674 Hash,
7675 Debug,
7676 Clone,
7677 schemars :: JsonSchema,
7678 parse_display :: FromStr,
7679 parse_display :: Display,
7680)]
7681#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
7682#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
7683pub enum GltfPresentation {
7684 #[doc = "Condense the JSON into the smallest possible size."]
7685 #[serde(rename = "compact")]
7686 #[display("compact")]
7687 Compact,
7688 #[doc = "Expand the JSON into a more human readable format.\n\nThis is the default setting."]
7689 #[serde(rename = "pretty")]
7690 #[display("pretty")]
7691 Pretty,
7692}
7693
7694#[doc = "Describes the storage format of a glTF 2.0 scene."]
7695#[derive(
7696 serde :: Serialize,
7697 serde :: Deserialize,
7698 PartialEq,
7699 Hash,
7700 Debug,
7701 Clone,
7702 schemars :: JsonSchema,
7703 parse_display :: FromStr,
7704 parse_display :: Display,
7705)]
7706#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
7707#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
7708pub enum GltfStorage {
7709 #[doc = "Binary glTF 2.0.\n\nThis is a single binary with .glb extension."]
7710 #[serde(rename = "binary")]
7711 #[display("binary")]
7712 Binary,
7713 #[doc = "Standard glTF 2.0.\n\nThis is a JSON file with .gltf extension paired with a \
7714 separate binary blob file with .bin extension."]
7715 #[serde(rename = "standard")]
7716 #[display("standard")]
7717 Standard,
7718 #[doc = "Embedded glTF 2.0.\n\nSingle JSON file with .gltf extension binary data encoded as \
7719 base64 data URIs.\n\nThis is the default setting."]
7720 #[serde(rename = "embedded")]
7721 #[display("embedded")]
7722 Embedded,
7723}
7724
7725#[doc = "The response from the `HandleMouseDragEnd` endpoint."]
7726#[derive(
7727 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7728)]
7729pub struct HandleMouseDragEnd {}
7730
7731impl std::fmt::Display for HandleMouseDragEnd {
7732 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7733 write!(
7734 f,
7735 "{}",
7736 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7737 )
7738 }
7739}
7740
7741#[cfg(feature = "tabled")]
7742impl tabled::Tabled for HandleMouseDragEnd {
7743 const LENGTH: usize = 0;
7744 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7745 vec![]
7746 }
7747
7748 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7749 vec![]
7750 }
7751}
7752
7753#[doc = "The response from the `HandleMouseDragMove` endpoint."]
7754#[derive(
7755 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7756)]
7757pub struct HandleMouseDragMove {}
7758
7759impl std::fmt::Display for HandleMouseDragMove {
7760 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7761 write!(
7762 f,
7763 "{}",
7764 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7765 )
7766 }
7767}
7768
7769#[cfg(feature = "tabled")]
7770impl tabled::Tabled for HandleMouseDragMove {
7771 const LENGTH: usize = 0;
7772 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7773 vec![]
7774 }
7775
7776 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7777 vec![]
7778 }
7779}
7780
7781#[doc = "The response from the `HandleMouseDragStart` endpoint."]
7782#[derive(
7783 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7784)]
7785pub struct HandleMouseDragStart {}
7786
7787impl std::fmt::Display for HandleMouseDragStart {
7788 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7789 write!(
7790 f,
7791 "{}",
7792 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7793 )
7794 }
7795}
7796
7797#[cfg(feature = "tabled")]
7798impl tabled::Tabled for HandleMouseDragStart {
7799 const LENGTH: usize = 0;
7800 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7801 vec![]
7802 }
7803
7804 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7805 vec![]
7806 }
7807}
7808
7809#[doc = "The response from the `HighlightSetEntities` endpoint."]
7810#[derive(
7811 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7812)]
7813pub struct HighlightSetEntities {}
7814
7815impl std::fmt::Display for HighlightSetEntities {
7816 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7817 write!(
7818 f,
7819 "{}",
7820 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7821 )
7822 }
7823}
7824
7825#[cfg(feature = "tabled")]
7826impl tabled::Tabled for HighlightSetEntities {
7827 const LENGTH: usize = 0;
7828 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7829 vec![]
7830 }
7831
7832 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7833 vec![]
7834 }
7835}
7836
7837#[doc = "The response from the `HighlightSetEntity` command."]
7838#[derive(
7839 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7840)]
7841pub struct HighlightSetEntity {
7842 #[doc = "The UUID of the entity that was highlighted."]
7843 #[serde(default, skip_serializing_if = "Option::is_none")]
7844 pub entity_id: Option<uuid::Uuid>,
7845 #[doc = "If the client sent a sequence ID with its request, the backend sends it back."]
7846 #[serde(default, skip_serializing_if = "Option::is_none")]
7847 pub sequence: Option<u32>,
7848}
7849
7850impl std::fmt::Display for HighlightSetEntity {
7851 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7852 write!(
7853 f,
7854 "{}",
7855 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7856 )
7857 }
7858}
7859
7860#[cfg(feature = "tabled")]
7861impl tabled::Tabled for HighlightSetEntity {
7862 const LENGTH: usize = 2;
7863 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7864 vec![
7865 if let Some(entity_id) = &self.entity_id {
7866 format!("{:?}", entity_id).into()
7867 } else {
7868 String::new().into()
7869 },
7870 if let Some(sequence) = &self.sequence {
7871 format!("{:?}", sequence).into()
7872 } else {
7873 String::new().into()
7874 },
7875 ]
7876 }
7877
7878 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7879 vec!["entity_id".into(), "sequence".into()]
7880 }
7881}
7882
7883#[doc = "Representation of an ICE server used for STUN/TURN Used to initiate WebRTC connections based on <https://developer.mozilla.org/en-US/docs/Web/API/RTCIceServer>"]
7884#[derive(
7885 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7886)]
7887pub struct IceServer {
7888 #[doc = "Credentials for a given TURN server."]
7889 #[serde(default, skip_serializing_if = "Option::is_none")]
7890 pub credential: Option<String>,
7891 #[doc = "URLs for a given STUN/TURN server. IceServer urls can either be a string or an array \
7892 of strings But, we choose to always convert to an array of strings for consistency"]
7893 pub urls: Vec<String>,
7894 #[doc = "Username for a given TURN server."]
7895 #[serde(default, skip_serializing_if = "Option::is_none")]
7896 pub username: Option<String>,
7897}
7898
7899impl std::fmt::Display for IceServer {
7900 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7901 write!(
7902 f,
7903 "{}",
7904 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
7905 )
7906 }
7907}
7908
7909#[cfg(feature = "tabled")]
7910impl tabled::Tabled for IceServer {
7911 const LENGTH: usize = 3;
7912 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
7913 vec![
7914 if let Some(credential) = &self.credential {
7915 format!("{:?}", credential).into()
7916 } else {
7917 String::new().into()
7918 },
7919 format!("{:?}", self.urls).into(),
7920 if let Some(username) = &self.username {
7921 format!("{:?}", username).into()
7922 } else {
7923 String::new().into()
7924 },
7925 ]
7926 }
7927
7928 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
7929 vec!["credential".into(), "urls".into(), "username".into()]
7930 }
7931}
7932
7933#[doc = "The source of an identity provider metadata descriptor."]
7934#[derive(
7935 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7936)]
7937#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
7938#[serde(tag = "type")]
7939pub enum IdpMetadataSource {
7940 #[doc = "A URL to the identity provider metadata descriptor."]
7941 #[serde(rename = "url")]
7942 Url {
7943 #[doc = "The URL of the identity provider metadata descriptor."]
7944 url: String,
7945 },
7946 #[doc = "A base64 encoded XML document containing the identity provider metadata descriptor."]
7947 #[serde(rename = "base64_encoded_xml")]
7948 Base64EncodedXml {
7949 #[doc = "The base64 encoded XML document containing the identity provider metadata \
7950 descriptor."]
7951 data: base64::Base64Data,
7952 },
7953}
7954
7955#[doc = "Enum containing the variety of image formats snapshots may be exported to."]
7956#[derive(
7957 serde :: Serialize,
7958 serde :: Deserialize,
7959 PartialEq,
7960 Hash,
7961 Debug,
7962 Clone,
7963 schemars :: JsonSchema,
7964 parse_display :: FromStr,
7965 parse_display :: Display,
7966)]
7967#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
7968#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
7969pub enum ImageFormat {
7970 #[doc = ".png format"]
7971 #[serde(rename = "png")]
7972 #[display("png")]
7973 Png,
7974 #[doc = ".jpeg format"]
7975 #[serde(rename = "jpeg")]
7976 #[display("jpeg")]
7977 Jpeg,
7978}
7979
7980#[doc = "File to import into the current model. If you are sending binary data for a file, be sure \
7981 to send the WebSocketRequest as binary/bson, not text/json."]
7982#[derive(
7983 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
7984)]
7985pub struct ImportFile {
7986 #[doc = "The raw bytes of the file"]
7987 #[serde(
7988 serialize_with = "serde_bytes::serialize",
7989 deserialize_with = "serde_bytes::deserialize"
7990 )]
7991 pub data: Vec<u8>,
7992 #[doc = "The file's full path, including file extension."]
7993 pub path: String,
7994}
7995
7996impl std::fmt::Display for ImportFile {
7997 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
7998 write!(
7999 f,
8000 "{}",
8001 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8002 )
8003 }
8004}
8005
8006#[cfg(feature = "tabled")]
8007impl tabled::Tabled for ImportFile {
8008 const LENGTH: usize = 2;
8009 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8010 vec![format!("{:?}", self.data).into(), self.path.clone().into()]
8011 }
8012
8013 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8014 vec!["data".into(), "path".into()]
8015 }
8016}
8017
8018#[doc = "Data from importing the files"]
8019#[derive(
8020 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8021)]
8022pub struct ImportFiles {
8023 #[doc = "ID of the imported 3D models within the scene."]
8024 pub object_id: uuid::Uuid,
8025}
8026
8027impl std::fmt::Display for ImportFiles {
8028 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8029 write!(
8030 f,
8031 "{}",
8032 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8033 )
8034 }
8035}
8036
8037#[cfg(feature = "tabled")]
8038impl tabled::Tabled for ImportFiles {
8039 const LENGTH: usize = 1;
8040 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8041 vec![format!("{:?}", self.object_id).into()]
8042 }
8043
8044 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8045 vec!["object_id".into()]
8046 }
8047}
8048
8049#[doc = "Data from importing the files"]
8050#[derive(
8051 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8052)]
8053pub struct ImportedGeometry {
8054 #[doc = "ID of the imported 3D models within the scene."]
8055 pub id: uuid::Uuid,
8056 #[doc = "The original file paths that held the geometry."]
8057 pub value: Vec<String>,
8058}
8059
8060impl std::fmt::Display for ImportedGeometry {
8061 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8062 write!(
8063 f,
8064 "{}",
8065 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8066 )
8067 }
8068}
8069
8070#[cfg(feature = "tabled")]
8071impl tabled::Tabled for ImportedGeometry {
8072 const LENGTH: usize = 2;
8073 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8074 vec![
8075 format!("{:?}", self.id).into(),
8076 format!("{:?}", self.value).into(),
8077 ]
8078 }
8079
8080 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8081 vec!["id".into(), "value".into()]
8082 }
8083}
8084
8085#[doc = "Input format specifier."]
8086#[derive(
8087 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8088)]
8089#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
8090#[serde(tag = "type")]
8091pub enum InputFormat3D {
8092 #[doc = "Autodesk Filmbox (FBX) format."]
8093 #[serde(rename = "fbx")]
8094 Fbx {},
8095 #[doc = "Binary glTF 2.0. We refer to this as glTF since that is how our customers refer to \
8096 it, but this can also import binary glTF (glb)."]
8097 #[serde(rename = "gltf")]
8098 Gltf {},
8099 #[doc = "Wavefront OBJ format."]
8100 #[serde(rename = "obj")]
8101 Obj {
8102 #[doc = "Co-ordinate system of input data.\n\nDefaults to the [KittyCAD co-ordinate \
8103 system].\n\n[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html"]
8104 coords: System,
8105 #[doc = "The units of the input data.\n\nThis is very important for correct scaling and \
8106 when calculating physics properties like mass, etc.\n\nDefaults to millimeters."]
8107 units: UnitLength,
8108 },
8109 #[doc = "The PLY Polygon File Format."]
8110 #[serde(rename = "ply")]
8111 Ply {
8112 #[doc = "Co-ordinate system of input data.\n\nDefaults to the [KittyCAD co-ordinate \
8113 system].\n\n[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html"]
8114 coords: System,
8115 #[doc = "The units of the input data.\n\nThis is very important for correct scaling and \
8116 when calculating physics properties like mass, etc.\n\nDefaults to millimeters."]
8117 units: UnitLength,
8118 },
8119 #[doc = "SolidWorks part (SLDPRT) format."]
8120 #[serde(rename = "sldprt")]
8121 Sldprt {
8122 #[doc = "Splits all closed faces into two open faces.\n\nDefaults to `false` but is \
8123 implicitly `true` when importing into the engine."]
8124 #[serde(default)]
8125 split_closed_faces: bool,
8126 },
8127 #[doc = "ISO 10303-21 (STEP) format."]
8128 #[serde(rename = "step")]
8129 Step {
8130 #[doc = "Splits all closed faces into two open faces.\n\nDefaults to `false` but is \
8131 implicitly `true` when importing into the engine."]
8132 #[serde(default)]
8133 split_closed_faces: bool,
8134 },
8135 #[doc = "*ST**ereo**L**ithography format."]
8136 #[serde(rename = "stl")]
8137 Stl {
8138 #[doc = "Co-ordinate system of input data.\n\nDefaults to the [KittyCAD co-ordinate \
8139 system].\n\n[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html"]
8140 coords: System,
8141 #[doc = "The units of the input data.\n\nThis is very important for correct scaling and \
8142 when calculating physics properties like mass, etc.\n\nDefaults to millimeters."]
8143 units: UnitLength,
8144 },
8145}
8146
8147#[doc = "The form for a public inquiry submission."]
8148#[derive(
8149 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8150)]
8151pub struct InquiryForm {
8152 #[doc = "The company name."]
8153 #[serde(default, skip_serializing_if = "Option::is_none")]
8154 pub company: Option<String>,
8155 #[doc = "The email address of the user."]
8156 pub email: String,
8157 #[doc = "The first name of the user."]
8158 pub first_name: String,
8159 #[doc = "The industry of the user."]
8160 #[serde(default, skip_serializing_if = "Option::is_none")]
8161 pub industry: Option<String>,
8162 #[doc = "The type of inquiry."]
8163 pub inquiry_type: InquiryType,
8164 #[doc = "The last name of the user."]
8165 pub last_name: String,
8166 #[doc = "The message content."]
8167 pub message: String,
8168 #[doc = "The phone number of the user."]
8169 #[serde(default, skip_serializing_if = "Option::is_none")]
8170 pub phone: Option<String>,
8171}
8172
8173impl std::fmt::Display for InquiryForm {
8174 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8175 write!(
8176 f,
8177 "{}",
8178 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8179 )
8180 }
8181}
8182
8183#[cfg(feature = "tabled")]
8184impl tabled::Tabled for InquiryForm {
8185 const LENGTH: usize = 8;
8186 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8187 vec![
8188 if let Some(company) = &self.company {
8189 format!("{:?}", company).into()
8190 } else {
8191 String::new().into()
8192 },
8193 self.email.clone().into(),
8194 self.first_name.clone().into(),
8195 if let Some(industry) = &self.industry {
8196 format!("{:?}", industry).into()
8197 } else {
8198 String::new().into()
8199 },
8200 format!("{:?}", self.inquiry_type).into(),
8201 self.last_name.clone().into(),
8202 self.message.clone().into(),
8203 if let Some(phone) = &self.phone {
8204 format!("{:?}", phone).into()
8205 } else {
8206 String::new().into()
8207 },
8208 ]
8209 }
8210
8211 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8212 vec![
8213 "company".into(),
8214 "email".into(),
8215 "first_name".into(),
8216 "industry".into(),
8217 "inquiry_type".into(),
8218 "last_name".into(),
8219 "message".into(),
8220 "phone".into(),
8221 ]
8222 }
8223}
8224
8225#[doc = "The type of inquiry."]
8226#[derive(
8227 serde :: Serialize,
8228 serde :: Deserialize,
8229 PartialEq,
8230 Hash,
8231 Debug,
8232 Clone,
8233 schemars :: JsonSchema,
8234 parse_display :: FromStr,
8235 parse_display :: Display,
8236)]
8237#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
8238#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
8239pub enum InquiryType {
8240 #[doc = "General inquiry about the service or product."]
8241 #[serde(rename = "general_inquiry")]
8242 #[display("general_inquiry")]
8243 GeneralInquiry,
8244 #[doc = "Questions related to sales or purchasing."]
8245 #[serde(rename = "sales_question")]
8246 #[display("sales_question")]
8247 SalesQuestion,
8248 #[doc = "Inquiry from a developer, typically technical in nature."]
8249 #[serde(rename = "developer_inquiry")]
8250 #[display("developer_inquiry")]
8251 DeveloperInquiry,
8252 #[doc = "Opportunity for partnership or collaboration."]
8253 #[serde(rename = "partnership_opportunity")]
8254 #[display("partnership_opportunity")]
8255 PartnershipOpportunity,
8256 #[doc = "Other inquiries related to sales that do not fit predefined categories."]
8257 #[serde(rename = "other_sales_inquiry")]
8258 #[display("other_sales_inquiry")]
8259 OtherSalesInquiry,
8260 #[doc = "Request for technical support or troubleshooting."]
8261 #[serde(rename = "technical_support")]
8262 #[display("technical_support")]
8263 TechnicalSupport,
8264 #[doc = "Questions or requests related to account management."]
8265 #[serde(rename = "account_management")]
8266 #[display("account_management")]
8267 AccountManagement,
8268 #[doc = "Other support-related inquiries that do not fit predefined categories."]
8269 #[serde(rename = "other_support_inquiry")]
8270 #[display("other_support_inquiry")]
8271 OtherSupportInquiry,
8272}
8273
8274#[doc = "An invoice."]
8275#[derive(
8276 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8277)]
8278pub struct Invoice {
8279 #[doc = "Final amount due at this time for this invoice.\n\nIf the invoice's total is smaller \
8280 than the minimum charge amount, for example, or if there is account credit that can \
8281 be applied to the invoice, the `amount_due` may be 0. If there is a positive \
8282 `starting_balance` for the invoice (the customer owes money), the `amount_due` will \
8283 also take that into account. The charge that gets generated for the invoice will be \
8284 for the amount specified in `amount_due`."]
8285 #[serde(default, skip_serializing_if = "Option::is_none")]
8286 pub amount_due: Option<f64>,
8287 #[doc = "The amount, in USD, that was paid."]
8288 #[serde(default, skip_serializing_if = "Option::is_none")]
8289 pub amount_paid: Option<f64>,
8290 #[doc = "The amount remaining, in USD, that is due."]
8291 #[serde(default, skip_serializing_if = "Option::is_none")]
8292 pub amount_remaining: Option<f64>,
8293 #[doc = "Number of payment attempts made for this invoice, from the perspective of the \
8294 payment retry schedule.\n\nAny payment attempt counts as the first attempt, and \
8295 subsequently only automatic retries increment the attempt count. In other words, \
8296 manual payment attempts after the first attempt do not affect the retry schedule."]
8297 #[serde(default, skip_serializing_if = "Option::is_none")]
8298 pub attempt_count: Option<u64>,
8299 #[doc = "Whether an attempt has been made to pay the invoice.\n\nAn invoice is not attempted \
8300 until 1 hour after the `invoice.created` webhook, for example, so you might not want \
8301 to display that invoice as unpaid to your users."]
8302 #[serde(default)]
8303 pub attempted: bool,
8304 #[doc = "Time at which the object was created."]
8305 pub created_at: chrono::DateTime<chrono::Utc>,
8306 #[doc = "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), \
8307 in lowercase."]
8308 #[serde(default, skip_serializing_if = "Option::is_none")]
8309 pub currency: Option<String>,
8310 #[doc = "The email address for the customer. Until the invoice is finalized, this field will \
8311 equal customer.email. Once the invoice is finalized, this field will no longer be \
8312 updated."]
8313 #[serde(default, skip_serializing_if = "Option::is_none")]
8314 pub customer_email: Option<String>,
8315 #[doc = "Customer ID. The unique identifier for the customer this invoice belongs to. This is \
8316 the customer ID in the payments service, not our database customer ID."]
8317 #[serde(default, skip_serializing_if = "Option::is_none")]
8318 pub customer_id: Option<String>,
8319 #[doc = "Default payment method."]
8320 #[serde(default, skip_serializing_if = "Option::is_none")]
8321 pub default_payment_method: Option<String>,
8322 #[doc = "Description of the invoice."]
8323 #[serde(default, skip_serializing_if = "Option::is_none")]
8324 pub description: Option<String>,
8325 #[doc = "The discounts applied to the invoice. This is an array of discount objects."]
8326 #[serde(default, skip_serializing_if = "Option::is_none")]
8327 pub discounts: Option<Vec<Discount>>,
8328 #[doc = "Unique identifier for the object."]
8329 #[serde(default, skip_serializing_if = "Option::is_none")]
8330 pub id: Option<String>,
8331 #[doc = "The individual line items that make up the invoice.\n\n`lines` is sorted as follows: \
8332 invoice items in reverse chronological order, followed by the subscription, if any."]
8333 #[serde(default, skip_serializing_if = "Option::is_none")]
8334 pub lines: Option<Vec<InvoiceLineItem>>,
8335 #[doc = "Set of key-value pairs."]
8336 #[serde(default, skip_serializing_if = "Option::is_none")]
8337 pub metadata: Option<std::collections::HashMap<String, String>>,
8338 #[doc = "A unique, identifying string that appears on emails sent to the customer for this \
8339 invoice."]
8340 #[serde(default, skip_serializing_if = "Option::is_none")]
8341 pub number: Option<String>,
8342 #[doc = "Whether payment was successfully collected for this invoice.\n\nAn invoice can be \
8343 paid (most commonly) with a charge or with credit from the customer's account \
8344 balance."]
8345 #[serde(default)]
8346 pub paid: bool,
8347 #[doc = "The link to download the PDF for the invoice."]
8348 #[serde(default, skip_serializing_if = "Option::is_none")]
8349 pub pdf: Option<String>,
8350 #[doc = "This is the transaction number that appears on email receipts sent for this invoice."]
8351 #[serde(default, skip_serializing_if = "Option::is_none")]
8352 pub receipt_number: Option<String>,
8353 #[doc = "Extra information about an invoice for the customer's credit card statement."]
8354 #[serde(default, skip_serializing_if = "Option::is_none")]
8355 pub statement_descriptor: Option<String>,
8356 #[doc = "The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or \
8357 `void`."]
8358 #[serde(default, skip_serializing_if = "Option::is_none")]
8359 pub status: Option<InvoiceStatus>,
8360 #[doc = "Total of all subscriptions, invoice items, and prorations on the invoice before any \
8361 invoice level discount or tax is applied.\n\nItem discounts are already incorporated."]
8362 #[serde(default, skip_serializing_if = "Option::is_none")]
8363 pub subtotal: Option<f64>,
8364 #[doc = "The amount of tax on this invoice.\n\nThis is the sum of all the tax amounts on this \
8365 invoice."]
8366 #[serde(default, skip_serializing_if = "Option::is_none")]
8367 pub tax: Option<f64>,
8368 #[doc = "Total after discounts and taxes."]
8369 #[serde(default, skip_serializing_if = "Option::is_none")]
8370 pub total: Option<f64>,
8371 #[doc = "The URL for the hosted invoice page, which allows customers to view and pay an \
8372 invoice."]
8373 #[serde(default, skip_serializing_if = "Option::is_none")]
8374 pub url: Option<String>,
8375}
8376
8377impl std::fmt::Display for Invoice {
8378 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8379 write!(
8380 f,
8381 "{}",
8382 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8383 )
8384 }
8385}
8386
8387#[cfg(feature = "tabled")]
8388impl tabled::Tabled for Invoice {
8389 const LENGTH: usize = 25;
8390 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8391 vec![
8392 if let Some(amount_due) = &self.amount_due {
8393 format!("{:?}", amount_due).into()
8394 } else {
8395 String::new().into()
8396 },
8397 if let Some(amount_paid) = &self.amount_paid {
8398 format!("{:?}", amount_paid).into()
8399 } else {
8400 String::new().into()
8401 },
8402 if let Some(amount_remaining) = &self.amount_remaining {
8403 format!("{:?}", amount_remaining).into()
8404 } else {
8405 String::new().into()
8406 },
8407 if let Some(attempt_count) = &self.attempt_count {
8408 format!("{:?}", attempt_count).into()
8409 } else {
8410 String::new().into()
8411 },
8412 format!("{:?}", self.attempted).into(),
8413 format!("{:?}", self.created_at).into(),
8414 if let Some(currency) = &self.currency {
8415 format!("{:?}", currency).into()
8416 } else {
8417 String::new().into()
8418 },
8419 if let Some(customer_email) = &self.customer_email {
8420 format!("{:?}", customer_email).into()
8421 } else {
8422 String::new().into()
8423 },
8424 if let Some(customer_id) = &self.customer_id {
8425 format!("{:?}", customer_id).into()
8426 } else {
8427 String::new().into()
8428 },
8429 if let Some(default_payment_method) = &self.default_payment_method {
8430 format!("{:?}", default_payment_method).into()
8431 } else {
8432 String::new().into()
8433 },
8434 if let Some(description) = &self.description {
8435 format!("{:?}", description).into()
8436 } else {
8437 String::new().into()
8438 },
8439 if let Some(discounts) = &self.discounts {
8440 format!("{:?}", discounts).into()
8441 } else {
8442 String::new().into()
8443 },
8444 if let Some(id) = &self.id {
8445 format!("{:?}", id).into()
8446 } else {
8447 String::new().into()
8448 },
8449 if let Some(lines) = &self.lines {
8450 format!("{:?}", lines).into()
8451 } else {
8452 String::new().into()
8453 },
8454 if let Some(metadata) = &self.metadata {
8455 format!("{:?}", metadata).into()
8456 } else {
8457 String::new().into()
8458 },
8459 if let Some(number) = &self.number {
8460 format!("{:?}", number).into()
8461 } else {
8462 String::new().into()
8463 },
8464 format!("{:?}", self.paid).into(),
8465 if let Some(pdf) = &self.pdf {
8466 format!("{:?}", pdf).into()
8467 } else {
8468 String::new().into()
8469 },
8470 if let Some(receipt_number) = &self.receipt_number {
8471 format!("{:?}", receipt_number).into()
8472 } else {
8473 String::new().into()
8474 },
8475 if let Some(statement_descriptor) = &self.statement_descriptor {
8476 format!("{:?}", statement_descriptor).into()
8477 } else {
8478 String::new().into()
8479 },
8480 if let Some(status) = &self.status {
8481 format!("{:?}", status).into()
8482 } else {
8483 String::new().into()
8484 },
8485 if let Some(subtotal) = &self.subtotal {
8486 format!("{:?}", subtotal).into()
8487 } else {
8488 String::new().into()
8489 },
8490 if let Some(tax) = &self.tax {
8491 format!("{:?}", tax).into()
8492 } else {
8493 String::new().into()
8494 },
8495 if let Some(total) = &self.total {
8496 format!("{:?}", total).into()
8497 } else {
8498 String::new().into()
8499 },
8500 if let Some(url) = &self.url {
8501 format!("{:?}", url).into()
8502 } else {
8503 String::new().into()
8504 },
8505 ]
8506 }
8507
8508 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8509 vec![
8510 "amount_due".into(),
8511 "amount_paid".into(),
8512 "amount_remaining".into(),
8513 "attempt_count".into(),
8514 "attempted".into(),
8515 "created_at".into(),
8516 "currency".into(),
8517 "customer_email".into(),
8518 "customer_id".into(),
8519 "default_payment_method".into(),
8520 "description".into(),
8521 "discounts".into(),
8522 "id".into(),
8523 "lines".into(),
8524 "metadata".into(),
8525 "number".into(),
8526 "paid".into(),
8527 "pdf".into(),
8528 "receipt_number".into(),
8529 "statement_descriptor".into(),
8530 "status".into(),
8531 "subtotal".into(),
8532 "tax".into(),
8533 "total".into(),
8534 "url".into(),
8535 ]
8536 }
8537}
8538
8539#[doc = "An invoice line item."]
8540#[derive(
8541 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8542)]
8543pub struct InvoiceLineItem {
8544 #[doc = "The amount, in USD."]
8545 #[serde(default, skip_serializing_if = "Option::is_none")]
8546 pub amount: Option<f64>,
8547 #[doc = "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), \
8548 in lowercase."]
8549 #[serde(default, skip_serializing_if = "Option::is_none")]
8550 pub currency: Option<String>,
8551 #[doc = "The description."]
8552 #[serde(default, skip_serializing_if = "Option::is_none")]
8553 pub description: Option<String>,
8554 #[doc = "Unique identifier for the object."]
8555 #[serde(default, skip_serializing_if = "Option::is_none")]
8556 pub id: Option<String>,
8557 #[doc = "The ID of the invoice item associated with this line item if any."]
8558 #[serde(default, skip_serializing_if = "Option::is_none")]
8559 pub invoice_item: Option<String>,
8560 #[doc = "Set of key-value pairs."]
8561 #[serde(default, skip_serializing_if = "Option::is_none")]
8562 pub metadata: Option<std::collections::HashMap<String, String>>,
8563}
8564
8565impl std::fmt::Display for InvoiceLineItem {
8566 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8567 write!(
8568 f,
8569 "{}",
8570 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8571 )
8572 }
8573}
8574
8575#[cfg(feature = "tabled")]
8576impl tabled::Tabled for InvoiceLineItem {
8577 const LENGTH: usize = 6;
8578 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8579 vec![
8580 if let Some(amount) = &self.amount {
8581 format!("{:?}", amount).into()
8582 } else {
8583 String::new().into()
8584 },
8585 if let Some(currency) = &self.currency {
8586 format!("{:?}", currency).into()
8587 } else {
8588 String::new().into()
8589 },
8590 if let Some(description) = &self.description {
8591 format!("{:?}", description).into()
8592 } else {
8593 String::new().into()
8594 },
8595 if let Some(id) = &self.id {
8596 format!("{:?}", id).into()
8597 } else {
8598 String::new().into()
8599 },
8600 if let Some(invoice_item) = &self.invoice_item {
8601 format!("{:?}", invoice_item).into()
8602 } else {
8603 String::new().into()
8604 },
8605 if let Some(metadata) = &self.metadata {
8606 format!("{:?}", metadata).into()
8607 } else {
8608 String::new().into()
8609 },
8610 ]
8611 }
8612
8613 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8614 vec![
8615 "amount".into(),
8616 "currency".into(),
8617 "description".into(),
8618 "id".into(),
8619 "invoice_item".into(),
8620 "metadata".into(),
8621 ]
8622 }
8623}
8624
8625#[doc = "An enum representing the possible values of an `Invoice`'s `status` field."]
8626#[derive(
8627 serde :: Serialize,
8628 serde :: Deserialize,
8629 PartialEq,
8630 Hash,
8631 Debug,
8632 Clone,
8633 schemars :: JsonSchema,
8634 parse_display :: FromStr,
8635 parse_display :: Display,
8636)]
8637#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
8638#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
8639pub enum InvoiceStatus {
8640 #[doc = "Draft."]
8641 #[serde(rename = "draft")]
8642 #[display("draft")]
8643 Draft,
8644 #[doc = "Open."]
8645 #[serde(rename = "open")]
8646 #[display("open")]
8647 Open,
8648 #[doc = "Paid."]
8649 #[serde(rename = "paid")]
8650 #[display("paid")]
8651 Paid,
8652 #[doc = "Uncollectible."]
8653 #[serde(rename = "uncollectible")]
8654 #[display("uncollectible")]
8655 Uncollectible,
8656 #[doc = "Void."]
8657 #[serde(rename = "void")]
8658 #[display("void")]
8659 Void,
8660}
8661
8662#[doc = "Information about an ip address. Represents geographical and network-related information."]
8663#[derive(
8664 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8665)]
8666pub struct IpAddrInfo {
8667 #[doc = "Autonomous System Number."]
8668 #[serde(default, skip_serializing_if = "Option::is_none")]
8669 pub asn: Option<i64>,
8670 #[doc = "City name."]
8671 #[serde(default, skip_serializing_if = "Option::is_none")]
8672 pub city: Option<String>,
8673 #[doc = "Continent code (e.g., \"EU\" for Europe)."]
8674 #[serde(default, skip_serializing_if = "Option::is_none")]
8675 pub continent_code: Option<String>,
8676 #[doc = "Country name."]
8677 #[serde(default, skip_serializing_if = "Option::is_none")]
8678 pub country: Option<String>,
8679 #[doc = "Two-letter country code (e.g., \"NL\" for Netherlands)."]
8680 #[serde(default, skip_serializing_if = "Option::is_none")]
8681 pub country_code: Option<String>,
8682 #[doc = "Three-letter country code (e.g., \"NLD\" for Netherlands)."]
8683 #[serde(
8684 rename = "country_code3",
8685 default,
8686 skip_serializing_if = "Option::is_none"
8687 )]
8688 pub country_code_3: Option<String>,
8689 #[doc = "IP address of the user."]
8690 #[serde(default, skip_serializing_if = "Option::is_none")]
8691 pub ip: Option<std::net::IpAddr>,
8692 #[doc = "Flag indicating whether the country is in the European Union."]
8693 #[serde(default, skip_serializing_if = "Option::is_none")]
8694 pub is_in_european_union: Option<bool>,
8695 #[doc = "Geographic latitude."]
8696 #[serde(default, skip_serializing_if = "Option::is_none")]
8697 pub latitude: Option<f64>,
8698 #[doc = "Geographic longitude."]
8699 #[serde(default, skip_serializing_if = "Option::is_none")]
8700 pub longitude: Option<f64>,
8701 #[doc = "Time offset in seconds from UTC."]
8702 #[serde(default, skip_serializing_if = "Option::is_none")]
8703 pub offset: Option<i64>,
8704 #[doc = "Organization name (e.g., \"RIPE NCC\")."]
8705 #[serde(default, skip_serializing_if = "Option::is_none")]
8706 pub organization: Option<String>,
8707 #[doc = "Postal code."]
8708 #[serde(default, skip_serializing_if = "Option::is_none")]
8709 pub postal_code: Option<String>,
8710 #[doc = "Name of the region (e.g., \"North Holland\")."]
8711 #[serde(default, skip_serializing_if = "Option::is_none")]
8712 pub region: Option<String>,
8713 #[doc = "Region code (e.g., \"NH\" for North Holland)."]
8714 #[serde(default, skip_serializing_if = "Option::is_none")]
8715 pub region_code: Option<String>,
8716 #[doc = "Timezone (e.g., \"Europe/Amsterdam\")."]
8717 #[serde(default, skip_serializing_if = "Option::is_none")]
8718 pub timezone: Option<String>,
8719}
8720
8721impl std::fmt::Display for IpAddrInfo {
8722 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8723 write!(
8724 f,
8725 "{}",
8726 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8727 )
8728 }
8729}
8730
8731#[cfg(feature = "tabled")]
8732impl tabled::Tabled for IpAddrInfo {
8733 const LENGTH: usize = 16;
8734 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8735 vec![
8736 if let Some(asn) = &self.asn {
8737 format!("{:?}", asn).into()
8738 } else {
8739 String::new().into()
8740 },
8741 if let Some(city) = &self.city {
8742 format!("{:?}", city).into()
8743 } else {
8744 String::new().into()
8745 },
8746 if let Some(continent_code) = &self.continent_code {
8747 format!("{:?}", continent_code).into()
8748 } else {
8749 String::new().into()
8750 },
8751 if let Some(country) = &self.country {
8752 format!("{:?}", country).into()
8753 } else {
8754 String::new().into()
8755 },
8756 if let Some(country_code) = &self.country_code {
8757 format!("{:?}", country_code).into()
8758 } else {
8759 String::new().into()
8760 },
8761 if let Some(country_code_3) = &self.country_code_3 {
8762 format!("{:?}", country_code_3).into()
8763 } else {
8764 String::new().into()
8765 },
8766 if let Some(ip) = &self.ip {
8767 format!("{:?}", ip).into()
8768 } else {
8769 String::new().into()
8770 },
8771 if let Some(is_in_european_union) = &self.is_in_european_union {
8772 format!("{:?}", is_in_european_union).into()
8773 } else {
8774 String::new().into()
8775 },
8776 if let Some(latitude) = &self.latitude {
8777 format!("{:?}", latitude).into()
8778 } else {
8779 String::new().into()
8780 },
8781 if let Some(longitude) = &self.longitude {
8782 format!("{:?}", longitude).into()
8783 } else {
8784 String::new().into()
8785 },
8786 if let Some(offset) = &self.offset {
8787 format!("{:?}", offset).into()
8788 } else {
8789 String::new().into()
8790 },
8791 if let Some(organization) = &self.organization {
8792 format!("{:?}", organization).into()
8793 } else {
8794 String::new().into()
8795 },
8796 if let Some(postal_code) = &self.postal_code {
8797 format!("{:?}", postal_code).into()
8798 } else {
8799 String::new().into()
8800 },
8801 if let Some(region) = &self.region {
8802 format!("{:?}", region).into()
8803 } else {
8804 String::new().into()
8805 },
8806 if let Some(region_code) = &self.region_code {
8807 format!("{:?}", region_code).into()
8808 } else {
8809 String::new().into()
8810 },
8811 if let Some(timezone) = &self.timezone {
8812 format!("{:?}", timezone).into()
8813 } else {
8814 String::new().into()
8815 },
8816 ]
8817 }
8818
8819 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8820 vec![
8821 "asn".into(),
8822 "city".into(),
8823 "continent_code".into(),
8824 "country".into(),
8825 "country_code".into(),
8826 "country_code_3".into(),
8827 "ip".into(),
8828 "is_in_european_union".into(),
8829 "latitude".into(),
8830 "longitude".into(),
8831 "offset".into(),
8832 "organization".into(),
8833 "postal_code".into(),
8834 "region".into(),
8835 "region_code".into(),
8836 "timezone".into(),
8837 ]
8838 }
8839}
8840
8841#[doc = "Extra params for the completions."]
8842#[derive(
8843 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8844)]
8845pub struct KclCodeCompletionParams {
8846 #[doc = "The language of the code."]
8847 #[serde(default, skip_serializing_if = "Option::is_none")]
8848 pub language: Option<String>,
8849 #[doc = "The next indent of the code."]
8850 #[serde(default, skip_serializing_if = "Option::is_none")]
8851 pub next_indent: Option<u8>,
8852 #[doc = "The prompt tokens for the completions."]
8853 #[serde(default, skip_serializing_if = "Option::is_none")]
8854 pub prompt_tokens: Option<u32>,
8855 #[doc = "The suffix tokens for the completions."]
8856 #[serde(default, skip_serializing_if = "Option::is_none")]
8857 pub suffix_tokens: Option<u32>,
8858 #[doc = "If we should trim by indentation."]
8859 #[serde(default)]
8860 pub trim_by_indentation: bool,
8861}
8862
8863impl std::fmt::Display for KclCodeCompletionParams {
8864 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8865 write!(
8866 f,
8867 "{}",
8868 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8869 )
8870 }
8871}
8872
8873#[cfg(feature = "tabled")]
8874impl tabled::Tabled for KclCodeCompletionParams {
8875 const LENGTH: usize = 5;
8876 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8877 vec![
8878 if let Some(language) = &self.language {
8879 format!("{:?}", language).into()
8880 } else {
8881 String::new().into()
8882 },
8883 if let Some(next_indent) = &self.next_indent {
8884 format!("{:?}", next_indent).into()
8885 } else {
8886 String::new().into()
8887 },
8888 if let Some(prompt_tokens) = &self.prompt_tokens {
8889 format!("{:?}", prompt_tokens).into()
8890 } else {
8891 String::new().into()
8892 },
8893 if let Some(suffix_tokens) = &self.suffix_tokens {
8894 format!("{:?}", suffix_tokens).into()
8895 } else {
8896 String::new().into()
8897 },
8898 format!("{:?}", self.trim_by_indentation).into(),
8899 ]
8900 }
8901
8902 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
8903 vec![
8904 "language".into(),
8905 "next_indent".into(),
8906 "prompt_tokens".into(),
8907 "suffix_tokens".into(),
8908 "trim_by_indentation".into(),
8909 ]
8910 }
8911}
8912
8913#[doc = "A request to generate KCL code completions."]
8914#[derive(
8915 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
8916)]
8917pub struct KclCodeCompletionRequest {
8918 #[doc = "Extra parameters for the completions."]
8919 #[serde(default, skip_serializing_if = "Option::is_none")]
8920 pub extra: Option<KclCodeCompletionParams>,
8921 #[doc = "The maximum number of tokens that can be generated for the completions. The total \
8922 length of input tokens and generated tokens is limited by the model’s context length."]
8923 #[serde(default, skip_serializing_if = "Option::is_none")]
8924 pub max_tokens: Option<u16>,
8925 #[doc = "How many completion choices to generate for each input message."]
8926 #[serde(default, skip_serializing_if = "Option::is_none")]
8927 pub n: Option<u8>,
8928 #[doc = "For GitHub copilot this is the `{org}/{repo}`. This does not do anything yet. But we \
8929 wanted the same API as GitHub Copilot. It might be used in the future."]
8930 #[serde(default, skip_serializing_if = "Option::is_none")]
8931 pub nwo: Option<String>,
8932 #[doc = "The prompt for the model."]
8933 #[serde(default, skip_serializing_if = "Option::is_none")]
8934 pub prompt: Option<String>,
8935 #[doc = "Up to 4 sequences where the API will stop generating further tokens."]
8936 #[serde(default, skip_serializing_if = "Option::is_none")]
8937 pub stop: Option<Vec<String>>,
8938 #[doc = "If set, partial message deltas will be sent, like in ChatGPT or OpenAPI. Tokens will \
8939 be sent as data-only server-sent events as they become available, with the stream \
8940 terminated by a data: [DONE] message."]
8941 #[serde(default)]
8942 pub stream: bool,
8943 #[doc = "The suffix for the model."]
8944 #[serde(default, skip_serializing_if = "Option::is_none")]
8945 pub suffix: Option<String>,
8946 #[doc = "The temperature for the model."]
8947 #[serde(default, skip_serializing_if = "Option::is_none")]
8948 pub temperature: Option<f64>,
8949 #[doc = "The top p for the model."]
8950 #[serde(default, skip_serializing_if = "Option::is_none")]
8951 pub top_p: Option<f64>,
8952}
8953
8954impl std::fmt::Display for KclCodeCompletionRequest {
8955 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
8956 write!(
8957 f,
8958 "{}",
8959 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
8960 )
8961 }
8962}
8963
8964#[cfg(feature = "tabled")]
8965impl tabled::Tabled for KclCodeCompletionRequest {
8966 const LENGTH: usize = 10;
8967 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
8968 vec![
8969 if let Some(extra) = &self.extra {
8970 format!("{:?}", extra).into()
8971 } else {
8972 String::new().into()
8973 },
8974 if let Some(max_tokens) = &self.max_tokens {
8975 format!("{:?}", max_tokens).into()
8976 } else {
8977 String::new().into()
8978 },
8979 if let Some(n) = &self.n {
8980 format!("{:?}", n).into()
8981 } else {
8982 String::new().into()
8983 },
8984 if let Some(nwo) = &self.nwo {
8985 format!("{:?}", nwo).into()
8986 } else {
8987 String::new().into()
8988 },
8989 if let Some(prompt) = &self.prompt {
8990 format!("{:?}", prompt).into()
8991 } else {
8992 String::new().into()
8993 },
8994 if let Some(stop) = &self.stop {
8995 format!("{:?}", stop).into()
8996 } else {
8997 String::new().into()
8998 },
8999 format!("{:?}", self.stream).into(),
9000 if let Some(suffix) = &self.suffix {
9001 format!("{:?}", suffix).into()
9002 } else {
9003 String::new().into()
9004 },
9005 if let Some(temperature) = &self.temperature {
9006 format!("{:?}", temperature).into()
9007 } else {
9008 String::new().into()
9009 },
9010 if let Some(top_p) = &self.top_p {
9011 format!("{:?}", top_p).into()
9012 } else {
9013 String::new().into()
9014 },
9015 ]
9016 }
9017
9018 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9019 vec![
9020 "extra".into(),
9021 "max_tokens".into(),
9022 "n".into(),
9023 "nwo".into(),
9024 "prompt".into(),
9025 "stop".into(),
9026 "stream".into(),
9027 "suffix".into(),
9028 "temperature".into(),
9029 "top_p".into(),
9030 ]
9031 }
9032}
9033
9034#[doc = "A response with KCL code completions."]
9035#[derive(
9036 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9037)]
9038pub struct KclCodeCompletionResponse {
9039 #[doc = "The completions."]
9040 pub completions: Vec<String>,
9041}
9042
9043impl std::fmt::Display for KclCodeCompletionResponse {
9044 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9045 write!(
9046 f,
9047 "{}",
9048 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9049 )
9050 }
9051}
9052
9053#[cfg(feature = "tabled")]
9054impl tabled::Tabled for KclCodeCompletionResponse {
9055 const LENGTH: usize = 1;
9056 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9057 vec![format!("{:?}", self.completions).into()]
9058 }
9059
9060 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9061 vec!["completions".into()]
9062 }
9063}
9064
9065#[doc = "The response containing the KCL code."]
9066#[derive(
9067 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9068)]
9069pub struct KclModel {
9070 #[doc = "The KCL code."]
9071 pub code: String,
9072}
9073
9074impl std::fmt::Display for KclModel {
9075 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9076 write!(
9077 f,
9078 "{}",
9079 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9080 )
9081 }
9082}
9083
9084#[cfg(feature = "tabled")]
9085impl tabled::Tabled for KclModel {
9086 const LENGTH: usize = 1;
9087 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9088 vec![self.code.clone().into()]
9089 }
9090
9091 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9092 vec!["code".into()]
9093 }
9094}
9095
9096#[doc = "The response from the `Loft` command."]
9097#[derive(
9098 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9099)]
9100pub struct Loft {
9101 #[doc = "The UUID of the newly created solid loft."]
9102 pub solid_id: uuid::Uuid,
9103}
9104
9105impl std::fmt::Display for Loft {
9106 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9107 write!(
9108 f,
9109 "{}",
9110 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9111 )
9112 }
9113}
9114
9115#[cfg(feature = "tabled")]
9116impl tabled::Tabled for Loft {
9117 const LENGTH: usize = 1;
9118 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9119 vec![format!("{:?}", self.solid_id).into()]
9120 }
9121
9122 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9123 vec!["solid_id".into()]
9124 }
9125}
9126
9127#[doc = "The response from the `MakeAxesGizmo` endpoint."]
9128#[derive(
9129 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9130)]
9131pub struct MakeAxesGizmo {}
9132
9133impl std::fmt::Display for MakeAxesGizmo {
9134 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9135 write!(
9136 f,
9137 "{}",
9138 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9139 )
9140 }
9141}
9142
9143#[cfg(feature = "tabled")]
9144impl tabled::Tabled for MakeAxesGizmo {
9145 const LENGTH: usize = 0;
9146 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9147 vec![]
9148 }
9149
9150 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9151 vec![]
9152 }
9153}
9154
9155#[doc = "The response from the `MakeOffsetPath` command."]
9156#[derive(
9157 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9158)]
9159pub struct MakeOffsetPath {
9160 #[doc = "If the offset path splits into multiple paths, this will contain the UUIDs of the \
9161 new paths. If the offset path remains as a single path, this will be empty, and the \
9162 resulting ID of the (single) new path will be the ID of the `MakeOffsetPath` command."]
9163 pub entity_ids: Vec<uuid::Uuid>,
9164}
9165
9166impl std::fmt::Display for MakeOffsetPath {
9167 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9168 write!(
9169 f,
9170 "{}",
9171 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9172 )
9173 }
9174}
9175
9176#[cfg(feature = "tabled")]
9177impl tabled::Tabled for MakeOffsetPath {
9178 const LENGTH: usize = 1;
9179 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9180 vec![format!("{:?}", self.entity_ids).into()]
9181 }
9182
9183 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9184 vec!["entity_ids".into()]
9185 }
9186}
9187
9188#[doc = "The response from the `MakePlane` endpoint."]
9189#[derive(
9190 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9191)]
9192pub struct MakePlane {}
9193
9194impl std::fmt::Display for MakePlane {
9195 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9196 write!(
9197 f,
9198 "{}",
9199 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9200 )
9201 }
9202}
9203
9204#[cfg(feature = "tabled")]
9205impl tabled::Tabled for MakePlane {
9206 const LENGTH: usize = 0;
9207 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9208 vec![]
9209 }
9210
9211 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9212 vec![]
9213 }
9214}
9215
9216#[doc = "The mass response."]
9217#[derive(
9218 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9219)]
9220pub struct Mass {
9221 #[doc = "The mass."]
9222 pub mass: f64,
9223 #[doc = "The output unit for the mass."]
9224 pub output_unit: UnitMass,
9225}
9226
9227impl std::fmt::Display for Mass {
9228 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9229 write!(
9230 f,
9231 "{}",
9232 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9233 )
9234 }
9235}
9236
9237#[cfg(feature = "tabled")]
9238impl tabled::Tabled for Mass {
9239 const LENGTH: usize = 2;
9240 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9241 vec![
9242 format!("{:?}", self.mass).into(),
9243 format!("{:?}", self.output_unit).into(),
9244 ]
9245 }
9246
9247 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9248 vec!["mass".into(), "output_unit".into()]
9249 }
9250}
9251
9252#[doc = "The Request Method (VERB)\n\nThis type also contains constants for a number of common HTTP methods such as GET, POST, etc.\n\nCurrently includes 8 variants representing the 8 methods defined in [RFC 7230](https://tools.ietf.org/html/rfc7231#section-4.1), plus PATCH, and an Extension variant for all extensions."]
9253#[derive(
9254 serde :: Serialize,
9255 serde :: Deserialize,
9256 PartialEq,
9257 Hash,
9258 Debug,
9259 Clone,
9260 schemars :: JsonSchema,
9261 parse_display :: FromStr,
9262 parse_display :: Display,
9263)]
9264#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9265#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9266pub enum Method {
9267 #[doc = "The `OPTIONS` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.2.1)."]
9268 #[serde(rename = "OPTIONS")]
9269 #[display("OPTIONS")]
9270 Options,
9271 #[doc = "The `GET` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.1)."]
9272 #[serde(rename = "GET")]
9273 #[display("GET")]
9274 Get,
9275 #[doc = "The `POST` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.1)."]
9276 #[serde(rename = "POST")]
9277 #[display("POST")]
9278 Post,
9279 #[doc = "The `PUT` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.1)."]
9280 #[serde(rename = "PUT")]
9281 #[display("PUT")]
9282 Put,
9283 #[doc = "The `DELETE` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.5)."]
9284 #[serde(rename = "DELETE")]
9285 #[display("DELETE")]
9286 Delete,
9287 #[doc = "The `HEAD` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.2)."]
9288 #[serde(rename = "HEAD")]
9289 #[display("HEAD")]
9290 Head,
9291 #[doc = "The `TRACE` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3)."]
9292 #[serde(rename = "TRACE")]
9293 #[display("TRACE")]
9294 Trace,
9295 #[doc = "The `CONNECT` method as defined in [RFC 7231](https://tools.ietf.org/html/rfc7231#section-4.3.6)."]
9296 #[serde(rename = "CONNECT")]
9297 #[display("CONNECT")]
9298 Connect,
9299 #[doc = "The `PATCH` method as defined in [RFC 5789](https://tools.ietf.org/html/rfc5789)."]
9300 #[serde(rename = "PATCH")]
9301 #[display("PATCH")]
9302 Patch,
9303 #[doc = "A catch all."]
9304 #[serde(rename = "EXTENSION")]
9305 #[display("EXTENSION")]
9306 Extension,
9307}
9308
9309#[doc = "The types of messages that can be sent by the client to the server."]
9310#[derive(
9311 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9312)]
9313#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9314#[serde(tag = "type")]
9315pub enum MlCopilotClientMessage {
9316 #[doc = "Authentication header request."]
9317 #[serde(rename = "headers")]
9318 Headers {
9319 #[doc = "The authentication header."]
9320 headers: std::collections::HashMap<String, String>,
9321 },
9322 #[doc = "The user message, which contains the content of the user's input."]
9323 #[serde(rename = "user")]
9324 User {
9325 #[doc = "The content of the user's message."]
9326 content: String,
9327 #[doc = "The current files in the project, if any. This can be used to provide context \
9328 for the AI. This should be sent in binary format, if the files are not text \
9329 files, like an imported binary file."]
9330 #[serde(default, skip_serializing_if = "Option::is_none")]
9331 current_files: Option<std::collections::HashMap<String, Vec<u8>>>,
9332 #[doc = "The user can force specific tools to be used for this message."]
9333 #[serde(default, skip_serializing_if = "Option::is_none")]
9334 forced_tools: Option<Vec<MlCopilotTool>>,
9335 #[doc = "The project name, if any. This can be used to associate the message with a \
9336 specific project."]
9337 #[serde(default, skip_serializing_if = "Option::is_none")]
9338 project_name: Option<String>,
9339 #[doc = "The source ranges the user suggested to change. If empty, the content (prompt) \
9340 will be used and is required."]
9341 #[serde(default, skip_serializing_if = "Option::is_none")]
9342 source_ranges: Option<Vec<SourceRangePrompt>>,
9343 },
9344 #[doc = "The system message, which can be used to set the context or instructions for the AI."]
9345 #[serde(rename = "system")]
9346 System {
9347 #[doc = "The content of the system message."]
9348 command: MlCopilotSystemCommand,
9349 },
9350}
9351
9352#[doc = "The types of messages that can be sent by the server to the client."]
9353#[derive(
9354 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9355)]
9356pub enum MlCopilotServerMessage {
9357 #[doc = "Session metadata sent by the server right after authentication.\n\nSemantics: - This \
9358 message is NOT persisted in the database and will NEVER appear in a subsequent \
9359 `Replay` message. However, we do have the `api_call_id` in the database. - Timing: \
9360 sent immediately after a client is authenticated on a websocket. Useful for \
9361 correlating logs and traces."]
9362 #[serde(rename = "session_data")]
9363 SessionData {
9364 #[doc = "The API call id associated with this websocket session."]
9365 api_call_id: String,
9366 },
9367 #[doc = "The ID of the conversation, which can be used to track the session."]
9368 #[serde(rename = "conversation_id")]
9369 ConversationId {
9370 #[doc = "The unique identifier for the conversation."]
9371 conversation_id: String,
9372 },
9373 #[doc = "Delta of the response, e.g. a chunk of text/tokens."]
9374 #[serde(rename = "delta")]
9375 Delta {
9376 #[doc = "The delta text, which is a part of the response that is being streamed."]
9377 delta: String,
9378 },
9379 #[doc = "Completed tool call result."]
9380 #[serde(rename = "tool_output")]
9381 ToolOutput {
9382 #[doc = "The result of the tool call."]
9383 result: MlToolResult,
9384 },
9385 #[doc = "Error sent by server."]
9386 #[serde(rename = "error")]
9387 Error {
9388 #[doc = "The error message."]
9389 detail: String,
9390 },
9391 #[doc = "Log / banner text."]
9392 #[serde(rename = "info")]
9393 Info {
9394 #[doc = "The informational text."]
9395 text: String,
9396 },
9397 #[doc = "Assistant reasoning / chain-of-thought (if you expose it)."]
9398 #[serde(rename = "reasoning")]
9399 Reasoning(ReasoningMessage),
9400 #[doc = "Replay containing raw bytes for previously-saved messages for a conversation. \
9401 Includes server messages and client `User` messages.\n\nInvariants: - Includes \
9402 server messages: `Info`, `Error`, `Reasoning(..)`, `ToolOutput { .. }`, and \
9403 `EndOfStream { .. }`. - Also includes client `User` messages. - The following are \
9404 NEVER included: `SessionData`, `ConversationId`, or `Delta`. - Ordering is stable: \
9405 messages are ordered by prompt creation time within the conversation, then by the \
9406 per-prompt `seq` value (monotonically increasing as seen in the original \
9407 stream).\n\nWire format: - Each element is canonical serialized bytes (typically \
9408 JSON) for either a `MlCopilotServerMessage` or a `MlCopilotClientMessage::User`. - \
9409 When delivered as an initial replay over the websocket (upon \
9410 `?replay=true&conversation_id=<uuid>`), the server sends a single WebSocket Binary \
9411 frame containing a BSON-encoded document of this enum: `Replay { messages }`."]
9412 #[serde(rename = "replay")]
9413 Replay {
9414 #[doc = "Canonical bytes (usually JSON) for each message, ordered by prompt creation \
9415 time, then message sequence number."]
9416 messages: Vec<Vec<u8>>,
9417 },
9418 #[doc = "Marks the end of a streamed answer."]
9419 #[serde(rename = "end_of_stream")]
9420 EndOfStream {
9421 #[doc = "This indicates the time that the server has finished processing the request. \
9422 This can be used by the client to measure the total time taken for the request. \
9423 Although this might be passed in other contexts, outside of copilot mode, it is \
9424 only relevant in copilot mode."]
9425 #[serde(default, skip_serializing_if = "Option::is_none")]
9426 completed_at: Option<chrono::DateTime<chrono::Utc>>,
9427 #[doc = "The conversation id for this session."]
9428 #[serde(default, skip_serializing_if = "Option::is_none")]
9429 conversation_id: Option<String>,
9430 #[doc = "The ML prompt id for this turn."]
9431 #[serde(default, skip_serializing_if = "Option::is_none")]
9432 id: Option<uuid::Uuid>,
9433 #[doc = "This indicates the time that the server had started processing the request. This \
9434 can be used by the client to measure the total time taken for the request. \
9435 Although this might be passed in other contexts, outside of copilot mode, it is \
9436 only relevant in copilot mode."]
9437 #[serde(default, skip_serializing_if = "Option::is_none")]
9438 started_at: Option<chrono::DateTime<chrono::Utc>>,
9439 #[doc = "The whole response text, which is the final output of the AI. This is only \
9440 relevant if in copilot mode, where the AI is expected to return the whole \
9441 response at once."]
9442 #[serde(default, skip_serializing_if = "Option::is_none")]
9443 whole_response: Option<String>,
9444 },
9445}
9446
9447#[doc = "The type of system command that can be sent to the ML Copilot."]
9448#[derive(
9449 serde :: Serialize,
9450 serde :: Deserialize,
9451 PartialEq,
9452 Hash,
9453 Debug,
9454 Clone,
9455 schemars :: JsonSchema,
9456 parse_display :: FromStr,
9457 parse_display :: Display,
9458)]
9459#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9460#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9461pub enum MlCopilotSystemCommand {
9462 #[doc = "Reset the conversation state, by creating a new state."]
9463 #[serde(rename = "new")]
9464 #[display("new")]
9465 New,
9466 #[doc = "Disconnect the client, which can be used to end the session."]
9467 #[serde(rename = "bye")]
9468 #[display("bye")]
9469 Bye,
9470}
9471
9472#[doc = "The tools that can be used by the ML Copilot."]
9473#[derive(
9474 serde :: Serialize,
9475 serde :: Deserialize,
9476 PartialEq,
9477 Hash,
9478 Debug,
9479 Clone,
9480 schemars :: JsonSchema,
9481 parse_display :: FromStr,
9482 parse_display :: Display,
9483)]
9484#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9485#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9486pub enum MlCopilotTool {
9487 #[doc = "The tool for generating or editing KCL code based on user prompts."]
9488 #[serde(rename = "edit_kcl_code")]
9489 #[display("edit_kcl_code")]
9490 EditKclCode,
9491 #[doc = "The tool for generating CAD models from textual descriptions."]
9492 #[serde(rename = "text_to_cad")]
9493 #[display("text_to_cad")]
9494 TextToCad,
9495 #[doc = "The tool for querying a mechanical knowledge base."]
9496 #[serde(rename = "mechanical_knowledge_base")]
9497 #[display("mechanical_knowledge_base")]
9498 MechanicalKnowledgeBase,
9499 #[doc = "The tool for searching the web for information."]
9500 #[serde(rename = "web_search")]
9501 #[display("web_search")]
9502 WebSearch,
9503}
9504
9505#[doc = "Human feedback on an ML response."]
9506#[derive(
9507 serde :: Serialize,
9508 serde :: Deserialize,
9509 PartialEq,
9510 Hash,
9511 Debug,
9512 Clone,
9513 schemars :: JsonSchema,
9514 parse_display :: FromStr,
9515 parse_display :: Display,
9516)]
9517#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9518#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9519pub enum MlFeedback {
9520 #[doc = "Thumbs up."]
9521 #[serde(rename = "thumbs_up")]
9522 #[display("thumbs_up")]
9523 ThumbsUp,
9524 #[doc = "Thumbs down."]
9525 #[serde(rename = "thumbs_down")]
9526 #[display("thumbs_down")]
9527 ThumbsDown,
9528 #[doc = "Accepted."]
9529 #[serde(rename = "accepted")]
9530 #[display("accepted")]
9531 Accepted,
9532 #[doc = "Rejected."]
9533 #[serde(rename = "rejected")]
9534 #[display("rejected")]
9535 Rejected,
9536}
9537
9538#[doc = "A ML prompt."]
9539#[derive(
9540 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9541)]
9542pub struct MlPrompt {
9543 #[doc = "When the prompt was completed."]
9544 #[serde(default, skip_serializing_if = "Option::is_none")]
9545 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
9546 #[doc = "The id for the conversation related to this prompt."]
9547 #[serde(default, skip_serializing_if = "Option::is_none")]
9548 pub conversation_id: Option<uuid::Uuid>,
9549 #[doc = "The date and time the ML prompt was created."]
9550 pub created_at: chrono::DateTime<chrono::Utc>,
9551 #[doc = "The error message if the prompt failed."]
9552 #[serde(default, skip_serializing_if = "Option::is_none")]
9553 pub error: Option<String>,
9554 #[doc = "Feedback from the user, if any."]
9555 #[serde(default, skip_serializing_if = "Option::is_none")]
9556 pub feedback: Option<MlFeedback>,
9557 #[doc = "The unique identifier for the ML prompt."]
9558 pub id: uuid::Uuid,
9559 #[doc = "The KCL version being used."]
9560 #[serde(default, skip_serializing_if = "Option::is_none")]
9561 pub kcl_version: Option<String>,
9562 #[doc = "The metadata for the prompt."]
9563 #[serde(default, skip_serializing_if = "Option::is_none")]
9564 pub metadata: Option<MlPromptMetadata>,
9565 #[doc = "The version of the model."]
9566 pub model_version: String,
9567 #[doc = "The output file. In the case of TextToCad this is a link to a file in a GCP bucket."]
9568 #[serde(default, skip_serializing_if = "Option::is_none")]
9569 pub output_file: Option<String>,
9570 #[doc = "The name of the project, if any. This allows us to group prompts together that come \
9571 from the same project and user."]
9572 #[serde(default, skip_serializing_if = "Option::is_none")]
9573 pub project_name: Option<String>,
9574 #[doc = "The prompt."]
9575 pub prompt: String,
9576 #[doc = "Sum of EndOfStream durations, in seconds. Nullable to allow lazy backfill."]
9577 #[serde(default, skip_serializing_if = "Option::is_none")]
9578 pub seconds: Option<i64>,
9579 #[doc = "When the prompt was started."]
9580 #[serde(default, skip_serializing_if = "Option::is_none")]
9581 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
9582 #[doc = "The status of the prompt."]
9583 pub status: ApiCallStatus,
9584 #[doc = "The type of prompt."]
9585 #[serde(rename = "type")]
9586 pub type_: MlPromptType,
9587 #[doc = "The date and time the ML prompt was last updated."]
9588 pub updated_at: chrono::DateTime<chrono::Utc>,
9589 #[doc = "The user ID of the user who created the ML prompt."]
9590 pub user_id: uuid::Uuid,
9591}
9592
9593impl std::fmt::Display for MlPrompt {
9594 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9595 write!(
9596 f,
9597 "{}",
9598 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9599 )
9600 }
9601}
9602
9603#[cfg(feature = "tabled")]
9604impl tabled::Tabled for MlPrompt {
9605 const LENGTH: usize = 18;
9606 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9607 vec![
9608 if let Some(completed_at) = &self.completed_at {
9609 format!("{:?}", completed_at).into()
9610 } else {
9611 String::new().into()
9612 },
9613 if let Some(conversation_id) = &self.conversation_id {
9614 format!("{:?}", conversation_id).into()
9615 } else {
9616 String::new().into()
9617 },
9618 format!("{:?}", self.created_at).into(),
9619 if let Some(error) = &self.error {
9620 format!("{:?}", error).into()
9621 } else {
9622 String::new().into()
9623 },
9624 if let Some(feedback) = &self.feedback {
9625 format!("{:?}", feedback).into()
9626 } else {
9627 String::new().into()
9628 },
9629 format!("{:?}", self.id).into(),
9630 if let Some(kcl_version) = &self.kcl_version {
9631 format!("{:?}", kcl_version).into()
9632 } else {
9633 String::new().into()
9634 },
9635 if let Some(metadata) = &self.metadata {
9636 format!("{:?}", metadata).into()
9637 } else {
9638 String::new().into()
9639 },
9640 self.model_version.clone().into(),
9641 if let Some(output_file) = &self.output_file {
9642 format!("{:?}", output_file).into()
9643 } else {
9644 String::new().into()
9645 },
9646 if let Some(project_name) = &self.project_name {
9647 format!("{:?}", project_name).into()
9648 } else {
9649 String::new().into()
9650 },
9651 self.prompt.clone().into(),
9652 if let Some(seconds) = &self.seconds {
9653 format!("{:?}", seconds).into()
9654 } else {
9655 String::new().into()
9656 },
9657 if let Some(started_at) = &self.started_at {
9658 format!("{:?}", started_at).into()
9659 } else {
9660 String::new().into()
9661 },
9662 format!("{:?}", self.status).into(),
9663 format!("{:?}", self.type_).into(),
9664 format!("{:?}", self.updated_at).into(),
9665 format!("{:?}", self.user_id).into(),
9666 ]
9667 }
9668
9669 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9670 vec![
9671 "completed_at".into(),
9672 "conversation_id".into(),
9673 "created_at".into(),
9674 "error".into(),
9675 "feedback".into(),
9676 "id".into(),
9677 "kcl_version".into(),
9678 "metadata".into(),
9679 "model_version".into(),
9680 "output_file".into(),
9681 "project_name".into(),
9682 "prompt".into(),
9683 "seconds".into(),
9684 "started_at".into(),
9685 "status".into(),
9686 "type_".into(),
9687 "updated_at".into(),
9688 "user_id".into(),
9689 ]
9690 }
9691}
9692
9693#[doc = "Metadata for a ML prompt."]
9694#[derive(
9695 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9696)]
9697pub struct MlPromptMetadata {
9698 #[doc = "Code for the model."]
9699 #[serde(default, skip_serializing_if = "Option::is_none")]
9700 pub code: Option<String>,
9701 #[doc = "The original source code for the model."]
9702 #[serde(default, skip_serializing_if = "Option::is_none")]
9703 pub original_source_code: Option<String>,
9704 #[doc = "The source ranges the user suggested to change."]
9705 #[serde(default, skip_serializing_if = "Option::is_none")]
9706 pub source_ranges: Option<Vec<SourceRangePrompt>>,
9707 #[doc = "The upstream conversation ID, if any."]
9708 #[serde(default, skip_serializing_if = "Option::is_none")]
9709 pub upstream_conversation_id: Option<String>,
9710}
9711
9712impl std::fmt::Display for MlPromptMetadata {
9713 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9714 write!(
9715 f,
9716 "{}",
9717 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9718 )
9719 }
9720}
9721
9722#[cfg(feature = "tabled")]
9723impl tabled::Tabled for MlPromptMetadata {
9724 const LENGTH: usize = 4;
9725 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9726 vec![
9727 if let Some(code) = &self.code {
9728 format!("{:?}", code).into()
9729 } else {
9730 String::new().into()
9731 },
9732 if let Some(original_source_code) = &self.original_source_code {
9733 format!("{:?}", original_source_code).into()
9734 } else {
9735 String::new().into()
9736 },
9737 if let Some(source_ranges) = &self.source_ranges {
9738 format!("{:?}", source_ranges).into()
9739 } else {
9740 String::new().into()
9741 },
9742 if let Some(upstream_conversation_id) = &self.upstream_conversation_id {
9743 format!("{:?}", upstream_conversation_id).into()
9744 } else {
9745 String::new().into()
9746 },
9747 ]
9748 }
9749
9750 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9751 vec![
9752 "code".into(),
9753 "original_source_code".into(),
9754 "source_ranges".into(),
9755 "upstream_conversation_id".into(),
9756 ]
9757 }
9758}
9759
9760#[doc = "A single page of results"]
9761#[derive(
9762 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9763)]
9764pub struct MlPromptResultsPage {
9765 #[doc = "list of items on this page of results"]
9766 pub items: Vec<MlPrompt>,
9767 #[doc = "token used to fetch the next page of results (if any)"]
9768 #[serde(default, skip_serializing_if = "Option::is_none")]
9769 pub next_page: Option<String>,
9770}
9771
9772impl std::fmt::Display for MlPromptResultsPage {
9773 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
9774 write!(
9775 f,
9776 "{}",
9777 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
9778 )
9779 }
9780}
9781
9782#[cfg(feature = "requests")]
9783impl crate::types::paginate::Pagination for MlPromptResultsPage {
9784 type Item = MlPrompt;
9785 fn has_more_pages(&self) -> bool {
9786 self.next_page.is_some()
9787 }
9788
9789 fn next_page_token(&self) -> Option<String> {
9790 self.next_page.clone()
9791 }
9792
9793 fn next_page(
9794 &self,
9795 req: reqwest::Request,
9796 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
9797 let mut req = req.try_clone().ok_or_else(|| {
9798 crate::types::error::Error::InvalidRequest(format!(
9799 "failed to clone request: {:?}",
9800 req
9801 ))
9802 })?;
9803 req.url_mut()
9804 .query_pairs_mut()
9805 .append_pair("next_page", self.next_page.as_deref().unwrap_or(""));
9806 Ok(req)
9807 }
9808
9809 fn items(&self) -> Vec<Self::Item> {
9810 self.items.clone()
9811 }
9812}
9813
9814#[cfg(feature = "tabled")]
9815impl tabled::Tabled for MlPromptResultsPage {
9816 const LENGTH: usize = 2;
9817 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
9818 vec![
9819 format!("{:?}", self.items).into(),
9820 if let Some(next_page) = &self.next_page {
9821 format!("{:?}", next_page).into()
9822 } else {
9823 String::new().into()
9824 },
9825 ]
9826 }
9827
9828 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
9829 vec!["items".into(), "next_page".into()]
9830 }
9831}
9832
9833#[doc = "A type of ML prompt."]
9834#[derive(
9835 serde :: Serialize,
9836 serde :: Deserialize,
9837 PartialEq,
9838 Hash,
9839 Debug,
9840 Clone,
9841 schemars :: JsonSchema,
9842 parse_display :: FromStr,
9843 parse_display :: Display,
9844)]
9845#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9846#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9847pub enum MlPromptType {
9848 #[doc = "Text to CAD."]
9849 #[serde(rename = "text_to_cad")]
9850 #[display("text_to_cad")]
9851 TextToCad,
9852 #[doc = "Text to KCL."]
9853 #[serde(rename = "text_to_kcl")]
9854 #[display("text_to_kcl")]
9855 TextToKcl,
9856 #[doc = "Text to KCL iteration."]
9857 #[serde(rename = "text_to_kcl_iteration")]
9858 #[display("text_to_kcl_iteration")]
9859 TextToKclIteration,
9860 #[doc = "Text to KCL iteration with multiple files."]
9861 #[serde(rename = "text_to_kcl_multi_file_iteration")]
9862 #[display("text_to_kcl_multi_file_iteration")]
9863 TextToKclMultiFileIteration,
9864 #[doc = "Copilot chat/assist prompts."]
9865 #[serde(rename = "copilot")]
9866 #[display("copilot")]
9867 Copilot,
9868}
9869
9870#[doc = "Responses from tools."]
9871#[derive(
9872 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
9873)]
9874#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9875#[serde(tag = "type")]
9876pub enum MlToolResult {
9877 #[doc = "Response from the `TextToCad` tool."]
9878 #[serde(rename = "text_to_cad")]
9879 TextToCad {
9880 #[doc = "Any error that occurred during the tool execution."]
9881 #[serde(default, skip_serializing_if = "Option::is_none")]
9882 error: Option<String>,
9883 #[doc = "The output files. Returns a map of the file name to the file contents. The file \
9884 contents are not encoded since kcl files are not binary."]
9885 #[serde(default, skip_serializing_if = "Option::is_none")]
9886 outputs: Option<std::collections::HashMap<String, String>>,
9887 #[doc = "The name of the project, if any."]
9888 #[serde(default, skip_serializing_if = "Option::is_none")]
9889 project_name: Option<String>,
9890 #[doc = "The status code of the tool execution."]
9891 status_code: i32,
9892 },
9893 #[doc = "Response from the `EditKclCode` tool."]
9894 #[serde(rename = "edit_kcl_code")]
9895 EditKclCode {
9896 #[doc = "Any error that occurred during the tool execution."]
9897 #[serde(default, skip_serializing_if = "Option::is_none")]
9898 error: Option<String>,
9899 #[doc = "The output files. Returns a map of the file name to the file contents. The file \
9900 contents are not encoded since kcl files are not binary."]
9901 #[serde(default, skip_serializing_if = "Option::is_none")]
9902 outputs: Option<std::collections::HashMap<String, String>>,
9903 #[doc = "The name of the project, if any."]
9904 #[serde(default, skip_serializing_if = "Option::is_none")]
9905 project_name: Option<String>,
9906 #[doc = "The status code of the tool execution."]
9907 status_code: i32,
9908 },
9909 #[doc = "Mechanical knowledge base response."]
9910 #[serde(rename = "mechanical_knowledge_base")]
9911 MechanicalKnowledgeBase {
9912 #[doc = "The response from the mechanical knowledge base."]
9913 response: String,
9914 },
9915}
9916
9917#[doc = "Type for modeling-app events"]
9918#[derive(
9919 serde :: Serialize,
9920 serde :: Deserialize,
9921 PartialEq,
9922 Hash,
9923 Debug,
9924 Clone,
9925 schemars :: JsonSchema,
9926 parse_display :: FromStr,
9927 parse_display :: Display,
9928)]
9929#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9930#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9931#[derive(Default)]
9932pub enum ModelingAppEventType {
9933 #[doc = "This event is sent before the modeling app or project is closed. The attachment \
9934 should contain the contents of the most recent successful compile."]
9935 #[serde(rename = "successful_compile_before_close")]
9936 #[display("successful_compile_before_close")]
9937 #[default]
9938 SuccessfulCompileBeforeClose,
9939}
9940
9941
9942#[doc = "The subscription tiers we offer for the Modeling App to individuals."]
9943#[derive(
9944 serde :: Serialize,
9945 serde :: Deserialize,
9946 PartialEq,
9947 Hash,
9948 Debug,
9949 Clone,
9950 schemars :: JsonSchema,
9951 parse_display :: FromStr,
9952 parse_display :: Display,
9953)]
9954#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9955#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9956pub enum ModelingAppIndividualSubscriptionTier {
9957 #[doc = "The free tier."]
9958 #[serde(rename = "free")]
9959 #[display("free")]
9960 Free,
9961 #[doc = "The plus tier."]
9962 #[serde(rename = "plus")]
9963 #[display("plus")]
9964 Plus,
9965 #[doc = "The pro tier."]
9966 #[serde(rename = "pro")]
9967 #[display("pro")]
9968 Pro,
9969}
9970
9971#[doc = "The subscription tiers we offer for the Modeling App to organizations."]
9972#[derive(
9973 serde :: Serialize,
9974 serde :: Deserialize,
9975 PartialEq,
9976 Hash,
9977 Debug,
9978 Clone,
9979 schemars :: JsonSchema,
9980 parse_display :: FromStr,
9981 parse_display :: Display,
9982)]
9983#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
9984#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
9985pub enum ModelingAppOrganizationSubscriptionTier {
9986 #[doc = "The team tier."]
9987 #[serde(rename = "team")]
9988 #[display("team")]
9989 Team,
9990 #[doc = "The enterprise tier."]
9991 #[serde(rename = "enterprise")]
9992 #[display("enterprise")]
9993 Enterprise,
9994}
9995
9996#[doc = "The options for sharable links through the modeling app."]
9997#[derive(
9998 serde :: Serialize,
9999 serde :: Deserialize,
10000 PartialEq,
10001 Hash,
10002 Debug,
10003 Clone,
10004 schemars :: JsonSchema,
10005 parse_display :: FromStr,
10006 parse_display :: Display,
10007)]
10008#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
10009#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
10010pub enum ModelingAppShareLinks {
10011 #[doc = "Public."]
10012 #[serde(rename = "public")]
10013 #[display("public")]
10014 Public,
10015 #[doc = "Password protected."]
10016 #[serde(rename = "password_protected")]
10017 #[display("password_protected")]
10018 PasswordProtected,
10019 #[doc = "Organization only. Links can be made only available to members of the organization."]
10020 #[serde(rename = "organization_only")]
10021 #[display("organization_only")]
10022 OrganizationOnly,
10023}
10024
10025#[doc = "A subscription tier we offer for the Modeling App."]
10026#[derive(
10027 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10028)]
10029pub struct ModelingAppSubscriptionTier {
10030 #[doc = "Annual discount. The percentage off the monthly price if the user pays annually."]
10031 #[serde(default, skip_serializing_if = "Option::is_none")]
10032 pub annual_discount: Option<f64>,
10033 #[doc = "A description of the tier."]
10034 pub description: String,
10035 #[doc = "The Zoo API endpoints that are included when through an approved zoo tool."]
10036 #[serde(default, skip_serializing_if = "Option::is_none")]
10037 pub endpoints_included: Option<Vec<ApiEndpoint>>,
10038 #[doc = "Features that are included in the subscription."]
10039 #[serde(default, skip_serializing_if = "Option::is_none")]
10040 pub features: Option<Vec<SubscriptionTierFeature>>,
10041 #[doc = "The amount of pay-as-you-go API credits the individual or org gets outside the \
10042 modeling app per month. This re-ups on the 1st of each month. This is equivalent to \
10043 the monetary value divided by the price of an API credit."]
10044 #[serde(default, skip_serializing_if = "Option::is_none")]
10045 pub monthly_pay_as_you_go_api_credits: Option<u64>,
10046 #[doc = "The monetary value of pay-as-you-go API credits the individual or org gets outside \
10047 the modeling app per month. This re-ups on the 1st of each month."]
10048 pub monthly_pay_as_you_go_api_credits_monetary_value: f64,
10049 #[doc = "The name of the tier."]
10050 pub name: ModelingAppSubscriptionTierName,
10051 #[doc = "The price of an API credit (meaning 1 credit = 1 minute of API usage)."]
10052 #[serde(default, skip_serializing_if = "Option::is_none")]
10053 pub pay_as_you_go_api_credit_price: Option<f64>,
10054 #[doc = "The price of the tier per month. If this is for an individual, this is the price \
10055 they pay. If this is for an organization, this is the price the organization pays \
10056 per member in the org. This is in USD."]
10057 pub price: SubscriptionTierPrice,
10058 #[doc = "The options for sharable links through the modeling app."]
10059 #[serde(default, skip_serializing_if = "Option::is_none")]
10060 pub share_links: Option<Vec<ModelingAppShareLinks>>,
10061 #[doc = "The support tier the subscription provides."]
10062 pub support_tier: SupportTier,
10063 #[doc = "The behavior of the users data (can it be used for training, etc)."]
10064 pub training_data_behavior: SubscriptionTrainingDataBehavior,
10065 #[doc = "If the tier is offered for an individual or an org."]
10066 #[serde(rename = "type")]
10067 pub type_: SubscriptionTierType,
10068 #[doc = "The Zoo tools that you can call unlimited times with this tier."]
10069 #[serde(default, skip_serializing_if = "Option::is_none")]
10070 pub zoo_tools_included: Option<Vec<ZooTool>>,
10071}
10072
10073impl std::fmt::Display for ModelingAppSubscriptionTier {
10074 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
10075 write!(
10076 f,
10077 "{}",
10078 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
10079 )
10080 }
10081}
10082
10083#[cfg(feature = "tabled")]
10084impl tabled::Tabled for ModelingAppSubscriptionTier {
10085 const LENGTH: usize = 14;
10086 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
10087 vec![
10088 if let Some(annual_discount) = &self.annual_discount {
10089 format!("{:?}", annual_discount).into()
10090 } else {
10091 String::new().into()
10092 },
10093 self.description.clone().into(),
10094 if let Some(endpoints_included) = &self.endpoints_included {
10095 format!("{:?}", endpoints_included).into()
10096 } else {
10097 String::new().into()
10098 },
10099 if let Some(features) = &self.features {
10100 format!("{:?}", features).into()
10101 } else {
10102 String::new().into()
10103 },
10104 if let Some(monthly_pay_as_you_go_api_credits) = &self.monthly_pay_as_you_go_api_credits
10105 {
10106 format!("{:?}", monthly_pay_as_you_go_api_credits).into()
10107 } else {
10108 String::new().into()
10109 },
10110 format!(
10111 "{:?}",
10112 self.monthly_pay_as_you_go_api_credits_monetary_value
10113 )
10114 .into(),
10115 format!("{:?}", self.name).into(),
10116 if let Some(pay_as_you_go_api_credit_price) = &self.pay_as_you_go_api_credit_price {
10117 format!("{:?}", pay_as_you_go_api_credit_price).into()
10118 } else {
10119 String::new().into()
10120 },
10121 format!("{:?}", self.price).into(),
10122 if let Some(share_links) = &self.share_links {
10123 format!("{:?}", share_links).into()
10124 } else {
10125 String::new().into()
10126 },
10127 format!("{:?}", self.support_tier).into(),
10128 format!("{:?}", self.training_data_behavior).into(),
10129 format!("{:?}", self.type_).into(),
10130 if let Some(zoo_tools_included) = &self.zoo_tools_included {
10131 format!("{:?}", zoo_tools_included).into()
10132 } else {
10133 String::new().into()
10134 },
10135 ]
10136 }
10137
10138 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
10139 vec![
10140 "annual_discount".into(),
10141 "description".into(),
10142 "endpoints_included".into(),
10143 "features".into(),
10144 "monthly_pay_as_you_go_api_credits".into(),
10145 "monthly_pay_as_you_go_api_credits_monetary_value".into(),
10146 "name".into(),
10147 "pay_as_you_go_api_credit_price".into(),
10148 "price".into(),
10149 "share_links".into(),
10150 "support_tier".into(),
10151 "training_data_behavior".into(),
10152 "type_".into(),
10153 "zoo_tools_included".into(),
10154 ]
10155 }
10156}
10157
10158#[doc = "An enum representing a Modeling App subscription tier name."]
10159#[derive(
10160 serde :: Serialize,
10161 serde :: Deserialize,
10162 PartialEq,
10163 Hash,
10164 Debug,
10165 Clone,
10166 schemars :: JsonSchema,
10167 parse_display :: FromStr,
10168 parse_display :: Display,
10169)]
10170#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
10171#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
10172pub enum ModelingAppSubscriptionTierName {
10173 #[doc = "The free tier."]
10174 #[serde(rename = "free")]
10175 #[display("free")]
10176 Free,
10177 #[doc = "The plus tier."]
10178 #[serde(rename = "plus")]
10179 #[display("plus")]
10180 Plus,
10181 #[doc = "The pro tier."]
10182 #[serde(rename = "pro")]
10183 #[display("pro")]
10184 Pro,
10185 #[doc = "The team tier."]
10186 #[serde(rename = "team")]
10187 #[display("team")]
10188 Team,
10189 #[doc = "The enterprise tier."]
10190 #[serde(rename = "enterprise")]
10191 #[display("enterprise")]
10192 Enterprise,
10193}
10194
10195#[doc = "Commands that the KittyCAD engine can execute."]
10196#[derive(
10197 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
10198)]
10199#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
10200#[serde(tag = "type")]
10201pub enum ModelingCmd {
10202 #[doc = "Evaluates the position of a path in one shot (engine utility for kcl executor)"]
10203 #[serde(rename = "engine_util_evaluate_path")]
10204 EngineUtilEvaluatePath {
10205 #[doc = "The path in json form (the serialized result of the kcl Sketch/Path object"]
10206 path_json: String,
10207 #[doc = "The evaluation parameter (path curve parameter in the normalized domain [0, 1])"]
10208 t: f64,
10209 },
10210 #[doc = "Start a new path."]
10211 #[serde(rename = "start_path")]
10212 StartPath {},
10213 #[doc = "Move the path's \"pen\". If you're in sketch mode, these coordinates are in the \
10214 local coordinate system, not the world's coordinate system. For example, say you're \
10215 sketching on the plane {x: (1,0,0), y: (0,1,0), origin: (0, 0, 50)}. In other words, \
10216 the plane 50 units above the default XY plane. Then, moving the pen to (1, 1, 0) \
10217 with this command uses local coordinates. So, it would move the pen to (1, 1, 50) in \
10218 global coordinates."]
10219 #[serde(rename = "move_path_pen")]
10220 MovePathPen {
10221 #[doc = "The ID of the command which created the path."]
10222 path: uuid::Uuid,
10223 #[doc = "Where the path's pen should be."]
10224 to: Point3D,
10225 },
10226 #[doc = "Extend a path by adding a new segment which starts at the path's \"pen\". If no \
10227 \"pen\" location has been set before (via `MovePen`), then the pen is at the origin."]
10228 #[serde(rename = "extend_path")]
10229 ExtendPath {
10230 #[doc = "The ID of the command which created the path."]
10231 path: uuid::Uuid,
10232 #[doc = "Segment to append to the path. This segment will implicitly begin at the current \
10233 \"pen\" location."]
10234 segment: PathSegment,
10235 },
10236 #[doc = "Command for extruding a solid 2d."]
10237 #[serde(rename = "extrude")]
10238 Extrude {
10239 #[doc = "How far off the plane to extrude"]
10240 distance: f64,
10241 #[doc = "Should the extrusion create a new object or be part of the existing object."]
10242 #[serde(default, skip_serializing_if = "Option::is_none")]
10243 extrude_method: Option<ExtrudeMethod>,
10244 #[doc = "Which IDs should the new faces have? If this isn't given, the engine will \
10245 generate IDs."]
10246 #[serde(default, skip_serializing_if = "Option::is_none")]
10247 faces: Option<ExtrudedFaceInfo>,
10248 #[doc = "Should the extrusion also extrude in the opposite direction? If so, this \
10249 specifies its distance."]
10250 #[serde(default, skip_serializing_if = "Option::is_none")]
10251 opposite: Option<String>,
10252 #[doc = "Which sketch to extrude. Must be a closed 2D solid."]
10253 target: uuid::Uuid,
10254 },
10255 #[doc = "Command for twist extruding a solid 2d."]
10256 #[serde(rename = "twist_extrude")]
10257 TwistExtrude {
10258 #[doc = "Angle step interval (converted to whole number degrees and bounded between 4° \
10259 and 90°)"]
10260 #[serde(default, skip_serializing_if = "Option::is_none")]
10261 angle_step_size: Option<Angle>,
10262 #[doc = "Center to twist about (relative to 2D sketch)"]
10263 #[serde(default, skip_serializing_if = "Option::is_none")]
10264 center_2d: Option<Point2D>,
10265 #[doc = "How far off the plane to extrude"]
10266 distance: f64,
10267 #[doc = "Which IDs should the new faces have? If this isn't given, the engine will \
10268 generate IDs."]
10269 #[serde(default, skip_serializing_if = "Option::is_none")]
10270 faces: Option<ExtrudedFaceInfo>,
10271 #[doc = "Which sketch to extrude. Must be a closed 2D solid."]
10272 target: uuid::Uuid,
10273 #[doc = "The twisted surface loft tolerance"]
10274 tolerance: f64,
10275 #[doc = "Total rotation of the section"]
10276 total_rotation_angle: Angle,
10277 },
10278 #[doc = "Extrude the object along a path."]
10279 #[serde(rename = "sweep")]
10280 Sweep {
10281 #[doc = "What is this sweep relative to?"]
10282 #[serde(default, skip_serializing_if = "Option::is_none")]
10283 relative_to: Option<RelativeTo>,
10284 #[doc = "If true, the sweep will be broken up into sub-sweeps (extrusions, revolves, \
10285 sweeps) based on the trajectory path components."]
10286 sectional: bool,
10287 #[doc = "Which sketch to sweep. Must be a closed 2D solid."]
10288 target: uuid::Uuid,
10289 #[doc = "The maximum acceptable surface gap computed between the revolution surface \
10290 joints. Must be positive (i.e. greater than zero)."]
10291 tolerance: f64,
10292 #[doc = "Path along which to sweep."]
10293 trajectory: uuid::Uuid,
10294 },
10295 #[doc = "Command for revolving a solid 2d."]
10296 #[serde(rename = "revolve")]
10297 Revolve {
10298 #[doc = "The signed angle of revolution (in degrees, must be <= 360 in either direction)"]
10299 angle: Angle,
10300 #[doc = "The axis of the extrusion (taken from the origin)"]
10301 axis: Point3D,
10302 #[doc = "If true, the axis is interpreted within the 2D space of the solid 2D's plane"]
10303 axis_is_2d: bool,
10304 #[doc = "Should the revolution also revolve in the opposite direction along the given \
10305 axis? If so, this specifies its angle."]
10306 #[serde(default, skip_serializing_if = "Option::is_none")]
10307 opposite: Option<String>,
10308 #[doc = "The origin of the extrusion axis"]
10309 origin: Point3D,
10310 #[doc = "Which sketch to revolve. Must be a closed 2D solid."]
10311 target: uuid::Uuid,
10312 #[doc = "The maximum acceptable surface gap computed between the revolution surface \
10313 joints. Must be positive (i.e. greater than zero)."]
10314 tolerance: f64,
10315 },
10316 #[doc = "Command for shelling a solid3d face"]
10317 #[serde(rename = "solid3d_shell_face")]
10318 Solid3DShellFace {
10319 #[doc = "Which faces to remove, leaving only the shell."]
10320 face_ids: Vec<uuid::Uuid>,
10321 #[doc = "If true, the Solid3D is made hollow instead of removing the selected faces"]
10322 #[serde(default)]
10323 hollow: bool,
10324 #[doc = "Which Solid3D is being shelled."]
10325 object_id: uuid::Uuid,
10326 #[doc = "How thick the shell should be. Smaller values mean a thinner shell."]
10327 shell_thickness: f64,
10328 },
10329 #[doc = "Command for revolving a solid 2d about a brep edge"]
10330 #[serde(rename = "revolve_about_edge")]
10331 RevolveAboutEdge {
10332 #[doc = "The signed angle of revolution (in degrees, must be <= 360 in either direction)"]
10333 angle: Angle,
10334 #[doc = "The edge to use as the axis of revolution, must be linear and lie in the plane \
10335 of the solid"]
10336 edge_id: uuid::Uuid,
10337 #[doc = "Should the revolution also revolve in the opposite direction along the given \
10338 axis? If so, this specifies its angle."]
10339 #[serde(default, skip_serializing_if = "Option::is_none")]
10340 opposite: Option<String>,
10341 #[doc = "Which sketch to revolve. Must be a closed 2D solid."]
10342 target: uuid::Uuid,
10343 #[doc = "The maximum acceptable surface gap computed between the revolution surface \
10344 joints. Must be positive (i.e. greater than zero)."]
10345 tolerance: f64,
10346 },
10347 #[doc = "Command for lofting sections to create a solid"]
10348 #[serde(rename = "loft")]
10349 Loft {
10350 #[doc = "This can be set to override the automatically determined topological base curve, \
10351 which is usually the first section encountered."]
10352 #[serde(default, skip_serializing_if = "Option::is_none")]
10353 base_curve_index: Option<u32>,
10354 #[doc = "Attempt to approximate rational curves (such as arcs) using a bezier. This will \
10355 remove banding around interpolations between arcs and non-arcs. It may produce \
10356 errors in other scenarios Over time, this field won't be necessary."]
10357 bez_approximate_rational: bool,
10358 #[doc = "The closed section curves to create a lofted solid from. Currently, these must \
10359 be Solid2Ds"]
10360 section_ids: Vec<uuid::Uuid>,
10361 #[doc = "Tolerance"]
10362 tolerance: f64,
10363 #[doc = "Degree of the interpolation. Must be greater than zero. For example, use 2 for \
10364 quadratic, or 3 for cubic interpolation in the V direction."]
10365 v_degree: u32,
10366 },
10367 #[doc = "Closes a path, converting it to a 2D solid."]
10368 #[serde(rename = "close_path")]
10369 ClosePath {
10370 #[doc = "Which path to close."]
10371 path_id: uuid::Uuid,
10372 },
10373 #[doc = "Camera drag started."]
10374 #[serde(rename = "camera_drag_start")]
10375 CameraDragStart {
10376 #[doc = "The type of camera drag interaction."]
10377 interaction: CameraDragInteractionType,
10378 #[doc = "The initial mouse position."]
10379 window: Point2D,
10380 },
10381 #[doc = "Camera drag continued."]
10382 #[serde(rename = "camera_drag_move")]
10383 CameraDragMove {
10384 #[doc = "The type of camera drag interaction."]
10385 interaction: CameraDragInteractionType,
10386 #[doc = "Logical timestamp. The client should increment this with every event in the \
10387 current mouse drag. That way, if the events are being sent over an unordered \
10388 channel, the API can ignore the older events."]
10389 #[serde(default, skip_serializing_if = "Option::is_none")]
10390 sequence: Option<u32>,
10391 #[doc = "The current mouse position."]
10392 window: Point2D,
10393 },
10394 #[doc = "Camera drag ended"]
10395 #[serde(rename = "camera_drag_end")]
10396 CameraDragEnd {
10397 #[doc = "The type of camera drag interaction."]
10398 interaction: CameraDragInteractionType,
10399 #[doc = "The final mouse position."]
10400 window: Point2D,
10401 },
10402 #[doc = "Gets the default camera's camera settings"]
10403 #[serde(rename = "default_camera_get_settings")]
10404 DefaultCameraGetSettings {},
10405 #[doc = "Gets the default camera's view state"]
10406 #[serde(rename = "default_camera_get_view")]
10407 DefaultCameraGetView {},
10408 #[doc = "Sets the default camera's view state"]
10409 #[serde(rename = "default_camera_set_view")]
10410 DefaultCameraSetView {
10411 #[doc = "Camera view state"]
10412 view: CameraViewState,
10413 },
10414 #[doc = "Change what the default camera is looking at."]
10415 #[serde(rename = "default_camera_look_at")]
10416 DefaultCameraLookAt {
10417 #[doc = "What the camera is looking at. Center of the camera's field of vision"]
10418 center: Point3D,
10419 #[doc = "Logical timestamp. The client should increment this with every event in the \
10420 current mouse drag. That way, if the events are being sent over an unordered \
10421 channel, the API can ignore the older events."]
10422 #[serde(default, skip_serializing_if = "Option::is_none")]
10423 sequence: Option<u32>,
10424 #[doc = "Which way is \"up\", from the camera's point of view."]
10425 up: Point3D,
10426 #[doc = "Where the camera is positioned"]
10427 vantage: Point3D,
10428 },
10429 #[doc = "Change what the default camera is looking at."]
10430 #[serde(rename = "default_camera_perspective_settings")]
10431 DefaultCameraPerspectiveSettings {
10432 #[doc = "What the camera is looking at. Center of the camera's field of vision"]
10433 center: Point3D,
10434 #[doc = "The field of view angle in the y direction, in degrees."]
10435 #[serde(default, skip_serializing_if = "Option::is_none")]
10436 fov_y: Option<f64>,
10437 #[doc = "Logical timestamp. The client should increment this with every event in the \
10438 current mouse drag. That way, if the events are being sent over an unordered \
10439 channel, the API can ignore the older events."]
10440 #[serde(default, skip_serializing_if = "Option::is_none")]
10441 sequence: Option<u32>,
10442 #[doc = "Which way is \"up\", from the camera's point of view."]
10443 up: Point3D,
10444 #[doc = "Where the camera is positioned"]
10445 vantage: Point3D,
10446 #[doc = "The distance to the far clipping plane."]
10447 #[serde(default, skip_serializing_if = "Option::is_none")]
10448 z_far: Option<f64>,
10449 #[doc = "The distance to the near clipping plane."]
10450 #[serde(default, skip_serializing_if = "Option::is_none")]
10451 z_near: Option<f64>,
10452 },
10453 #[doc = "Adjust zoom of the default camera."]
10454 #[serde(rename = "default_camera_zoom")]
10455 DefaultCameraZoom {
10456 #[doc = "Move the camera forward along the vector it's looking at, by this \
10457 magnitudedefaultCameraZoom. Basically, how much should the camera move forward \
10458 by."]
10459 magnitude: f64,
10460 },
10461 #[doc = "Export a sketch to a file."]
10462 #[serde(rename = "export2d")]
10463 Export2D {
10464 #[doc = "IDs of the entities to be exported."]
10465 entity_ids: Vec<uuid::Uuid>,
10466 #[doc = "The file format to export to."]
10467 format: OutputFormat2D,
10468 },
10469 #[doc = "Export the scene to a file."]
10470 #[serde(rename = "export3d")]
10471 Export3D {
10472 #[doc = "IDs of the entities to be exported. If this is empty, then all entities are \
10473 exported."]
10474 entity_ids: Vec<uuid::Uuid>,
10475 #[doc = "The file format to export to."]
10476 format: OutputFormat3D,
10477 },
10478 #[doc = "Export the scene to a file."]
10479 #[serde(rename = "export")]
10480 Export {
10481 #[doc = "IDs of the entities to be exported. If this is empty, then all entities are \
10482 exported."]
10483 entity_ids: Vec<uuid::Uuid>,
10484 #[doc = "The file format to export to."]
10485 format: OutputFormat3D,
10486 },
10487 #[doc = "What is this entity's parent?"]
10488 #[serde(rename = "entity_get_parent_id")]
10489 EntityGetParentId {
10490 #[doc = "ID of the entity being queried."]
10491 entity_id: uuid::Uuid,
10492 },
10493 #[doc = "How many children does the entity have?"]
10494 #[serde(rename = "entity_get_num_children")]
10495 EntityGetNumChildren {
10496 #[doc = "ID of the entity being queried."]
10497 entity_id: uuid::Uuid,
10498 },
10499 #[doc = "What is the UUID of this entity's n-th child?"]
10500 #[serde(rename = "entity_get_child_uuid")]
10501 EntityGetChildUuid {
10502 #[doc = "Index into the entity's list of children."]
10503 child_index: u32,
10504 #[doc = "ID of the entity being queried."]
10505 entity_id: uuid::Uuid,
10506 },
10507 #[doc = "What are all UUIDs of this entity's children?"]
10508 #[serde(rename = "entity_get_all_child_uuids")]
10509 EntityGetAllChildUuids {
10510 #[doc = "ID of the entity being queried."]
10511 entity_id: uuid::Uuid,
10512 },
10513 #[doc = "What are all UUIDs of all the paths sketched on top of this entity?"]
10514 #[serde(rename = "entity_get_sketch_paths")]
10515 EntityGetSketchPaths {
10516 #[doc = "ID of the entity being queried."]
10517 entity_id: uuid::Uuid,
10518 },
10519 #[doc = "What is the distance between these two entities?"]
10520 #[serde(rename = "entity_get_distance")]
10521 EntityGetDistance {
10522 #[doc = "Type of distance to be measured."]
10523 distance_type: DistanceType,
10524 #[doc = "ID of the first entity being queried."]
10525 #[serde(rename = "entity_id1")]
10526 entity_id_1: uuid::Uuid,
10527 #[doc = "ID of the second entity being queried."]
10528 #[serde(rename = "entity_id2")]
10529 entity_id_2: uuid::Uuid,
10530 },
10531 #[doc = "Create a pattern using this entity by specifying the transform for each desired \
10532 repetition. Transformations are performed in the following order (first applied to \
10533 last applied): scale, rotate, translate."]
10534 #[serde(rename = "entity_clone")]
10535 EntityClone {
10536 #[doc = "ID of the entity being cloned."]
10537 entity_id: uuid::Uuid,
10538 },
10539 #[doc = "Create a pattern using this entity by specifying the transform for each desired \
10540 repetition. Transformations are performed in the following order (first applied to \
10541 last applied): scale, rotate, translate."]
10542 #[serde(rename = "entity_linear_pattern_transform")]
10543 EntityLinearPatternTransform {
10544 #[doc = "ID of the entity being copied."]
10545 entity_id: uuid::Uuid,
10546 #[doc = "How to transform each repeated solid. The 0th transform will create the first \
10547 copy of the entity. The total number of (optional) repetitions equals the size \
10548 of this list."]
10549 #[serde(default)]
10550 transform: Vec<Transform>,
10551 #[doc = "Alternatively, you could set this key instead. If you want to use multiple \
10552 transforms per item. If this is non-empty then the `transform` key must be \
10553 empty, and vice-versa."]
10554 #[serde(default)]
10555 transforms: Vec<Vec<Transform>>,
10556 },
10557 #[doc = "Create a linear pattern using this entity."]
10558 #[serde(rename = "entity_linear_pattern")]
10559 EntityLinearPattern {
10560 #[doc = "Axis along which to make the copies. For Solid2d patterns, the z component is \
10561 ignored."]
10562 axis: Point3D,
10563 #[doc = "ID of the entity being copied."]
10564 entity_id: uuid::Uuid,
10565 #[doc = "Number of repetitions to make."]
10566 num_repetitions: u32,
10567 #[doc = "Spacing between repetitions."]
10568 spacing: f64,
10569 },
10570 #[doc = "Create a circular pattern using this entity."]
10571 #[serde(rename = "entity_circular_pattern")]
10572 EntityCircularPattern {
10573 #[doc = "Arc angle (in degrees) to place repetitions along."]
10574 arc_degrees: f64,
10575 #[doc = "Axis around which to make the copies. For Solid2d patterns, this is ignored."]
10576 axis: Point3D,
10577 #[doc = "Point around which to make the copies. For Solid2d patterns, the z component is \
10578 ignored."]
10579 center: Point3D,
10580 #[doc = "ID of the entity being copied."]
10581 entity_id: uuid::Uuid,
10582 #[doc = "Number of repetitions to make."]
10583 num_repetitions: u32,
10584 #[doc = "Whether or not to rotate the objects as they are copied."]
10585 rotate_duplicates: bool,
10586 },
10587 #[doc = "Create a helix using the input cylinder and other specified parameters."]
10588 #[serde(rename = "entity_make_helix")]
10589 EntityMakeHelix {
10590 #[doc = "ID of the cylinder."]
10591 cylinder_id: uuid::Uuid,
10592 #[doc = "Is the helix rotation clockwise?"]
10593 is_clockwise: bool,
10594 #[doc = "Length of the helix."]
10595 length: f64,
10596 #[doc = "Number of revolutions."]
10597 revolutions: f64,
10598 #[doc = "Start angle."]
10599 #[serde(default, skip_serializing_if = "Option::is_none")]
10600 start_angle: Option<Angle>,
10601 },
10602 #[doc = "Create a helix using the specified parameters."]
10603 #[serde(rename = "entity_make_helix_from_params")]
10604 EntityMakeHelixFromParams {
10605 #[doc = "Axis of the helix. The helix will be created around and in the direction of this \
10606 axis."]
10607 axis: Point3D,
10608 #[doc = "Center of the helix at the base of the helix."]
10609 center: Point3D,
10610 #[doc = "Is the helix rotation clockwise?"]
10611 is_clockwise: bool,
10612 #[doc = "Length of the helix."]
10613 length: f64,
10614 #[doc = "Radius of the helix."]
10615 radius: f64,
10616 #[doc = "Number of revolutions."]
10617 revolutions: f64,
10618 #[doc = "Start angle."]
10619 #[serde(default, skip_serializing_if = "Option::is_none")]
10620 start_angle: Option<Angle>,
10621 },
10622 #[doc = "Create a helix using the specified parameters."]
10623 #[serde(rename = "entity_make_helix_from_edge")]
10624 EntityMakeHelixFromEdge {
10625 #[doc = "Edge about which to make the helix."]
10626 edge_id: uuid::Uuid,
10627 #[doc = "Is the helix rotation clockwise?"]
10628 is_clockwise: bool,
10629 #[doc = "Length of the helix. If None, the length of the edge will be used instead."]
10630 #[serde(default, skip_serializing_if = "Option::is_none")]
10631 length: Option<f64>,
10632 #[doc = "Radius of the helix."]
10633 radius: f64,
10634 #[doc = "Number of revolutions."]
10635 revolutions: f64,
10636 #[doc = "Start angle."]
10637 #[serde(default, skip_serializing_if = "Option::is_none")]
10638 start_angle: Option<Angle>,
10639 },
10640 #[doc = "Mirror the input entities over the specified axis. (Currently only supports sketches)"]
10641 #[serde(rename = "entity_mirror")]
10642 EntityMirror {
10643 #[doc = "Axis to use as mirror."]
10644 axis: Point3D,
10645 #[doc = "ID of the mirror entities."]
10646 ids: Vec<uuid::Uuid>,
10647 #[doc = "Point through which the mirror axis passes."]
10648 point: Point3D,
10649 },
10650 #[doc = "Mirror the input entities over the specified edge. (Currently only supports sketches)"]
10651 #[serde(rename = "entity_mirror_across_edge")]
10652 EntityMirrorAcrossEdge {
10653 #[doc = "The edge to use as the mirror axis, must be linear and lie in the plane of the \
10654 solid"]
10655 edge_id: uuid::Uuid,
10656 #[doc = "ID of the mirror entities."]
10657 ids: Vec<uuid::Uuid>,
10658 },
10659 #[doc = "Modifies the selection by simulating a \"mouse click\" at the given x,y window \
10660 coordinate Returns ID of whatever was selected."]
10661 #[serde(rename = "select_with_point")]
10662 SelectWithPoint {
10663 #[doc = "Where in the window was selected"]
10664 selected_at_window: Point2D,
10665 #[doc = "What entity was selected?"]
10666 selection_type: SceneSelectionType,
10667 },
10668 #[doc = "Adds one or more entities (by UUID) to the selection."]
10669 #[serde(rename = "select_add")]
10670 SelectAdd {
10671 #[doc = "Which entities to select"]
10672 entities: Vec<uuid::Uuid>,
10673 },
10674 #[doc = "Removes one or more entities (by UUID) from the selection."]
10675 #[serde(rename = "select_remove")]
10676 SelectRemove {
10677 #[doc = "Which entities to unselect"]
10678 entities: Vec<uuid::Uuid>,
10679 },
10680 #[doc = "Removes all of the Objects in the scene"]
10681 #[serde(rename = "scene_clear_all")]
10682 SceneClearAll {},
10683 #[doc = "Replaces current selection with these entities (by UUID)."]
10684 #[serde(rename = "select_replace")]
10685 SelectReplace {
10686 #[doc = "Which entities to select"]
10687 entities: Vec<uuid::Uuid>,
10688 },
10689 #[doc = "Changes the current highlighted entity to whichever one is at the given window \
10690 coordinate. If there's no entity at this location, clears the highlight."]
10691 #[serde(rename = "highlight_set_entity")]
10692 HighlightSetEntity {
10693 #[doc = "Coordinates of the window being clicked"]
10694 selected_at_window: Point2D,
10695 #[doc = "Logical timestamp. The client should increment this with every event in the \
10696 current mouse drag. That way, if the events are being sent over an unordered \
10697 channel, the API can ignore the older events."]
10698 #[serde(default, skip_serializing_if = "Option::is_none")]
10699 sequence: Option<u32>,
10700 },
10701 #[doc = "Changes the current highlighted entity to these entities."]
10702 #[serde(rename = "highlight_set_entities")]
10703 HighlightSetEntities {
10704 #[doc = "Highlight these entities."]
10705 entities: Vec<uuid::Uuid>,
10706 },
10707 #[doc = "Create a new annotation"]
10708 #[serde(rename = "new_annotation")]
10709 NewAnnotation {
10710 #[doc = "What type of annotation to create."]
10711 annotation_type: AnnotationType,
10712 #[doc = "If true, any existing drawables within the obj will be replaced (the object will \
10713 be reset)"]
10714 clobber: bool,
10715 #[doc = "What should the annotation contain?"]
10716 options: AnnotationOptions,
10717 },
10718 #[doc = "Update an annotation"]
10719 #[serde(rename = "update_annotation")]
10720 UpdateAnnotation {
10721 #[doc = "Which annotation to update"]
10722 annotation_id: uuid::Uuid,
10723 #[doc = "If any of these fields are set, they will overwrite the previous options for the \
10724 annotation."]
10725 options: AnnotationOptions,
10726 },
10727 #[doc = "Changes visibility of scene-wide edge lines on brep solids"]
10728 #[serde(rename = "edge_lines_visible")]
10729 EdgeLinesVisible {
10730 #[doc = "Whether or not the edge lines should be hidden."]
10731 hidden: bool,
10732 },
10733 #[doc = "Hide or show an object"]
10734 #[serde(rename = "object_visible")]
10735 ObjectVisible {
10736 #[doc = "Whether or not the object should be hidden."]
10737 hidden: bool,
10738 #[doc = "Which object to change"]
10739 object_id: uuid::Uuid,
10740 },
10741 #[doc = "Bring an object to the front of the scene"]
10742 #[serde(rename = "object_bring_to_front")]
10743 ObjectBringToFront {
10744 #[doc = "Which object to change"]
10745 object_id: uuid::Uuid,
10746 },
10747 #[doc = "Set the material properties of an object"]
10748 #[serde(rename = "object_set_material_params_pbr")]
10749 ObjectSetMaterialParamsPbr {
10750 #[doc = "Ambient Occlusion of the new material"]
10751 ambient_occlusion: f64,
10752 #[doc = "Color of the new material"]
10753 color: Color,
10754 #[doc = "Metalness of the new material"]
10755 metalness: f64,
10756 #[doc = "Which object to change"]
10757 object_id: uuid::Uuid,
10758 #[doc = "Roughness of the new material"]
10759 roughness: f64,
10760 },
10761 #[doc = "What type of entity is this?"]
10762 #[serde(rename = "get_entity_type")]
10763 GetEntityType {
10764 #[doc = "ID of the entity being queried."]
10765 entity_id: uuid::Uuid,
10766 },
10767 #[doc = "Gets all faces which use the given edge."]
10768 #[serde(rename = "solid3d_get_all_edge_faces")]
10769 Solid3DGetAllEdgeFaces {
10770 #[doc = "Which edge you want the faces of."]
10771 edge_id: uuid::Uuid,
10772 #[doc = "Which object is being queried."]
10773 object_id: uuid::Uuid,
10774 },
10775 #[doc = "Add a hole to a Solid2d object before extruding it."]
10776 #[serde(rename = "solid2d_add_hole")]
10777 Solid2DAddHole {
10778 #[doc = "The id of the path to use as the inner profile (hole)."]
10779 hole_id: uuid::Uuid,
10780 #[doc = "Which object to add the hole to."]
10781 object_id: uuid::Uuid,
10782 },
10783 #[doc = "Gets all edges which are opposite the given edge, across all possible faces."]
10784 #[serde(rename = "solid3d_get_all_opposite_edges")]
10785 Solid3DGetAllOppositeEdges {
10786 #[doc = "If given, only faces parallel to this vector will be considered."]
10787 #[serde(default, skip_serializing_if = "Option::is_none")]
10788 along_vector: Option<Point3D>,
10789 #[doc = "Which edge you want the opposites of."]
10790 edge_id: uuid::Uuid,
10791 #[doc = "Which object is being queried."]
10792 object_id: uuid::Uuid,
10793 },
10794 #[doc = "Gets the edge opposite the given edge, along the given face."]
10795 #[serde(rename = "solid3d_get_opposite_edge")]
10796 Solid3DGetOppositeEdge {
10797 #[doc = "Which edge you want the opposite of."]
10798 edge_id: uuid::Uuid,
10799 #[doc = "Which face is used to figure out the opposite edge?"]
10800 face_id: uuid::Uuid,
10801 #[doc = "Which object is being queried."]
10802 object_id: uuid::Uuid,
10803 },
10804 #[doc = "Gets the next adjacent edge for the given edge, along the given face."]
10805 #[serde(rename = "solid3d_get_next_adjacent_edge")]
10806 Solid3DGetNextAdjacentEdge {
10807 #[doc = "Which edge you want the opposite of."]
10808 edge_id: uuid::Uuid,
10809 #[doc = "Which face is used to figure out the opposite edge?"]
10810 face_id: uuid::Uuid,
10811 #[doc = "Which object is being queried."]
10812 object_id: uuid::Uuid,
10813 },
10814 #[doc = "Gets the previous adjacent edge for the given edge, along the given face."]
10815 #[serde(rename = "solid3d_get_prev_adjacent_edge")]
10816 Solid3DGetPrevAdjacentEdge {
10817 #[doc = "Which edge you want the opposite of."]
10818 edge_id: uuid::Uuid,
10819 #[doc = "Which face is used to figure out the opposite edge?"]
10820 face_id: uuid::Uuid,
10821 #[doc = "Which object is being queried."]
10822 object_id: uuid::Uuid,
10823 },
10824 #[doc = "Gets the shared edge between these two faces if it exists"]
10825 #[serde(rename = "solid3d_get_common_edge")]
10826 Solid3DGetCommonEdge {
10827 #[doc = "The faces being queried"]
10828 face_ids: Vec<uuid::Uuid>,
10829 #[doc = "Which object is being queried."]
10830 object_id: uuid::Uuid,
10831 },
10832 #[doc = "Fillets the given edge with the specified radius."]
10833 #[serde(rename = "solid3d_fillet_edge")]
10834 Solid3DFilletEdge {
10835 #[doc = "How to apply the cut."]
10836 #[serde(default, skip_serializing_if = "Option::is_none")]
10837 cut_type: Option<CutType>,
10838 #[doc = "Which edge you want to fillet."]
10839 #[serde(default, skip_serializing_if = "Option::is_none")]
10840 edge_id: Option<uuid::Uuid>,
10841 #[doc = "Which edges you want to fillet."]
10842 #[serde(default)]
10843 edge_ids: Vec<uuid::Uuid>,
10844 #[doc = "What IDs should the resulting faces have? If you've only passed one edge ID, its \
10845 ID will be the command ID used to send this command, and this field should be \
10846 empty. If you've passed `n` IDs (to fillet `n` edges), then this should be \
10847 length `n-1`, and the first edge will use the command ID used to send this \
10848 command."]
10849 #[serde(default)]
10850 extra_face_ids: Vec<uuid::Uuid>,
10851 #[doc = "Which object is being filletted."]
10852 object_id: uuid::Uuid,
10853 #[doc = "The radius of the fillet. Measured in length (using the same units that the \
10854 current sketch uses). Must be positive (i.e. greater than zero)."]
10855 radius: f64,
10856 #[doc = "Which cutting algorithm to use."]
10857 #[serde(default, skip_serializing_if = "Option::is_none")]
10858 strategy: Option<CutStrategy>,
10859 #[doc = "The maximum acceptable surface gap computed between the filleted surfaces. Must \
10860 be positive (i.e. greater than zero)."]
10861 tolerance: f64,
10862 },
10863 #[doc = "Determines whether a brep face is planar and returns its surface-local planar axes \
10864 if so"]
10865 #[serde(rename = "face_is_planar")]
10866 FaceIsPlanar {
10867 #[doc = "Which face is being queried."]
10868 object_id: uuid::Uuid,
10869 },
10870 #[doc = "Determines a position on a brep face evaluated by parameters u,v"]
10871 #[serde(rename = "face_get_position")]
10872 FaceGetPosition {
10873 #[doc = "Which face is being queried."]
10874 object_id: uuid::Uuid,
10875 #[doc = "The 2D parameter-space u,v position to evaluate the surface at"]
10876 uv: Point2D,
10877 },
10878 #[doc = "Obtains the surface \"center of mass\""]
10879 #[serde(rename = "face_get_center")]
10880 FaceGetCenter {
10881 #[doc = "Which face is being queried."]
10882 object_id: uuid::Uuid,
10883 },
10884 #[doc = "Determines the gradient (dFdu, dFdv) + normal vector on a brep face evaluated by \
10885 parameters u,v"]
10886 #[serde(rename = "face_get_gradient")]
10887 FaceGetGradient {
10888 #[doc = "Which face is being queried."]
10889 object_id: uuid::Uuid,
10890 #[doc = "The 2D parameter-space u,v position to evaluate the surface at"]
10891 uv: Point2D,
10892 },
10893 #[doc = "Send object to front or back."]
10894 #[serde(rename = "send_object")]
10895 SendObject {
10896 #[doc = "Bring to front = true, send to back = false."]
10897 front: bool,
10898 #[doc = "Which object is being changed."]
10899 object_id: uuid::Uuid,
10900 },
10901 #[doc = "Set opacity of the entity."]
10902 #[serde(rename = "entity_set_opacity")]
10903 EntitySetOpacity {
10904 #[doc = "Which entity is being changed."]
10905 entity_id: uuid::Uuid,
10906 #[doc = "How transparent should it be? 0 or lower is totally transparent. 1 or greater is \
10907 totally opaque."]
10908 opacity: f64,
10909 },
10910 #[doc = "Fade entity in or out."]
10911 #[serde(rename = "entity_fade")]
10912 EntityFade {
10913 #[doc = "How many seconds the animation should take."]
10914 #[serde(default, skip_serializing_if = "Option::is_none")]
10915 duration_seconds: Option<f64>,
10916 #[doc = "Which entity is being changed."]
10917 entity_id: uuid::Uuid,
10918 #[doc = "Fade in = true, fade out = false."]
10919 fade_in: bool,
10920 },
10921 #[doc = "Make a new plane"]
10922 #[serde(rename = "make_plane")]
10923 MakePlane {
10924 #[doc = "If true, any existing drawables within the obj will be replaced (the object will \
10925 be reset)"]
10926 clobber: bool,
10927 #[doc = "If true, the plane will be created but hidden initially."]
10928 #[serde(default, skip_serializing_if = "Option::is_none")]
10929 hide: Option<bool>,
10930 #[doc = "Origin of the plane"]
10931 origin: Point3D,
10932 #[doc = "What should the plane's span/extent? When rendered visually, this is both the \
10933 width and height along X and Y axis respectively."]
10934 size: f64,
10935 #[doc = "What should the plane's X axis be?"]
10936 x_axis: Point3D,
10937 #[doc = "What should the plane's Y axis be?"]
10938 y_axis: Point3D,
10939 },
10940 #[doc = "Set the color of a plane."]
10941 #[serde(rename = "plane_set_color")]
10942 PlaneSetColor {
10943 #[doc = "What color it should be."]
10944 color: Color,
10945 #[doc = "Which plane is being changed."]
10946 plane_id: uuid::Uuid,
10947 },
10948 #[doc = "Set the current tool."]
10949 #[serde(rename = "set_tool")]
10950 SetTool {
10951 #[doc = "What tool should be active."]
10952 tool: SceneToolType,
10953 },
10954 #[doc = "Send a mouse move event"]
10955 #[serde(rename = "mouse_move")]
10956 MouseMove {
10957 #[doc = "Logical timestamp. The client should increment this with every event in the \
10958 current mouse drag. That way, if the events are being sent over an unordered \
10959 channel, the API can ignore the older events."]
10960 #[serde(default, skip_serializing_if = "Option::is_none")]
10961 sequence: Option<u32>,
10962 #[doc = "Where the mouse is"]
10963 window: Point2D,
10964 },
10965 #[doc = "Send a mouse click event Updates modified/selected entities."]
10966 #[serde(rename = "mouse_click")]
10967 MouseClick {
10968 #[doc = "Where the mouse is"]
10969 window: Point2D,
10970 },
10971 #[doc = "Disable sketch mode. If you are sketching on a face, be sure to not disable sketch \
10972 mode until you have extruded. Otherwise, your object will not be fused with the face."]
10973 #[serde(rename = "sketch_mode_disable")]
10974 SketchModeDisable {},
10975 #[doc = "Get the plane for sketch mode."]
10976 #[serde(rename = "get_sketch_mode_plane")]
10977 GetSketchModePlane {},
10978 #[doc = "Get the plane for sketch mode."]
10979 #[serde(rename = "curve_set_constraint")]
10980 CurveSetConstraint {
10981 #[doc = "Which constraint to apply."]
10982 constraint_bound: PathComponentConstraintBound,
10983 #[doc = "What part of the curve should be constrained."]
10984 constraint_type: PathComponentConstraintType,
10985 #[doc = "Which curve to constrain."]
10986 object_id: uuid::Uuid,
10987 },
10988 #[doc = "Sketch on some entity (e.g. a plane, a face)."]
10989 #[serde(rename = "enable_sketch_mode")]
10990 EnableSketchMode {
10991 #[doc = "Should the camera move at all?"]
10992 adjust_camera: bool,
10993 #[doc = "Should we animate or snap for the camera transition?"]
10994 animated: bool,
10995 #[doc = "Which entity to sketch on."]
10996 entity_id: uuid::Uuid,
10997 #[doc = "Should the camera use orthographic projection? In other words, should an \
10998 object's size in the rendered image stay constant regardless of its distance \
10999 from the camera."]
11000 ortho: bool,
11001 #[doc = "If provided, ensures that the normal of the sketch plane must be aligned with \
11002 this supplied normal (otherwise the camera position will be used to infer the \
11003 normal to point towards the viewer)"]
11004 #[serde(default, skip_serializing_if = "Option::is_none")]
11005 planar_normal: Option<Point3D>,
11006 },
11007 #[doc = "Sets whether or not changes to the scene or its objects will be done as a \"dry \
11008 run\" In a dry run, successful commands won't actually change the model. This is \
11009 useful for catching errors before actually making the change."]
11010 #[serde(rename = "enable_dry_run")]
11011 EnableDryRun {},
11012 #[doc = "Sets whether or not changes to the scene or its objects will be done as a \"dry \
11013 run\" In a dry run, successful commands won't actually change the model. This is \
11014 useful for catching errors before actually making the change."]
11015 #[serde(rename = "disable_dry_run")]
11016 DisableDryRun {},
11017 #[doc = "Set the background color of the scene."]
11018 #[serde(rename = "set_background_color")]
11019 SetBackgroundColor {
11020 #[doc = "The color to set the background to."]
11021 color: Color,
11022 },
11023 #[doc = "Set the properties of the tool lines for the scene."]
11024 #[serde(rename = "set_current_tool_properties")]
11025 SetCurrentToolProperties {
11026 #[doc = "The color to set the tool line to."]
11027 #[serde(default, skip_serializing_if = "Option::is_none")]
11028 color: Option<Color>,
11029 },
11030 #[doc = "Set the default system properties used when a specific property isn't set."]
11031 #[serde(rename = "set_default_system_properties")]
11032 SetDefaultSystemProperties {
11033 #[doc = "The default system color."]
11034 #[serde(default, skip_serializing_if = "Option::is_none")]
11035 color: Option<Color>,
11036 },
11037 #[doc = "Get type of the given curve."]
11038 #[serde(rename = "curve_get_type")]
11039 CurveGetType {
11040 #[doc = "Which curve to query."]
11041 curve_id: uuid::Uuid,
11042 },
11043 #[doc = "Get control points of the given curve."]
11044 #[serde(rename = "curve_get_control_points")]
11045 CurveGetControlPoints {
11046 #[doc = "Which curve to query."]
11047 curve_id: uuid::Uuid,
11048 },
11049 #[doc = "Project an entity on to a plane."]
11050 #[serde(rename = "project_entity_to_plane")]
11051 ProjectEntityToPlane {
11052 #[doc = "Which entity to project (vertex or edge)."]
11053 entity_id: uuid::Uuid,
11054 #[doc = "Which plane to project entity_id onto."]
11055 plane_id: uuid::Uuid,
11056 #[doc = "If true: the projected points are returned in the plane_id's coordinate system, \
11057 else: the projected points are returned in the world coordinate system."]
11058 use_plane_coords: bool,
11059 },
11060 #[doc = "Project a list of points on to a plane."]
11061 #[serde(rename = "project_points_to_plane")]
11062 ProjectPointsToPlane {
11063 #[doc = "The id of the plane used for the projection."]
11064 plane_id: uuid::Uuid,
11065 #[doc = "The list of points that will be projected."]
11066 points: Vec<Point3D>,
11067 #[doc = "If true: the projected points are returned in the plane_id's coordinate sysetm. \
11068 else: the projected points are returned in the world coordinate system."]
11069 use_plane_coords: bool,
11070 },
11071 #[doc = "Take a snapshot of the current view."]
11072 #[serde(rename = "take_snapshot")]
11073 TakeSnapshot {
11074 #[doc = "What image format to return."]
11075 format: ImageFormat,
11076 },
11077 #[doc = "Add a gizmo showing the axes."]
11078 #[serde(rename = "make_axes_gizmo")]
11079 MakeAxesGizmo {
11080 #[doc = "If true, any existing drawables within the obj will be replaced (the object will \
11081 be reset)"]
11082 clobber: bool,
11083 #[doc = "If true, axes gizmo will be placed in the corner of the screen. If false, it \
11084 will be placed at the origin of the scene."]
11085 gizmo_mode: bool,
11086 },
11087 #[doc = "Query the given path."]
11088 #[serde(rename = "path_get_info")]
11089 PathGetInfo {
11090 #[doc = "Which path to query"]
11091 path_id: uuid::Uuid,
11092 },
11093 #[doc = "Obtain curve ids for vertex ids"]
11094 #[serde(rename = "path_get_curve_uuids_for_vertices")]
11095 PathGetCurveUuidsForVertices {
11096 #[doc = "Which path to query"]
11097 path_id: uuid::Uuid,
11098 #[doc = "IDs of the vertices for which to obtain curve ids from"]
11099 vertex_ids: Vec<uuid::Uuid>,
11100 },
11101 #[doc = "Obtain curve id by index"]
11102 #[serde(rename = "path_get_curve_uuid")]
11103 PathGetCurveUuid {
11104 #[doc = "IDs of the vertices for which to obtain curve ids from"]
11105 index: u32,
11106 #[doc = "Which path to query"]
11107 path_id: uuid::Uuid,
11108 },
11109 #[doc = "Obtain vertex ids for a path"]
11110 #[serde(rename = "path_get_vertex_uuids")]
11111 PathGetVertexUuids {
11112 #[doc = "Which path to query"]
11113 path_id: uuid::Uuid,
11114 },
11115 #[doc = "Obtain the sketch target id (if the path was drawn in sketchmode) for a path"]
11116 #[serde(rename = "path_get_sketch_target_uuid")]
11117 PathGetSketchTargetUuid {
11118 #[doc = "Which path to query"]
11119 path_id: uuid::Uuid,
11120 },
11121 #[doc = "Start dragging the mouse."]
11122 #[serde(rename = "handle_mouse_drag_start")]
11123 HandleMouseDragStart {
11124 #[doc = "The mouse position."]
11125 window: Point2D,
11126 },
11127 #[doc = "Continue dragging the mouse."]
11128 #[serde(rename = "handle_mouse_drag_move")]
11129 HandleMouseDragMove {
11130 #[doc = "Logical timestamp. The client should increment this with every event in the \
11131 current mouse drag. That way, if the events are being sent over an unordered \
11132 channel, the API can ignore the older events."]
11133 #[serde(default, skip_serializing_if = "Option::is_none")]
11134 sequence: Option<u32>,
11135 #[doc = "The mouse position."]
11136 window: Point2D,
11137 },
11138 #[doc = "Stop dragging the mouse."]
11139 #[serde(rename = "handle_mouse_drag_end")]
11140 HandleMouseDragEnd {
11141 #[doc = "The mouse position."]
11142 window: Point2D,
11143 },
11144 #[doc = "Remove scene objects."]
11145 #[serde(rename = "remove_scene_objects")]
11146 RemoveSceneObjects {
11147 #[doc = "Objects to remove."]
11148 object_ids: Vec<uuid::Uuid>,
11149 },
11150 #[doc = "Utility method. Performs both a ray cast and projection to plane-local coordinates. \
11151 Returns the plane coordinates for the given window coordinates."]
11152 #[serde(rename = "plane_intersect_and_project")]
11153 PlaneIntersectAndProject {
11154 #[doc = "The plane you're intersecting against."]
11155 plane_id: uuid::Uuid,
11156 #[doc = "Window coordinates where the ray cast should be aimed."]
11157 window: Point2D,
11158 },
11159 #[doc = "Find the start and end of a curve."]
11160 #[serde(rename = "curve_get_end_points")]
11161 CurveGetEndPoints {
11162 #[doc = "ID of the curve being queried."]
11163 curve_id: uuid::Uuid,
11164 },
11165 #[doc = "Reconfigure the stream."]
11166 #[serde(rename = "reconfigure_stream")]
11167 ReconfigureStream {
11168 #[doc = "Video feed's constant bitrate (CBR)"]
11169 #[serde(default, skip_serializing_if = "Option::is_none")]
11170 bitrate: Option<u32>,
11171 #[doc = "Frames per second."]
11172 fps: u32,
11173 #[doc = "Height of the stream."]
11174 height: u32,
11175 #[doc = "Width of the stream."]
11176 width: u32,
11177 },
11178 #[doc = "Import files to the current model."]
11179 #[serde(rename = "import_files")]
11180 ImportFiles {
11181 #[doc = "Files to import."]
11182 files: Vec<ImportFile>,
11183 #[doc = "Input file format."]
11184 format: InputFormat3D,
11185 },
11186 #[doc = "Set the units of the scene. For all following commands, the units will be \
11187 interpreted as the given units. Any previously executed commands will not be \
11188 affected or have their units changed. They will remain in the units they were \
11189 originally executed in."]
11190 #[serde(rename = "set_scene_units")]
11191 SetSceneUnits {
11192 #[doc = "Which units the scene uses."]
11193 unit: UnitLength,
11194 },
11195 #[doc = "Get the mass of entities in the scene or the default scene."]
11196 #[serde(rename = "mass")]
11197 Mass {
11198 #[doc = "IDs of the entities to get the mass of. If this is empty, then the default scene \
11199 is included in the mass."]
11200 entity_ids: Vec<uuid::Uuid>,
11201 #[doc = "The material density."]
11202 material_density: f64,
11203 #[doc = "The material density unit."]
11204 material_density_unit: UnitDensity,
11205 #[doc = "The output unit for the mass."]
11206 output_unit: UnitMass,
11207 },
11208 #[doc = "Get the density of entities in the scene or the default scene."]
11209 #[serde(rename = "density")]
11210 Density {
11211 #[doc = "IDs of the entities to get the density of. If this is empty, then the default \
11212 scene is included in the density."]
11213 entity_ids: Vec<uuid::Uuid>,
11214 #[doc = "The material mass."]
11215 material_mass: f64,
11216 #[doc = "The material mass unit."]
11217 material_mass_unit: UnitMass,
11218 #[doc = "The output unit for the density."]
11219 output_unit: UnitDensity,
11220 },
11221 #[doc = "Get the volume of entities in the scene or the default scene."]
11222 #[serde(rename = "volume")]
11223 Volume {
11224 #[doc = "IDs of the entities to get the volume of. If this is empty, then the default \
11225 scene is included in the volume."]
11226 entity_ids: Vec<uuid::Uuid>,
11227 #[doc = "The output unit for the volume."]
11228 output_unit: UnitVolume,
11229 },
11230 #[doc = "Get the center of mass of entities in the scene or the default scene."]
11231 #[serde(rename = "center_of_mass")]
11232 CenterOfMass {
11233 #[doc = "IDs of the entities to get the center of mass of. If this is empty, then the \
11234 default scene is included in the center of mass."]
11235 entity_ids: Vec<uuid::Uuid>,
11236 #[doc = "The output unit for the center of mass."]
11237 output_unit: UnitLength,
11238 },
11239 #[doc = "Get the surface area of entities in the scene or the default scene."]
11240 #[serde(rename = "surface_area")]
11241 SurfaceArea {
11242 #[doc = "IDs of the entities to get the surface area of. If this is empty, then the \
11243 default scene is included in the surface area."]
11244 entity_ids: Vec<uuid::Uuid>,
11245 #[doc = "The output unit for the surface area."]
11246 output_unit: UnitArea,
11247 },
11248 #[doc = "Focus the default camera upon an object in the scene."]
11249 #[serde(rename = "default_camera_focus_on")]
11250 DefaultCameraFocusOn {
11251 #[doc = "UUID of object to focus on."]
11252 uuid: uuid::Uuid,
11253 },
11254 #[doc = "When you select some entity with the current tool, what should happen to the entity?"]
11255 #[serde(rename = "set_selection_type")]
11256 SetSelectionType {
11257 #[doc = "What type of selection should occur when you select something?"]
11258 selection_type: SceneSelectionType,
11259 },
11260 #[doc = "What kind of entities can be selected?"]
11261 #[serde(rename = "set_selection_filter")]
11262 SetSelectionFilter {
11263 #[doc = "If vector is empty, clear all filters. If vector is non-empty, only the given \
11264 entity types will be selectable."]
11265 filter: Vec<EntityType>,
11266 },
11267 #[doc = "Use orthographic projection."]
11268 #[serde(rename = "default_camera_set_orthographic")]
11269 DefaultCameraSetOrthographic {},
11270 #[doc = "Use perspective projection."]
11271 #[serde(rename = "default_camera_set_perspective")]
11272 DefaultCameraSetPerspective {
11273 #[doc = "If this is not given, use the same parameters as last time the perspective \
11274 camera was used."]
11275 #[serde(default, skip_serializing_if = "Option::is_none")]
11276 parameters: Option<PerspectiveCameraParameters>,
11277 },
11278 #[doc = "Updates the camera to center to the center of the current selection (or the origin \
11279 if nothing is selected)"]
11280 #[serde(rename = "default_camera_center_to_selection")]
11281 DefaultCameraCenterToSelection {
11282 #[doc = "Dictates whether or not the camera position should be adjusted during this \
11283 operation If no movement is requested, the camera will orbit around the new \
11284 center from its current position"]
11285 #[serde(default, skip_serializing_if = "Option::is_none")]
11286 camera_movement: Option<CameraMovement>,
11287 },
11288 #[doc = "Updates the camera to center to the center of the current scene's bounds"]
11289 #[serde(rename = "default_camera_center_to_scene")]
11290 DefaultCameraCenterToScene {
11291 #[doc = "Dictates whether or not the camera position should be adjusted during this \
11292 operation If no movement is requested, the camera will orbit around the new \
11293 center from its current position"]
11294 #[serde(default, skip_serializing_if = "Option::is_none")]
11295 camera_movement: Option<CameraMovement>,
11296 },
11297 #[doc = "Fit the view to the specified object(s)."]
11298 #[serde(rename = "zoom_to_fit")]
11299 ZoomToFit {
11300 #[doc = "Whether or not to animate the camera movement."]
11301 #[serde(default)]
11302 animated: bool,
11303 #[doc = "Which objects to fit camera to; if empty, fit to all non-default objects. \
11304 Defaults to empty vector."]
11305 #[serde(default)]
11306 object_ids: Vec<uuid::Uuid>,
11307 #[doc = "How much to pad the view frame by, as a fraction of the object(s) bounding box \
11308 size. Negative padding will crop the view of the object proportionally. e.g. \
11309 padding = 0.2 means the view will span 120% of the object(s) bounding box, and \
11310 padding = -0.2 means the view will span 80% of the object(s) bounding box."]
11311 #[serde(default, skip_serializing_if = "Option::is_none")]
11312 padding: Option<f64>,
11313 },
11314 #[doc = "Looks along the normal of the specified face (if it is planar!), and fits the view \
11315 to it."]
11316 #[serde(rename = "orient_to_face")]
11317 OrientToFace {
11318 #[doc = "Whether or not to animate the camera movement. (Animation is currently not \
11319 supported.)"]
11320 #[serde(default)]
11321 animated: bool,
11322 #[doc = "Which face to orient camera to. If the face is not planar, no action will occur."]
11323 face_id: uuid::Uuid,
11324 #[doc = "How much to pad the view frame by, as a fraction of the face bounding box size. \
11325 Negative padding will crop the view of the face proportionally. e.g. padding = \
11326 0.2 means the view will span 120% of the face bounding box, and padding = -0.2 \
11327 means the view will span 80% of the face bounding box."]
11328 #[serde(default, skip_serializing_if = "Option::is_none")]
11329 padding: Option<f64>,
11330 },
11331 #[doc = "Fit the view to the scene with an isometric view."]
11332 #[serde(rename = "view_isometric")]
11333 ViewIsometric {
11334 #[doc = "How much to pad the view frame by, as a fraction of the object(s) bounding box \
11335 size. Negative padding will crop the view of the object proportionally. e.g. \
11336 padding = 0.2 means the view will span 120% of the object(s) bounding box, and \
11337 padding = -0.2 means the view will span 80% of the object(s) bounding box."]
11338 #[serde(default, skip_serializing_if = "Option::is_none")]
11339 padding: Option<f64>,
11340 },
11341 #[doc = "Get a concise description of all of an extrusion's faces."]
11342 #[serde(rename = "solid3d_get_extrusion_face_info")]
11343 Solid3DGetExtrusionFaceInfo {
11344 #[doc = "Any edge that lies on the extrusion base path."]
11345 edge_id: uuid::Uuid,
11346 #[doc = "The Solid3d object whose extrusion is being queried."]
11347 object_id: uuid::Uuid,
11348 },
11349 #[doc = "Get a concise description of all of solids edges."]
11350 #[serde(rename = "solid3d_get_adjacency_info")]
11351 Solid3DGetAdjacencyInfo {
11352 #[doc = "Any edge that lies on the extrusion base path."]
11353 edge_id: uuid::Uuid,
11354 #[doc = "The Solid3d object whose info is being queried."]
11355 object_id: uuid::Uuid,
11356 },
11357 #[doc = "Clear the selection"]
11358 #[serde(rename = "select_clear")]
11359 SelectClear {},
11360 #[doc = "Find all IDs of selected entities"]
11361 #[serde(rename = "select_get")]
11362 SelectGet {},
11363 #[doc = "Get the number of objects in the scene"]
11364 #[serde(rename = "get_num_objects")]
11365 GetNumObjects {},
11366 #[doc = "Set the transform of an object."]
11367 #[serde(rename = "set_object_transform")]
11368 SetObjectTransform {
11369 #[doc = "Id of the object whose transform is to be set."]
11370 object_id: uuid::Uuid,
11371 #[doc = "List of transforms to be applied to the object."]
11372 transforms: Vec<ComponentTransform>,
11373 },
11374 #[doc = "Create a new solid from combining other smaller solids. In other words, every part \
11375 of the input solids will be included in the output solid."]
11376 #[serde(rename = "boolean_union")]
11377 BooleanUnion {
11378 #[doc = "Which solids to union together. Cannot be empty."]
11379 solid_ids: Vec<uuid::Uuid>,
11380 #[doc = "The maximum acceptable surface gap computed between the joined solids. Must be \
11381 positive (i.e. greater than zero)."]
11382 tolerance: f64,
11383 },
11384 #[doc = "Create a new solid from intersecting several other solids. In other words, the part \
11385 of the input solids where they all overlap will be the output solid."]
11386 #[serde(rename = "boolean_intersection")]
11387 BooleanIntersection {
11388 #[doc = "Which solids to intersect together"]
11389 solid_ids: Vec<uuid::Uuid>,
11390 #[doc = "The maximum acceptable surface gap computed between the joined solids. Must be \
11391 positive (i.e. greater than zero)."]
11392 tolerance: f64,
11393 },
11394 #[doc = "Create a new solid from subtracting several other solids. The 'target' is what will \
11395 be cut from. The 'tool' is what will be cut out from 'target'."]
11396 #[serde(rename = "boolean_subtract")]
11397 BooleanSubtract {
11398 #[doc = "Geometry to cut out from."]
11399 target_ids: Vec<uuid::Uuid>,
11400 #[doc = "The maximum acceptable surface gap computed between the target and the solids \
11401 cut out from it. Must be positive (i.e. greater than zero)."]
11402 tolerance: f64,
11403 #[doc = "Will be cut out from the 'target'."]
11404 tool_ids: Vec<uuid::Uuid>,
11405 },
11406 #[doc = "Make a new path by offsetting an object by a given distance. The new path's ID will \
11407 be the ID of this command."]
11408 #[serde(rename = "make_offset_path")]
11409 MakeOffsetPath {
11410 #[doc = "If the object is a solid, this is the ID of the face to base the offset on. If \
11411 given, and `object_id` refers to a solid, then this face on the solid will be \
11412 offset. If given but `object_id` doesn't refer to a solid, responds with an \
11413 error. If not given, then `object_id` itself will be offset directly."]
11414 #[serde(default, skip_serializing_if = "Option::is_none")]
11415 face_id: Option<uuid::Uuid>,
11416 #[doc = "The object that will be offset (can be a path, sketch, or a solid)"]
11417 object_id: uuid::Uuid,
11418 #[doc = "The distance to offset the path (positive for outset, negative for inset)"]
11419 offset: f64,
11420 },
11421 #[doc = "Add a hole to a closed path by offsetting it a uniform distance inward."]
11422 #[serde(rename = "add_hole_from_offset")]
11423 AddHoleFromOffset {
11424 #[doc = "The closed path to add a hole to."]
11425 object_id: uuid::Uuid,
11426 #[doc = "The distance to offset the path (positive for outset, negative for inset)"]
11427 offset: f64,
11428 },
11429 #[doc = "Align the grid with a plane or a planar face."]
11430 #[serde(rename = "set_grid_reference_plane")]
11431 SetGridReferencePlane {
11432 #[doc = "The grid to be moved."]
11433 grid_id: uuid::Uuid,
11434 #[doc = "The plane or face that the grid will be aligned to. If a face, it must be planar \
11435 to succeed."]
11436 reference_id: uuid::Uuid,
11437 },
11438 #[doc = "Set the scale of the grid lines in the video feed."]
11439 #[serde(rename = "set_grid_scale")]
11440 SetGridScale {
11441 #[doc = "Which units the `value` field uses."]
11442 units: UnitLength,
11443 #[doc = "Distance between grid lines represents this much distance."]
11444 value: f64,
11445 },
11446 #[doc = "Set the grid lines to auto scale. The grid will get larger the further you zoom out, \
11447 and smaller the more you zoom in."]
11448 #[serde(rename = "set_grid_auto_scale")]
11449 SetGridAutoScale {},
11450}
11451
11452#[doc = "A graphics command submitted to the KittyCAD engine via the Modeling API."]
11453#[derive(
11454 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11455)]
11456pub struct ModelingCmdReq {
11457 #[doc = "Which command to submit to the Kittycad engine."]
11458 pub cmd: ModelingCmd,
11459 #[doc = "ID of command being submitted."]
11460 pub cmd_id: uuid::Uuid,
11461}
11462
11463impl std::fmt::Display for ModelingCmdReq {
11464 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11465 write!(
11466 f,
11467 "{}",
11468 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11469 )
11470 }
11471}
11472
11473#[cfg(feature = "tabled")]
11474impl tabled::Tabled for ModelingCmdReq {
11475 const LENGTH: usize = 2;
11476 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11477 vec![
11478 format!("{:?}", self.cmd).into(),
11479 format!("{:?}", self.cmd_id).into(),
11480 ]
11481 }
11482
11483 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11484 vec!["cmd".into(), "cmd_id".into()]
11485 }
11486}
11487
11488#[doc = "Successful Websocket response."]
11489#[derive(
11490 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11491)]
11492pub struct ModelingSessionData {
11493 #[doc = "ID of the API call this modeling session is using. Useful for tracing and debugging."]
11494 pub api_call_id: String,
11495}
11496
11497impl std::fmt::Display for ModelingSessionData {
11498 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11499 write!(
11500 f,
11501 "{}",
11502 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11503 )
11504 }
11505}
11506
11507#[cfg(feature = "tabled")]
11508impl tabled::Tabled for ModelingSessionData {
11509 const LENGTH: usize = 1;
11510 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11511 vec![self.api_call_id.clone().into()]
11512 }
11513
11514 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11515 vec!["api_call_id".into()]
11516 }
11517}
11518
11519#[doc = "The response from the `MouseClick` command."]
11520#[derive(
11521 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11522)]
11523pub struct MouseClick {
11524 #[doc = "Entities that are modified."]
11525 pub entities_modified: Vec<uuid::Uuid>,
11526 #[doc = "Entities that are selected."]
11527 pub entities_selected: Vec<uuid::Uuid>,
11528}
11529
11530impl std::fmt::Display for MouseClick {
11531 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11532 write!(
11533 f,
11534 "{}",
11535 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11536 )
11537 }
11538}
11539
11540#[cfg(feature = "tabled")]
11541impl tabled::Tabled for MouseClick {
11542 const LENGTH: usize = 2;
11543 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11544 vec![
11545 format!("{:?}", self.entities_modified).into(),
11546 format!("{:?}", self.entities_selected).into(),
11547 ]
11548 }
11549
11550 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11551 vec!["entities_modified".into(), "entities_selected".into()]
11552 }
11553}
11554
11555#[doc = "The response from the `MouseMove` endpoint."]
11556#[derive(
11557 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11558)]
11559pub struct MouseMove {}
11560
11561impl std::fmt::Display for MouseMove {
11562 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11563 write!(
11564 f,
11565 "{}",
11566 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11567 )
11568 }
11569}
11570
11571#[cfg(feature = "tabled")]
11572impl tabled::Tabled for MouseMove {
11573 const LENGTH: usize = 0;
11574 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11575 vec![]
11576 }
11577
11578 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11579 vec![]
11580 }
11581}
11582
11583#[doc = "The response from the `MovePathPen` endpoint."]
11584#[derive(
11585 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11586)]
11587pub struct MovePathPen {}
11588
11589impl std::fmt::Display for MovePathPen {
11590 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11591 write!(
11592 f,
11593 "{}",
11594 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11595 )
11596 }
11597}
11598
11599#[cfg(feature = "tabled")]
11600impl tabled::Tabled for MovePathPen {
11601 const LENGTH: usize = 0;
11602 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11603 vec![]
11604 }
11605
11606 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11607 vec![]
11608 }
11609}
11610
11611#[doc = "The response from the `NewAnnotation` endpoint."]
11612#[derive(
11613 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11614)]
11615pub struct NewAnnotation {}
11616
11617impl std::fmt::Display for NewAnnotation {
11618 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11619 write!(
11620 f,
11621 "{}",
11622 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11623 )
11624 }
11625}
11626
11627#[cfg(feature = "tabled")]
11628impl tabled::Tabled for NewAnnotation {
11629 const LENGTH: usize = 0;
11630 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11631 vec![]
11632 }
11633
11634 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11635 vec![]
11636 }
11637}
11638
11639#[doc = "Information about an OAuth 2.0 client."]
11640#[derive(
11641 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11642)]
11643pub struct Oauth2ClientInfo {
11644 #[doc = "Value used for [CSRF](https://tools.ietf.org/html/rfc6749#section-10.12) protection \
11645 via the `state` parameter."]
11646 #[serde(default, skip_serializing_if = "Option::is_none")]
11647 pub csrf_token: Option<String>,
11648 #[doc = "Nonce required for OIDC flows."]
11649 #[serde(default, skip_serializing_if = "Option::is_none")]
11650 pub oidc_nonce: Option<String>,
11651 #[doc = "Code Verifier used for [PKCE]((https://tools.ietf.org/html/rfc7636)) protection via \
11652 the `code_verifier` parameter. The value must have a minimum length of 43 characters \
11653 and a maximum length of 128 characters. Each character must be ASCII alphanumeric \
11654 or one of the characters \"-\" / \".\" / \"_\" / \"~\"."]
11655 #[serde(default, skip_serializing_if = "Option::is_none")]
11656 pub pkce_code_verifier: Option<String>,
11657 #[doc = "The URL for consent."]
11658 #[serde(default, skip_serializing_if = "Option::is_none")]
11659 pub url: Option<String>,
11660}
11661
11662impl std::fmt::Display for Oauth2ClientInfo {
11663 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11664 write!(
11665 f,
11666 "{}",
11667 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11668 )
11669 }
11670}
11671
11672#[cfg(feature = "tabled")]
11673impl tabled::Tabled for Oauth2ClientInfo {
11674 const LENGTH: usize = 4;
11675 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11676 vec![
11677 if let Some(csrf_token) = &self.csrf_token {
11678 format!("{:?}", csrf_token).into()
11679 } else {
11680 String::new().into()
11681 },
11682 if let Some(oidc_nonce) = &self.oidc_nonce {
11683 format!("{:?}", oidc_nonce).into()
11684 } else {
11685 String::new().into()
11686 },
11687 if let Some(pkce_code_verifier) = &self.pkce_code_verifier {
11688 format!("{:?}", pkce_code_verifier).into()
11689 } else {
11690 String::new().into()
11691 },
11692 if let Some(url) = &self.url {
11693 format!("{:?}", url).into()
11694 } else {
11695 String::new().into()
11696 },
11697 ]
11698 }
11699
11700 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11701 vec![
11702 "csrf_token".into(),
11703 "oidc_nonce".into(),
11704 "pkce_code_verifier".into(),
11705 "url".into(),
11706 ]
11707 }
11708}
11709
11710#[doc = "An OAuth 2.0 Grant Type. These are documented here: <https://oauth.net/2/grant-types/>."]
11711#[derive(
11712 serde :: Serialize,
11713 serde :: Deserialize,
11714 PartialEq,
11715 Hash,
11716 Debug,
11717 Clone,
11718 schemars :: JsonSchema,
11719 parse_display :: FromStr,
11720 parse_display :: Display,
11721)]
11722#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
11723#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
11724#[derive(Default)]
11725pub enum Oauth2GrantType {
11726 #[doc = "An OAuth 2.0 Device Authorization Grant."]
11727 #[serde(rename = "urn:ietf:params:oauth:grant-type:device_code")]
11728 #[display("urn:ietf:params:oauth:grant-type:device_code")]
11729 #[default]
11730 UrnIetfParamsOauthGrantTypeDeviceCode,
11731}
11732
11733
11734#[doc = "The response from the `ObjectBringToFront` endpoint."]
11735#[derive(
11736 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11737)]
11738pub struct ObjectBringToFront {}
11739
11740impl std::fmt::Display for ObjectBringToFront {
11741 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11742 write!(
11743 f,
11744 "{}",
11745 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11746 )
11747 }
11748}
11749
11750#[cfg(feature = "tabled")]
11751impl tabled::Tabled for ObjectBringToFront {
11752 const LENGTH: usize = 0;
11753 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11754 vec![]
11755 }
11756
11757 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11758 vec![]
11759 }
11760}
11761
11762#[doc = "The response from the `ObjectSetMaterialParamsPbr` endpoint."]
11763#[derive(
11764 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11765)]
11766pub struct ObjectSetMaterialParamsPbr {}
11767
11768impl std::fmt::Display for ObjectSetMaterialParamsPbr {
11769 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11770 write!(
11771 f,
11772 "{}",
11773 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11774 )
11775 }
11776}
11777
11778#[cfg(feature = "tabled")]
11779impl tabled::Tabled for ObjectSetMaterialParamsPbr {
11780 const LENGTH: usize = 0;
11781 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11782 vec![]
11783 }
11784
11785 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11786 vec![]
11787 }
11788}
11789
11790#[doc = "The response from the `ObjectVisible` endpoint."]
11791#[derive(
11792 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11793)]
11794pub struct ObjectVisible {}
11795
11796impl std::fmt::Display for ObjectVisible {
11797 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
11798 write!(
11799 f,
11800 "{}",
11801 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
11802 )
11803 }
11804}
11805
11806#[cfg(feature = "tabled")]
11807impl tabled::Tabled for ObjectVisible {
11808 const LENGTH: usize = 0;
11809 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
11810 vec![]
11811 }
11812
11813 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
11814 vec![]
11815 }
11816}
11817
11818#[doc = "A successful response from a modeling command. This can be one of several types of \
11819 responses, depending on the command."]
11820#[derive(
11821 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
11822)]
11823#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
11824#[serde(tag = "type")]
11825pub enum OkModelingCmdResponse {
11826 #[doc = "An empty response, used for any command that does not explicitly have a response \
11827 defined here."]
11828 #[serde(rename = "empty")]
11829 Empty {},
11830 #[serde(rename = "engine_util_evaluate_path")]
11831 EngineUtilEvaluatePath {
11832 #[doc = "The response of the `EngineUtilEvaluatePath` endpoint"]
11833 data: EngineUtilEvaluatePath,
11834 },
11835 #[serde(rename = "start_path")]
11836 StartPath {
11837 #[doc = "The response from the `StartPath` endpoint."]
11838 data: StartPath,
11839 },
11840 #[serde(rename = "move_path_pen")]
11841 MovePathPen {
11842 #[doc = "The response from the `MovePathPen` endpoint."]
11843 data: MovePathPen,
11844 },
11845 #[serde(rename = "extend_path")]
11846 ExtendPath {
11847 #[doc = "The response from the `ExtendPath` endpoint."]
11848 data: ExtendPath,
11849 },
11850 #[serde(rename = "extrude")]
11851 Extrude {
11852 #[doc = "The response from the `Extrude` endpoint."]
11853 data: Extrude,
11854 },
11855 #[serde(rename = "twist_extrude")]
11856 TwistExtrude {
11857 #[doc = "The response from the `TwistExtrude` endpoint."]
11858 data: TwistExtrude,
11859 },
11860 #[serde(rename = "sweep")]
11861 Sweep {
11862 #[doc = "The response from the `Sweep` endpoint."]
11863 data: Sweep,
11864 },
11865 #[serde(rename = "revolve")]
11866 Revolve {
11867 #[doc = "The response from the `Revolve` endpoint."]
11868 data: Revolve,
11869 },
11870 #[serde(rename = "solid3d_shell_face")]
11871 Solid3DShellFace {
11872 #[doc = "The response from the `Solid3dShellFace` endpoint."]
11873 data: Solid3DShellFace,
11874 },
11875 #[serde(rename = "revolve_about_edge")]
11876 RevolveAboutEdge {
11877 #[doc = "The response from the `RevolveAboutEdge` endpoint."]
11878 data: RevolveAboutEdge,
11879 },
11880 #[serde(rename = "camera_drag_start")]
11881 CameraDragStart {
11882 #[doc = "The response from the `CameraDragStart` endpoint."]
11883 data: CameraDragStart,
11884 },
11885 #[serde(rename = "default_camera_look_at")]
11886 DefaultCameraLookAt {
11887 #[doc = "The response from the `DefaultCameraLookAt` endpoint."]
11888 data: DefaultCameraLookAt,
11889 },
11890 #[serde(rename = "default_camera_perspective_settings")]
11891 DefaultCameraPerspectiveSettings {
11892 #[doc = "The response from the `DefaultCameraPerspectiveSettings` endpoint."]
11893 data: DefaultCameraPerspectiveSettings,
11894 },
11895 #[serde(rename = "select_add")]
11896 SelectAdd {
11897 #[doc = "The response from the `SelectAdd` endpoint."]
11898 data: SelectAdd,
11899 },
11900 #[serde(rename = "select_remove")]
11901 SelectRemove {
11902 #[doc = "The response from the `SelectRemove` endpoint."]
11903 data: SelectRemove,
11904 },
11905 #[serde(rename = "scene_clear_all")]
11906 SceneClearAll {
11907 #[doc = "The response from the `SceneClearAll` endpoint."]
11908 data: SceneClearAll,
11909 },
11910 #[serde(rename = "select_replace")]
11911 SelectReplace {
11912 #[doc = "The response from the `SelectReplace` endpoint."]
11913 data: SelectReplace,
11914 },
11915 #[serde(rename = "highlight_set_entities")]
11916 HighlightSetEntities {
11917 #[doc = "The response from the `HighlightSetEntities` endpoint."]
11918 data: HighlightSetEntities,
11919 },
11920 #[serde(rename = "new_annotation")]
11921 NewAnnotation {
11922 #[doc = "The response from the `NewAnnotation` endpoint."]
11923 data: NewAnnotation,
11924 },
11925 #[serde(rename = "update_annotation")]
11926 UpdateAnnotation {
11927 #[doc = "The response from the `UpdateAnnotation` endpoint."]
11928 data: UpdateAnnotation,
11929 },
11930 #[serde(rename = "edge_lines_visible")]
11931 EdgeLinesVisible {
11932 #[doc = "The response from the `EdgeLinesVisible` endpoint."]
11933 data: EdgeLinesVisible,
11934 },
11935 #[serde(rename = "object_visible")]
11936 ObjectVisible {
11937 #[doc = "The response from the `ObjectVisible` endpoint."]
11938 data: ObjectVisible,
11939 },
11940 #[serde(rename = "object_bring_to_front")]
11941 ObjectBringToFront {
11942 #[doc = "The response from the `ObjectBringToFront` endpoint."]
11943 data: ObjectBringToFront,
11944 },
11945 #[serde(rename = "object_set_material_params_pbr")]
11946 ObjectSetMaterialParamsPbr {
11947 #[doc = "The response from the `ObjectSetMaterialParamsPbr` endpoint."]
11948 data: ObjectSetMaterialParamsPbr,
11949 },
11950 #[serde(rename = "solid2d_add_hole")]
11951 Solid2DAddHole {
11952 #[doc = "The response from the `Solid2dAddHole` endpoint."]
11953 data: Solid2DAddHole,
11954 },
11955 #[serde(rename = "solid3d_fillet_edge")]
11956 Solid3DFilletEdge {
11957 #[doc = "The response from the `Solid3dFilletEdge` endpoint."]
11958 data: Solid3DFilletEdge,
11959 },
11960 #[serde(rename = "send_object")]
11961 SendObject {
11962 #[doc = "The response from the `SendObject` endpoint."]
11963 data: SendObject,
11964 },
11965 #[serde(rename = "entity_set_opacity")]
11966 EntitySetOpacity {
11967 #[doc = "The response from the `EntitySetOpacity` endpoint."]
11968 data: EntitySetOpacity,
11969 },
11970 #[serde(rename = "entity_fade")]
11971 EntityFade {
11972 #[doc = "The response from the `EntityFade` endpoint."]
11973 data: EntityFade,
11974 },
11975 #[serde(rename = "make_plane")]
11976 MakePlane {
11977 #[doc = "The response from the `MakePlane` endpoint."]
11978 data: MakePlane,
11979 },
11980 #[serde(rename = "plane_set_color")]
11981 PlaneSetColor {
11982 #[doc = "The response from the `PlaneSetColor` endpoint."]
11983 data: PlaneSetColor,
11984 },
11985 #[serde(rename = "set_tool")]
11986 SetTool {
11987 #[doc = "The response from the `SetTool` endpoint."]
11988 data: SetTool,
11989 },
11990 #[serde(rename = "mouse_move")]
11991 MouseMove {
11992 #[doc = "The response from the `MouseMove` endpoint."]
11993 data: MouseMove,
11994 },
11995 #[serde(rename = "sketch_mode_disable")]
11996 SketchModeDisable {
11997 #[doc = "The response from the `SketchModeDisable` endpoint."]
11998 data: SketchModeDisable,
11999 },
12000 #[serde(rename = "enable_dry_run")]
12001 EnableDryRun {
12002 #[doc = "The response from the `EnableDryRun` endpoint."]
12003 data: EnableDryRun,
12004 },
12005 #[serde(rename = "disable_dry_run")]
12006 DisableDryRun {
12007 #[doc = "The response from the `DisableDryRun` endpoint."]
12008 data: DisableDryRun,
12009 },
12010 #[serde(rename = "curve_set_constraint")]
12011 CurveSetConstraint {
12012 #[doc = "The response from the `CurveSetConstraint` endpoint."]
12013 data: CurveSetConstraint,
12014 },
12015 #[serde(rename = "enable_sketch_mode")]
12016 EnableSketchMode {
12017 #[doc = "The response from the `EnableSketchMode` endpoint."]
12018 data: EnableSketchMode,
12019 },
12020 #[serde(rename = "set_background_color")]
12021 SetBackgroundColor {
12022 #[doc = "The response from the `SetBackgroundColor` endpoint."]
12023 data: SetBackgroundColor,
12024 },
12025 #[serde(rename = "set_current_tool_properties")]
12026 SetCurrentToolProperties {
12027 #[doc = "The response from the `SetCurrentToolProperties` endpoint."]
12028 data: SetCurrentToolProperties,
12029 },
12030 #[serde(rename = "set_default_system_properties")]
12031 SetDefaultSystemProperties {
12032 #[doc = "The response from the `SetDefaultSystemProperties` endpoint."]
12033 data: SetDefaultSystemProperties,
12034 },
12035 #[serde(rename = "make_axes_gizmo")]
12036 MakeAxesGizmo {
12037 #[doc = "The response from the `MakeAxesGizmo` endpoint."]
12038 data: MakeAxesGizmo,
12039 },
12040 #[serde(rename = "handle_mouse_drag_start")]
12041 HandleMouseDragStart {
12042 #[doc = "The response from the `HandleMouseDragStart` endpoint."]
12043 data: HandleMouseDragStart,
12044 },
12045 #[serde(rename = "handle_mouse_drag_move")]
12046 HandleMouseDragMove {
12047 #[doc = "The response from the `HandleMouseDragMove` endpoint."]
12048 data: HandleMouseDragMove,
12049 },
12050 #[serde(rename = "handle_mouse_drag_end")]
12051 HandleMouseDragEnd {
12052 #[doc = "The response from the `HandleMouseDragEnd` endpoint."]
12053 data: HandleMouseDragEnd,
12054 },
12055 #[serde(rename = "remove_scene_objects")]
12056 RemoveSceneObjects {
12057 #[doc = "The response from the `RemoveSceneObjects` endpoint."]
12058 data: RemoveSceneObjects,
12059 },
12060 #[serde(rename = "reconfigure_stream")]
12061 ReconfigureStream {
12062 #[doc = "The response from the `ReconfigureStream` endpoint."]
12063 data: ReconfigureStream,
12064 },
12065 #[serde(rename = "set_scene_units")]
12066 SetSceneUnits {
12067 #[doc = "The response from the `SetSceneUnits` endpoint."]
12068 data: SetSceneUnits,
12069 },
12070 #[serde(rename = "set_selection_type")]
12071 SetSelectionType {
12072 #[doc = "The response from the `SetSelectionType` endpoint."]
12073 data: SetSelectionType,
12074 },
12075 #[serde(rename = "set_selection_filter")]
12076 SetSelectionFilter {
12077 #[doc = "The response from the `SetSelectionFilter` endpoint."]
12078 data: SetSelectionFilter,
12079 },
12080 #[serde(rename = "default_camera_set_orthographic")]
12081 DefaultCameraSetOrthographic {
12082 #[doc = "The response from the `DefaultCameraSetOrthographic` endpoint."]
12083 data: DefaultCameraSetOrthographic,
12084 },
12085 #[serde(rename = "default_camera_set_perspective")]
12086 DefaultCameraSetPerspective {
12087 #[doc = "The response from the `DefaultCameraSetPerspective` endpoint."]
12088 data: DefaultCameraSetPerspective,
12089 },
12090 #[serde(rename = "default_camera_center_to_selection")]
12091 DefaultCameraCenterToSelection {
12092 #[doc = "The response from the `DefaultCameraCenterToSelection` endpoint."]
12093 data: DefaultCameraCenterToSelection,
12094 },
12095 #[serde(rename = "default_camera_center_to_scene")]
12096 DefaultCameraCenterToScene {
12097 #[doc = "The response from the `DefaultCameraCenterToScene` endpoint."]
12098 data: DefaultCameraCenterToScene,
12099 },
12100 #[serde(rename = "select_clear")]
12101 SelectClear {
12102 #[doc = "The response from the `SelectClear` endpoint."]
12103 data: SelectClear,
12104 },
12105 #[serde(rename = "export2d")]
12106 Export2D {
12107 #[doc = "The response from the `Export2d` endpoint."]
12108 data: Export2D,
12109 },
12110 #[serde(rename = "export3d")]
12111 Export3D {
12112 #[doc = "The response from the `Export3d` endpoint."]
12113 data: Export3D,
12114 },
12115 #[serde(rename = "export")]
12116 Export {
12117 #[doc = "The response from the `Export` endpoint."]
12118 data: Export,
12119 },
12120 #[serde(rename = "select_with_point")]
12121 SelectWithPoint {
12122 #[doc = "The response from the `SelectWithPoint` command."]
12123 data: SelectWithPoint,
12124 },
12125 #[serde(rename = "highlight_set_entity")]
12126 HighlightSetEntity {
12127 #[doc = "The response from the `HighlightSetEntity` command."]
12128 data: HighlightSetEntity,
12129 },
12130 #[serde(rename = "entity_get_child_uuid")]
12131 EntityGetChildUuid {
12132 #[doc = "The response from the `EntityGetChildUuid` command."]
12133 data: EntityGetChildUuid,
12134 },
12135 #[serde(rename = "entity_get_num_children")]
12136 EntityGetNumChildren {
12137 #[doc = "The response from the `EntityGetNumChildren` command."]
12138 data: EntityGetNumChildren,
12139 },
12140 #[serde(rename = "entity_get_parent_id")]
12141 EntityGetParentId {
12142 #[doc = "The response from the `EntityGetParentId` command."]
12143 data: EntityGetParentId,
12144 },
12145 #[serde(rename = "entity_get_all_child_uuids")]
12146 EntityGetAllChildUuids {
12147 #[doc = "The response from the `EntityGetAllChildUuids` command."]
12148 data: EntityGetAllChildUuids,
12149 },
12150 #[serde(rename = "entity_get_sketch_paths")]
12151 EntityGetSketchPaths {
12152 #[doc = "The response from the `EntityGetSketchPaths` command."]
12153 data: EntityGetSketchPaths,
12154 },
12155 #[serde(rename = "loft")]
12156 Loft {
12157 #[doc = "The response from the `Loft` command."]
12158 data: Loft,
12159 },
12160 #[serde(rename = "close_path")]
12161 ClosePath {
12162 #[doc = "The response from the `ClosePath` command."]
12163 data: ClosePath,
12164 },
12165 #[serde(rename = "camera_drag_move")]
12166 CameraDragMove {
12167 #[doc = "The response from the `CameraDragMove` command. Note this is an \"unreliable\" \
12168 channel message, so this data may need more data like a \"sequence\""]
12169 data: CameraDragMove,
12170 },
12171 #[serde(rename = "camera_drag_end")]
12172 CameraDragEnd {
12173 #[doc = "The response from the `CameraDragEnd` command."]
12174 data: CameraDragEnd,
12175 },
12176 #[serde(rename = "default_camera_get_settings")]
12177 DefaultCameraGetSettings {
12178 #[doc = "The response from the `DefaultCameraGetSettings` command."]
12179 data: DefaultCameraGetSettings,
12180 },
12181 #[serde(rename = "default_camera_get_view")]
12182 DefaultCameraGetView {
12183 #[doc = "The response from the `DefaultCameraGetView` command."]
12184 data: DefaultCameraGetView,
12185 },
12186 #[serde(rename = "default_camera_set_view")]
12187 DefaultCameraSetView {
12188 #[doc = "The response from the `DefaultCameraSetView` command."]
12189 data: DefaultCameraSetView,
12190 },
12191 #[serde(rename = "default_camera_zoom")]
12192 DefaultCameraZoom {
12193 #[doc = "The response from the `DefaultCameraZoom` command."]
12194 data: DefaultCameraZoom,
12195 },
12196 #[serde(rename = "zoom_to_fit")]
12197 ZoomToFit {
12198 #[doc = "The response from the `ZoomToFit` command."]
12199 data: ZoomToFit,
12200 },
12201 #[serde(rename = "orient_to_face")]
12202 OrientToFace {
12203 #[doc = "The response from the `OrientToFace` command."]
12204 data: OrientToFace,
12205 },
12206 #[serde(rename = "view_isometric")]
12207 ViewIsometric {
12208 #[doc = "The response from the `ViewIsometric` command."]
12209 data: ViewIsometric,
12210 },
12211 #[serde(rename = "get_num_objects")]
12212 GetNumObjects {
12213 #[doc = "The response from the `GetNumObjects` command."]
12214 data: GetNumObjects,
12215 },
12216 #[serde(rename = "make_offset_path")]
12217 MakeOffsetPath {
12218 #[doc = "The response from the `MakeOffsetPath` command."]
12219 data: MakeOffsetPath,
12220 },
12221 #[serde(rename = "set_object_transform")]
12222 SetObjectTransform {
12223 #[doc = "The response from the `SetObjectTransform` command."]
12224 data: SetObjectTransform,
12225 },
12226 #[serde(rename = "add_hole_from_offset")]
12227 AddHoleFromOffset {
12228 #[doc = "The response from the `AddHoleFromOffset` command."]
12229 data: AddHoleFromOffset,
12230 },
12231 #[serde(rename = "default_camera_focus_on")]
12232 DefaultCameraFocusOn {
12233 #[doc = "The response from the `DefaultCameraFocusOn` command."]
12234 data: DefaultCameraFocusOn,
12235 },
12236 #[serde(rename = "select_get")]
12237 SelectGet {
12238 #[doc = "The response from the `SelectGet` command."]
12239 data: SelectGet,
12240 },
12241 #[serde(rename = "solid3d_get_adjacency_info")]
12242 Solid3DGetAdjacencyInfo {
12243 #[doc = "Extrusion face info struct (useful for maintaining mappings between source path \
12244 segment ids and extrusion faces) This includes the opposite and adjacent faces \
12245 and edges."]
12246 data: Solid3DGetAdjacencyInfo,
12247 },
12248 #[serde(rename = "solid3d_get_all_edge_faces")]
12249 Solid3DGetAllEdgeFaces {
12250 #[doc = "The response from the `Solid3dGetAllEdgeFaces` command."]
12251 data: Solid3DGetAllEdgeFaces,
12252 },
12253 #[serde(rename = "solid3d_get_all_opposite_edges")]
12254 Solid3DGetAllOppositeEdges {
12255 #[doc = "The response from the `Solid3dGetAllOppositeEdges` command."]
12256 data: Solid3DGetAllOppositeEdges,
12257 },
12258 #[serde(rename = "solid3d_get_opposite_edge")]
12259 Solid3DGetOppositeEdge {
12260 #[doc = "The response from the `Solid3dGetOppositeEdge` command."]
12261 data: Solid3DGetOppositeEdge,
12262 },
12263 #[serde(rename = "solid3d_get_next_adjacent_edge")]
12264 Solid3DGetNextAdjacentEdge {
12265 #[doc = "The response from the `Solid3dGetNextAdjacentEdge` command."]
12266 data: Solid3DGetNextAdjacentEdge,
12267 },
12268 #[serde(rename = "solid3d_get_prev_adjacent_edge")]
12269 Solid3DGetPrevAdjacentEdge {
12270 #[doc = "The response from the `Solid3dGetPrevAdjacentEdge` command."]
12271 data: Solid3DGetPrevAdjacentEdge,
12272 },
12273 #[serde(rename = "solid3d_get_common_edge")]
12274 Solid3DGetCommonEdge {
12275 #[doc = "The response from the `Solid3DGetCommonEdge` command."]
12276 data: Solid3DGetCommonEdge,
12277 },
12278 #[serde(rename = "get_entity_type")]
12279 GetEntityType {
12280 #[doc = "The response from the `GetEntityType` command."]
12281 data: GetEntityType,
12282 },
12283 #[serde(rename = "curve_get_control_points")]
12284 CurveGetControlPoints {
12285 #[doc = "The response from the `CurveGetControlPoints` command."]
12286 data: CurveGetControlPoints,
12287 },
12288 #[serde(rename = "project_entity_to_plane")]
12289 ProjectEntityToPlane {
12290 #[doc = "The response from the `ProjectEntityToPlane` command."]
12291 data: ProjectEntityToPlane,
12292 },
12293 #[serde(rename = "project_points_to_plane")]
12294 ProjectPointsToPlane {
12295 #[doc = "The response from the `ProjectPointsToPlane` command."]
12296 data: ProjectPointsToPlane,
12297 },
12298 #[serde(rename = "curve_get_type")]
12299 CurveGetType {
12300 #[doc = "The response from the `CurveGetType` command."]
12301 data: CurveGetType,
12302 },
12303 #[serde(rename = "mouse_click")]
12304 MouseClick {
12305 #[doc = "The response from the `MouseClick` command."]
12306 data: MouseClick,
12307 },
12308 #[serde(rename = "take_snapshot")]
12309 TakeSnapshot {
12310 #[doc = "The response from the `TakeSnapshot` command."]
12311 data: TakeSnapshot,
12312 },
12313 #[serde(rename = "path_get_info")]
12314 PathGetInfo {
12315 #[doc = "The response from the `PathGetInfo` command."]
12316 data: PathGetInfo,
12317 },
12318 #[serde(rename = "path_segment_info")]
12319 PathSegmentInfo {
12320 #[doc = "Info about a path segment"]
12321 data: PathSegmentInfo,
12322 },
12323 #[serde(rename = "path_get_curve_uuids_for_vertices")]
12324 PathGetCurveUuidsForVertices {
12325 #[doc = "The response from the `PathGetCurveUuidsForVertices` command."]
12326 data: PathGetCurveUuidsForVertices,
12327 },
12328 #[serde(rename = "path_get_curve_uuid")]
12329 PathGetCurveUuid {
12330 #[doc = "The response from the `PathGetCurveUuid` command."]
12331 data: PathGetCurveUuid,
12332 },
12333 #[serde(rename = "path_get_vertex_uuids")]
12334 PathGetVertexUuids {
12335 #[doc = "The response from the `PathGetVertexUuids` command."]
12336 data: PathGetVertexUuids,
12337 },
12338 #[serde(rename = "path_get_sketch_target_uuid")]
12339 PathGetSketchTargetUuid {
12340 #[doc = "The response from the `PathGetSketchTargetUuid` command."]
12341 data: PathGetSketchTargetUuid,
12342 },
12343 #[serde(rename = "curve_get_end_points")]
12344 CurveGetEndPoints {
12345 #[doc = "Endpoints of a curve"]
12346 data: CurveGetEndPoints,
12347 },
12348 #[serde(rename = "face_is_planar")]
12349 FaceIsPlanar {
12350 #[doc = "Surface-local planar axes (if available)"]
12351 data: FaceIsPlanar,
12352 },
12353 #[serde(rename = "face_get_position")]
12354 FaceGetPosition {
12355 #[doc = "The 3D position on the surface that was evaluated"]
12356 data: FaceGetPosition,
12357 },
12358 #[serde(rename = "face_get_center")]
12359 FaceGetCenter {
12360 #[doc = "The 3D center of mass on the surface"]
12361 data: FaceGetCenter,
12362 },
12363 #[serde(rename = "face_get_gradient")]
12364 FaceGetGradient {
12365 #[doc = "The gradient (dFdu, dFdv) + normal vector on a brep face"]
12366 data: FaceGetGradient,
12367 },
12368 #[serde(rename = "plane_intersect_and_project")]
12369 PlaneIntersectAndProject {
12370 #[doc = "Corresponding coordinates of given window coordinates, intersected on given \
12371 plane."]
12372 data: PlaneIntersectAndProject,
12373 },
12374 #[serde(rename = "import_files")]
12375 ImportFiles {
12376 #[doc = "Data from importing the files"]
12377 data: ImportFiles,
12378 },
12379 #[serde(rename = "imported_geometry")]
12380 ImportedGeometry {
12381 #[doc = "Data from importing the files"]
12382 data: ImportedGeometry,
12383 },
12384 #[serde(rename = "mass")]
12385 Mass {
12386 #[doc = "The mass response."]
12387 data: Mass,
12388 },
12389 #[serde(rename = "volume")]
12390 Volume {
12391 #[doc = "The volume response."]
12392 data: Volume,
12393 },
12394 #[serde(rename = "density")]
12395 Density {
12396 #[doc = "The density response."]
12397 data: Density,
12398 },
12399 #[serde(rename = "surface_area")]
12400 SurfaceArea {
12401 #[doc = "The surface area response."]
12402 data: SurfaceArea,
12403 },
12404 #[serde(rename = "center_of_mass")]
12405 CenterOfMass {
12406 #[doc = "The center of mass response."]
12407 data: CenterOfMass,
12408 },
12409 #[serde(rename = "get_sketch_mode_plane")]
12410 GetSketchModePlane {
12411 #[doc = "The plane for sketch mode."]
12412 data: GetSketchModePlane,
12413 },
12414 #[serde(rename = "entity_get_distance")]
12415 EntityGetDistance {
12416 #[doc = "The response from the `EntitiesGetDistance` command."]
12417 data: EntityGetDistance,
12418 },
12419 #[serde(rename = "face_edge_info")]
12420 FaceEdgeInfo {
12421 #[doc = "Faces and edges id info (most used in identifying geometry in patterned and \
12422 mirrored objects)."]
12423 data: FaceEdgeInfo,
12424 },
12425 #[serde(rename = "edge_info")]
12426 EdgeInfo {
12427 #[doc = "A list of faces for a specific edge."]
12428 data: EdgeInfo,
12429 },
12430 #[serde(rename = "entity_clone")]
12431 EntityClone {
12432 #[doc = "The response from the `EntityClone` command."]
12433 data: EntityClone,
12434 },
12435 #[serde(rename = "entity_linear_pattern_transform")]
12436 EntityLinearPatternTransform {
12437 #[doc = "The response from the `EntityLinearPatternTransform` command."]
12438 data: EntityLinearPatternTransform,
12439 },
12440 #[serde(rename = "entity_linear_pattern")]
12441 EntityLinearPattern {
12442 #[doc = "The response from the `EntityLinearPattern` command."]
12443 data: EntityLinearPattern,
12444 },
12445 #[serde(rename = "entity_circular_pattern")]
12446 EntityCircularPattern {
12447 #[doc = "The response from the `EntityCircularPattern` command."]
12448 data: EntityCircularPattern,
12449 },
12450 #[serde(rename = "entity_mirror")]
12451 EntityMirror {
12452 #[doc = "The response from the `EntityMirror` endpoint."]
12453 data: EntityMirror,
12454 },
12455 #[serde(rename = "entity_mirror_across_edge")]
12456 EntityMirrorAcrossEdge {
12457 #[doc = "The response from the `EntityMirrorAcrossEdge` endpoint."]
12458 data: EntityMirrorAcrossEdge,
12459 },
12460 #[serde(rename = "entity_make_helix")]
12461 EntityMakeHelix {
12462 #[doc = "The response from the `EntityMakeHelix` endpoint."]
12463 data: EntityMakeHelix,
12464 },
12465 #[serde(rename = "entity_make_helix_from_params")]
12466 EntityMakeHelixFromParams {
12467 #[doc = "The response from the `EntityMakeHelixFromParams` endpoint."]
12468 data: EntityMakeHelixFromParams,
12469 },
12470 #[serde(rename = "entity_make_helix_from_edge")]
12471 EntityMakeHelixFromEdge {
12472 #[doc = "The response from the `EntityMakeHelixFromEdge` endpoint."]
12473 data: EntityMakeHelixFromEdge,
12474 },
12475 #[serde(rename = "solid3d_get_extrusion_face_info")]
12476 Solid3DGetExtrusionFaceInfo {
12477 #[doc = "Extrusion face info struct (useful for maintaining mappings between source path \
12478 segment ids and extrusion faces)"]
12479 data: Solid3DGetExtrusionFaceInfo,
12480 },
12481 #[serde(rename = "extrusion_face_info")]
12482 ExtrusionFaceInfo {
12483 #[doc = "Extrusion face info struct (useful for maintaining mappings between source path \
12484 segment ids and extrusion faces)"]
12485 data: ExtrusionFaceInfo,
12486 },
12487 #[serde(rename = "complementary_edges")]
12488 ComplementaryEdges {
12489 #[doc = "Struct to contain the edge information of a wall of an extrude/rotate/loft/sweep."]
12490 data: ComplementaryEdges,
12491 },
12492 #[serde(rename = "adjacency_info")]
12493 AdjacencyInfo {
12494 #[doc = "Edge info struct (useful for maintaining mappings between edges and faces and \
12495 adjacent/opposite edges)."]
12496 data: AdjacencyInfo,
12497 },
12498 #[serde(rename = "set_grid_reference_plane")]
12499 SetGridReferencePlane {
12500 #[doc = "The response from the 'SetGridReferencePlane'."]
12501 data: SetGridReferencePlane,
12502 },
12503 #[serde(rename = "boolean_union")]
12504 BooleanUnion {
12505 #[doc = "The response from the 'BooleanUnion'."]
12506 data: BooleanUnion,
12507 },
12508 #[serde(rename = "boolean_intersection")]
12509 BooleanIntersection {
12510 #[doc = "The response from the 'BooleanIntersection'."]
12511 data: BooleanIntersection,
12512 },
12513 #[serde(rename = "boolean_subtract")]
12514 BooleanSubtract {
12515 #[doc = "The response from the 'BooleanSubtract'."]
12516 data: BooleanSubtract,
12517 },
12518 #[serde(rename = "set_grid_scale")]
12519 SetGridScale {
12520 #[doc = "The response from the 'SetGridScale'."]
12521 data: SetGridScale,
12522 },
12523 #[serde(rename = "set_grid_auto_scale")]
12524 SetGridAutoScale {
12525 #[doc = "The response from the 'SetGridScale'."]
12526 data: SetGridAutoScale,
12527 },
12528}
12529
12530#[doc = "The websocket messages this server sends."]
12531#[derive(
12532 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
12533)]
12534#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
12535#[serde(tag = "type", content = "data")]
12536pub enum OkWebSocketResponseData {
12537 #[doc = "Information about the ICE servers."]
12538 #[serde(rename = "ice_server_info")]
12539 IceServerInfo {
12540 #[doc = "Information about the ICE servers."]
12541 ice_servers: Vec<IceServer>,
12542 },
12543 #[doc = "The trickle ICE candidate response."]
12544 #[serde(rename = "trickle_ice")]
12545 TrickleIce {
12546 #[doc = "Information about the ICE candidate."]
12547 candidate: RtcIceCandidateInit,
12548 },
12549 #[doc = "The SDP answer response."]
12550 #[serde(rename = "sdp_answer")]
12551 SdpAnswer {
12552 #[doc = "The session description."]
12553 answer: RtcSessionDescription,
12554 },
12555 #[doc = "The modeling command response."]
12556 #[serde(rename = "modeling")]
12557 Modeling {
12558 #[doc = "The result of the command."]
12559 modeling_response: OkModelingCmdResponse,
12560 },
12561 #[doc = "Response to a ModelingBatch."]
12562 #[serde(rename = "modeling_batch")]
12563 ModelingBatch {
12564 #[doc = "For each request in the batch, maps its ID to the request's outcome."]
12565 responses: std::collections::HashMap<String, BatchResponse>,
12566 },
12567 #[doc = "The exported files."]
12568 #[serde(rename = "export")]
12569 Export {
12570 #[doc = "The exported files"]
12571 files: Vec<RawFile>,
12572 },
12573 #[doc = "Request a collection of metrics, to include WebRTC."]
12574 #[serde(rename = "metrics_request")]
12575 MetricsRequest {},
12576 #[doc = "Data about the Modeling Session (application-level)."]
12577 #[serde(rename = "modeling_session_data")]
12578 ModelingSessionData {
12579 #[doc = "Data about the Modeling Session (application-level)."]
12580 session: ModelingSessionData,
12581 },
12582 #[doc = "Pong response to a Ping message."]
12583 #[serde(rename = "pong")]
12584 Pong {},
12585 #[doc = "Information about the connected instance"]
12586 #[serde(rename = "debug")]
12587 Debug {
12588 #[doc = "Instance name. This may or may not mean something."]
12589 name: String,
12590 },
12591}
12592
12593#[doc = "An organization."]
12594#[derive(
12595 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
12596)]
12597pub struct Org {
12598 #[doc = "If we should allow all future users who are created with email addresses from this \
12599 domain to join the org."]
12600 #[serde(default, skip_serializing_if = "Option::is_none")]
12601 pub allow_users_in_domain_to_auto_join: Option<bool>,
12602 #[doc = "The billing email address of the org."]
12603 pub billing_email: String,
12604 #[doc = "The date and time the billing email address was verified."]
12605 #[serde(default, skip_serializing_if = "Option::is_none")]
12606 pub billing_email_verified: Option<chrono::DateTime<chrono::Utc>>,
12607 #[doc = "If the org should be blocked and the reason why."]
12608 #[serde(default, skip_serializing_if = "Option::is_none")]
12609 pub block: Option<BlockReason>,
12610 #[doc = "If we can train on the orgs's data. This value overrides any individual user's \
12611 `can_train_on_data` value if they are a member of the org."]
12612 #[serde(default)]
12613 pub can_train_on_data: bool,
12614 #[doc = "The date and time the org was created."]
12615 pub created_at: chrono::DateTime<chrono::Utc>,
12616 #[doc = "The org's domain."]
12617 #[serde(default, skip_serializing_if = "Option::is_none")]
12618 pub domain: Option<String>,
12619 #[doc = "The unique identifier for the org."]
12620 pub id: uuid::Uuid,
12621 #[doc = "The image for the org. This is a URL."]
12622 #[serde(default, skip_serializing_if = "Option::is_none")]
12623 pub image: Option<String>,
12624 #[doc = "The name of the org."]
12625 #[serde(default, skip_serializing_if = "Option::is_none")]
12626 pub name: Option<String>,
12627 #[doc = "The org's phone number."]
12628 #[serde(default, skip_serializing_if = "Option::is_none")]
12629 pub phone: phone_number::PhoneNumber,
12630 #[doc = "The org's stripe id."]
12631 #[serde(default, skip_serializing_if = "Option::is_none")]
12632 pub stripe_id: Option<String>,
12633 #[doc = "The date and time the org was last updated."]
12634 pub updated_at: chrono::DateTime<chrono::Utc>,
12635}
12636
12637impl std::fmt::Display for Org {
12638 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
12639 write!(
12640 f,
12641 "{}",
12642 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
12643 )
12644 }
12645}
12646
12647#[cfg(feature = "tabled")]
12648impl tabled::Tabled for Org {
12649 const LENGTH: usize = 13;
12650 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
12651 vec![
12652 if let Some(allow_users_in_domain_to_auto_join) =
12653 &self.allow_users_in_domain_to_auto_join
12654 {
12655 format!("{:?}", allow_users_in_domain_to_auto_join).into()
12656 } else {
12657 String::new().into()
12658 },
12659 self.billing_email.clone().into(),
12660 if let Some(billing_email_verified) = &self.billing_email_verified {
12661 format!("{:?}", billing_email_verified).into()
12662 } else {
12663 String::new().into()
12664 },
12665 if let Some(block) = &self.block {
12666 format!("{:?}", block).into()
12667 } else {
12668 String::new().into()
12669 },
12670 format!("{:?}", self.can_train_on_data).into(),
12671 format!("{:?}", self.created_at).into(),
12672 if let Some(domain) = &self.domain {
12673 format!("{:?}", domain).into()
12674 } else {
12675 String::new().into()
12676 },
12677 format!("{:?}", self.id).into(),
12678 if let Some(image) = &self.image {
12679 format!("{:?}", image).into()
12680 } else {
12681 String::new().into()
12682 },
12683 if let Some(name) = &self.name {
12684 format!("{:?}", name).into()
12685 } else {
12686 String::new().into()
12687 },
12688 format!("{:?}", self.phone).into(),
12689 if let Some(stripe_id) = &self.stripe_id {
12690 format!("{:?}", stripe_id).into()
12691 } else {
12692 String::new().into()
12693 },
12694 format!("{:?}", self.updated_at).into(),
12695 ]
12696 }
12697
12698 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
12699 vec![
12700 "allow_users_in_domain_to_auto_join".into(),
12701 "billing_email".into(),
12702 "billing_email_verified".into(),
12703 "block".into(),
12704 "can_train_on_data".into(),
12705 "created_at".into(),
12706 "domain".into(),
12707 "id".into(),
12708 "image".into(),
12709 "name".into(),
12710 "phone".into(),
12711 "stripe_id".into(),
12712 "updated_at".into(),
12713 ]
12714 }
12715}
12716
12717#[doc = "The user-modifiable parts of an organization."]
12718#[derive(
12719 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
12720)]
12721pub struct OrgDetails {
12722 #[doc = "If we should allow all future users who are created with email addresses from this \
12723 domain to join the org."]
12724 #[serde(default, skip_serializing_if = "Option::is_none")]
12725 pub allow_users_in_domain_to_auto_join: Option<bool>,
12726 #[doc = "The billing email address of the org."]
12727 #[serde(default, skip_serializing_if = "Option::is_none")]
12728 pub billing_email: Option<String>,
12729 #[doc = "The org's domain."]
12730 #[serde(default, skip_serializing_if = "Option::is_none")]
12731 pub domain: Option<String>,
12732 #[doc = "The image for the org. This is a URL."]
12733 #[serde(default, skip_serializing_if = "Option::is_none")]
12734 pub image: Option<String>,
12735 #[doc = "The name of the org."]
12736 #[serde(default, skip_serializing_if = "Option::is_none")]
12737 pub name: Option<String>,
12738 #[doc = "The org's phone number."]
12739 #[serde(default, skip_serializing_if = "Option::is_none")]
12740 pub phone: phone_number::PhoneNumber,
12741}
12742
12743impl std::fmt::Display for OrgDetails {
12744 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
12745 write!(
12746 f,
12747 "{}",
12748 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
12749 )
12750 }
12751}
12752
12753#[cfg(feature = "tabled")]
12754impl tabled::Tabled for OrgDetails {
12755 const LENGTH: usize = 6;
12756 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
12757 vec![
12758 if let Some(allow_users_in_domain_to_auto_join) =
12759 &self.allow_users_in_domain_to_auto_join
12760 {
12761 format!("{:?}", allow_users_in_domain_to_auto_join).into()
12762 } else {
12763 String::new().into()
12764 },
12765 if let Some(billing_email) = &self.billing_email {
12766 format!("{:?}", billing_email).into()
12767 } else {
12768 String::new().into()
12769 },
12770 if let Some(domain) = &self.domain {
12771 format!("{:?}", domain).into()
12772 } else {
12773 String::new().into()
12774 },
12775 if let Some(image) = &self.image {
12776 format!("{:?}", image).into()
12777 } else {
12778 String::new().into()
12779 },
12780 if let Some(name) = &self.name {
12781 format!("{:?}", name).into()
12782 } else {
12783 String::new().into()
12784 },
12785 format!("{:?}", self.phone).into(),
12786 ]
12787 }
12788
12789 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
12790 vec![
12791 "allow_users_in_domain_to_auto_join".into(),
12792 "billing_email".into(),
12793 "domain".into(),
12794 "image".into(),
12795 "name".into(),
12796 "phone".into(),
12797 ]
12798 }
12799}
12800
12801#[doc = "A member of an organization."]
12802#[derive(
12803 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
12804)]
12805pub struct OrgMember {
12806 #[doc = "The user's company."]
12807 #[serde(default, skip_serializing_if = "Option::is_none")]
12808 pub company: Option<String>,
12809 #[doc = "The date and time the user was created."]
12810 pub created_at: chrono::DateTime<chrono::Utc>,
12811 #[doc = "The user's Discord handle."]
12812 #[serde(default, skip_serializing_if = "Option::is_none")]
12813 pub discord: Option<String>,
12814 #[doc = "The email address of the user."]
12815 #[serde(default, skip_serializing_if = "Option::is_none")]
12816 pub email: Option<String>,
12817 #[doc = "The date and time the email address was verified."]
12818 #[serde(default, skip_serializing_if = "Option::is_none")]
12819 pub email_verified: Option<chrono::DateTime<chrono::Utc>>,
12820 #[doc = "The user's first name."]
12821 #[serde(default, skip_serializing_if = "Option::is_none")]
12822 pub first_name: Option<String>,
12823 #[doc = "The user's GitHub handle."]
12824 #[serde(default, skip_serializing_if = "Option::is_none")]
12825 pub github: Option<String>,
12826 #[doc = "The unique identifier for the user."]
12827 pub id: uuid::Uuid,
12828 #[doc = "The image avatar for the user. This is a URL."]
12829 pub image: String,
12830 #[doc = "The user's last name."]
12831 #[serde(default, skip_serializing_if = "Option::is_none")]
12832 pub last_name: Option<String>,
12833 #[doc = "The name of the user. This is auto populated at first from the authentication \
12834 provider (if there was a name). It can be updated by the user by updating their \
12835 `first_name` and `last_name` fields."]
12836 #[serde(default, skip_serializing_if = "Option::is_none")]
12837 pub name: Option<String>,
12838 #[doc = "The user's phone number."]
12839 #[serde(default, skip_serializing_if = "Option::is_none")]
12840 pub phone: phone_number::PhoneNumber,
12841 #[doc = "The user's role in the org."]
12842 pub role: OrgRole,
12843 #[doc = "The date and time the user was last updated."]
12844 pub updated_at: chrono::DateTime<chrono::Utc>,
12845}
12846
12847impl std::fmt::Display for OrgMember {
12848 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
12849 write!(
12850 f,
12851 "{}",
12852 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
12853 )
12854 }
12855}
12856
12857#[cfg(feature = "tabled")]
12858impl tabled::Tabled for OrgMember {
12859 const LENGTH: usize = 14;
12860 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
12861 vec![
12862 if let Some(company) = &self.company {
12863 format!("{:?}", company).into()
12864 } else {
12865 String::new().into()
12866 },
12867 format!("{:?}", self.created_at).into(),
12868 if let Some(discord) = &self.discord {
12869 format!("{:?}", discord).into()
12870 } else {
12871 String::new().into()
12872 },
12873 if let Some(email) = &self.email {
12874 format!("{:?}", email).into()
12875 } else {
12876 String::new().into()
12877 },
12878 if let Some(email_verified) = &self.email_verified {
12879 format!("{:?}", email_verified).into()
12880 } else {
12881 String::new().into()
12882 },
12883 if let Some(first_name) = &self.first_name {
12884 format!("{:?}", first_name).into()
12885 } else {
12886 String::new().into()
12887 },
12888 if let Some(github) = &self.github {
12889 format!("{:?}", github).into()
12890 } else {
12891 String::new().into()
12892 },
12893 format!("{:?}", self.id).into(),
12894 self.image.clone().into(),
12895 if let Some(last_name) = &self.last_name {
12896 format!("{:?}", last_name).into()
12897 } else {
12898 String::new().into()
12899 },
12900 if let Some(name) = &self.name {
12901 format!("{:?}", name).into()
12902 } else {
12903 String::new().into()
12904 },
12905 format!("{:?}", self.phone).into(),
12906 format!("{:?}", self.role).into(),
12907 format!("{:?}", self.updated_at).into(),
12908 ]
12909 }
12910
12911 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
12912 vec![
12913 "company".into(),
12914 "created_at".into(),
12915 "discord".into(),
12916 "email".into(),
12917 "email_verified".into(),
12918 "first_name".into(),
12919 "github".into(),
12920 "id".into(),
12921 "image".into(),
12922 "last_name".into(),
12923 "name".into(),
12924 "phone".into(),
12925 "role".into(),
12926 "updated_at".into(),
12927 ]
12928 }
12929}
12930
12931#[doc = "A single page of results"]
12932#[derive(
12933 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
12934)]
12935pub struct OrgMemberResultsPage {
12936 #[doc = "list of items on this page of results"]
12937 pub items: Vec<OrgMember>,
12938 #[doc = "token used to fetch the next page of results (if any)"]
12939 #[serde(default, skip_serializing_if = "Option::is_none")]
12940 pub next_page: Option<String>,
12941}
12942
12943impl std::fmt::Display for OrgMemberResultsPage {
12944 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
12945 write!(
12946 f,
12947 "{}",
12948 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
12949 )
12950 }
12951}
12952
12953#[cfg(feature = "requests")]
12954impl crate::types::paginate::Pagination for OrgMemberResultsPage {
12955 type Item = OrgMember;
12956 fn has_more_pages(&self) -> bool {
12957 self.next_page.is_some()
12958 }
12959
12960 fn next_page_token(&self) -> Option<String> {
12961 self.next_page.clone()
12962 }
12963
12964 fn next_page(
12965 &self,
12966 req: reqwest::Request,
12967 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
12968 let mut req = req.try_clone().ok_or_else(|| {
12969 crate::types::error::Error::InvalidRequest(format!(
12970 "failed to clone request: {:?}",
12971 req
12972 ))
12973 })?;
12974 req.url_mut()
12975 .query_pairs_mut()
12976 .append_pair("next_page", self.next_page.as_deref().unwrap_or(""));
12977 Ok(req)
12978 }
12979
12980 fn items(&self) -> Vec<Self::Item> {
12981 self.items.clone()
12982 }
12983}
12984
12985#[cfg(feature = "tabled")]
12986impl tabled::Tabled for OrgMemberResultsPage {
12987 const LENGTH: usize = 2;
12988 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
12989 vec![
12990 format!("{:?}", self.items).into(),
12991 if let Some(next_page) = &self.next_page {
12992 format!("{:?}", next_page).into()
12993 } else {
12994 String::new().into()
12995 },
12996 ]
12997 }
12998
12999 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13000 vec!["items".into(), "next_page".into()]
13001 }
13002}
13003
13004#[doc = "A single page of results"]
13005#[derive(
13006 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13007)]
13008pub struct OrgResultsPage {
13009 #[doc = "list of items on this page of results"]
13010 pub items: Vec<Org>,
13011 #[doc = "token used to fetch the next page of results (if any)"]
13012 #[serde(default, skip_serializing_if = "Option::is_none")]
13013 pub next_page: Option<String>,
13014}
13015
13016impl std::fmt::Display for OrgResultsPage {
13017 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13018 write!(
13019 f,
13020 "{}",
13021 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13022 )
13023 }
13024}
13025
13026#[cfg(feature = "requests")]
13027impl crate::types::paginate::Pagination for OrgResultsPage {
13028 type Item = Org;
13029 fn has_more_pages(&self) -> bool {
13030 self.next_page.is_some()
13031 }
13032
13033 fn next_page_token(&self) -> Option<String> {
13034 self.next_page.clone()
13035 }
13036
13037 fn next_page(
13038 &self,
13039 req: reqwest::Request,
13040 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
13041 let mut req = req.try_clone().ok_or_else(|| {
13042 crate::types::error::Error::InvalidRequest(format!(
13043 "failed to clone request: {:?}",
13044 req
13045 ))
13046 })?;
13047 req.url_mut()
13048 .query_pairs_mut()
13049 .append_pair("next_page", self.next_page.as_deref().unwrap_or(""));
13050 Ok(req)
13051 }
13052
13053 fn items(&self) -> Vec<Self::Item> {
13054 self.items.clone()
13055 }
13056}
13057
13058#[cfg(feature = "tabled")]
13059impl tabled::Tabled for OrgResultsPage {
13060 const LENGTH: usize = 2;
13061 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13062 vec![
13063 format!("{:?}", self.items).into(),
13064 if let Some(next_page) = &self.next_page {
13065 format!("{:?}", next_page).into()
13066 } else {
13067 String::new().into()
13068 },
13069 ]
13070 }
13071
13072 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13073 vec!["items".into(), "next_page".into()]
13074 }
13075}
13076
13077#[doc = "The roles in an organization."]
13078#[derive(
13079 serde :: Serialize,
13080 serde :: Deserialize,
13081 PartialEq,
13082 Hash,
13083 Debug,
13084 Clone,
13085 schemars :: JsonSchema,
13086 parse_display :: FromStr,
13087 parse_display :: Display,
13088)]
13089#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
13090#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
13091pub enum OrgRole {
13092 #[doc = "Admins can do anything in the org."]
13093 #[serde(rename = "admin")]
13094 #[display("admin")]
13095 Admin,
13096 #[doc = "Members of an org can not modify an org, but they belong in the org."]
13097 #[serde(rename = "member")]
13098 #[display("member")]
13099 Member,
13100 #[doc = "A service account role."]
13101 #[serde(rename = "service_account")]
13102 #[display("service_account")]
13103 ServiceAccount,
13104}
13105
13106#[doc = "The response from the `OrientToFace` command."]
13107#[derive(
13108 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13109)]
13110pub struct OrientToFace {
13111 #[doc = "Camera settings"]
13112 pub settings: CameraSettings,
13113}
13114
13115impl std::fmt::Display for OrientToFace {
13116 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13117 write!(
13118 f,
13119 "{}",
13120 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13121 )
13122 }
13123}
13124
13125#[cfg(feature = "tabled")]
13126impl tabled::Tabled for OrientToFace {
13127 const LENGTH: usize = 1;
13128 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13129 vec![format!("{:?}", self.settings).into()]
13130 }
13131
13132 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13133 vec!["settings".into()]
13134 }
13135}
13136
13137#[doc = "The type of origin"]
13138#[derive(
13139 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13140)]
13141#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
13142#[serde(tag = "type")]
13143pub enum OriginType {
13144 #[doc = "Local Origin (center of object bounding box)."]
13145 #[serde(rename = "local")]
13146 Local {},
13147 #[doc = "Global Origin (0, 0, 0)."]
13148 #[serde(rename = "global")]
13149 Global {},
13150 #[doc = "Custom Origin (user specified point)."]
13151 #[serde(rename = "custom")]
13152 Custom {
13153 #[doc = "Custom origin point."]
13154 origin: Point3D,
13155 },
13156}
13157
13158#[doc = "Output file contents.\n\n<details><summary>JSON schema</summary>\n\n```json { \
13159 \"description\": \"Output file contents.\", \"type\": \"object\", \"properties\": { \
13160 \"contents\": { \"description\": \"The contents of the file. This is base64 encoded so we \
13161 can ensure it is UTF-8 for JSON.\", \"type\": \"string\" }, \"name\": { \"description\": \
13162 \"The name of the file.\", \"default\": \"\", \"type\": \"string\" } } } ``` </details>"]
13163#[derive(
13164 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13165)]
13166pub struct OutputFile {
13167 #[doc = "The contents of the file. This is base64 encoded so we can ensure it is UTF-8 for \
13168 JSON."]
13169 #[serde(default, skip_serializing_if = "Option::is_none")]
13170 pub contents: Option<String>,
13171 #[doc = "The name of the file."]
13172 #[serde(default, skip_serializing_if = "Option::is_none")]
13173 pub name: Option<String>,
13174}
13175
13176impl std::fmt::Display for OutputFile {
13177 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13178 write!(
13179 f,
13180 "{}",
13181 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13182 )
13183 }
13184}
13185
13186#[cfg(feature = "tabled")]
13187impl tabled::Tabled for OutputFile {
13188 const LENGTH: usize = 2;
13189 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13190 vec![
13191 if let Some(contents) = &self.contents {
13192 format!("{:?}", contents).into()
13193 } else {
13194 String::new().into()
13195 },
13196 if let Some(name) = &self.name {
13197 format!("{:?}", name).into()
13198 } else {
13199 String::new().into()
13200 },
13201 ]
13202 }
13203
13204 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13205 vec!["contents".into(), "name".into()]
13206 }
13207}
13208
13209#[derive(
13210 serde :: Serialize,
13211 serde :: Deserialize,
13212 PartialEq,
13213 Hash,
13214 Debug,
13215 Clone,
13216 schemars :: JsonSchema,
13217 parse_display :: FromStr,
13218 parse_display :: Display,
13219)]
13220#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
13221#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
13222#[derive(Default)]
13223pub enum OutputFormat2DType {
13224 #[serde(rename = "dxf")]
13225 #[display("dxf")]
13226 #[default]
13227 Dxf,
13228}
13229
13230
13231#[doc = "AutoCAD drawing interchange format."]
13232#[derive(
13233 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13234)]
13235pub struct OutputFormat2D {
13236 #[doc = "Export storage."]
13237 pub storage: DxfStorage,
13238 #[serde(rename = "type")]
13239 pub type_: OutputFormat2DType,
13240}
13241
13242impl std::fmt::Display for OutputFormat2D {
13243 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13244 write!(
13245 f,
13246 "{}",
13247 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13248 )
13249 }
13250}
13251
13252#[cfg(feature = "tabled")]
13253impl tabled::Tabled for OutputFormat2D {
13254 const LENGTH: usize = 2;
13255 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13256 vec![
13257 format!("{:?}", self.storage).into(),
13258 format!("{:?}", self.type_).into(),
13259 ]
13260 }
13261
13262 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13263 vec!["storage".into(), "type_".into()]
13264 }
13265}
13266
13267#[doc = "Output 3D format specifier."]
13268#[derive(
13269 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13270)]
13271#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
13272#[serde(tag = "type")]
13273pub enum OutputFormat3D {
13274 #[doc = "Autodesk Filmbox (FBX) format."]
13275 #[serde(rename = "fbx")]
13276 Fbx {
13277 #[doc = "Timestamp override."]
13278 #[serde(default, skip_serializing_if = "Option::is_none")]
13279 created: Option<chrono::DateTime<chrono::Utc>>,
13280 #[doc = "Specifies which kind of FBX will be exported."]
13281 storage: FbxStorage,
13282 },
13283 #[doc = "glTF 2.0. We refer to this as glTF since that is how our customers refer to it, \
13284 although by default it will be in binary format and thus technically (glb). If you \
13285 prefer ASCII output, you can set that option for the export."]
13286 #[serde(rename = "gltf")]
13287 Gltf {
13288 #[doc = "Specifies how the JSON will be presented."]
13289 presentation: GltfPresentation,
13290 #[doc = "Specifies which kind of glTF 2.0 will be exported."]
13291 storage: GltfStorage,
13292 },
13293 #[doc = "Wavefront OBJ format."]
13294 #[serde(rename = "obj")]
13295 Obj {
13296 #[doc = "Co-ordinate system of output data.\n\nDefaults to the [KittyCAD co-ordinate \
13297 system].\n\n[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html"]
13298 coords: System,
13299 #[doc = "Export length unit.\n\nDefaults to millimeters."]
13300 units: UnitLength,
13301 },
13302 #[doc = "The PLY Polygon File Format."]
13303 #[serde(rename = "ply")]
13304 Ply {
13305 #[doc = "Co-ordinate system of output data.\n\nDefaults to the [KittyCAD co-ordinate \
13306 system].\n\n[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html"]
13307 coords: System,
13308 #[doc = "Export selection."]
13309 selection: Selection,
13310 #[doc = "The storage for the output PLY file."]
13311 storage: PlyStorage,
13312 #[doc = "Export length unit.\n\nDefaults to millimeters."]
13313 units: UnitLength,
13314 },
13315 #[doc = "ISO 10303-21 (STEP) format."]
13316 #[serde(rename = "step")]
13317 Step {
13318 #[doc = "Co-ordinate system of output data.\n\nDefaults to the [KittyCAD co-ordinate \
13319 system].\n\n[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html"]
13320 coords: System,
13321 #[doc = "Timestamp override."]
13322 #[serde(default, skip_serializing_if = "Option::is_none")]
13323 created: Option<chrono::DateTime<chrono::Utc>>,
13324 },
13325 #[doc = "*ST**ereo**L**ithography format."]
13326 #[serde(rename = "stl")]
13327 Stl {
13328 #[doc = "Co-ordinate system of output data.\n\nDefaults to the [KittyCAD co-ordinate \
13329 system].\n\n[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html"]
13330 coords: System,
13331 #[doc = "Export selection."]
13332 selection: Selection,
13333 #[doc = "Export storage."]
13334 storage: StlStorage,
13335 #[doc = "Export length unit.\n\nDefaults to millimeters."]
13336 units: UnitLength,
13337 },
13338}
13339
13340#[doc = "The path component command type (within a Path)"]
13341#[derive(
13342 serde :: Serialize,
13343 serde :: Deserialize,
13344 PartialEq,
13345 Hash,
13346 Debug,
13347 Clone,
13348 schemars :: JsonSchema,
13349 parse_display :: FromStr,
13350 parse_display :: Display,
13351)]
13352#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
13353#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
13354pub enum PathCommand {
13355 #[serde(rename = "move_to")]
13356 #[display("move_to")]
13357 MoveTo,
13358 #[serde(rename = "line_to")]
13359 #[display("line_to")]
13360 LineTo,
13361 #[serde(rename = "bez_curve_to")]
13362 #[display("bez_curve_to")]
13363 BezCurveTo,
13364 #[serde(rename = "nurbs_curve_to")]
13365 #[display("nurbs_curve_to")]
13366 NurbsCurveTo,
13367 #[serde(rename = "add_arc")]
13368 #[display("add_arc")]
13369 AddArc,
13370}
13371
13372#[doc = "The path component constraint bounds type"]
13373#[derive(
13374 serde :: Serialize,
13375 serde :: Deserialize,
13376 PartialEq,
13377 Hash,
13378 Debug,
13379 Clone,
13380 schemars :: JsonSchema,
13381 parse_display :: FromStr,
13382 parse_display :: Display,
13383)]
13384#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
13385#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
13386pub enum PathComponentConstraintBound {
13387 #[serde(rename = "unconstrained")]
13388 #[display("unconstrained")]
13389 Unconstrained,
13390 #[serde(rename = "partially_constrained")]
13391 #[display("partially_constrained")]
13392 PartiallyConstrained,
13393 #[serde(rename = "fully_constrained")]
13394 #[display("fully_constrained")]
13395 FullyConstrained,
13396}
13397
13398#[doc = "The path component constraint type"]
13399#[derive(
13400 serde :: Serialize,
13401 serde :: Deserialize,
13402 PartialEq,
13403 Hash,
13404 Debug,
13405 Clone,
13406 schemars :: JsonSchema,
13407 parse_display :: FromStr,
13408 parse_display :: Display,
13409)]
13410#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
13411#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
13412pub enum PathComponentConstraintType {
13413 #[serde(rename = "unconstrained")]
13414 #[display("unconstrained")]
13415 Unconstrained,
13416 #[serde(rename = "vertical")]
13417 #[display("vertical")]
13418 Vertical,
13419 #[serde(rename = "horizontal")]
13420 #[display("horizontal")]
13421 Horizontal,
13422 #[serde(rename = "equal_length")]
13423 #[display("equal_length")]
13424 EqualLength,
13425 #[serde(rename = "parallel")]
13426 #[display("parallel")]
13427 Parallel,
13428 #[serde(rename = "angle_between")]
13429 #[display("angle_between")]
13430 AngleBetween,
13431}
13432
13433#[doc = "The response from the `PathGetCurveUuid` command."]
13434#[derive(
13435 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13436)]
13437pub struct PathGetCurveUuid {
13438 #[doc = "The UUID of the curve entity."]
13439 pub curve_id: uuid::Uuid,
13440}
13441
13442impl std::fmt::Display for PathGetCurveUuid {
13443 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13444 write!(
13445 f,
13446 "{}",
13447 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13448 )
13449 }
13450}
13451
13452#[cfg(feature = "tabled")]
13453impl tabled::Tabled for PathGetCurveUuid {
13454 const LENGTH: usize = 1;
13455 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13456 vec![format!("{:?}", self.curve_id).into()]
13457 }
13458
13459 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13460 vec!["curve_id".into()]
13461 }
13462}
13463
13464#[doc = "The response from the `PathGetCurveUuidsForVertices` command."]
13465#[derive(
13466 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13467)]
13468pub struct PathGetCurveUuidsForVertices {
13469 #[doc = "The UUIDs of the curve entities."]
13470 pub curve_ids: Vec<uuid::Uuid>,
13471}
13472
13473impl std::fmt::Display for PathGetCurveUuidsForVertices {
13474 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13475 write!(
13476 f,
13477 "{}",
13478 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13479 )
13480 }
13481}
13482
13483#[cfg(feature = "tabled")]
13484impl tabled::Tabled for PathGetCurveUuidsForVertices {
13485 const LENGTH: usize = 1;
13486 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13487 vec![format!("{:?}", self.curve_ids).into()]
13488 }
13489
13490 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13491 vec!["curve_ids".into()]
13492 }
13493}
13494
13495#[doc = "The response from the `PathGetInfo` command."]
13496#[derive(
13497 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13498)]
13499pub struct PathGetInfo {
13500 #[doc = "All segments in the path, in the order they were added."]
13501 pub segments: Vec<PathSegmentInfo>,
13502}
13503
13504impl std::fmt::Display for PathGetInfo {
13505 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13506 write!(
13507 f,
13508 "{}",
13509 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13510 )
13511 }
13512}
13513
13514#[cfg(feature = "tabled")]
13515impl tabled::Tabled for PathGetInfo {
13516 const LENGTH: usize = 1;
13517 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13518 vec![format!("{:?}", self.segments).into()]
13519 }
13520
13521 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13522 vec!["segments".into()]
13523 }
13524}
13525
13526#[doc = "The response from the `PathGetSketchTargetUuid` command."]
13527#[derive(
13528 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13529)]
13530pub struct PathGetSketchTargetUuid {
13531 #[doc = "The UUID of the sketch target."]
13532 #[serde(default, skip_serializing_if = "Option::is_none")]
13533 pub target_id: Option<uuid::Uuid>,
13534}
13535
13536impl std::fmt::Display for PathGetSketchTargetUuid {
13537 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13538 write!(
13539 f,
13540 "{}",
13541 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13542 )
13543 }
13544}
13545
13546#[cfg(feature = "tabled")]
13547impl tabled::Tabled for PathGetSketchTargetUuid {
13548 const LENGTH: usize = 1;
13549 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13550 vec![if let Some(target_id) = &self.target_id {
13551 format!("{:?}", target_id).into()
13552 } else {
13553 String::new().into()
13554 }]
13555 }
13556
13557 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13558 vec!["target_id".into()]
13559 }
13560}
13561
13562#[doc = "The response from the `PathGetVertexUuids` command."]
13563#[derive(
13564 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13565)]
13566pub struct PathGetVertexUuids {
13567 #[doc = "The UUIDs of the vertex entities."]
13568 pub vertex_ids: Vec<uuid::Uuid>,
13569}
13570
13571impl std::fmt::Display for PathGetVertexUuids {
13572 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13573 write!(
13574 f,
13575 "{}",
13576 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13577 )
13578 }
13579}
13580
13581#[cfg(feature = "tabled")]
13582impl tabled::Tabled for PathGetVertexUuids {
13583 const LENGTH: usize = 1;
13584 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13585 vec![format!("{:?}", self.vertex_ids).into()]
13586 }
13587
13588 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13589 vec!["vertex_ids".into()]
13590 }
13591}
13592
13593#[doc = "A segment of a path. Paths are composed of many segments."]
13594#[derive(
13595 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13596)]
13597#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
13598#[serde(tag = "type")]
13599pub enum PathSegment {
13600 #[doc = "A straight line segment. Goes from the current path \"pen\" to the given endpoint."]
13601 #[serde(rename = "line")]
13602 Line {
13603 #[doc = "End point of the line."]
13604 end: Point3D,
13605 #[doc = "Whether or not this line is a relative offset"]
13606 relative: bool,
13607 },
13608 #[doc = "A circular arc segment. Arcs can be drawn clockwise when start > end."]
13609 #[serde(rename = "arc")]
13610 Arc {
13611 #[doc = "Center of the circle"]
13612 center: Point2D,
13613 #[doc = "End of the arc along circle's perimeter."]
13614 end: Angle,
13615 #[doc = "Radius of the circle"]
13616 radius: f64,
13617 #[doc = "Whether or not this arc is a relative offset"]
13618 relative: bool,
13619 #[doc = "Start of the arc along circle's perimeter."]
13620 start: Angle,
13621 },
13622 #[doc = "A cubic bezier curve segment. Start at the end of the current line, go through \
13623 control point 1 and 2, then end at a given point."]
13624 #[serde(rename = "bezier")]
13625 Bezier {
13626 #[doc = "First control point."]
13627 #[serde(rename = "control1")]
13628 control_1: Point3D,
13629 #[doc = "Second control point."]
13630 #[serde(rename = "control2")]
13631 control_2: Point3D,
13632 #[doc = "Final control point."]
13633 end: Point3D,
13634 #[doc = "Whether or not this bezier is a relative offset"]
13635 relative: bool,
13636 },
13637 #[doc = "Adds a tangent arc from current pen position with the given radius and angle."]
13638 #[serde(rename = "tangential_arc")]
13639 TangentialArc {
13640 #[doc = "Offset of the arc. Negative values will arc clockwise."]
13641 offset: Angle,
13642 #[doc = "Radius of the arc. Not to be confused with Raiders of the Lost Ark."]
13643 radius: f64,
13644 },
13645 #[doc = "Adds a tangent arc from current pen position to the new position. Arcs will choose a \
13646 clockwise or counter-clockwise direction based on the arc end position."]
13647 #[serde(rename = "tangential_arc_to")]
13648 TangentialArcTo {
13649 #[doc = "0 will be interpreted as none/null."]
13650 #[serde(default, skip_serializing_if = "Option::is_none")]
13651 angle_snap_increment: Option<Angle>,
13652 #[doc = "Where the arc should end. Must lie in the same plane as the current path pen \
13653 position. Must not be colinear with current path pen position."]
13654 to: Point3D,
13655 },
13656 #[doc = "Adds an arc from the current position that goes through the given interior point and \
13657 ends at the given end position"]
13658 #[serde(rename = "arc_to")]
13659 ArcTo {
13660 #[doc = "End point of the arc."]
13661 end: Point3D,
13662 #[doc = "Interior point of the arc."]
13663 interior: Point3D,
13664 #[doc = "Whether or not interior and end are relative to the previous path position"]
13665 relative: bool,
13666 },
13667 #[doc = "Adds a circular involute from the current position that goes through the given \
13668 end_radius and is rotated around the current point by angle."]
13669 #[serde(rename = "circular_involute")]
13670 CircularInvolute {
13671 #[doc = "The angle to rotate the involute by. A value of zero will produce a curve with a \
13672 tangent along the x-axis at the start point of the curve."]
13673 angle: Angle,
13674 #[doc = "The involute is described between two circles, end_radius is the radius of the \
13675 outer circle."]
13676 end_radius: f64,
13677 #[doc = "If reverse is true, the segment will start from the end of the involute, \
13678 otherwise it will start from that start."]
13679 reverse: bool,
13680 #[doc = "The involute is described between two circles, start_radius is the radius of the \
13681 inner circle."]
13682 start_radius: f64,
13683 },
13684 #[doc = "Adds an elliptical arc segment."]
13685 #[serde(rename = "ellipse")]
13686 Ellipse {
13687 #[doc = "The center point of the ellipse."]
13688 center: Point2D,
13689 #[doc = "End of the path along the perimeter of the ellipse."]
13690 end_angle: Angle,
13691 #[doc = "Major axis of the ellipse."]
13692 major_axis: Point2D,
13693 #[doc = "Minor radius of the ellipse."]
13694 minor_radius: f64,
13695 #[doc = "Start of the path along the perimeter of the ellipse."]
13696 start_angle: Angle,
13697 },
13698 #[doc = "Adds a generic conic section specified by the end point, interior point and tangents \
13699 at the start and end of the section."]
13700 #[serde(rename = "conic_to")]
13701 ConicTo {
13702 #[doc = "End point of the conic."]
13703 end: Point2D,
13704 #[doc = "Tangent at the end of the conic."]
13705 end_tangent: Point2D,
13706 #[doc = "Interior point that lies on the conic."]
13707 interior: Point2D,
13708 #[doc = "Whether or not the interior and end points are relative to the previous path \
13709 position."]
13710 relative: bool,
13711 #[doc = "Tangent at the start of the conic."]
13712 start_tangent: Point2D,
13713 },
13714}
13715
13716#[doc = "Info about a path segment"]
13717#[derive(
13718 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13719)]
13720pub struct PathSegmentInfo {
13721 #[doc = "What is the path segment?"]
13722 pub command: PathCommand,
13723 #[doc = "Which command created this path? This field is absent if the path command is not \
13724 actually creating a path segment, e.g. moving the pen doesn't create a path segment."]
13725 #[serde(default, skip_serializing_if = "Option::is_none")]
13726 pub command_id: Option<uuid::Uuid>,
13727 #[doc = "Whether or not this segment is a relative offset"]
13728 pub relative: bool,
13729}
13730
13731impl std::fmt::Display for PathSegmentInfo {
13732 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13733 write!(
13734 f,
13735 "{}",
13736 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13737 )
13738 }
13739}
13740
13741#[cfg(feature = "tabled")]
13742impl tabled::Tabled for PathSegmentInfo {
13743 const LENGTH: usize = 3;
13744 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13745 vec![
13746 format!("{:?}", self.command).into(),
13747 if let Some(command_id) = &self.command_id {
13748 format!("{:?}", command_id).into()
13749 } else {
13750 String::new().into()
13751 },
13752 format!("{:?}", self.relative).into(),
13753 ]
13754 }
13755
13756 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13757 vec!["command".into(), "command_id".into(), "relative".into()]
13758 }
13759}
13760
13761#[doc = "A payment intent response."]
13762#[derive(
13763 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13764)]
13765pub struct PaymentIntent {
13766 #[doc = "The client secret is used for client-side retrieval using a publishable key. The \
13767 client secret can be used to complete payment setup from your frontend. It should \
13768 not be stored, logged, or exposed to anyone other than the customer. Make sure that \
13769 you have TLS enabled on any page that includes the client secret."]
13770 pub client_secret: String,
13771}
13772
13773impl std::fmt::Display for PaymentIntent {
13774 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13775 write!(
13776 f,
13777 "{}",
13778 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13779 )
13780 }
13781}
13782
13783#[cfg(feature = "tabled")]
13784impl tabled::Tabled for PaymentIntent {
13785 const LENGTH: usize = 1;
13786 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13787 vec![self.client_secret.clone().into()]
13788 }
13789
13790 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13791 vec!["client_secret".into()]
13792 }
13793}
13794
13795#[doc = "A payment method."]
13796#[derive(
13797 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13798)]
13799pub struct PaymentMethod {
13800 #[doc = "The billing info for the payment method."]
13801 pub billing_info: BillingInfo,
13802 #[doc = "The card, if it is one. For our purposes, this is the only type of payment method \
13803 that we support."]
13804 #[serde(default, skip_serializing_if = "Option::is_none")]
13805 pub card: Option<CardDetails>,
13806 #[doc = "Time at which the object was created."]
13807 pub created_at: chrono::DateTime<chrono::Utc>,
13808 #[doc = "Unique identifier for the object."]
13809 #[serde(default, skip_serializing_if = "Option::is_none")]
13810 pub id: Option<String>,
13811 #[doc = "Set of key-value pairs."]
13812 #[serde(default, skip_serializing_if = "Option::is_none")]
13813 pub metadata: Option<std::collections::HashMap<String, String>>,
13814 #[doc = "The type of payment method."]
13815 #[serde(rename = "type")]
13816 pub type_: PaymentMethodType,
13817}
13818
13819impl std::fmt::Display for PaymentMethod {
13820 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13821 write!(
13822 f,
13823 "{}",
13824 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13825 )
13826 }
13827}
13828
13829#[cfg(feature = "tabled")]
13830impl tabled::Tabled for PaymentMethod {
13831 const LENGTH: usize = 6;
13832 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13833 vec![
13834 format!("{:?}", self.billing_info).into(),
13835 if let Some(card) = &self.card {
13836 format!("{:?}", card).into()
13837 } else {
13838 String::new().into()
13839 },
13840 format!("{:?}", self.created_at).into(),
13841 if let Some(id) = &self.id {
13842 format!("{:?}", id).into()
13843 } else {
13844 String::new().into()
13845 },
13846 if let Some(metadata) = &self.metadata {
13847 format!("{:?}", metadata).into()
13848 } else {
13849 String::new().into()
13850 },
13851 format!("{:?}", self.type_).into(),
13852 ]
13853 }
13854
13855 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13856 vec![
13857 "billing_info".into(),
13858 "card".into(),
13859 "created_at".into(),
13860 "id".into(),
13861 "metadata".into(),
13862 "type_".into(),
13863 ]
13864 }
13865}
13866
13867#[doc = "Card checks."]
13868#[derive(
13869 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13870)]
13871pub struct PaymentMethodCardChecks {
13872 #[doc = "If a address line1 was provided, results of the check, one of `pass`, `fail`, \
13873 `unavailable`, or `unchecked`."]
13874 #[serde(
13875 rename = "address_line1_check",
13876 default,
13877 skip_serializing_if = "Option::is_none"
13878 )]
13879 pub address_line_1_check: Option<String>,
13880 #[doc = "If a address postal code was provided, results of the check, one of `pass`, `fail`, \
13881 `unavailable`, or `unchecked`."]
13882 #[serde(default, skip_serializing_if = "Option::is_none")]
13883 pub address_postal_code_check: Option<String>,
13884 #[doc = "If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, \
13885 or `unchecked`."]
13886 #[serde(default, skip_serializing_if = "Option::is_none")]
13887 pub cvc_check: Option<String>,
13888}
13889
13890impl std::fmt::Display for PaymentMethodCardChecks {
13891 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13892 write!(
13893 f,
13894 "{}",
13895 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13896 )
13897 }
13898}
13899
13900#[cfg(feature = "tabled")]
13901impl tabled::Tabled for PaymentMethodCardChecks {
13902 const LENGTH: usize = 3;
13903 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13904 vec![
13905 if let Some(address_line_1_check) = &self.address_line_1_check {
13906 format!("{:?}", address_line_1_check).into()
13907 } else {
13908 String::new().into()
13909 },
13910 if let Some(address_postal_code_check) = &self.address_postal_code_check {
13911 format!("{:?}", address_postal_code_check).into()
13912 } else {
13913 String::new().into()
13914 },
13915 if let Some(cvc_check) = &self.cvc_check {
13916 format!("{:?}", cvc_check).into()
13917 } else {
13918 String::new().into()
13919 },
13920 ]
13921 }
13922
13923 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
13924 vec![
13925 "address_line_1_check".into(),
13926 "address_postal_code_check".into(),
13927 "cvc_check".into(),
13928 ]
13929 }
13930}
13931
13932#[doc = "An enum representing the possible values of an `PaymentMethod`'s `type` field."]
13933#[derive(
13934 serde :: Serialize,
13935 serde :: Deserialize,
13936 PartialEq,
13937 Hash,
13938 Debug,
13939 Clone,
13940 schemars :: JsonSchema,
13941 parse_display :: FromStr,
13942 parse_display :: Display,
13943)]
13944#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
13945#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
13946#[derive(Default)]
13947pub enum PaymentMethodType {
13948 #[doc = "A card payment method."]
13949 #[serde(rename = "card")]
13950 #[display("card")]
13951 #[default]
13952 Card,
13953}
13954
13955
13956#[doc = "Defines a perspective view."]
13957#[derive(
13958 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
13959)]
13960pub struct PerspectiveCameraParameters {
13961 #[doc = "Camera frustum vertical field of view."]
13962 #[serde(default, skip_serializing_if = "Option::is_none")]
13963 pub fov_y: Option<f64>,
13964 #[doc = "Camera frustum far plane."]
13965 #[serde(default, skip_serializing_if = "Option::is_none")]
13966 pub z_far: Option<f64>,
13967 #[doc = "Camera frustum near plane."]
13968 #[serde(default, skip_serializing_if = "Option::is_none")]
13969 pub z_near: Option<f64>,
13970}
13971
13972impl std::fmt::Display for PerspectiveCameraParameters {
13973 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
13974 write!(
13975 f,
13976 "{}",
13977 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
13978 )
13979 }
13980}
13981
13982#[cfg(feature = "tabled")]
13983impl tabled::Tabled for PerspectiveCameraParameters {
13984 const LENGTH: usize = 3;
13985 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
13986 vec![
13987 if let Some(fov_y) = &self.fov_y {
13988 format!("{:?}", fov_y).into()
13989 } else {
13990 String::new().into()
13991 },
13992 if let Some(z_far) = &self.z_far {
13993 format!("{:?}", z_far).into()
13994 } else {
13995 String::new().into()
13996 },
13997 if let Some(z_near) = &self.z_near {
13998 format!("{:?}", z_near).into()
13999 } else {
14000 String::new().into()
14001 },
14002 ]
14003 }
14004
14005 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14006 vec!["fov_y".into(), "z_far".into(), "z_near".into()]
14007 }
14008}
14009
14010#[doc = "A plan's interval."]
14011#[derive(
14012 serde :: Serialize,
14013 serde :: Deserialize,
14014 PartialEq,
14015 Hash,
14016 Debug,
14017 Clone,
14018 schemars :: JsonSchema,
14019 parse_display :: FromStr,
14020 parse_display :: Display,
14021)]
14022#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
14023#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
14024pub enum PlanInterval {
14025 #[doc = "Day."]
14026 #[serde(rename = "day")]
14027 #[display("day")]
14028 Day,
14029 #[doc = "Month."]
14030 #[serde(rename = "month")]
14031 #[display("month")]
14032 Month,
14033 #[doc = "Week."]
14034 #[serde(rename = "week")]
14035 #[display("week")]
14036 Week,
14037 #[doc = "Year."]
14038 #[serde(rename = "year")]
14039 #[display("year")]
14040 Year,
14041}
14042
14043#[doc = "A step in the design plan."]
14044#[derive(
14045 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14046)]
14047pub struct PlanStep {
14048 #[doc = "The edit instructions for the step."]
14049 pub edit_instructions: String,
14050 #[doc = "The file path it's editing."]
14051 pub filepath_to_edit: String,
14052}
14053
14054impl std::fmt::Display for PlanStep {
14055 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14056 write!(
14057 f,
14058 "{}",
14059 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14060 )
14061 }
14062}
14063
14064#[cfg(feature = "tabled")]
14065impl tabled::Tabled for PlanStep {
14066 const LENGTH: usize = 2;
14067 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14068 vec![
14069 self.edit_instructions.clone().into(),
14070 self.filepath_to_edit.clone().into(),
14071 ]
14072 }
14073
14074 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14075 vec!["edit_instructions".into(), "filepath_to_edit".into()]
14076 }
14077}
14078
14079#[doc = "Corresponding coordinates of given window coordinates, intersected on given plane."]
14080#[derive(
14081 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14082)]
14083pub struct PlaneIntersectAndProject {
14084 #[doc = "Corresponding coordinates of given window coordinates, intersected on given plane."]
14085 #[serde(default, skip_serializing_if = "Option::is_none")]
14086 pub plane_coordinates: Option<Point2D>,
14087}
14088
14089impl std::fmt::Display for PlaneIntersectAndProject {
14090 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14091 write!(
14092 f,
14093 "{}",
14094 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14095 )
14096 }
14097}
14098
14099#[cfg(feature = "tabled")]
14100impl tabled::Tabled for PlaneIntersectAndProject {
14101 const LENGTH: usize = 1;
14102 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14103 vec![if let Some(plane_coordinates) = &self.plane_coordinates {
14104 format!("{:?}", plane_coordinates).into()
14105 } else {
14106 String::new().into()
14107 }]
14108 }
14109
14110 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14111 vec!["plane_coordinates".into()]
14112 }
14113}
14114
14115#[doc = "The response from the `PlaneSetColor` endpoint."]
14116#[derive(
14117 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14118)]
14119pub struct PlaneSetColor {}
14120
14121impl std::fmt::Display for PlaneSetColor {
14122 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14123 write!(
14124 f,
14125 "{}",
14126 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14127 )
14128 }
14129}
14130
14131#[cfg(feature = "tabled")]
14132impl tabled::Tabled for PlaneSetColor {
14133 const LENGTH: usize = 0;
14134 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14135 vec![]
14136 }
14137
14138 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14139 vec![]
14140 }
14141}
14142
14143#[doc = "The storage for the output PLY file."]
14144#[derive(
14145 serde :: Serialize,
14146 serde :: Deserialize,
14147 PartialEq,
14148 Hash,
14149 Debug,
14150 Clone,
14151 schemars :: JsonSchema,
14152 parse_display :: FromStr,
14153 parse_display :: Display,
14154)]
14155#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
14156#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
14157pub enum PlyStorage {
14158 #[doc = "Write numbers in their ascii representation (e.g. -13, 6.28, etc.). Properties are \
14159 separated by spaces and elements are separated by line breaks."]
14160 #[serde(rename = "ascii")]
14161 #[display("ascii")]
14162 Ascii,
14163 #[doc = "Encode payload as binary using little endian."]
14164 #[serde(rename = "binary_little_endian")]
14165 #[display("binary_little_endian")]
14166 BinaryLittleEndian,
14167 #[doc = "Encode payload as binary using big endian."]
14168 #[serde(rename = "binary_big_endian")]
14169 #[display("binary_big_endian")]
14170 BinaryBigEndian,
14171}
14172
14173#[doc = "A point in 2D space"]
14174#[derive(
14175 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14176)]
14177pub struct Point2D {
14178 pub x: f64,
14179 pub y: f64,
14180}
14181
14182impl std::fmt::Display for Point2D {
14183 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14184 write!(
14185 f,
14186 "{}",
14187 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14188 )
14189 }
14190}
14191
14192#[cfg(feature = "tabled")]
14193impl tabled::Tabled for Point2D {
14194 const LENGTH: usize = 2;
14195 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14196 vec![
14197 format!("{:?}", self.x).into(),
14198 format!("{:?}", self.y).into(),
14199 ]
14200 }
14201
14202 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14203 vec!["x".into(), "y".into()]
14204 }
14205}
14206
14207#[doc = "A point in 3D space"]
14208#[derive(
14209 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14210)]
14211pub struct Point3D {
14212 pub x: f64,
14213 pub y: f64,
14214 pub z: f64,
14215}
14216
14217impl std::fmt::Display for Point3D {
14218 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14219 write!(
14220 f,
14221 "{}",
14222 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14223 )
14224 }
14225}
14226
14227#[cfg(feature = "tabled")]
14228impl tabled::Tabled for Point3D {
14229 const LENGTH: usize = 3;
14230 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14231 vec![
14232 format!("{:?}", self.x).into(),
14233 format!("{:?}", self.y).into(),
14234 format!("{:?}", self.z).into(),
14235 ]
14236 }
14237
14238 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14239 vec!["x".into(), "y".into(), "z".into()]
14240 }
14241}
14242
14243#[doc = "A point in homogeneous (4D) space"]
14244#[derive(
14245 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14246)]
14247pub struct Point4D {
14248 pub w: f64,
14249 pub x: f64,
14250 pub y: f64,
14251 pub z: f64,
14252}
14253
14254impl std::fmt::Display for Point4D {
14255 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14256 write!(
14257 f,
14258 "{}",
14259 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14260 )
14261 }
14262}
14263
14264#[cfg(feature = "tabled")]
14265impl tabled::Tabled for Point4D {
14266 const LENGTH: usize = 4;
14267 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14268 vec![
14269 format!("{:?}", self.w).into(),
14270 format!("{:?}", self.x).into(),
14271 format!("{:?}", self.y).into(),
14272 format!("{:?}", self.z).into(),
14273 ]
14274 }
14275
14276 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14277 vec!["w".into(), "x".into(), "y".into(), "z".into()]
14278 }
14279}
14280
14281#[doc = "The response from the `/ping` endpoint."]
14282#[derive(
14283 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14284)]
14285pub struct Pong {
14286 #[doc = "The pong response."]
14287 pub message: String,
14288}
14289
14290impl std::fmt::Display for Pong {
14291 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14292 write!(
14293 f,
14294 "{}",
14295 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14296 )
14297 }
14298}
14299
14300#[cfg(feature = "tabled")]
14301impl tabled::Tabled for Pong {
14302 const LENGTH: usize = 1;
14303 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14304 vec![self.message.clone().into()]
14305 }
14306
14307 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14308 vec!["message".into()]
14309 }
14310}
14311
14312#[doc = "Privacy settings for an org or user."]
14313#[derive(
14314 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14315)]
14316pub struct PrivacySettings {
14317 #[doc = "If we can train on the data. If the user is a member of an organization, the \
14318 organization's setting will override this. The organization's setting takes priority."]
14319 pub can_train_on_data: bool,
14320}
14321
14322impl std::fmt::Display for PrivacySettings {
14323 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14324 write!(
14325 f,
14326 "{}",
14327 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14328 )
14329 }
14330}
14331
14332#[cfg(feature = "tabled")]
14333impl tabled::Tabled for PrivacySettings {
14334 const LENGTH: usize = 1;
14335 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14336 vec![format!("{:?}", self.can_train_on_data).into()]
14337 }
14338
14339 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14340 vec!["can_train_on_data".into()]
14341 }
14342}
14343
14344#[doc = "The response from the `ProjectEntityToPlane` command."]
14345#[derive(
14346 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14347)]
14348pub struct ProjectEntityToPlane {
14349 #[doc = "Projected points."]
14350 pub projected_points: Vec<Point3D>,
14351}
14352
14353impl std::fmt::Display for ProjectEntityToPlane {
14354 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14355 write!(
14356 f,
14357 "{}",
14358 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14359 )
14360 }
14361}
14362
14363#[cfg(feature = "tabled")]
14364impl tabled::Tabled for ProjectEntityToPlane {
14365 const LENGTH: usize = 1;
14366 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14367 vec![format!("{:?}", self.projected_points).into()]
14368 }
14369
14370 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14371 vec!["projected_points".into()]
14372 }
14373}
14374
14375#[doc = "The response from the `ProjectPointsToPlane` command."]
14376#[derive(
14377 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14378)]
14379pub struct ProjectPointsToPlane {
14380 #[doc = "Projected points."]
14381 pub projected_points: Vec<Point3D>,
14382}
14383
14384impl std::fmt::Display for ProjectPointsToPlane {
14385 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14386 write!(
14387 f,
14388 "{}",
14389 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14390 )
14391 }
14392}
14393
14394#[cfg(feature = "tabled")]
14395impl tabled::Tabled for ProjectPointsToPlane {
14396 const LENGTH: usize = 1;
14397 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14398 vec![format!("{:?}", self.projected_points).into()]
14399 }
14400
14401 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14402 vec!["projected_points".into()]
14403 }
14404}
14405
14406#[doc = "A raw file with unencoded contents to be passed over binary websockets. When raw files \
14407 come back for exports it is sent as binary/bson, not text/json."]
14408#[derive(
14409 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14410)]
14411pub struct RawFile {
14412 #[doc = "The contents of the file."]
14413 #[serde(
14414 serialize_with = "serde_bytes::serialize",
14415 deserialize_with = "serde_bytes::deserialize"
14416 )]
14417 pub contents: Vec<u8>,
14418 #[doc = "The name of the file."]
14419 pub name: String,
14420}
14421
14422impl std::fmt::Display for RawFile {
14423 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14424 write!(
14425 f,
14426 "{}",
14427 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14428 )
14429 }
14430}
14431
14432#[cfg(feature = "tabled")]
14433impl tabled::Tabled for RawFile {
14434 const LENGTH: usize = 2;
14435 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14436 vec![
14437 format!("{:?}", self.contents).into(),
14438 self.name.clone().into(),
14439 ]
14440 }
14441
14442 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14443 vec!["contents".into(), "name".into()]
14444 }
14445}
14446
14447#[doc = "A message containing reasoning information."]
14448#[derive(
14449 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14450)]
14451#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
14452#[serde(tag = "type")]
14453pub enum ReasoningMessage {
14454 #[doc = "Plain text reasoning."]
14455 #[serde(rename = "text")]
14456 Text {
14457 #[doc = "The content of the reasoning."]
14458 content: String,
14459 },
14460 #[doc = "Markdown formatted reasoning."]
14461 #[serde(rename = "markdown")]
14462 Markdown {
14463 #[doc = "The content of the reasoning."]
14464 content: String,
14465 },
14466 #[doc = "Reasoning that contains the KCL docs relevant to the reasoning."]
14467 #[serde(rename = "kcl_docs")]
14468 KclDocs {
14469 #[doc = "The content of the reasoning."]
14470 content: String,
14471 },
14472 #[doc = "Reasoning that contains the KCL code examples relevant to the reasoning."]
14473 #[serde(rename = "kcl_code_examples")]
14474 KclCodeExamples {
14475 #[doc = "The content of the reasoning."]
14476 content: String,
14477 },
14478 #[doc = "Reasoning that contains a feature tree outline."]
14479 #[serde(rename = "feature_tree_outline")]
14480 FeatureTreeOutline {
14481 #[doc = "The content of the reasoning."]
14482 content: String,
14483 },
14484 #[doc = "Reasoning that contains a design plan with steps."]
14485 #[serde(rename = "design_plan")]
14486 DesignPlan {
14487 #[doc = "The steps in the design plan."]
14488 steps: Vec<PlanStep>,
14489 },
14490 #[doc = "Reasoning that contains potential KCL code, this code has not been executed yet. It \
14491 might not even compile or be valid KCL code."]
14492 #[serde(rename = "generated_kcl_code")]
14493 GeneratedKclCode {
14494 #[doc = "The content of the reasoning."]
14495 code: String,
14496 },
14497 #[doc = "Reasoning containing an error message from executing the KCL code."]
14498 #[serde(rename = "kcl_code_error")]
14499 KclCodeError {
14500 #[doc = "The error message."]
14501 error: String,
14502 },
14503 #[doc = "A KCL file that is being created by the AI. This might contain invalid KCL code."]
14504 #[serde(rename = "created_kcl_file")]
14505 CreatedKclFile {
14506 #[doc = "The content of the file."]
14507 content: String,
14508 #[doc = "The file name."]
14509 file_name: String,
14510 },
14511 #[doc = "A KCL file that is being updated by the AI. This might contain invalid KCL code."]
14512 #[serde(rename = "updated_kcl_file")]
14513 UpdatedKclFile {
14514 #[doc = "The content of the file."]
14515 content: String,
14516 #[doc = "The file name."]
14517 file_name: String,
14518 },
14519 #[doc = "A KCL file that is being deleted by the AI."]
14520 #[serde(rename = "deleted_kcl_file")]
14521 DeletedKclFile {
14522 #[doc = "The file name."]
14523 file_name: String,
14524 },
14525}
14526
14527#[doc = "The response from the `ReconfigureStream` endpoint."]
14528#[derive(
14529 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14530)]
14531pub struct ReconfigureStream {}
14532
14533impl std::fmt::Display for ReconfigureStream {
14534 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14535 write!(
14536 f,
14537 "{}",
14538 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14539 )
14540 }
14541}
14542
14543#[cfg(feature = "tabled")]
14544impl tabled::Tabled for ReconfigureStream {
14545 const LENGTH: usize = 0;
14546 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14547 vec![]
14548 }
14549
14550 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14551 vec![]
14552 }
14553}
14554
14555#[doc = "What is the given geometry relative to?"]
14556#[derive(
14557 serde :: Serialize,
14558 serde :: Deserialize,
14559 PartialEq,
14560 Hash,
14561 Debug,
14562 Clone,
14563 schemars :: JsonSchema,
14564 parse_display :: FromStr,
14565 parse_display :: Display,
14566)]
14567#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
14568#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
14569pub enum RelativeTo {
14570 #[doc = "Local/relative to a position centered within the plane being sketched on"]
14571 #[serde(rename = "sketch_plane")]
14572 #[display("sketch_plane")]
14573 SketchPlane,
14574 #[doc = "Local/relative to the trajectory curve"]
14575 #[serde(rename = "trajectory_curve")]
14576 #[display("trajectory_curve")]
14577 TrajectoryCurve,
14578}
14579
14580#[doc = "The response from the `RemoveSceneObjects` endpoint."]
14581#[derive(
14582 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14583)]
14584pub struct RemoveSceneObjects {}
14585
14586impl std::fmt::Display for RemoveSceneObjects {
14587 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14588 write!(
14589 f,
14590 "{}",
14591 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14592 )
14593 }
14594}
14595
14596#[cfg(feature = "tabled")]
14597impl tabled::Tabled for RemoveSceneObjects {
14598 const LENGTH: usize = 0;
14599 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14600 vec![]
14601 }
14602
14603 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14604 vec![]
14605 }
14606}
14607
14608#[doc = "The response from the `Revolve` endpoint."]
14609#[derive(
14610 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14611)]
14612pub struct Revolve {}
14613
14614impl std::fmt::Display for Revolve {
14615 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14616 write!(
14617 f,
14618 "{}",
14619 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14620 )
14621 }
14622}
14623
14624#[cfg(feature = "tabled")]
14625impl tabled::Tabled for Revolve {
14626 const LENGTH: usize = 0;
14627 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14628 vec![]
14629 }
14630
14631 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14632 vec![]
14633 }
14634}
14635
14636#[doc = "The response from the `RevolveAboutEdge` endpoint."]
14637#[derive(
14638 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14639)]
14640pub struct RevolveAboutEdge {}
14641
14642impl std::fmt::Display for RevolveAboutEdge {
14643 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14644 write!(
14645 f,
14646 "{}",
14647 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14648 )
14649 }
14650}
14651
14652#[cfg(feature = "tabled")]
14653impl tabled::Tabled for RevolveAboutEdge {
14654 const LENGTH: usize = 0;
14655 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14656 vec![]
14657 }
14658
14659 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14660 vec![]
14661 }
14662}
14663
14664#[doc = "A rotation defined by an axis, origin of rotation, and an angle."]
14665#[derive(
14666 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14667)]
14668pub struct Rotation {
14669 #[doc = "Rotate this far about the rotation axis. Defaults to zero (i.e. no rotation)."]
14670 pub angle: Angle,
14671 #[doc = "Rotation axis. Defaults to (0, 0, 1) (i.e. the Z axis)."]
14672 pub axis: Point3D,
14673 #[doc = "Origin of the rotation. If one isn't provided, the object will rotate about its own \
14674 bounding box center."]
14675 pub origin: OriginType,
14676}
14677
14678impl std::fmt::Display for Rotation {
14679 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14680 write!(
14681 f,
14682 "{}",
14683 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14684 )
14685 }
14686}
14687
14688#[cfg(feature = "tabled")]
14689impl tabled::Tabled for Rotation {
14690 const LENGTH: usize = 3;
14691 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14692 vec![
14693 format!("{:?}", self.angle).into(),
14694 format!("{:?}", self.axis).into(),
14695 format!("{:?}", self.origin).into(),
14696 ]
14697 }
14698
14699 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14700 vec!["angle".into(), "axis".into(), "origin".into()]
14701 }
14702}
14703
14704#[doc = "ICECandidateInit is used to serialize ice candidates"]
14705#[derive(
14706 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14707)]
14708pub struct RtcIceCandidateInit {
14709 #[doc = "The candidate string associated with the object."]
14710 pub candidate: String,
14711 #[doc = "The index (starting at zero) of the m-line in the SDP this candidate is associated \
14712 with."]
14713 #[serde(
14714 rename = "sdpMLineIndex",
14715 default,
14716 skip_serializing_if = "Option::is_none"
14717 )]
14718 pub sdp_m_line_index: Option<u16>,
14719 #[doc = "The identifier of the \"media stream identification\" as defined in [RFC 8841](https://tools.ietf.org/html/rfc8841)."]
14720 #[serde(rename = "sdpMid", default, skip_serializing_if = "Option::is_none")]
14721 pub sdp_mid: Option<String>,
14722 #[doc = "The username fragment (as defined in [RFC 8445](https://tools.ietf.org/html/rfc8445#section-5.2.1)) associated with the object."]
14723 #[serde(
14724 rename = "usernameFragment",
14725 default,
14726 skip_serializing_if = "Option::is_none"
14727 )]
14728 pub username_fragment: Option<String>,
14729}
14730
14731impl std::fmt::Display for RtcIceCandidateInit {
14732 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14733 write!(
14734 f,
14735 "{}",
14736 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14737 )
14738 }
14739}
14740
14741#[cfg(feature = "tabled")]
14742impl tabled::Tabled for RtcIceCandidateInit {
14743 const LENGTH: usize = 4;
14744 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14745 vec![
14746 self.candidate.clone().into(),
14747 if let Some(sdp_m_line_index) = &self.sdp_m_line_index {
14748 format!("{:?}", sdp_m_line_index).into()
14749 } else {
14750 String::new().into()
14751 },
14752 if let Some(sdp_mid) = &self.sdp_mid {
14753 format!("{:?}", sdp_mid).into()
14754 } else {
14755 String::new().into()
14756 },
14757 if let Some(username_fragment) = &self.username_fragment {
14758 format!("{:?}", username_fragment).into()
14759 } else {
14760 String::new().into()
14761 },
14762 ]
14763 }
14764
14765 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14766 vec![
14767 "candidate".into(),
14768 "sdp_m_line_index".into(),
14769 "sdp_mid".into(),
14770 "username_fragment".into(),
14771 ]
14772 }
14773}
14774
14775#[doc = "SDPType describes the type of an SessionDescription."]
14776#[derive(
14777 serde :: Serialize,
14778 serde :: Deserialize,
14779 PartialEq,
14780 Hash,
14781 Debug,
14782 Clone,
14783 schemars :: JsonSchema,
14784 parse_display :: FromStr,
14785 parse_display :: Display,
14786)]
14787#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
14788#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
14789pub enum RtcSdpType {
14790 #[doc = "Unspecified indicates that the type is unspecified."]
14791 #[serde(rename = "unspecified")]
14792 #[display("unspecified")]
14793 Unspecified,
14794 #[doc = "indicates that a description MUST be treated as an SDP offer."]
14795 #[serde(rename = "offer")]
14796 #[display("offer")]
14797 Offer,
14798 #[doc = "indicates that a description MUST be treated as an SDP answer, but not a final \
14799 answer. A description used as an SDP pranswer may be applied as a response to an SDP \
14800 offer, or an update to a previously sent SDP pranswer."]
14801 #[serde(rename = "pranswer")]
14802 #[display("pranswer")]
14803 Pranswer,
14804 #[doc = "indicates that a description MUST be treated as an SDP final answer, and the \
14805 offer-answer exchange MUST be considered complete. A description used as an SDP \
14806 answer may be applied as a response to an SDP offer or as an update to a previously \
14807 sent SDP pranswer."]
14808 #[serde(rename = "answer")]
14809 #[display("answer")]
14810 Answer,
14811 #[doc = "indicates that a description MUST be treated as canceling the current SDP \
14812 negotiation and moving the SDP offer and answer back to what it was in the previous \
14813 stable state. Note the local or remote SDP descriptions in the previous stable state \
14814 could be null if there has not yet been a successful offer-answer negotiation."]
14815 #[serde(rename = "rollback")]
14816 #[display("rollback")]
14817 Rollback,
14818}
14819
14820#[doc = "SessionDescription is used to expose local and remote session descriptions."]
14821#[derive(
14822 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14823)]
14824pub struct RtcSessionDescription {
14825 #[doc = "SDP string."]
14826 pub sdp: String,
14827 #[doc = "SDP type."]
14828 #[serde(rename = "type")]
14829 pub type_: RtcSdpType,
14830}
14831
14832impl std::fmt::Display for RtcSessionDescription {
14833 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14834 write!(
14835 f,
14836 "{}",
14837 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14838 )
14839 }
14840}
14841
14842#[cfg(feature = "tabled")]
14843impl tabled::Tabled for RtcSessionDescription {
14844 const LENGTH: usize = 2;
14845 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14846 vec![self.sdp.clone().into(), format!("{:?}", self.type_).into()]
14847 }
14848
14849 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14850 vec!["sdp".into(), "type_".into()]
14851 }
14852}
14853
14854#[doc = "A SAML identity provider."]
14855#[derive(
14856 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14857)]
14858pub struct SamlIdentityProvider {
14859 #[doc = "The ACS (Assertion Consumer Service) URL."]
14860 pub acs_url: String,
14861 #[doc = "The date and time the SAML identity provider was created."]
14862 pub created_at: chrono::DateTime<chrono::Utc>,
14863 #[doc = "The unique identifier for the SAML identity provider."]
14864 pub id: uuid::Uuid,
14865 #[doc = "The entity ID of the SAML identity provider."]
14866 #[serde(default, skip_serializing_if = "Option::is_none")]
14867 pub idp_entity_id: Option<String>,
14868 #[doc = "The metadata document as a string."]
14869 #[serde(default, skip_serializing_if = "Option::is_none")]
14870 pub idp_metadata_document_string: Option<String>,
14871 #[doc = "The organization ID the SAML identity provider belongs to."]
14872 pub org_id: uuid::Uuid,
14873 #[doc = "The private key for the SAML identity provider. This is the PEM corresponding to the \
14874 X509 pair."]
14875 #[serde(default, skip_serializing_if = "Option::is_none")]
14876 pub private_key: Option<base64::Base64Data>,
14877 #[doc = "The public certificate for the SAML identity provider. This is the PEM corresponding \
14878 to the X509 pair."]
14879 #[serde(default, skip_serializing_if = "Option::is_none")]
14880 pub public_cert: Option<base64::Base64Data>,
14881 #[doc = "The SLO (Single Logout) URL."]
14882 pub slo_url: String,
14883 #[doc = "The technical contact email address for the SAML identity provider."]
14884 #[serde(default, skip_serializing_if = "Option::is_none")]
14885 pub technical_contact_email: Option<String>,
14886 #[doc = "The date and time the SAML identity provider was last updated."]
14887 pub updated_at: chrono::DateTime<chrono::Utc>,
14888}
14889
14890impl std::fmt::Display for SamlIdentityProvider {
14891 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14892 write!(
14893 f,
14894 "{}",
14895 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14896 )
14897 }
14898}
14899
14900#[cfg(feature = "tabled")]
14901impl tabled::Tabled for SamlIdentityProvider {
14902 const LENGTH: usize = 11;
14903 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14904 vec![
14905 self.acs_url.clone().into(),
14906 format!("{:?}", self.created_at).into(),
14907 format!("{:?}", self.id).into(),
14908 if let Some(idp_entity_id) = &self.idp_entity_id {
14909 format!("{:?}", idp_entity_id).into()
14910 } else {
14911 String::new().into()
14912 },
14913 if let Some(idp_metadata_document_string) = &self.idp_metadata_document_string {
14914 format!("{:?}", idp_metadata_document_string).into()
14915 } else {
14916 String::new().into()
14917 },
14918 format!("{:?}", self.org_id).into(),
14919 if let Some(private_key) = &self.private_key {
14920 format!("{:?}", private_key).into()
14921 } else {
14922 String::new().into()
14923 },
14924 if let Some(public_cert) = &self.public_cert {
14925 format!("{:?}", public_cert).into()
14926 } else {
14927 String::new().into()
14928 },
14929 self.slo_url.clone().into(),
14930 if let Some(technical_contact_email) = &self.technical_contact_email {
14931 format!("{:?}", technical_contact_email).into()
14932 } else {
14933 String::new().into()
14934 },
14935 format!("{:?}", self.updated_at).into(),
14936 ]
14937 }
14938
14939 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
14940 vec![
14941 "acs_url".into(),
14942 "created_at".into(),
14943 "id".into(),
14944 "idp_entity_id".into(),
14945 "idp_metadata_document_string".into(),
14946 "org_id".into(),
14947 "private_key".into(),
14948 "public_cert".into(),
14949 "slo_url".into(),
14950 "technical_contact_email".into(),
14951 "updated_at".into(),
14952 ]
14953 }
14954}
14955
14956#[doc = "Parameters for creating a SAML identity provider."]
14957#[derive(
14958 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
14959)]
14960pub struct SamlIdentityProviderCreate {
14961 #[doc = "The entity ID of the SAML identity provider."]
14962 #[serde(default, skip_serializing_if = "Option::is_none")]
14963 pub idp_entity_id: Option<String>,
14964 #[doc = "The source of an identity provider metadata descriptor."]
14965 pub idp_metadata_source: IdpMetadataSource,
14966 #[doc = "The request signing key pair."]
14967 #[serde(default, skip_serializing_if = "Option::is_none")]
14968 pub signing_keypair: Option<DerEncodedKeyPair>,
14969 #[doc = "The technical contact email address for the SAML identity provider."]
14970 #[serde(default, skip_serializing_if = "Option::is_none")]
14971 pub technical_contact_email: Option<String>,
14972}
14973
14974impl std::fmt::Display for SamlIdentityProviderCreate {
14975 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
14976 write!(
14977 f,
14978 "{}",
14979 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
14980 )
14981 }
14982}
14983
14984#[cfg(feature = "tabled")]
14985impl tabled::Tabled for SamlIdentityProviderCreate {
14986 const LENGTH: usize = 4;
14987 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
14988 vec![
14989 if let Some(idp_entity_id) = &self.idp_entity_id {
14990 format!("{:?}", idp_entity_id).into()
14991 } else {
14992 String::new().into()
14993 },
14994 format!("{:?}", self.idp_metadata_source).into(),
14995 if let Some(signing_keypair) = &self.signing_keypair {
14996 format!("{:?}", signing_keypair).into()
14997 } else {
14998 String::new().into()
14999 },
15000 if let Some(technical_contact_email) = &self.technical_contact_email {
15001 format!("{:?}", technical_contact_email).into()
15002 } else {
15003 String::new().into()
15004 },
15005 ]
15006 }
15007
15008 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15009 vec![
15010 "idp_entity_id".into(),
15011 "idp_metadata_source".into(),
15012 "signing_keypair".into(),
15013 "technical_contact_email".into(),
15014 ]
15015 }
15016}
15017
15018#[doc = "The response from the `SceneClearAll` endpoint."]
15019#[derive(
15020 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15021)]
15022pub struct SceneClearAll {}
15023
15024impl std::fmt::Display for SceneClearAll {
15025 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15026 write!(
15027 f,
15028 "{}",
15029 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15030 )
15031 }
15032}
15033
15034#[cfg(feature = "tabled")]
15035impl tabled::Tabled for SceneClearAll {
15036 const LENGTH: usize = 0;
15037 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15038 vec![]
15039 }
15040
15041 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15042 vec![]
15043 }
15044}
15045
15046#[doc = "The type of scene selection change"]
15047#[derive(
15048 serde :: Serialize,
15049 serde :: Deserialize,
15050 PartialEq,
15051 Hash,
15052 Debug,
15053 Clone,
15054 schemars :: JsonSchema,
15055 parse_display :: FromStr,
15056 parse_display :: Display,
15057)]
15058#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
15059#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
15060pub enum SceneSelectionType {
15061 #[doc = "Replaces the selection"]
15062 #[serde(rename = "replace")]
15063 #[display("replace")]
15064 Replace,
15065 #[doc = "Adds to the selection"]
15066 #[serde(rename = "add")]
15067 #[display("add")]
15068 Add,
15069 #[doc = "Removes from the selection"]
15070 #[serde(rename = "remove")]
15071 #[display("remove")]
15072 Remove,
15073}
15074
15075#[doc = "The type of scene's active tool"]
15076#[derive(
15077 serde :: Serialize,
15078 serde :: Deserialize,
15079 PartialEq,
15080 Hash,
15081 Debug,
15082 Clone,
15083 schemars :: JsonSchema,
15084 parse_display :: FromStr,
15085 parse_display :: Display,
15086)]
15087#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
15088#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
15089pub enum SceneToolType {
15090 #[serde(rename = "camera_revolve")]
15091 #[display("camera_revolve")]
15092 CameraRevolve,
15093 #[serde(rename = "select")]
15094 #[display("select")]
15095 Select,
15096 #[serde(rename = "move")]
15097 #[display("move")]
15098 Move,
15099 #[serde(rename = "sketch_line")]
15100 #[display("sketch_line")]
15101 SketchLine,
15102 #[serde(rename = "sketch_tangential_arc")]
15103 #[display("sketch_tangential_arc")]
15104 SketchTangentialArc,
15105 #[serde(rename = "sketch_curve")]
15106 #[display("sketch_curve")]
15107 SketchCurve,
15108 #[serde(rename = "sketch_curve_mod")]
15109 #[display("sketch_curve_mod")]
15110 SketchCurveMod,
15111}
15112
15113#[doc = "The response from the `SelectAdd` endpoint."]
15114#[derive(
15115 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15116)]
15117pub struct SelectAdd {}
15118
15119impl std::fmt::Display for SelectAdd {
15120 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15121 write!(
15122 f,
15123 "{}",
15124 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15125 )
15126 }
15127}
15128
15129#[cfg(feature = "tabled")]
15130impl tabled::Tabled for SelectAdd {
15131 const LENGTH: usize = 0;
15132 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15133 vec![]
15134 }
15135
15136 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15137 vec![]
15138 }
15139}
15140
15141#[doc = "The response from the `SelectClear` endpoint."]
15142#[derive(
15143 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15144)]
15145pub struct SelectClear {}
15146
15147impl std::fmt::Display for SelectClear {
15148 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15149 write!(
15150 f,
15151 "{}",
15152 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15153 )
15154 }
15155}
15156
15157#[cfg(feature = "tabled")]
15158impl tabled::Tabled for SelectClear {
15159 const LENGTH: usize = 0;
15160 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15161 vec![]
15162 }
15163
15164 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15165 vec![]
15166 }
15167}
15168
15169#[doc = "The response from the `SelectGet` command."]
15170#[derive(
15171 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15172)]
15173pub struct SelectGet {
15174 #[doc = "The UUIDs of the selected entities."]
15175 pub entity_ids: Vec<uuid::Uuid>,
15176}
15177
15178impl std::fmt::Display for SelectGet {
15179 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15180 write!(
15181 f,
15182 "{}",
15183 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15184 )
15185 }
15186}
15187
15188#[cfg(feature = "tabled")]
15189impl tabled::Tabled for SelectGet {
15190 const LENGTH: usize = 1;
15191 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15192 vec![format!("{:?}", self.entity_ids).into()]
15193 }
15194
15195 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15196 vec!["entity_ids".into()]
15197 }
15198}
15199
15200#[doc = "The response from the `SelectRemove` endpoint."]
15201#[derive(
15202 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15203)]
15204pub struct SelectRemove {}
15205
15206impl std::fmt::Display for SelectRemove {
15207 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15208 write!(
15209 f,
15210 "{}",
15211 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15212 )
15213 }
15214}
15215
15216#[cfg(feature = "tabled")]
15217impl tabled::Tabled for SelectRemove {
15218 const LENGTH: usize = 0;
15219 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15220 vec![]
15221 }
15222
15223 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15224 vec![]
15225 }
15226}
15227
15228#[doc = "The response from the `SelectReplace` endpoint."]
15229#[derive(
15230 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15231)]
15232pub struct SelectReplace {}
15233
15234impl std::fmt::Display for SelectReplace {
15235 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15236 write!(
15237 f,
15238 "{}",
15239 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15240 )
15241 }
15242}
15243
15244#[cfg(feature = "tabled")]
15245impl tabled::Tabled for SelectReplace {
15246 const LENGTH: usize = 0;
15247 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15248 vec![]
15249 }
15250
15251 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15252 vec![]
15253 }
15254}
15255
15256#[doc = "The response from the `SelectWithPoint` command."]
15257#[derive(
15258 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15259)]
15260pub struct SelectWithPoint {
15261 #[doc = "The UUID of the entity that was selected."]
15262 #[serde(default, skip_serializing_if = "Option::is_none")]
15263 pub entity_id: Option<uuid::Uuid>,
15264}
15265
15266impl std::fmt::Display for SelectWithPoint {
15267 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15268 write!(
15269 f,
15270 "{}",
15271 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15272 )
15273 }
15274}
15275
15276#[cfg(feature = "tabled")]
15277impl tabled::Tabled for SelectWithPoint {
15278 const LENGTH: usize = 1;
15279 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15280 vec![if let Some(entity_id) = &self.entity_id {
15281 format!("{:?}", entity_id).into()
15282 } else {
15283 String::new().into()
15284 }]
15285 }
15286
15287 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15288 vec!["entity_id".into()]
15289 }
15290}
15291
15292#[doc = "Data item selection."]
15293#[derive(
15294 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15295)]
15296#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
15297#[serde(tag = "type")]
15298pub enum Selection {
15299 #[doc = "Visit the default scene."]
15300 #[serde(rename = "default_scene")]
15301 DefaultScene {},
15302 #[doc = "Visit the indexed scene."]
15303 #[serde(rename = "scene_by_index")]
15304 SceneByIndex {
15305 #[doc = "The index."]
15306 index: u32,
15307 },
15308 #[doc = "Visit the first scene with the given name."]
15309 #[serde(rename = "scene_by_name")]
15310 SceneByName {
15311 #[doc = "The name."]
15312 name: String,
15313 },
15314 #[doc = "Visit the indexed mesh."]
15315 #[serde(rename = "mesh_by_index")]
15316 MeshByIndex {
15317 #[doc = "The index."]
15318 index: u32,
15319 },
15320 #[doc = "Visit the first mesh with the given name."]
15321 #[serde(rename = "mesh_by_name")]
15322 MeshByName {
15323 #[doc = "The name."]
15324 name: String,
15325 },
15326}
15327
15328#[doc = "The response from the `SendObject` endpoint."]
15329#[derive(
15330 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15331)]
15332pub struct SendObject {}
15333
15334impl std::fmt::Display for SendObject {
15335 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15336 write!(
15337 f,
15338 "{}",
15339 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15340 )
15341 }
15342}
15343
15344#[cfg(feature = "tabled")]
15345impl tabled::Tabled for SendObject {
15346 const LENGTH: usize = 0;
15347 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15348 vec![]
15349 }
15350
15351 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15352 vec![]
15353 }
15354}
15355
15356#[doc = "A service account.\n\nThese are used to authenticate orgs with Bearer \
15357 authentication.\n\nThis works just like an API token, but it is tied to an organization \
15358 versus an individual user."]
15359#[derive(
15360 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15361)]
15362pub struct ServiceAccount {
15363 #[doc = "The date and time the API token was created."]
15364 pub created_at: chrono::DateTime<chrono::Utc>,
15365 #[doc = "The unique identifier for the API token."]
15366 pub id: uuid::Uuid,
15367 #[doc = "If the token is valid. We never delete API tokens, but we can mark them as invalid. \
15368 We save them for ever to preserve the history of the API token."]
15369 pub is_valid: bool,
15370 #[doc = "An optional label for the API token."]
15371 #[serde(default, skip_serializing_if = "Option::is_none")]
15372 pub label: Option<String>,
15373 #[doc = "The ID of the organization that owns the API token."]
15374 pub org_id: uuid::Uuid,
15375 #[doc = "The API token itself."]
15376 pub token: String,
15377 #[doc = "The date and time the API token was last updated."]
15378 pub updated_at: chrono::DateTime<chrono::Utc>,
15379}
15380
15381impl std::fmt::Display for ServiceAccount {
15382 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15383 write!(
15384 f,
15385 "{}",
15386 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15387 )
15388 }
15389}
15390
15391#[cfg(feature = "tabled")]
15392impl tabled::Tabled for ServiceAccount {
15393 const LENGTH: usize = 7;
15394 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15395 vec![
15396 format!("{:?}", self.created_at).into(),
15397 format!("{:?}", self.id).into(),
15398 format!("{:?}", self.is_valid).into(),
15399 if let Some(label) = &self.label {
15400 format!("{:?}", label).into()
15401 } else {
15402 String::new().into()
15403 },
15404 format!("{:?}", self.org_id).into(),
15405 self.token.clone().into(),
15406 format!("{:?}", self.updated_at).into(),
15407 ]
15408 }
15409
15410 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15411 vec![
15412 "created_at".into(),
15413 "id".into(),
15414 "is_valid".into(),
15415 "label".into(),
15416 "org_id".into(),
15417 "token".into(),
15418 "updated_at".into(),
15419 ]
15420 }
15421}
15422
15423#[doc = "A single page of results"]
15424#[derive(
15425 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15426)]
15427pub struct ServiceAccountResultsPage {
15428 #[doc = "list of items on this page of results"]
15429 pub items: Vec<ServiceAccount>,
15430 #[doc = "token used to fetch the next page of results (if any)"]
15431 #[serde(default, skip_serializing_if = "Option::is_none")]
15432 pub next_page: Option<String>,
15433}
15434
15435impl std::fmt::Display for ServiceAccountResultsPage {
15436 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15437 write!(
15438 f,
15439 "{}",
15440 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15441 )
15442 }
15443}
15444
15445#[cfg(feature = "requests")]
15446impl crate::types::paginate::Pagination for ServiceAccountResultsPage {
15447 type Item = ServiceAccount;
15448 fn has_more_pages(&self) -> bool {
15449 self.next_page.is_some()
15450 }
15451
15452 fn next_page_token(&self) -> Option<String> {
15453 self.next_page.clone()
15454 }
15455
15456 fn next_page(
15457 &self,
15458 req: reqwest::Request,
15459 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
15460 let mut req = req.try_clone().ok_or_else(|| {
15461 crate::types::error::Error::InvalidRequest(format!(
15462 "failed to clone request: {:?}",
15463 req
15464 ))
15465 })?;
15466 req.url_mut()
15467 .query_pairs_mut()
15468 .append_pair("next_page", self.next_page.as_deref().unwrap_or(""));
15469 Ok(req)
15470 }
15471
15472 fn items(&self) -> Vec<Self::Item> {
15473 self.items.clone()
15474 }
15475}
15476
15477#[cfg(feature = "tabled")]
15478impl tabled::Tabled for ServiceAccountResultsPage {
15479 const LENGTH: usize = 2;
15480 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15481 vec![
15482 format!("{:?}", self.items).into(),
15483 if let Some(next_page) = &self.next_page {
15484 format!("{:?}", next_page).into()
15485 } else {
15486 String::new().into()
15487 },
15488 ]
15489 }
15490
15491 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15492 vec!["items".into(), "next_page".into()]
15493 }
15494}
15495
15496#[doc = "An authentication session."]
15497#[derive(
15498 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15499)]
15500pub struct Session {
15501 #[doc = "The date and time the session was created."]
15502 pub created_at: chrono::DateTime<chrono::Utc>,
15503 #[doc = "The date and time the session expires."]
15504 pub expires: chrono::DateTime<chrono::Utc>,
15505 #[doc = "The unique identifier for the session."]
15506 pub id: uuid::Uuid,
15507 #[doc = "The session token."]
15508 pub session_token: String,
15509 #[doc = "The date and time the session was last updated."]
15510 pub updated_at: chrono::DateTime<chrono::Utc>,
15511 #[doc = "The user ID of the user that the session belongs to."]
15512 pub user_id: uuid::Uuid,
15513}
15514
15515impl std::fmt::Display for Session {
15516 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15517 write!(
15518 f,
15519 "{}",
15520 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15521 )
15522 }
15523}
15524
15525#[cfg(feature = "tabled")]
15526impl tabled::Tabled for Session {
15527 const LENGTH: usize = 6;
15528 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15529 vec![
15530 format!("{:?}", self.created_at).into(),
15531 format!("{:?}", self.expires).into(),
15532 format!("{:?}", self.id).into(),
15533 self.session_token.clone().into(),
15534 format!("{:?}", self.updated_at).into(),
15535 format!("{:?}", self.user_id).into(),
15536 ]
15537 }
15538
15539 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15540 vec![
15541 "created_at".into(),
15542 "expires".into(),
15543 "id".into(),
15544 "session_token".into(),
15545 "updated_at".into(),
15546 "user_id".into(),
15547 ]
15548 }
15549}
15550
15551#[doc = "The response from the `SetBackgroundColor` endpoint."]
15552#[derive(
15553 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15554)]
15555pub struct SetBackgroundColor {}
15556
15557impl std::fmt::Display for SetBackgroundColor {
15558 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15559 write!(
15560 f,
15561 "{}",
15562 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15563 )
15564 }
15565}
15566
15567#[cfg(feature = "tabled")]
15568impl tabled::Tabled for SetBackgroundColor {
15569 const LENGTH: usize = 0;
15570 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15571 vec![]
15572 }
15573
15574 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15575 vec![]
15576 }
15577}
15578
15579#[doc = "The response from the `SetCurrentToolProperties` endpoint."]
15580#[derive(
15581 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15582)]
15583pub struct SetCurrentToolProperties {}
15584
15585impl std::fmt::Display for SetCurrentToolProperties {
15586 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15587 write!(
15588 f,
15589 "{}",
15590 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15591 )
15592 }
15593}
15594
15595#[cfg(feature = "tabled")]
15596impl tabled::Tabled for SetCurrentToolProperties {
15597 const LENGTH: usize = 0;
15598 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15599 vec![]
15600 }
15601
15602 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15603 vec![]
15604 }
15605}
15606
15607#[doc = "The response from the `SetDefaultSystemProperties` endpoint."]
15608#[derive(
15609 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15610)]
15611pub struct SetDefaultSystemProperties {}
15612
15613impl std::fmt::Display for SetDefaultSystemProperties {
15614 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15615 write!(
15616 f,
15617 "{}",
15618 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15619 )
15620 }
15621}
15622
15623#[cfg(feature = "tabled")]
15624impl tabled::Tabled for SetDefaultSystemProperties {
15625 const LENGTH: usize = 0;
15626 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15627 vec![]
15628 }
15629
15630 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15631 vec![]
15632 }
15633}
15634
15635#[doc = "The response from the 'SetGridScale'."]
15636#[derive(
15637 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15638)]
15639pub struct SetGridAutoScale {}
15640
15641impl std::fmt::Display for SetGridAutoScale {
15642 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15643 write!(
15644 f,
15645 "{}",
15646 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15647 )
15648 }
15649}
15650
15651#[cfg(feature = "tabled")]
15652impl tabled::Tabled for SetGridAutoScale {
15653 const LENGTH: usize = 0;
15654 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15655 vec![]
15656 }
15657
15658 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15659 vec![]
15660 }
15661}
15662
15663#[doc = "The response from the 'SetGridReferencePlane'."]
15664#[derive(
15665 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15666)]
15667pub struct SetGridReferencePlane {}
15668
15669impl std::fmt::Display for SetGridReferencePlane {
15670 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15671 write!(
15672 f,
15673 "{}",
15674 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15675 )
15676 }
15677}
15678
15679#[cfg(feature = "tabled")]
15680impl tabled::Tabled for SetGridReferencePlane {
15681 const LENGTH: usize = 0;
15682 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15683 vec![]
15684 }
15685
15686 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15687 vec![]
15688 }
15689}
15690
15691#[doc = "The response from the 'SetGridScale'."]
15692#[derive(
15693 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15694)]
15695pub struct SetGridScale {}
15696
15697impl std::fmt::Display for SetGridScale {
15698 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15699 write!(
15700 f,
15701 "{}",
15702 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15703 )
15704 }
15705}
15706
15707#[cfg(feature = "tabled")]
15708impl tabled::Tabled for SetGridScale {
15709 const LENGTH: usize = 0;
15710 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15711 vec![]
15712 }
15713
15714 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15715 vec![]
15716 }
15717}
15718
15719#[doc = "The response from the `SetObjectTransform` command."]
15720#[derive(
15721 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15722)]
15723pub struct SetObjectTransform {}
15724
15725impl std::fmt::Display for SetObjectTransform {
15726 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15727 write!(
15728 f,
15729 "{}",
15730 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15731 )
15732 }
15733}
15734
15735#[cfg(feature = "tabled")]
15736impl tabled::Tabled for SetObjectTransform {
15737 const LENGTH: usize = 0;
15738 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15739 vec![]
15740 }
15741
15742 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15743 vec![]
15744 }
15745}
15746
15747#[doc = "The response from the `SetSceneUnits` endpoint."]
15748#[derive(
15749 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15750)]
15751pub struct SetSceneUnits {}
15752
15753impl std::fmt::Display for SetSceneUnits {
15754 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15755 write!(
15756 f,
15757 "{}",
15758 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15759 )
15760 }
15761}
15762
15763#[cfg(feature = "tabled")]
15764impl tabled::Tabled for SetSceneUnits {
15765 const LENGTH: usize = 0;
15766 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15767 vec![]
15768 }
15769
15770 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15771 vec![]
15772 }
15773}
15774
15775#[doc = "The response from the `SetSelectionFilter` endpoint."]
15776#[derive(
15777 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15778)]
15779pub struct SetSelectionFilter {}
15780
15781impl std::fmt::Display for SetSelectionFilter {
15782 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15783 write!(
15784 f,
15785 "{}",
15786 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15787 )
15788 }
15789}
15790
15791#[cfg(feature = "tabled")]
15792impl tabled::Tabled for SetSelectionFilter {
15793 const LENGTH: usize = 0;
15794 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15795 vec![]
15796 }
15797
15798 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15799 vec![]
15800 }
15801}
15802
15803#[doc = "The response from the `SetSelectionType` endpoint."]
15804#[derive(
15805 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15806)]
15807pub struct SetSelectionType {}
15808
15809impl std::fmt::Display for SetSelectionType {
15810 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15811 write!(
15812 f,
15813 "{}",
15814 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15815 )
15816 }
15817}
15818
15819#[cfg(feature = "tabled")]
15820impl tabled::Tabled for SetSelectionType {
15821 const LENGTH: usize = 0;
15822 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15823 vec![]
15824 }
15825
15826 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15827 vec![]
15828 }
15829}
15830
15831#[doc = "The response from the `SetTool` endpoint."]
15832#[derive(
15833 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15834)]
15835pub struct SetTool {}
15836
15837impl std::fmt::Display for SetTool {
15838 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15839 write!(
15840 f,
15841 "{}",
15842 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15843 )
15844 }
15845}
15846
15847#[cfg(feature = "tabled")]
15848impl tabled::Tabled for SetTool {
15849 const LENGTH: usize = 0;
15850 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15851 vec![]
15852 }
15853
15854 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15855 vec![]
15856 }
15857}
15858
15859#[doc = "A short url."]
15860#[derive(
15861 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15862)]
15863pub struct Shortlink {
15864 #[doc = "The date and time the shortlink was created."]
15865 pub created_at: chrono::DateTime<chrono::Utc>,
15866 #[doc = "The unique identifier for the shortlink."]
15867 pub id: uuid::Uuid,
15868 #[doc = "The key of the shortlink. This is the short part of the URL."]
15869 pub key: String,
15870 #[doc = "The organization ID of the shortlink."]
15871 #[serde(default, skip_serializing_if = "Option::is_none")]
15872 pub org_id: Option<uuid::Uuid>,
15873 #[doc = "The hash of the password for the shortlink."]
15874 #[serde(default, skip_serializing_if = "Option::is_none")]
15875 pub password_hash: Option<String>,
15876 #[doc = "If the shortlink should be restricted to the organization. This only applies to org \
15877 shortlinks. If you are creating a user shortlink and you are not a member of a team \
15878 or enterprise and you try to set this to true, it will fail."]
15879 #[serde(default)]
15880 pub restrict_to_org: bool,
15881 #[doc = "The date and time the shortlink was last updated."]
15882 pub updated_at: chrono::DateTime<chrono::Utc>,
15883 #[doc = "The ID of the user that made the shortlink."]
15884 pub user_id: uuid::Uuid,
15885 #[doc = "The URL the shortlink redirects to."]
15886 pub value: String,
15887}
15888
15889impl std::fmt::Display for Shortlink {
15890 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15891 write!(
15892 f,
15893 "{}",
15894 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15895 )
15896 }
15897}
15898
15899#[cfg(feature = "tabled")]
15900impl tabled::Tabled for Shortlink {
15901 const LENGTH: usize = 9;
15902 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15903 vec![
15904 format!("{:?}", self.created_at).into(),
15905 format!("{:?}", self.id).into(),
15906 self.key.clone().into(),
15907 if let Some(org_id) = &self.org_id {
15908 format!("{:?}", org_id).into()
15909 } else {
15910 String::new().into()
15911 },
15912 if let Some(password_hash) = &self.password_hash {
15913 format!("{:?}", password_hash).into()
15914 } else {
15915 String::new().into()
15916 },
15917 format!("{:?}", self.restrict_to_org).into(),
15918 format!("{:?}", self.updated_at).into(),
15919 format!("{:?}", self.user_id).into(),
15920 self.value.clone().into(),
15921 ]
15922 }
15923
15924 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
15925 vec![
15926 "created_at".into(),
15927 "id".into(),
15928 "key".into(),
15929 "org_id".into(),
15930 "password_hash".into(),
15931 "restrict_to_org".into(),
15932 "updated_at".into(),
15933 "user_id".into(),
15934 "value".into(),
15935 ]
15936 }
15937}
15938
15939#[doc = "A single page of results"]
15940#[derive(
15941 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
15942)]
15943pub struct ShortlinkResultsPage {
15944 #[doc = "list of items on this page of results"]
15945 pub items: Vec<Shortlink>,
15946 #[doc = "token used to fetch the next page of results (if any)"]
15947 #[serde(default, skip_serializing_if = "Option::is_none")]
15948 pub next_page: Option<String>,
15949}
15950
15951impl std::fmt::Display for ShortlinkResultsPage {
15952 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
15953 write!(
15954 f,
15955 "{}",
15956 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
15957 )
15958 }
15959}
15960
15961#[cfg(feature = "requests")]
15962impl crate::types::paginate::Pagination for ShortlinkResultsPage {
15963 type Item = Shortlink;
15964 fn has_more_pages(&self) -> bool {
15965 self.next_page.is_some()
15966 }
15967
15968 fn next_page_token(&self) -> Option<String> {
15969 self.next_page.clone()
15970 }
15971
15972 fn next_page(
15973 &self,
15974 req: reqwest::Request,
15975 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
15976 let mut req = req.try_clone().ok_or_else(|| {
15977 crate::types::error::Error::InvalidRequest(format!(
15978 "failed to clone request: {:?}",
15979 req
15980 ))
15981 })?;
15982 req.url_mut()
15983 .query_pairs_mut()
15984 .append_pair("next_page", self.next_page.as_deref().unwrap_or(""));
15985 Ok(req)
15986 }
15987
15988 fn items(&self) -> Vec<Self::Item> {
15989 self.items.clone()
15990 }
15991}
15992
15993#[cfg(feature = "tabled")]
15994impl tabled::Tabled for ShortlinkResultsPage {
15995 const LENGTH: usize = 2;
15996 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
15997 vec![
15998 format!("{:?}", self.items).into(),
15999 if let Some(next_page) = &self.next_page {
16000 format!("{:?}", next_page).into()
16001 } else {
16002 String::new().into()
16003 },
16004 ]
16005 }
16006
16007 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16008 vec!["items".into(), "next_page".into()]
16009 }
16010}
16011
16012#[doc = "IDs for a side face, extruded from the path of some sketch/2D shape."]
16013#[derive(
16014 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16015)]
16016pub struct SideFace {
16017 #[doc = "Desired ID for the resulting face."]
16018 pub face_id: uuid::Uuid,
16019 #[doc = "ID of the path this face is being extruded from."]
16020 pub path_id: uuid::Uuid,
16021}
16022
16023impl std::fmt::Display for SideFace {
16024 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16025 write!(
16026 f,
16027 "{}",
16028 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16029 )
16030 }
16031}
16032
16033#[cfg(feature = "tabled")]
16034impl tabled::Tabled for SideFace {
16035 const LENGTH: usize = 2;
16036 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16037 vec![
16038 format!("{:?}", self.face_id).into(),
16039 format!("{:?}", self.path_id).into(),
16040 ]
16041 }
16042
16043 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16044 vec!["face_id".into(), "path_id".into()]
16045 }
16046}
16047
16048#[doc = "The response from the `SketchModeDisable` endpoint."]
16049#[derive(
16050 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16051)]
16052pub struct SketchModeDisable {}
16053
16054impl std::fmt::Display for SketchModeDisable {
16055 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16056 write!(
16057 f,
16058 "{}",
16059 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16060 )
16061 }
16062}
16063
16064#[cfg(feature = "tabled")]
16065impl tabled::Tabled for SketchModeDisable {
16066 const LENGTH: usize = 0;
16067 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16068 vec![]
16069 }
16070
16071 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16072 vec![]
16073 }
16074}
16075
16076#[doc = "The response from the `Solid2dAddHole` endpoint."]
16077#[derive(
16078 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16079)]
16080pub struct Solid2DAddHole {}
16081
16082impl std::fmt::Display for Solid2DAddHole {
16083 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16084 write!(
16085 f,
16086 "{}",
16087 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16088 )
16089 }
16090}
16091
16092#[cfg(feature = "tabled")]
16093impl tabled::Tabled for Solid2DAddHole {
16094 const LENGTH: usize = 0;
16095 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16096 vec![]
16097 }
16098
16099 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16100 vec![]
16101 }
16102}
16103
16104#[doc = "The response from the `Solid3dFilletEdge` endpoint."]
16105#[derive(
16106 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16107)]
16108pub struct Solid3DFilletEdge {}
16109
16110impl std::fmt::Display for Solid3DFilletEdge {
16111 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16112 write!(
16113 f,
16114 "{}",
16115 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16116 )
16117 }
16118}
16119
16120#[cfg(feature = "tabled")]
16121impl tabled::Tabled for Solid3DFilletEdge {
16122 const LENGTH: usize = 0;
16123 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16124 vec![]
16125 }
16126
16127 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16128 vec![]
16129 }
16130}
16131
16132#[doc = "Extrusion face info struct (useful for maintaining mappings between source path segment \
16133 ids and extrusion faces) This includes the opposite and adjacent faces and edges."]
16134#[derive(
16135 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16136)]
16137pub struct Solid3DGetAdjacencyInfo {
16138 #[doc = "Details of each edge."]
16139 pub edges: Vec<AdjacencyInfo>,
16140}
16141
16142impl std::fmt::Display for Solid3DGetAdjacencyInfo {
16143 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16144 write!(
16145 f,
16146 "{}",
16147 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16148 )
16149 }
16150}
16151
16152#[cfg(feature = "tabled")]
16153impl tabled::Tabled for Solid3DGetAdjacencyInfo {
16154 const LENGTH: usize = 1;
16155 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16156 vec![format!("{:?}", self.edges).into()]
16157 }
16158
16159 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16160 vec!["edges".into()]
16161 }
16162}
16163
16164#[doc = "The response from the `Solid3dGetAllEdgeFaces` command."]
16165#[derive(
16166 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16167)]
16168pub struct Solid3DGetAllEdgeFaces {
16169 #[doc = "The UUIDs of the faces."]
16170 pub faces: Vec<uuid::Uuid>,
16171}
16172
16173impl std::fmt::Display for Solid3DGetAllEdgeFaces {
16174 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16175 write!(
16176 f,
16177 "{}",
16178 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16179 )
16180 }
16181}
16182
16183#[cfg(feature = "tabled")]
16184impl tabled::Tabled for Solid3DGetAllEdgeFaces {
16185 const LENGTH: usize = 1;
16186 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16187 vec![format!("{:?}", self.faces).into()]
16188 }
16189
16190 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16191 vec!["faces".into()]
16192 }
16193}
16194
16195#[doc = "The response from the `Solid3dGetAllOppositeEdges` command."]
16196#[derive(
16197 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16198)]
16199pub struct Solid3DGetAllOppositeEdges {
16200 #[doc = "The UUIDs of the edges."]
16201 pub edges: Vec<uuid::Uuid>,
16202}
16203
16204impl std::fmt::Display for Solid3DGetAllOppositeEdges {
16205 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16206 write!(
16207 f,
16208 "{}",
16209 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16210 )
16211 }
16212}
16213
16214#[cfg(feature = "tabled")]
16215impl tabled::Tabled for Solid3DGetAllOppositeEdges {
16216 const LENGTH: usize = 1;
16217 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16218 vec![format!("{:?}", self.edges).into()]
16219 }
16220
16221 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16222 vec!["edges".into()]
16223 }
16224}
16225
16226#[doc = "The response from the `Solid3DGetCommonEdge` command."]
16227#[derive(
16228 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16229)]
16230pub struct Solid3DGetCommonEdge {
16231 #[doc = "The UUID of the common edge, if any."]
16232 #[serde(default, skip_serializing_if = "Option::is_none")]
16233 pub edge: Option<uuid::Uuid>,
16234}
16235
16236impl std::fmt::Display for Solid3DGetCommonEdge {
16237 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16238 write!(
16239 f,
16240 "{}",
16241 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16242 )
16243 }
16244}
16245
16246#[cfg(feature = "tabled")]
16247impl tabled::Tabled for Solid3DGetCommonEdge {
16248 const LENGTH: usize = 1;
16249 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16250 vec![if let Some(edge) = &self.edge {
16251 format!("{:?}", edge).into()
16252 } else {
16253 String::new().into()
16254 }]
16255 }
16256
16257 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16258 vec!["edge".into()]
16259 }
16260}
16261
16262#[doc = "Extrusion face info struct (useful for maintaining mappings between source path segment \
16263 ids and extrusion faces)"]
16264#[derive(
16265 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16266)]
16267pub struct Solid3DGetExtrusionFaceInfo {
16268 #[doc = "Details of each face."]
16269 pub faces: Vec<ExtrusionFaceInfo>,
16270}
16271
16272impl std::fmt::Display for Solid3DGetExtrusionFaceInfo {
16273 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16274 write!(
16275 f,
16276 "{}",
16277 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16278 )
16279 }
16280}
16281
16282#[cfg(feature = "tabled")]
16283impl tabled::Tabled for Solid3DGetExtrusionFaceInfo {
16284 const LENGTH: usize = 1;
16285 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16286 vec![format!("{:?}", self.faces).into()]
16287 }
16288
16289 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16290 vec!["faces".into()]
16291 }
16292}
16293
16294#[doc = "The response from the `Solid3dGetNextAdjacentEdge` command."]
16295#[derive(
16296 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16297)]
16298pub struct Solid3DGetNextAdjacentEdge {
16299 #[doc = "The UUID of the edge."]
16300 #[serde(default, skip_serializing_if = "Option::is_none")]
16301 pub edge: Option<uuid::Uuid>,
16302}
16303
16304impl std::fmt::Display for Solid3DGetNextAdjacentEdge {
16305 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16306 write!(
16307 f,
16308 "{}",
16309 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16310 )
16311 }
16312}
16313
16314#[cfg(feature = "tabled")]
16315impl tabled::Tabled for Solid3DGetNextAdjacentEdge {
16316 const LENGTH: usize = 1;
16317 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16318 vec![if let Some(edge) = &self.edge {
16319 format!("{:?}", edge).into()
16320 } else {
16321 String::new().into()
16322 }]
16323 }
16324
16325 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16326 vec!["edge".into()]
16327 }
16328}
16329
16330#[doc = "The response from the `Solid3dGetOppositeEdge` command."]
16331#[derive(
16332 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16333)]
16334pub struct Solid3DGetOppositeEdge {
16335 #[doc = "The UUID of the edge."]
16336 pub edge: uuid::Uuid,
16337}
16338
16339impl std::fmt::Display for Solid3DGetOppositeEdge {
16340 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16341 write!(
16342 f,
16343 "{}",
16344 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16345 )
16346 }
16347}
16348
16349#[cfg(feature = "tabled")]
16350impl tabled::Tabled for Solid3DGetOppositeEdge {
16351 const LENGTH: usize = 1;
16352 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16353 vec![format!("{:?}", self.edge).into()]
16354 }
16355
16356 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16357 vec!["edge".into()]
16358 }
16359}
16360
16361#[doc = "The response from the `Solid3dGetPrevAdjacentEdge` command."]
16362#[derive(
16363 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16364)]
16365pub struct Solid3DGetPrevAdjacentEdge {
16366 #[doc = "The UUID of the edge."]
16367 #[serde(default, skip_serializing_if = "Option::is_none")]
16368 pub edge: Option<uuid::Uuid>,
16369}
16370
16371impl std::fmt::Display for Solid3DGetPrevAdjacentEdge {
16372 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16373 write!(
16374 f,
16375 "{}",
16376 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16377 )
16378 }
16379}
16380
16381#[cfg(feature = "tabled")]
16382impl tabled::Tabled for Solid3DGetPrevAdjacentEdge {
16383 const LENGTH: usize = 1;
16384 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16385 vec![if let Some(edge) = &self.edge {
16386 format!("{:?}", edge).into()
16387 } else {
16388 String::new().into()
16389 }]
16390 }
16391
16392 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16393 vec!["edge".into()]
16394 }
16395}
16396
16397#[doc = "The response from the `Solid3dShellFace` endpoint."]
16398#[derive(
16399 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16400)]
16401pub struct Solid3DShellFace {}
16402
16403impl std::fmt::Display for Solid3DShellFace {
16404 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16405 write!(
16406 f,
16407 "{}",
16408 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16409 )
16410 }
16411}
16412
16413#[cfg(feature = "tabled")]
16414impl tabled::Tabled for Solid3DShellFace {
16415 const LENGTH: usize = 0;
16416 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16417 vec![]
16418 }
16419
16420 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16421 vec![]
16422 }
16423}
16424
16425#[doc = "A position in the source code."]
16426#[derive(
16427 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16428)]
16429pub struct SourcePosition {
16430 #[doc = "The column number."]
16431 pub column: u32,
16432 #[doc = "The line number."]
16433 pub line: u32,
16434}
16435
16436impl std::fmt::Display for SourcePosition {
16437 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16438 write!(
16439 f,
16440 "{}",
16441 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16442 )
16443 }
16444}
16445
16446#[cfg(feature = "tabled")]
16447impl tabled::Tabled for SourcePosition {
16448 const LENGTH: usize = 2;
16449 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16450 vec![
16451 format!("{:?}", self.column).into(),
16452 format!("{:?}", self.line).into(),
16453 ]
16454 }
16455
16456 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16457 vec!["column".into(), "line".into()]
16458 }
16459}
16460
16461#[doc = "A source range of code."]
16462#[derive(
16463 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16464)]
16465pub struct SourceRange {
16466 #[doc = "The end of the range."]
16467 pub end: SourcePosition,
16468 #[doc = "The start of the range."]
16469 pub start: SourcePosition,
16470}
16471
16472impl std::fmt::Display for SourceRange {
16473 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16474 write!(
16475 f,
16476 "{}",
16477 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16478 )
16479 }
16480}
16481
16482#[cfg(feature = "tabled")]
16483impl tabled::Tabled for SourceRange {
16484 const LENGTH: usize = 2;
16485 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16486 vec![
16487 format!("{:?}", self.end).into(),
16488 format!("{:?}", self.start).into(),
16489 ]
16490 }
16491
16492 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16493 vec!["end".into(), "start".into()]
16494 }
16495}
16496
16497#[doc = "A source range and prompt for a text to CAD iteration."]
16498#[derive(
16499 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16500)]
16501pub struct SourceRangePrompt {
16502 #[doc = "The name of the file the source range applies to. This is the relative path to the \
16503 file from the root of the project. This only applies to multi-file iterations."]
16504 #[serde(default, skip_serializing_if = "Option::is_none")]
16505 pub file: Option<String>,
16506 #[doc = "The prompt for the changes."]
16507 pub prompt: String,
16508 #[doc = "The range of the source code to change. If you want to apply the prompt to the whole \
16509 file, set the start to 0 and the end to the end of the file."]
16510 pub range: SourceRange,
16511}
16512
16513impl std::fmt::Display for SourceRangePrompt {
16514 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16515 write!(
16516 f,
16517 "{}",
16518 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16519 )
16520 }
16521}
16522
16523#[cfg(feature = "tabled")]
16524impl tabled::Tabled for SourceRangePrompt {
16525 const LENGTH: usize = 3;
16526 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16527 vec![
16528 if let Some(file) = &self.file {
16529 format!("{:?}", file).into()
16530 } else {
16531 String::new().into()
16532 },
16533 self.prompt.clone().into(),
16534 format!("{:?}", self.range).into(),
16535 ]
16536 }
16537
16538 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16539 vec!["file".into(), "prompt".into(), "range".into()]
16540 }
16541}
16542
16543#[doc = "The response from the `StartPath` endpoint."]
16544#[derive(
16545 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16546)]
16547pub struct StartPath {}
16548
16549impl std::fmt::Display for StartPath {
16550 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16551 write!(
16552 f,
16553 "{}",
16554 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16555 )
16556 }
16557}
16558
16559#[cfg(feature = "tabled")]
16560impl tabled::Tabled for StartPath {
16561 const LENGTH: usize = 0;
16562 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16563 vec![]
16564 }
16565
16566 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16567 vec![]
16568 }
16569}
16570
16571#[doc = "Export storage."]
16572#[derive(
16573 serde :: Serialize,
16574 serde :: Deserialize,
16575 PartialEq,
16576 Hash,
16577 Debug,
16578 Clone,
16579 schemars :: JsonSchema,
16580 parse_display :: FromStr,
16581 parse_display :: Display,
16582)]
16583#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
16584#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
16585pub enum StlStorage {
16586 #[doc = "Plaintext encoding."]
16587 #[serde(rename = "ascii")]
16588 #[display("ascii")]
16589 Ascii,
16590 #[doc = "Binary STL encoding.\n\nThis is the default setting."]
16591 #[serde(rename = "binary")]
16592 #[display("binary")]
16593 Binary,
16594}
16595
16596#[doc = "The parameters for a new store coupon."]
16597#[derive(
16598 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16599)]
16600pub struct StoreCouponParams {
16601 #[doc = "The percentage off."]
16602 pub percent_off: u32,
16603}
16604
16605impl std::fmt::Display for StoreCouponParams {
16606 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16607 write!(
16608 f,
16609 "{}",
16610 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16611 )
16612 }
16613}
16614
16615#[cfg(feature = "tabled")]
16616impl tabled::Tabled for StoreCouponParams {
16617 const LENGTH: usize = 1;
16618 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16619 vec![format!("{:?}", self.percent_off).into()]
16620 }
16621
16622 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16623 vec!["percent_off".into()]
16624 }
16625}
16626
16627#[doc = "The data for subscribing a user to the newsletter."]
16628#[derive(
16629 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16630)]
16631pub struct Subscribe {
16632 #[doc = "The email"]
16633 pub email: String,
16634}
16635
16636impl std::fmt::Display for Subscribe {
16637 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16638 write!(
16639 f,
16640 "{}",
16641 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16642 )
16643 }
16644}
16645
16646#[cfg(feature = "tabled")]
16647impl tabled::Tabled for Subscribe {
16648 const LENGTH: usize = 1;
16649 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16650 vec![self.email.clone().into()]
16651 }
16652
16653 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16654 vec!["email".into()]
16655 }
16656}
16657
16658#[doc = "A subscription tier feature."]
16659#[derive(
16660 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16661)]
16662pub struct SubscriptionTierFeature {
16663 #[doc = "Information about the feature."]
16664 pub info: String,
16665}
16666
16667impl std::fmt::Display for SubscriptionTierFeature {
16668 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16669 write!(
16670 f,
16671 "{}",
16672 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16673 )
16674 }
16675}
16676
16677#[cfg(feature = "tabled")]
16678impl tabled::Tabled for SubscriptionTierFeature {
16679 const LENGTH: usize = 1;
16680 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16681 vec![self.info.clone().into()]
16682 }
16683
16684 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16685 vec!["info".into()]
16686 }
16687}
16688
16689#[doc = "The price for a subscription tier."]
16690#[derive(
16691 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16692)]
16693#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
16694#[serde(tag = "type")]
16695pub enum SubscriptionTierPrice {
16696 #[doc = "A flat price that we publicly list."]
16697 #[serde(rename = "flat")]
16698 Flat {
16699 #[doc = "The interval the price is charged."]
16700 interval: PlanInterval,
16701 #[doc = "The price."]
16702 price: f64,
16703 },
16704 #[doc = "A per user price that we publicly list."]
16705 #[serde(rename = "per_user")]
16706 PerUser {
16707 #[doc = "The interval the price is charged."]
16708 interval: PlanInterval,
16709 #[doc = "The price."]
16710 price: f64,
16711 },
16712 #[doc = "Enterprise: The price is not listed and the user needs to contact sales."]
16713 #[serde(rename = "enterprise")]
16714 Enterprise {},
16715}
16716
16717#[doc = "An enum representing a subscription tier type."]
16718#[derive(
16719 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16720)]
16721#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
16722#[serde(tag = "type")]
16723pub enum SubscriptionTierType {
16724 #[doc = "A subscription tier that can be applied to individuals only."]
16725 #[serde(rename = "individual")]
16726 Individual {},
16727 #[doc = "An subscription tier that can be applied to organizations only."]
16728 #[serde(rename = "organization")]
16729 Organization {
16730 #[doc = "Whether or not the subscription type supports SAML SSO."]
16731 saml_sso: bool,
16732 },
16733}
16734
16735#[doc = "An enum representing a subscription training data behavior."]
16736#[derive(
16737 serde :: Serialize,
16738 serde :: Deserialize,
16739 PartialEq,
16740 Hash,
16741 Debug,
16742 Clone,
16743 schemars :: JsonSchema,
16744 parse_display :: FromStr,
16745 parse_display :: Display,
16746)]
16747#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
16748#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
16749pub enum SubscriptionTrainingDataBehavior {
16750 #[doc = "The data is always used for training and cannot be turned off."]
16751 #[serde(rename = "always")]
16752 #[display("always")]
16753 Always,
16754 #[doc = "The data is used for training by default, but can be turned off."]
16755 #[serde(rename = "default_on")]
16756 #[display("default_on")]
16757 DefaultOn,
16758 #[doc = "The data is not used for training by default, but can be turned on."]
16759 #[serde(rename = "default_off")]
16760 #[display("default_off")]
16761 DefaultOff,
16762}
16763
16764#[doc = "Successful Websocket response."]
16765#[derive(
16766 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16767)]
16768pub struct SuccessWebSocketResponse {
16769 #[doc = "Which request this is a response to. If the request was a modeling command, this is \
16770 the modeling command ID. If no request ID was sent, this will be null."]
16771 #[serde(default, skip_serializing_if = "Option::is_none")]
16772 pub request_id: Option<uuid::Uuid>,
16773 #[doc = "The data sent with a successful response. This will be flattened into a 'type' and \
16774 'data' field."]
16775 pub resp: OkWebSocketResponseData,
16776 #[doc = "Always true"]
16777 pub success: bool,
16778}
16779
16780impl std::fmt::Display for SuccessWebSocketResponse {
16781 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16782 write!(
16783 f,
16784 "{}",
16785 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16786 )
16787 }
16788}
16789
16790#[cfg(feature = "tabled")]
16791impl tabled::Tabled for SuccessWebSocketResponse {
16792 const LENGTH: usize = 3;
16793 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16794 vec![
16795 if let Some(request_id) = &self.request_id {
16796 format!("{:?}", request_id).into()
16797 } else {
16798 String::new().into()
16799 },
16800 format!("{:?}", self.resp).into(),
16801 format!("{:?}", self.success).into(),
16802 ]
16803 }
16804
16805 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16806 vec!["request_id".into(), "resp".into(), "success".into()]
16807 }
16808}
16809
16810#[doc = "The support tier the subscription provides."]
16811#[derive(
16812 serde :: Serialize,
16813 serde :: Deserialize,
16814 PartialEq,
16815 Hash,
16816 Debug,
16817 Clone,
16818 schemars :: JsonSchema,
16819 parse_display :: FromStr,
16820 parse_display :: Display,
16821)]
16822#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
16823#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
16824pub enum SupportTier {
16825 #[doc = "Community support."]
16826 #[serde(rename = "community")]
16827 #[display("community")]
16828 Community,
16829 #[doc = "Standard email support."]
16830 #[serde(rename = "standard_email")]
16831 #[display("standard_email")]
16832 StandardEmail,
16833 #[doc = "Priority email support."]
16834 #[serde(rename = "priority_email")]
16835 #[display("priority_email")]
16836 PriorityEmail,
16837 #[doc = "Premium support."]
16838 #[serde(rename = "premium")]
16839 #[display("premium")]
16840 Premium,
16841}
16842
16843#[doc = "The surface area response."]
16844#[derive(
16845 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16846)]
16847pub struct SurfaceArea {
16848 #[doc = "The output unit for the surface area."]
16849 pub output_unit: UnitArea,
16850 #[doc = "The surface area."]
16851 pub surface_area: f64,
16852}
16853
16854impl std::fmt::Display for SurfaceArea {
16855 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16856 write!(
16857 f,
16858 "{}",
16859 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16860 )
16861 }
16862}
16863
16864#[cfg(feature = "tabled")]
16865impl tabled::Tabled for SurfaceArea {
16866 const LENGTH: usize = 2;
16867 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16868 vec![
16869 format!("{:?}", self.output_unit).into(),
16870 format!("{:?}", self.surface_area).into(),
16871 ]
16872 }
16873
16874 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16875 vec!["output_unit".into(), "surface_area".into()]
16876 }
16877}
16878
16879#[doc = "The response from the `Sweep` endpoint."]
16880#[derive(
16881 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16882)]
16883pub struct Sweep {}
16884
16885impl std::fmt::Display for Sweep {
16886 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16887 write!(
16888 f,
16889 "{}",
16890 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16891 )
16892 }
16893}
16894
16895#[cfg(feature = "tabled")]
16896impl tabled::Tabled for Sweep {
16897 const LENGTH: usize = 0;
16898 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16899 vec![]
16900 }
16901
16902 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16903 vec![]
16904 }
16905}
16906
16907#[doc = "Co-ordinate system definition.\n\nThe `up` axis must be orthogonal to the `forward` axis.\n\nSee [cglearn.eu] for background reading.\n\n[cglearn.eu](https://cglearn.eu/pub/computer-graphics/introduction-to-geometry#material-coordinate-systems-1)"]
16908#[derive(
16909 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16910)]
16911pub struct System {
16912 #[doc = "Axis the front face of a model looks along."]
16913 pub forward: AxisDirectionPair,
16914 #[doc = "Axis pointing up and away from a model."]
16915 pub up: AxisDirectionPair,
16916}
16917
16918impl std::fmt::Display for System {
16919 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16920 write!(
16921 f,
16922 "{}",
16923 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16924 )
16925 }
16926}
16927
16928#[cfg(feature = "tabled")]
16929impl tabled::Tabled for System {
16930 const LENGTH: usize = 2;
16931 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16932 vec![
16933 format!("{:?}", self.forward).into(),
16934 format!("{:?}", self.up).into(),
16935 ]
16936 }
16937
16938 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16939 vec!["forward".into(), "up".into()]
16940 }
16941}
16942
16943#[doc = "The response from the `TakeSnapshot` command."]
16944#[derive(
16945 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16946)]
16947pub struct TakeSnapshot {
16948 #[doc = "Contents of the image."]
16949 pub contents: base64::Base64Data,
16950}
16951
16952impl std::fmt::Display for TakeSnapshot {
16953 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
16954 write!(
16955 f,
16956 "{}",
16957 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
16958 )
16959 }
16960}
16961
16962#[cfg(feature = "tabled")]
16963impl tabled::Tabled for TakeSnapshot {
16964 const LENGTH: usize = 1;
16965 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
16966 vec![format!("{:?}", self.contents).into()]
16967 }
16968
16969 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
16970 vec!["contents".into()]
16971 }
16972}
16973
16974#[doc = "A response from a text to CAD prompt."]
16975#[derive(
16976 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
16977)]
16978pub struct TextToCad {
16979 #[doc = "The code for the model. This is optional but will be required in the future once we \
16980 are at v1."]
16981 #[serde(default, skip_serializing_if = "Option::is_none")]
16982 pub code: Option<String>,
16983 #[doc = "The time and date the API call was completed."]
16984 #[serde(default, skip_serializing_if = "Option::is_none")]
16985 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
16986 #[doc = "The conversation ID Conversations group different prompts together."]
16987 pub conversation_id: uuid::Uuid,
16988 #[doc = "The time and date the API call was created."]
16989 pub created_at: chrono::DateTime<chrono::Utc>,
16990 #[doc = "The error the function returned, if any."]
16991 #[serde(default, skip_serializing_if = "Option::is_none")]
16992 pub error: Option<String>,
16993 #[doc = "Feedback from the user, if any."]
16994 #[serde(default, skip_serializing_if = "Option::is_none")]
16995 pub feedback: Option<MlFeedback>,
16996 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
16997 pub id: uuid::Uuid,
16998 #[doc = "The version of kcl requested."]
16999 #[serde(default, skip_serializing_if = "Option::is_none")]
17000 pub kcl_version: Option<String>,
17001 #[doc = "The model being used."]
17002 pub model: TextToCadModel,
17003 #[doc = "The version of the model."]
17004 pub model_version: String,
17005 #[doc = "The output format of the model."]
17006 pub output_format: FileExportFormat,
17007 #[doc = "The output of the model in the given file format the user requested, base64 encoded. \
17008 The key of the map is the path of the output file."]
17009 #[serde(default, skip_serializing_if = "Option::is_none")]
17010 pub outputs: Option<std::collections::HashMap<String, base64::Base64Data>>,
17011 #[doc = "The prompt."]
17012 pub prompt: String,
17013 #[doc = "The time and date the API call was started."]
17014 #[serde(default, skip_serializing_if = "Option::is_none")]
17015 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
17016 #[doc = "The status of the API call."]
17017 pub status: ApiCallStatus,
17018 #[doc = "The time and date the API call was last updated."]
17019 pub updated_at: chrono::DateTime<chrono::Utc>,
17020 #[doc = "The user ID of the user who created the API call."]
17021 pub user_id: uuid::Uuid,
17022}
17023
17024impl std::fmt::Display for TextToCad {
17025 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
17026 write!(
17027 f,
17028 "{}",
17029 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
17030 )
17031 }
17032}
17033
17034#[cfg(feature = "tabled")]
17035impl tabled::Tabled for TextToCad {
17036 const LENGTH: usize = 17;
17037 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
17038 vec![
17039 if let Some(code) = &self.code {
17040 format!("{:?}", code).into()
17041 } else {
17042 String::new().into()
17043 },
17044 if let Some(completed_at) = &self.completed_at {
17045 format!("{:?}", completed_at).into()
17046 } else {
17047 String::new().into()
17048 },
17049 format!("{:?}", self.conversation_id).into(),
17050 format!("{:?}", self.created_at).into(),
17051 if let Some(error) = &self.error {
17052 format!("{:?}", error).into()
17053 } else {
17054 String::new().into()
17055 },
17056 if let Some(feedback) = &self.feedback {
17057 format!("{:?}", feedback).into()
17058 } else {
17059 String::new().into()
17060 },
17061 format!("{:?}", self.id).into(),
17062 if let Some(kcl_version) = &self.kcl_version {
17063 format!("{:?}", kcl_version).into()
17064 } else {
17065 String::new().into()
17066 },
17067 format!("{:?}", self.model).into(),
17068 self.model_version.clone().into(),
17069 format!("{:?}", self.output_format).into(),
17070 if let Some(outputs) = &self.outputs {
17071 format!("{:?}", outputs).into()
17072 } else {
17073 String::new().into()
17074 },
17075 self.prompt.clone().into(),
17076 if let Some(started_at) = &self.started_at {
17077 format!("{:?}", started_at).into()
17078 } else {
17079 String::new().into()
17080 },
17081 format!("{:?}", self.status).into(),
17082 format!("{:?}", self.updated_at).into(),
17083 format!("{:?}", self.user_id).into(),
17084 ]
17085 }
17086
17087 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
17088 vec![
17089 "code".into(),
17090 "completed_at".into(),
17091 "conversation_id".into(),
17092 "created_at".into(),
17093 "error".into(),
17094 "feedback".into(),
17095 "id".into(),
17096 "kcl_version".into(),
17097 "model".into(),
17098 "model_version".into(),
17099 "output_format".into(),
17100 "outputs".into(),
17101 "prompt".into(),
17102 "started_at".into(),
17103 "status".into(),
17104 "updated_at".into(),
17105 "user_id".into(),
17106 ]
17107 }
17108}
17109
17110#[doc = "Body for generating parts from text."]
17111#[derive(
17112 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
17113)]
17114pub struct TextToCadCreateBody {
17115 #[doc = "The version of kcl to use. If empty, the latest version will be used."]
17116 #[serde(default, skip_serializing_if = "Option::is_none")]
17117 pub kcl_version: Option<String>,
17118 #[doc = "The project name. This is used to tie the prompt to a project. Which helps us make \
17119 our models better over time."]
17120 #[serde(default, skip_serializing_if = "Option::is_none")]
17121 pub project_name: Option<String>,
17122 #[doc = "The prompt for the model."]
17123 pub prompt: String,
17124}
17125
17126impl std::fmt::Display for TextToCadCreateBody {
17127 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
17128 write!(
17129 f,
17130 "{}",
17131 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
17132 )
17133 }
17134}
17135
17136#[cfg(feature = "tabled")]
17137impl tabled::Tabled for TextToCadCreateBody {
17138 const LENGTH: usize = 3;
17139 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
17140 vec![
17141 if let Some(kcl_version) = &self.kcl_version {
17142 format!("{:?}", kcl_version).into()
17143 } else {
17144 String::new().into()
17145 },
17146 if let Some(project_name) = &self.project_name {
17147 format!("{:?}", project_name).into()
17148 } else {
17149 String::new().into()
17150 },
17151 self.prompt.clone().into(),
17152 ]
17153 }
17154
17155 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
17156 vec!["kcl_version".into(), "project_name".into(), "prompt".into()]
17157 }
17158}
17159
17160#[doc = "A response from a text to CAD iteration."]
17161#[derive(
17162 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
17163)]
17164pub struct TextToCadIteration {
17165 #[doc = "The code for the new model."]
17166 pub code: String,
17167 #[doc = "The time and date the API call was completed."]
17168 #[serde(default, skip_serializing_if = "Option::is_none")]
17169 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
17170 #[doc = "The conversation ID Conversations group different prompts together."]
17171 pub conversation_id: uuid::Uuid,
17172 #[doc = "The time and date the API call was created."]
17173 pub created_at: chrono::DateTime<chrono::Utc>,
17174 #[doc = "The error the function returned, if any."]
17175 #[serde(default, skip_serializing_if = "Option::is_none")]
17176 pub error: Option<String>,
17177 #[doc = "Feedback from the user, if any."]
17178 #[serde(default, skip_serializing_if = "Option::is_none")]
17179 pub feedback: Option<MlFeedback>,
17180 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
17181 pub id: uuid::Uuid,
17182 #[doc = "The model being used."]
17183 pub model: TextToCadModel,
17184 #[doc = "The version of the model."]
17185 pub model_version: String,
17186 #[doc = "The original source code for the model, previous to the changes."]
17187 pub original_source_code: String,
17188 #[doc = "The prompt for the overall changes. This is optional if you only want changes on \
17189 specific source ranges."]
17190 #[serde(default, skip_serializing_if = "Option::is_none")]
17191 pub prompt: Option<String>,
17192 #[doc = "The source ranges the user suggested to change."]
17193 pub source_ranges: Vec<SourceRangePrompt>,
17194 #[doc = "The time and date the API call was started."]
17195 #[serde(default, skip_serializing_if = "Option::is_none")]
17196 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
17197 #[doc = "The status of the API call."]
17198 pub status: ApiCallStatus,
17199 #[doc = "The time and date the API call was last updated."]
17200 pub updated_at: chrono::DateTime<chrono::Utc>,
17201 #[doc = "The user ID of the user who created the API call."]
17202 pub user_id: uuid::Uuid,
17203}
17204
17205impl std::fmt::Display for TextToCadIteration {
17206 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
17207 write!(
17208 f,
17209 "{}",
17210 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
17211 )
17212 }
17213}
17214
17215#[cfg(feature = "tabled")]
17216impl tabled::Tabled for TextToCadIteration {
17217 const LENGTH: usize = 16;
17218 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
17219 vec![
17220 self.code.clone().into(),
17221 if let Some(completed_at) = &self.completed_at {
17222 format!("{:?}", completed_at).into()
17223 } else {
17224 String::new().into()
17225 },
17226 format!("{:?}", self.conversation_id).into(),
17227 format!("{:?}", self.created_at).into(),
17228 if let Some(error) = &self.error {
17229 format!("{:?}", error).into()
17230 } else {
17231 String::new().into()
17232 },
17233 if let Some(feedback) = &self.feedback {
17234 format!("{:?}", feedback).into()
17235 } else {
17236 String::new().into()
17237 },
17238 format!("{:?}", self.id).into(),
17239 format!("{:?}", self.model).into(),
17240 self.model_version.clone().into(),
17241 self.original_source_code.clone().into(),
17242 if let Some(prompt) = &self.prompt {
17243 format!("{:?}", prompt).into()
17244 } else {
17245 String::new().into()
17246 },
17247 format!("{:?}", self.source_ranges).into(),
17248 if let Some(started_at) = &self.started_at {
17249 format!("{:?}", started_at).into()
17250 } else {
17251 String::new().into()
17252 },
17253 format!("{:?}", self.status).into(),
17254 format!("{:?}", self.updated_at).into(),
17255 format!("{:?}", self.user_id).into(),
17256 ]
17257 }
17258
17259 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
17260 vec![
17261 "code".into(),
17262 "completed_at".into(),
17263 "conversation_id".into(),
17264 "created_at".into(),
17265 "error".into(),
17266 "feedback".into(),
17267 "id".into(),
17268 "model".into(),
17269 "model_version".into(),
17270 "original_source_code".into(),
17271 "prompt".into(),
17272 "source_ranges".into(),
17273 "started_at".into(),
17274 "status".into(),
17275 "updated_at".into(),
17276 "user_id".into(),
17277 ]
17278 }
17279}
17280
17281#[doc = "Body for generating parts from text."]
17282#[derive(
17283 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
17284)]
17285pub struct TextToCadIterationBody {
17286 #[doc = "The version of kcl to use. If empty, the latest version will be used."]
17287 #[serde(default, skip_serializing_if = "Option::is_none")]
17288 pub kcl_version: Option<String>,
17289 #[doc = "The source code for the model (in kcl) that is to be edited."]
17290 pub original_source_code: String,
17291 #[doc = "The project name. This is used to tie the prompt to a project. Which helps us make \
17292 our models better over time."]
17293 #[serde(default, skip_serializing_if = "Option::is_none")]
17294 pub project_name: Option<String>,
17295 #[doc = "The prompt for the model, if not using source ranges."]
17296 #[serde(default, skip_serializing_if = "Option::is_none")]
17297 pub prompt: Option<String>,
17298 #[doc = "The source ranges the user suggested to change. If empty, the prompt will be used \
17299 and is required."]
17300 pub source_ranges: Vec<SourceRangePrompt>,
17301}
17302
17303impl std::fmt::Display for TextToCadIterationBody {
17304 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
17305 write!(
17306 f,
17307 "{}",
17308 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
17309 )
17310 }
17311}
17312
17313#[cfg(feature = "tabled")]
17314impl tabled::Tabled for TextToCadIterationBody {
17315 const LENGTH: usize = 5;
17316 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
17317 vec![
17318 if let Some(kcl_version) = &self.kcl_version {
17319 format!("{:?}", kcl_version).into()
17320 } else {
17321 String::new().into()
17322 },
17323 self.original_source_code.clone().into(),
17324 if let Some(project_name) = &self.project_name {
17325 format!("{:?}", project_name).into()
17326 } else {
17327 String::new().into()
17328 },
17329 if let Some(prompt) = &self.prompt {
17330 format!("{:?}", prompt).into()
17331 } else {
17332 String::new().into()
17333 },
17334 format!("{:?}", self.source_ranges).into(),
17335 ]
17336 }
17337
17338 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
17339 vec![
17340 "kcl_version".into(),
17341 "original_source_code".into(),
17342 "project_name".into(),
17343 "prompt".into(),
17344 "source_ranges".into(),
17345 ]
17346 }
17347}
17348
17349#[doc = "A type of Text-to-CAD model."]
17350#[derive(
17351 serde :: Serialize,
17352 serde :: Deserialize,
17353 PartialEq,
17354 Hash,
17355 Debug,
17356 Clone,
17357 schemars :: JsonSchema,
17358 parse_display :: FromStr,
17359 parse_display :: Display,
17360)]
17361#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
17362#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
17363pub enum TextToCadModel {
17364 #[doc = "CAD."]
17365 #[serde(rename = "cad")]
17366 #[display("cad")]
17367 Cad,
17368 #[doc = "KCL."]
17369 #[serde(rename = "kcl")]
17370 #[display("kcl")]
17371 Kcl,
17372 #[doc = "KCL iteration."]
17373 #[serde(rename = "kcl_iteration")]
17374 #[display("kcl_iteration")]
17375 KclIteration,
17376}
17377
17378#[doc = "A response from a text to CAD multi-file iteration."]
17379#[derive(
17380 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
17381)]
17382pub struct TextToCadMultiFileIteration {
17383 #[doc = "The time and date the API call was completed."]
17384 #[serde(default, skip_serializing_if = "Option::is_none")]
17385 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
17386 #[doc = "The conversation ID Conversations group different prompts together."]
17387 pub conversation_id: uuid::Uuid,
17388 #[doc = "The time and date the API call was created."]
17389 pub created_at: chrono::DateTime<chrono::Utc>,
17390 #[doc = "The error the function returned, if any."]
17391 #[serde(default, skip_serializing_if = "Option::is_none")]
17392 pub error: Option<String>,
17393 #[doc = "Feedback from the user, if any."]
17394 #[serde(default, skip_serializing_if = "Option::is_none")]
17395 pub feedback: Option<MlFeedback>,
17396 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
17397 pub id: uuid::Uuid,
17398 #[doc = "The version of kcl to use. If empty, the latest version will be used."]
17399 #[serde(default, skip_serializing_if = "Option::is_none")]
17400 pub kcl_version: Option<String>,
17401 #[doc = "The model being used."]
17402 pub model: TextToCadModel,
17403 #[doc = "The version of the model."]
17404 pub model_version: String,
17405 #[doc = "The output files. Returns a map of the file name to the file contents. The file \
17406 contents are not encoded since kcl files are not binary."]
17407 #[serde(default, skip_serializing_if = "Option::is_none")]
17408 pub outputs: Option<std::collections::HashMap<String, String>>,
17409 #[doc = "The project name. This is used to tie the prompt to a project. Which helps us make \
17410 our models better over time."]
17411 #[serde(default, skip_serializing_if = "Option::is_none")]
17412 pub project_name: Option<String>,
17413 #[doc = "The prompt for the overall changes. This is optional if you only want changes on \
17414 specific source ranges. This will apply to all the files."]
17415 #[serde(default, skip_serializing_if = "Option::is_none")]
17416 pub prompt: Option<String>,
17417 #[doc = "The source ranges the user suggested to change."]
17418 pub source_ranges: Vec<SourceRangePrompt>,
17419 #[doc = "The time and date the API call was started."]
17420 #[serde(default, skip_serializing_if = "Option::is_none")]
17421 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
17422 #[doc = "The status of the API call."]
17423 pub status: ApiCallStatus,
17424 #[doc = "The time and date the API call was last updated."]
17425 pub updated_at: chrono::DateTime<chrono::Utc>,
17426 #[doc = "The user ID of the user who created the API call."]
17427 pub user_id: uuid::Uuid,
17428}
17429
17430impl std::fmt::Display for TextToCadMultiFileIteration {
17431 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
17432 write!(
17433 f,
17434 "{}",
17435 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
17436 )
17437 }
17438}
17439
17440#[cfg(feature = "tabled")]
17441impl tabled::Tabled for TextToCadMultiFileIteration {
17442 const LENGTH: usize = 17;
17443 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
17444 vec![
17445 if let Some(completed_at) = &self.completed_at {
17446 format!("{:?}", completed_at).into()
17447 } else {
17448 String::new().into()
17449 },
17450 format!("{:?}", self.conversation_id).into(),
17451 format!("{:?}", self.created_at).into(),
17452 if let Some(error) = &self.error {
17453 format!("{:?}", error).into()
17454 } else {
17455 String::new().into()
17456 },
17457 if let Some(feedback) = &self.feedback {
17458 format!("{:?}", feedback).into()
17459 } else {
17460 String::new().into()
17461 },
17462 format!("{:?}", self.id).into(),
17463 if let Some(kcl_version) = &self.kcl_version {
17464 format!("{:?}", kcl_version).into()
17465 } else {
17466 String::new().into()
17467 },
17468 format!("{:?}", self.model).into(),
17469 self.model_version.clone().into(),
17470 if let Some(outputs) = &self.outputs {
17471 format!("{:?}", outputs).into()
17472 } else {
17473 String::new().into()
17474 },
17475 if let Some(project_name) = &self.project_name {
17476 format!("{:?}", project_name).into()
17477 } else {
17478 String::new().into()
17479 },
17480 if let Some(prompt) = &self.prompt {
17481 format!("{:?}", prompt).into()
17482 } else {
17483 String::new().into()
17484 },
17485 format!("{:?}", self.source_ranges).into(),
17486 if let Some(started_at) = &self.started_at {
17487 format!("{:?}", started_at).into()
17488 } else {
17489 String::new().into()
17490 },
17491 format!("{:?}", self.status).into(),
17492 format!("{:?}", self.updated_at).into(),
17493 format!("{:?}", self.user_id).into(),
17494 ]
17495 }
17496
17497 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
17498 vec![
17499 "completed_at".into(),
17500 "conversation_id".into(),
17501 "created_at".into(),
17502 "error".into(),
17503 "feedback".into(),
17504 "id".into(),
17505 "kcl_version".into(),
17506 "model".into(),
17507 "model_version".into(),
17508 "outputs".into(),
17509 "project_name".into(),
17510 "prompt".into(),
17511 "source_ranges".into(),
17512 "started_at".into(),
17513 "status".into(),
17514 "updated_at".into(),
17515 "user_id".into(),
17516 ]
17517 }
17518}
17519
17520#[doc = "Body for iterating on models from text prompts."]
17521#[derive(
17522 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
17523)]
17524pub struct TextToCadMultiFileIterationBody {
17525 #[doc = "The conversation ID Conversations group different prompts together. This should be \
17526 omitted when starting a new conversation. The conversation_id returned in the \
17527 response should be used to link future messages in the same conversation."]
17528 #[serde(default, skip_serializing_if = "Option::is_none")]
17529 pub conversation_id: Option<uuid::Uuid>,
17530 #[doc = "The version of kcl to use. If empty, the latest version will be used."]
17531 #[serde(default, skip_serializing_if = "Option::is_none")]
17532 pub kcl_version: Option<String>,
17533 #[doc = "The project name. This is used to tie the prompt to a project. Which helps us make \
17534 our models better over time."]
17535 #[serde(default, skip_serializing_if = "Option::is_none")]
17536 pub project_name: Option<String>,
17537 #[doc = "The prompt for the overall changes. This is optional if you only want changes on \
17538 specific source ranges. This will apply to all the files. If you want to apply a \
17539 prompt to just a single file, use the source_ranges field and you can leave this \
17540 empty."]
17541 #[serde(default, skip_serializing_if = "Option::is_none")]
17542 pub prompt: Option<String>,
17543 #[doc = "The source ranges the user suggested to change. If empty, the prompt will be used \
17544 and is required."]
17545 #[serde(default, skip_serializing_if = "Option::is_none")]
17546 pub source_ranges: Option<Vec<SourceRangePrompt>>,
17547}
17548
17549impl std::fmt::Display for TextToCadMultiFileIterationBody {
17550 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
17551 write!(
17552 f,
17553 "{}",
17554 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
17555 )
17556 }
17557}
17558
17559#[cfg(feature = "tabled")]
17560impl tabled::Tabled for TextToCadMultiFileIterationBody {
17561 const LENGTH: usize = 5;
17562 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
17563 vec![
17564 if let Some(conversation_id) = &self.conversation_id {
17565 format!("{:?}", conversation_id).into()
17566 } else {
17567 String::new().into()
17568 },
17569 if let Some(kcl_version) = &self.kcl_version {
17570 format!("{:?}", kcl_version).into()
17571 } else {
17572 String::new().into()
17573 },
17574 if let Some(project_name) = &self.project_name {
17575 format!("{:?}", project_name).into()
17576 } else {
17577 String::new().into()
17578 },
17579 if let Some(prompt) = &self.prompt {
17580 format!("{:?}", prompt).into()
17581 } else {
17582 String::new().into()
17583 },
17584 if let Some(source_ranges) = &self.source_ranges {
17585 format!("{:?}", source_ranges).into()
17586 } else {
17587 String::new().into()
17588 },
17589 ]
17590 }
17591
17592 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
17593 vec![
17594 "conversation_id".into(),
17595 "kcl_version".into(),
17596 "project_name".into(),
17597 "prompt".into(),
17598 "source_ranges".into(),
17599 ]
17600 }
17601}
17602
17603#[doc = "Type that encompasses all Text-to-CAD response types, including iteration and multi-file \
17604 iteration."]
17605#[derive(
17606 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
17607)]
17608#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
17609#[serde(tag = "type")]
17610pub enum TextToCadResponse {
17611 #[doc = "A response from a text to CAD prompt."]
17612 #[serde(rename = "text_to_cad")]
17613 TextToCad {
17614 #[doc = "The code for the model. This is optional but will be required in the future once \
17615 we are at v1."]
17616 #[serde(default, skip_serializing_if = "Option::is_none")]
17617 code: Option<String>,
17618 #[doc = "The time and date the API call was completed."]
17619 #[serde(default, skip_serializing_if = "Option::is_none")]
17620 completed_at: Option<chrono::DateTime<chrono::Utc>>,
17621 #[doc = "The conversation ID Conversations group different prompts together."]
17622 conversation_id: uuid::Uuid,
17623 #[doc = "The time and date the API call was created."]
17624 created_at: chrono::DateTime<chrono::Utc>,
17625 #[doc = "The error the function returned, if any."]
17626 #[serde(default, skip_serializing_if = "Option::is_none")]
17627 error: Option<String>,
17628 #[doc = "Feedback from the user, if any."]
17629 #[serde(default, skip_serializing_if = "Option::is_none")]
17630 feedback: Option<MlFeedback>,
17631 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
17632 id: uuid::Uuid,
17633 #[doc = "The version of kcl requested."]
17634 #[serde(default, skip_serializing_if = "Option::is_none")]
17635 kcl_version: Option<String>,
17636 #[doc = "The model being used."]
17637 model: TextToCadModel,
17638 #[doc = "The version of the model."]
17639 model_version: String,
17640 #[doc = "The output format of the model."]
17641 output_format: FileExportFormat,
17642 #[doc = "The output of the model in the given file format the user requested, base64 \
17643 encoded. The key of the map is the path of the output file."]
17644 #[serde(default, skip_serializing_if = "Option::is_none")]
17645 outputs: Option<std::collections::HashMap<String, base64::Base64Data>>,
17646 #[doc = "The prompt."]
17647 prompt: String,
17648 #[doc = "The time and date the API call was started."]
17649 #[serde(default, skip_serializing_if = "Option::is_none")]
17650 started_at: Option<chrono::DateTime<chrono::Utc>>,
17651 #[doc = "The status of the API call."]
17652 status: ApiCallStatus,
17653 #[doc = "The time and date the API call was last updated."]
17654 updated_at: chrono::DateTime<chrono::Utc>,
17655 #[doc = "The user ID of the user who created the API call."]
17656 user_id: uuid::Uuid,
17657 },
17658 #[doc = "A response from a text to CAD iteration."]
17659 #[serde(rename = "text_to_cad_iteration")]
17660 TextToCadIteration {
17661 #[doc = "The code for the new model."]
17662 code: String,
17663 #[doc = "The time and date the API call was completed."]
17664 #[serde(default, skip_serializing_if = "Option::is_none")]
17665 completed_at: Option<chrono::DateTime<chrono::Utc>>,
17666 #[doc = "The conversation ID Conversations group different prompts together."]
17667 conversation_id: uuid::Uuid,
17668 #[doc = "The time and date the API call was created."]
17669 created_at: chrono::DateTime<chrono::Utc>,
17670 #[doc = "The error the function returned, if any."]
17671 #[serde(default, skip_serializing_if = "Option::is_none")]
17672 error: Option<String>,
17673 #[doc = "Feedback from the user, if any."]
17674 #[serde(default, skip_serializing_if = "Option::is_none")]
17675 feedback: Option<MlFeedback>,
17676 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
17677 id: uuid::Uuid,
17678 #[doc = "The model being used."]
17679 model: TextToCadModel,
17680 #[doc = "The version of the model."]
17681 model_version: String,
17682 #[doc = "The original source code for the model, previous to the changes."]
17683 original_source_code: String,
17684 #[doc = "The prompt for the overall changes. This is optional if you only want changes on \
17685 specific source ranges."]
17686 #[serde(default, skip_serializing_if = "Option::is_none")]
17687 prompt: Option<String>,
17688 #[doc = "The source ranges the user suggested to change."]
17689 source_ranges: Vec<SourceRangePrompt>,
17690 #[doc = "The time and date the API call was started."]
17691 #[serde(default, skip_serializing_if = "Option::is_none")]
17692 started_at: Option<chrono::DateTime<chrono::Utc>>,
17693 #[doc = "The status of the API call."]
17694 status: ApiCallStatus,
17695 #[doc = "The time and date the API call was last updated."]
17696 updated_at: chrono::DateTime<chrono::Utc>,
17697 #[doc = "The user ID of the user who created the API call."]
17698 user_id: uuid::Uuid,
17699 },
17700 #[doc = "A response from a text to CAD multi-file iteration."]
17701 #[serde(rename = "text_to_cad_multi_file_iteration")]
17702 TextToCadMultiFileIteration {
17703 #[doc = "The time and date the API call was completed."]
17704 #[serde(default, skip_serializing_if = "Option::is_none")]
17705 completed_at: Option<chrono::DateTime<chrono::Utc>>,
17706 #[doc = "The conversation ID Conversations group different prompts together."]
17707 conversation_id: uuid::Uuid,
17708 #[doc = "The time and date the API call was created."]
17709 created_at: chrono::DateTime<chrono::Utc>,
17710 #[doc = "The error the function returned, if any."]
17711 #[serde(default, skip_serializing_if = "Option::is_none")]
17712 error: Option<String>,
17713 #[doc = "Feedback from the user, if any."]
17714 #[serde(default, skip_serializing_if = "Option::is_none")]
17715 feedback: Option<MlFeedback>,
17716 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
17717 id: uuid::Uuid,
17718 #[doc = "The version of kcl to use. If empty, the latest version will be used."]
17719 #[serde(default, skip_serializing_if = "Option::is_none")]
17720 kcl_version: Option<String>,
17721 #[doc = "The model being used."]
17722 model: TextToCadModel,
17723 #[doc = "The version of the model."]
17724 model_version: String,
17725 #[doc = "The output files. Returns a map of the file name to the file contents. The file \
17726 contents are not encoded since kcl files are not binary."]
17727 #[serde(default, skip_serializing_if = "Option::is_none")]
17728 outputs: Option<std::collections::HashMap<String, String>>,
17729 #[doc = "The project name. This is used to tie the prompt to a project. Which helps us \
17730 make our models better over time."]
17731 #[serde(default, skip_serializing_if = "Option::is_none")]
17732 project_name: Option<String>,
17733 #[doc = "The prompt for the overall changes. This is optional if you only want changes on \
17734 specific source ranges. This will apply to all the files."]
17735 #[serde(default, skip_serializing_if = "Option::is_none")]
17736 prompt: Option<String>,
17737 #[doc = "The source ranges the user suggested to change."]
17738 source_ranges: Vec<SourceRangePrompt>,
17739 #[doc = "The time and date the API call was started."]
17740 #[serde(default, skip_serializing_if = "Option::is_none")]
17741 started_at: Option<chrono::DateTime<chrono::Utc>>,
17742 #[doc = "The status of the API call."]
17743 status: ApiCallStatus,
17744 #[doc = "The time and date the API call was last updated."]
17745 updated_at: chrono::DateTime<chrono::Utc>,
17746 #[doc = "The user ID of the user who created the API call."]
17747 user_id: uuid::Uuid,
17748 },
17749}
17750
17751#[doc = "A single page of results"]
17752#[derive(
17753 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
17754)]
17755pub struct TextToCadResponseResultsPage {
17756 #[doc = "list of items on this page of results"]
17757 pub items: Vec<TextToCadResponse>,
17758 #[doc = "token used to fetch the next page of results (if any)"]
17759 #[serde(default, skip_serializing_if = "Option::is_none")]
17760 pub next_page: Option<String>,
17761}
17762
17763impl std::fmt::Display for TextToCadResponseResultsPage {
17764 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
17765 write!(
17766 f,
17767 "{}",
17768 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
17769 )
17770 }
17771}
17772
17773#[cfg(feature = "requests")]
17774impl crate::types::paginate::Pagination for TextToCadResponseResultsPage {
17775 type Item = TextToCadResponse;
17776 fn has_more_pages(&self) -> bool {
17777 self.next_page.is_some()
17778 }
17779
17780 fn next_page_token(&self) -> Option<String> {
17781 self.next_page.clone()
17782 }
17783
17784 fn next_page(
17785 &self,
17786 req: reqwest::Request,
17787 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
17788 let mut req = req.try_clone().ok_or_else(|| {
17789 crate::types::error::Error::InvalidRequest(format!(
17790 "failed to clone request: {:?}",
17791 req
17792 ))
17793 })?;
17794 req.url_mut()
17795 .query_pairs_mut()
17796 .append_pair("next_page", self.next_page.as_deref().unwrap_or(""));
17797 Ok(req)
17798 }
17799
17800 fn items(&self) -> Vec<Self::Item> {
17801 self.items.clone()
17802 }
17803}
17804
17805#[cfg(feature = "tabled")]
17806impl tabled::Tabled for TextToCadResponseResultsPage {
17807 const LENGTH: usize = 2;
17808 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
17809 vec![
17810 format!("{:?}", self.items).into(),
17811 if let Some(next_page) = &self.next_page {
17812 format!("{:?}", next_page).into()
17813 } else {
17814 String::new().into()
17815 },
17816 ]
17817 }
17818
17819 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
17820 vec!["items".into(), "next_page".into()]
17821 }
17822}
17823
17824#[doc = "The request parameters for the OAuth 2.0 token revocation flow."]
17825#[derive(
17826 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
17827)]
17828pub struct TokenRevokeRequestForm {
17829 #[doc = "The client ID."]
17830 pub client_id: uuid::Uuid,
17831 #[doc = "The client secret."]
17832 #[serde(default, skip_serializing_if = "Option::is_none")]
17833 pub client_secret: Option<String>,
17834 #[doc = "The token to revoke."]
17835 pub token: String,
17836}
17837
17838impl std::fmt::Display for TokenRevokeRequestForm {
17839 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
17840 write!(
17841 f,
17842 "{}",
17843 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
17844 )
17845 }
17846}
17847
17848#[cfg(feature = "tabled")]
17849impl tabled::Tabled for TokenRevokeRequestForm {
17850 const LENGTH: usize = 3;
17851 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
17852 vec![
17853 format!("{:?}", self.client_id).into(),
17854 if let Some(client_secret) = &self.client_secret {
17855 format!("{:?}", client_secret).into()
17856 } else {
17857 String::new().into()
17858 },
17859 self.token.clone().into(),
17860 ]
17861 }
17862
17863 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
17864 vec!["client_id".into(), "client_secret".into(), "token".into()]
17865 }
17866}
17867
17868#[doc = "Ways to transform each solid being replicated in a repeating pattern."]
17869#[derive(
17870 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
17871)]
17872pub struct Transform {
17873 #[doc = "Whether to replicate the original solid in this instance."]
17874 #[serde(default)]
17875 pub replicate: bool,
17876 #[doc = "Rotate the replica about the specified rotation axis and origin. Defaults to no \
17877 rotation."]
17878 #[serde(default, skip_serializing_if = "Option::is_none")]
17879 pub rotation: Option<Rotation>,
17880 #[doc = "Scale the replica's size along each axis. Defaults to (1, 1, 1) (i.e. the same size \
17881 as the original)."]
17882 #[serde(default, skip_serializing_if = "Option::is_none")]
17883 pub scale: Option<Point3D>,
17884 #[doc = "Translate the replica this far along each dimension. Defaults to zero vector (i.e. \
17885 same position as the original)."]
17886 #[serde(default, skip_serializing_if = "Option::is_none")]
17887 pub translate: Option<Point3D>,
17888}
17889
17890impl std::fmt::Display for Transform {
17891 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
17892 write!(
17893 f,
17894 "{}",
17895 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
17896 )
17897 }
17898}
17899
17900#[cfg(feature = "tabled")]
17901impl tabled::Tabled for Transform {
17902 const LENGTH: usize = 4;
17903 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
17904 vec![
17905 format!("{:?}", self.replicate).into(),
17906 if let Some(rotation) = &self.rotation {
17907 format!("{:?}", rotation).into()
17908 } else {
17909 String::new().into()
17910 },
17911 if let Some(scale) = &self.scale {
17912 format!("{:?}", scale).into()
17913 } else {
17914 String::new().into()
17915 },
17916 if let Some(translate) = &self.translate {
17917 format!("{:?}", translate).into()
17918 } else {
17919 String::new().into()
17920 },
17921 ]
17922 }
17923
17924 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
17925 vec![
17926 "replicate".into(),
17927 "rotation".into(),
17928 "scale".into(),
17929 "translate".into(),
17930 ]
17931 }
17932}
17933
17934#[doc = "How a property of an object should be transformed."]
17935#[derive(
17936 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
17937)]
17938pub struct TransformByForPoint3D {
17939 #[doc = "If true, the transform is applied in local space. If false, the transform is applied \
17940 in global space."]
17941 #[deprecated]
17942 pub is_local: bool,
17943 #[doc = "What to use as the origin for the transformation. If not provided, will fall back to \
17944 local or global origin, depending on whatever the `is_local` field was set to."]
17945 #[serde(default, skip_serializing_if = "Option::is_none")]
17946 pub origin: Option<OriginType>,
17947 #[doc = "The scale, or rotation, or translation."]
17948 pub property: Point3D,
17949 #[doc = "If true, overwrite the previous value with this. If false, the previous value will \
17950 be modified. E.g. when translating, `set=true` will set a new location, and \
17951 `set=false` will translate the current location by the given X/Y/Z."]
17952 pub set: bool,
17953}
17954
17955impl std::fmt::Display for TransformByForPoint3D {
17956 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
17957 write!(
17958 f,
17959 "{}",
17960 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
17961 )
17962 }
17963}
17964
17965#[cfg(feature = "tabled")]
17966impl tabled::Tabled for TransformByForPoint3D {
17967 const LENGTH: usize = 4;
17968 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
17969 vec![
17970 format!("{:?}", self.is_local).into(),
17971 if let Some(origin) = &self.origin {
17972 format!("{:?}", origin).into()
17973 } else {
17974 String::new().into()
17975 },
17976 format!("{:?}", self.property).into(),
17977 format!("{:?}", self.set).into(),
17978 ]
17979 }
17980
17981 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
17982 vec![
17983 "is_local".into(),
17984 "origin".into(),
17985 "property".into(),
17986 "set".into(),
17987 ]
17988 }
17989}
17990
17991#[doc = "How a property of an object should be transformed."]
17992#[derive(
17993 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
17994)]
17995pub struct TransformByForPoint4D {
17996 #[doc = "If true, the transform is applied in local space. If false, the transform is applied \
17997 in global space."]
17998 #[deprecated]
17999 pub is_local: bool,
18000 #[doc = "What to use as the origin for the transformation. If not provided, will fall back to \
18001 local or global origin, depending on whatever the `is_local` field was set to."]
18002 #[serde(default, skip_serializing_if = "Option::is_none")]
18003 pub origin: Option<OriginType>,
18004 #[doc = "The scale, or rotation, or translation."]
18005 pub property: Point4D,
18006 #[doc = "If true, overwrite the previous value with this. If false, the previous value will \
18007 be modified. E.g. when translating, `set=true` will set a new location, and \
18008 `set=false` will translate the current location by the given X/Y/Z."]
18009 pub set: bool,
18010}
18011
18012impl std::fmt::Display for TransformByForPoint4D {
18013 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
18014 write!(
18015 f,
18016 "{}",
18017 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
18018 )
18019 }
18020}
18021
18022#[cfg(feature = "tabled")]
18023impl tabled::Tabled for TransformByForPoint4D {
18024 const LENGTH: usize = 4;
18025 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
18026 vec![
18027 format!("{:?}", self.is_local).into(),
18028 if let Some(origin) = &self.origin {
18029 format!("{:?}", origin).into()
18030 } else {
18031 String::new().into()
18032 },
18033 format!("{:?}", self.property).into(),
18034 format!("{:?}", self.set).into(),
18035 ]
18036 }
18037
18038 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
18039 vec![
18040 "is_local".into(),
18041 "origin".into(),
18042 "property".into(),
18043 "set".into(),
18044 ]
18045 }
18046}
18047
18048#[doc = "The response from the `TwistExtrude` endpoint."]
18049#[derive(
18050 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
18051)]
18052pub struct TwistExtrude {}
18053
18054impl std::fmt::Display for TwistExtrude {
18055 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
18056 write!(
18057 f,
18058 "{}",
18059 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
18060 )
18061 }
18062}
18063
18064#[cfg(feature = "tabled")]
18065impl tabled::Tabled for TwistExtrude {
18066 const LENGTH: usize = 0;
18067 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
18068 vec![]
18069 }
18070
18071 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
18072 vec![]
18073 }
18074}
18075
18076#[doc = "The valid types of angle formats."]
18077#[derive(
18078 serde :: Serialize,
18079 serde :: Deserialize,
18080 PartialEq,
18081 Hash,
18082 Debug,
18083 Clone,
18084 schemars :: JsonSchema,
18085 parse_display :: FromStr,
18086 parse_display :: Display,
18087)]
18088#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
18089#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
18090pub enum UnitAngle {
18091 #[doc = "Degrees <https://en.wikipedia.org/wiki/Degree_(angle)>"]
18092 #[serde(rename = "degrees")]
18093 #[display("degrees")]
18094 Degrees,
18095 #[doc = "Radians <https://en.wikipedia.org/wiki/Radian>"]
18096 #[serde(rename = "radians")]
18097 #[display("radians")]
18098 Radians,
18099}
18100
18101#[doc = "Result of converting between units."]
18102#[derive(
18103 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
18104)]
18105pub struct UnitAngleConversion {
18106 #[doc = "The time and date the API call was completed."]
18107 #[serde(default, skip_serializing_if = "Option::is_none")]
18108 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
18109 #[doc = "The time and date the API call was created."]
18110 pub created_at: chrono::DateTime<chrono::Utc>,
18111 #[doc = "The error the function returned, if any."]
18112 #[serde(default, skip_serializing_if = "Option::is_none")]
18113 pub error: Option<String>,
18114 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
18115 pub id: uuid::Uuid,
18116 #[doc = "The input value."]
18117 #[serde(default, skip_serializing_if = "Option::is_none")]
18118 pub input: Option<f64>,
18119 #[doc = "The source format of the unit conversion."]
18120 pub input_unit: UnitAngle,
18121 #[doc = "The resulting value."]
18122 #[serde(default, skip_serializing_if = "Option::is_none")]
18123 pub output: Option<f64>,
18124 #[doc = "The output format of the unit conversion."]
18125 pub output_unit: UnitAngle,
18126 #[doc = "The time and date the API call was started."]
18127 #[serde(default, skip_serializing_if = "Option::is_none")]
18128 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
18129 #[doc = "The status of the API call."]
18130 pub status: ApiCallStatus,
18131 #[doc = "The time and date the API call was last updated."]
18132 pub updated_at: chrono::DateTime<chrono::Utc>,
18133 #[doc = "The user ID of the user who created the API call."]
18134 pub user_id: uuid::Uuid,
18135}
18136
18137impl std::fmt::Display for UnitAngleConversion {
18138 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
18139 write!(
18140 f,
18141 "{}",
18142 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
18143 )
18144 }
18145}
18146
18147#[cfg(feature = "tabled")]
18148impl tabled::Tabled for UnitAngleConversion {
18149 const LENGTH: usize = 12;
18150 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
18151 vec![
18152 if let Some(completed_at) = &self.completed_at {
18153 format!("{:?}", completed_at).into()
18154 } else {
18155 String::new().into()
18156 },
18157 format!("{:?}", self.created_at).into(),
18158 if let Some(error) = &self.error {
18159 format!("{:?}", error).into()
18160 } else {
18161 String::new().into()
18162 },
18163 format!("{:?}", self.id).into(),
18164 if let Some(input) = &self.input {
18165 format!("{:?}", input).into()
18166 } else {
18167 String::new().into()
18168 },
18169 format!("{:?}", self.input_unit).into(),
18170 if let Some(output) = &self.output {
18171 format!("{:?}", output).into()
18172 } else {
18173 String::new().into()
18174 },
18175 format!("{:?}", self.output_unit).into(),
18176 if let Some(started_at) = &self.started_at {
18177 format!("{:?}", started_at).into()
18178 } else {
18179 String::new().into()
18180 },
18181 format!("{:?}", self.status).into(),
18182 format!("{:?}", self.updated_at).into(),
18183 format!("{:?}", self.user_id).into(),
18184 ]
18185 }
18186
18187 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
18188 vec![
18189 "completed_at".into(),
18190 "created_at".into(),
18191 "error".into(),
18192 "id".into(),
18193 "input".into(),
18194 "input_unit".into(),
18195 "output".into(),
18196 "output_unit".into(),
18197 "started_at".into(),
18198 "status".into(),
18199 "updated_at".into(),
18200 "user_id".into(),
18201 ]
18202 }
18203}
18204
18205#[doc = "The valid types of area units."]
18206#[derive(
18207 serde :: Serialize,
18208 serde :: Deserialize,
18209 PartialEq,
18210 Hash,
18211 Debug,
18212 Clone,
18213 schemars :: JsonSchema,
18214 parse_display :: FromStr,
18215 parse_display :: Display,
18216)]
18217#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
18218#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
18219pub enum UnitArea {
18220 #[doc = "Square centimeters <https://en.wikipedia.org/wiki/Square_centimeter>"]
18221 #[serde(rename = "cm2")]
18222 #[display("cm2")]
18223 Cm2,
18224 #[doc = "Square decimeters <https://en.wikipedia.org/wiki/Square_decimeter>"]
18225 #[serde(rename = "dm2")]
18226 #[display("dm2")]
18227 Dm2,
18228 #[doc = "Square feet <https://en.wikipedia.org/wiki/Square_foot>"]
18229 #[serde(rename = "ft2")]
18230 #[display("ft2")]
18231 Ft2,
18232 #[doc = "Square inches <https://en.wikipedia.org/wiki/Square_inch>"]
18233 #[serde(rename = "in2")]
18234 #[display("in2")]
18235 In2,
18236 #[doc = "Square kilometers <https://en.wikipedia.org/wiki/Square_kilometer>"]
18237 #[serde(rename = "km2")]
18238 #[display("km2")]
18239 Km2,
18240 #[doc = "Square meters <https://en.wikipedia.org/wiki/Square_meter>"]
18241 #[serde(rename = "m2")]
18242 #[display("m2")]
18243 M2,
18244 #[doc = "Square millimeters <https://en.wikipedia.org/wiki/Square_millimeter>"]
18245 #[serde(rename = "mm2")]
18246 #[display("mm2")]
18247 Mm2,
18248 #[doc = "Square yards <https://en.wikipedia.org/wiki/Square_mile>"]
18249 #[serde(rename = "yd2")]
18250 #[display("yd2")]
18251 Yd2,
18252}
18253
18254#[doc = "Result of converting between units."]
18255#[derive(
18256 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
18257)]
18258pub struct UnitAreaConversion {
18259 #[doc = "The time and date the API call was completed."]
18260 #[serde(default, skip_serializing_if = "Option::is_none")]
18261 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
18262 #[doc = "The time and date the API call was created."]
18263 pub created_at: chrono::DateTime<chrono::Utc>,
18264 #[doc = "The error the function returned, if any."]
18265 #[serde(default, skip_serializing_if = "Option::is_none")]
18266 pub error: Option<String>,
18267 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
18268 pub id: uuid::Uuid,
18269 #[doc = "The input value."]
18270 #[serde(default, skip_serializing_if = "Option::is_none")]
18271 pub input: Option<f64>,
18272 #[doc = "The source format of the unit conversion."]
18273 pub input_unit: UnitArea,
18274 #[doc = "The resulting value."]
18275 #[serde(default, skip_serializing_if = "Option::is_none")]
18276 pub output: Option<f64>,
18277 #[doc = "The output format of the unit conversion."]
18278 pub output_unit: UnitArea,
18279 #[doc = "The time and date the API call was started."]
18280 #[serde(default, skip_serializing_if = "Option::is_none")]
18281 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
18282 #[doc = "The status of the API call."]
18283 pub status: ApiCallStatus,
18284 #[doc = "The time and date the API call was last updated."]
18285 pub updated_at: chrono::DateTime<chrono::Utc>,
18286 #[doc = "The user ID of the user who created the API call."]
18287 pub user_id: uuid::Uuid,
18288}
18289
18290impl std::fmt::Display for UnitAreaConversion {
18291 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
18292 write!(
18293 f,
18294 "{}",
18295 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
18296 )
18297 }
18298}
18299
18300#[cfg(feature = "tabled")]
18301impl tabled::Tabled for UnitAreaConversion {
18302 const LENGTH: usize = 12;
18303 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
18304 vec![
18305 if let Some(completed_at) = &self.completed_at {
18306 format!("{:?}", completed_at).into()
18307 } else {
18308 String::new().into()
18309 },
18310 format!("{:?}", self.created_at).into(),
18311 if let Some(error) = &self.error {
18312 format!("{:?}", error).into()
18313 } else {
18314 String::new().into()
18315 },
18316 format!("{:?}", self.id).into(),
18317 if let Some(input) = &self.input {
18318 format!("{:?}", input).into()
18319 } else {
18320 String::new().into()
18321 },
18322 format!("{:?}", self.input_unit).into(),
18323 if let Some(output) = &self.output {
18324 format!("{:?}", output).into()
18325 } else {
18326 String::new().into()
18327 },
18328 format!("{:?}", self.output_unit).into(),
18329 if let Some(started_at) = &self.started_at {
18330 format!("{:?}", started_at).into()
18331 } else {
18332 String::new().into()
18333 },
18334 format!("{:?}", self.status).into(),
18335 format!("{:?}", self.updated_at).into(),
18336 format!("{:?}", self.user_id).into(),
18337 ]
18338 }
18339
18340 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
18341 vec![
18342 "completed_at".into(),
18343 "created_at".into(),
18344 "error".into(),
18345 "id".into(),
18346 "input".into(),
18347 "input_unit".into(),
18348 "output".into(),
18349 "output_unit".into(),
18350 "started_at".into(),
18351 "status".into(),
18352 "updated_at".into(),
18353 "user_id".into(),
18354 ]
18355 }
18356}
18357
18358#[doc = "The valid types of current units."]
18359#[derive(
18360 serde :: Serialize,
18361 serde :: Deserialize,
18362 PartialEq,
18363 Hash,
18364 Debug,
18365 Clone,
18366 schemars :: JsonSchema,
18367 parse_display :: FromStr,
18368 parse_display :: Display,
18369)]
18370#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
18371#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
18372pub enum UnitCurrent {
18373 #[doc = "Amperes <https://en.wikipedia.org/wiki/Ampere>"]
18374 #[serde(rename = "amperes")]
18375 #[display("amperes")]
18376 Amperes,
18377 #[doc = "Microamperes <https://en.wikipedia.org/wiki/Microampere>"]
18378 #[serde(rename = "microamperes")]
18379 #[display("microamperes")]
18380 Microamperes,
18381 #[doc = "Milliamperes <https://en.wikipedia.org/wiki/Milliampere>"]
18382 #[serde(rename = "milliamperes")]
18383 #[display("milliamperes")]
18384 Milliamperes,
18385 #[doc = "Nanoamperes <https://en.wikipedia.org/wiki/Nanoampere>"]
18386 #[serde(rename = "nanoamperes")]
18387 #[display("nanoamperes")]
18388 Nanoamperes,
18389}
18390
18391#[doc = "Result of converting between units."]
18392#[derive(
18393 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
18394)]
18395pub struct UnitCurrentConversion {
18396 #[doc = "The time and date the API call was completed."]
18397 #[serde(default, skip_serializing_if = "Option::is_none")]
18398 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
18399 #[doc = "The time and date the API call was created."]
18400 pub created_at: chrono::DateTime<chrono::Utc>,
18401 #[doc = "The error the function returned, if any."]
18402 #[serde(default, skip_serializing_if = "Option::is_none")]
18403 pub error: Option<String>,
18404 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
18405 pub id: uuid::Uuid,
18406 #[doc = "The input value."]
18407 #[serde(default, skip_serializing_if = "Option::is_none")]
18408 pub input: Option<f64>,
18409 #[doc = "The source format of the unit conversion."]
18410 pub input_unit: UnitCurrent,
18411 #[doc = "The resulting value."]
18412 #[serde(default, skip_serializing_if = "Option::is_none")]
18413 pub output: Option<f64>,
18414 #[doc = "The output format of the unit conversion."]
18415 pub output_unit: UnitCurrent,
18416 #[doc = "The time and date the API call was started."]
18417 #[serde(default, skip_serializing_if = "Option::is_none")]
18418 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
18419 #[doc = "The status of the API call."]
18420 pub status: ApiCallStatus,
18421 #[doc = "The time and date the API call was last updated."]
18422 pub updated_at: chrono::DateTime<chrono::Utc>,
18423 #[doc = "The user ID of the user who created the API call."]
18424 pub user_id: uuid::Uuid,
18425}
18426
18427impl std::fmt::Display for UnitCurrentConversion {
18428 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
18429 write!(
18430 f,
18431 "{}",
18432 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
18433 )
18434 }
18435}
18436
18437#[cfg(feature = "tabled")]
18438impl tabled::Tabled for UnitCurrentConversion {
18439 const LENGTH: usize = 12;
18440 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
18441 vec![
18442 if let Some(completed_at) = &self.completed_at {
18443 format!("{:?}", completed_at).into()
18444 } else {
18445 String::new().into()
18446 },
18447 format!("{:?}", self.created_at).into(),
18448 if let Some(error) = &self.error {
18449 format!("{:?}", error).into()
18450 } else {
18451 String::new().into()
18452 },
18453 format!("{:?}", self.id).into(),
18454 if let Some(input) = &self.input {
18455 format!("{:?}", input).into()
18456 } else {
18457 String::new().into()
18458 },
18459 format!("{:?}", self.input_unit).into(),
18460 if let Some(output) = &self.output {
18461 format!("{:?}", output).into()
18462 } else {
18463 String::new().into()
18464 },
18465 format!("{:?}", self.output_unit).into(),
18466 if let Some(started_at) = &self.started_at {
18467 format!("{:?}", started_at).into()
18468 } else {
18469 String::new().into()
18470 },
18471 format!("{:?}", self.status).into(),
18472 format!("{:?}", self.updated_at).into(),
18473 format!("{:?}", self.user_id).into(),
18474 ]
18475 }
18476
18477 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
18478 vec![
18479 "completed_at".into(),
18480 "created_at".into(),
18481 "error".into(),
18482 "id".into(),
18483 "input".into(),
18484 "input_unit".into(),
18485 "output".into(),
18486 "output_unit".into(),
18487 "started_at".into(),
18488 "status".into(),
18489 "updated_at".into(),
18490 "user_id".into(),
18491 ]
18492 }
18493}
18494
18495#[doc = "The valid types for density units."]
18496#[derive(
18497 serde :: Serialize,
18498 serde :: Deserialize,
18499 PartialEq,
18500 Hash,
18501 Debug,
18502 Clone,
18503 schemars :: JsonSchema,
18504 parse_display :: FromStr,
18505 parse_display :: Display,
18506)]
18507#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
18508#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
18509pub enum UnitDensity {
18510 #[doc = "Pounds per cubic feet."]
18511 #[serde(rename = "lb:ft3")]
18512 #[display("lb:ft3")]
18513 LbFt3,
18514 #[doc = "Kilograms per cubic meter."]
18515 #[serde(rename = "kg:m3")]
18516 #[display("kg:m3")]
18517 KgM3,
18518}
18519
18520#[doc = "The valid types of energy units."]
18521#[derive(
18522 serde :: Serialize,
18523 serde :: Deserialize,
18524 PartialEq,
18525 Hash,
18526 Debug,
18527 Clone,
18528 schemars :: JsonSchema,
18529 parse_display :: FromStr,
18530 parse_display :: Display,
18531)]
18532#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
18533#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
18534pub enum UnitEnergy {
18535 #[doc = "British Thermal Unit (BTU) <https://en.wikipedia.org/wiki/British_thermal_unit>"]
18536 #[serde(rename = "btu")]
18537 #[display("btu")]
18538 Btu,
18539 #[doc = "Electron Volts (eV) <https://en.wikipedia.org/wiki/Electronvolt>"]
18540 #[serde(rename = "electronvolts")]
18541 #[display("electronvolts")]
18542 Electronvolts,
18543 #[doc = "Joules (or watt-seconds) <https://en.wikipedia.org/wiki/Joule>"]
18544 #[serde(rename = "joules")]
18545 #[display("joules")]
18546 Joules,
18547 #[doc = "Kilocalories (often just called calories) <https://en.wikipedia.org/wiki/Kilocalorie>"]
18548 #[serde(rename = "kilocalories")]
18549 #[display("kilocalories")]
18550 Kilocalories,
18551 #[doc = "Kilowatt hours (kWh) <https://en.wikipedia.org/wiki/Kilowatt-hour>"]
18552 #[serde(rename = "kilowatt_hours")]
18553 #[display("kilowatt_hours")]
18554 KilowattHours,
18555 #[doc = "Watt hours (Wh) <https://en.wikipedia.org/wiki/Kilowatt-hour>"]
18556 #[serde(rename = "watt_hours")]
18557 #[display("watt_hours")]
18558 WattHours,
18559}
18560
18561#[doc = "Result of converting between units."]
18562#[derive(
18563 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
18564)]
18565pub struct UnitEnergyConversion {
18566 #[doc = "The time and date the API call was completed."]
18567 #[serde(default, skip_serializing_if = "Option::is_none")]
18568 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
18569 #[doc = "The time and date the API call was created."]
18570 pub created_at: chrono::DateTime<chrono::Utc>,
18571 #[doc = "The error the function returned, if any."]
18572 #[serde(default, skip_serializing_if = "Option::is_none")]
18573 pub error: Option<String>,
18574 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
18575 pub id: uuid::Uuid,
18576 #[doc = "The input value."]
18577 #[serde(default, skip_serializing_if = "Option::is_none")]
18578 pub input: Option<f64>,
18579 #[doc = "The source format of the unit conversion."]
18580 pub input_unit: UnitEnergy,
18581 #[doc = "The resulting value."]
18582 #[serde(default, skip_serializing_if = "Option::is_none")]
18583 pub output: Option<f64>,
18584 #[doc = "The output format of the unit conversion."]
18585 pub output_unit: UnitEnergy,
18586 #[doc = "The time and date the API call was started."]
18587 #[serde(default, skip_serializing_if = "Option::is_none")]
18588 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
18589 #[doc = "The status of the API call."]
18590 pub status: ApiCallStatus,
18591 #[doc = "The time and date the API call was last updated."]
18592 pub updated_at: chrono::DateTime<chrono::Utc>,
18593 #[doc = "The user ID of the user who created the API call."]
18594 pub user_id: uuid::Uuid,
18595}
18596
18597impl std::fmt::Display for UnitEnergyConversion {
18598 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
18599 write!(
18600 f,
18601 "{}",
18602 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
18603 )
18604 }
18605}
18606
18607#[cfg(feature = "tabled")]
18608impl tabled::Tabled for UnitEnergyConversion {
18609 const LENGTH: usize = 12;
18610 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
18611 vec![
18612 if let Some(completed_at) = &self.completed_at {
18613 format!("{:?}", completed_at).into()
18614 } else {
18615 String::new().into()
18616 },
18617 format!("{:?}", self.created_at).into(),
18618 if let Some(error) = &self.error {
18619 format!("{:?}", error).into()
18620 } else {
18621 String::new().into()
18622 },
18623 format!("{:?}", self.id).into(),
18624 if let Some(input) = &self.input {
18625 format!("{:?}", input).into()
18626 } else {
18627 String::new().into()
18628 },
18629 format!("{:?}", self.input_unit).into(),
18630 if let Some(output) = &self.output {
18631 format!("{:?}", output).into()
18632 } else {
18633 String::new().into()
18634 },
18635 format!("{:?}", self.output_unit).into(),
18636 if let Some(started_at) = &self.started_at {
18637 format!("{:?}", started_at).into()
18638 } else {
18639 String::new().into()
18640 },
18641 format!("{:?}", self.status).into(),
18642 format!("{:?}", self.updated_at).into(),
18643 format!("{:?}", self.user_id).into(),
18644 ]
18645 }
18646
18647 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
18648 vec![
18649 "completed_at".into(),
18650 "created_at".into(),
18651 "error".into(),
18652 "id".into(),
18653 "input".into(),
18654 "input_unit".into(),
18655 "output".into(),
18656 "output_unit".into(),
18657 "started_at".into(),
18658 "status".into(),
18659 "updated_at".into(),
18660 "user_id".into(),
18661 ]
18662 }
18663}
18664
18665#[doc = "The valid types of force units."]
18666#[derive(
18667 serde :: Serialize,
18668 serde :: Deserialize,
18669 PartialEq,
18670 Hash,
18671 Debug,
18672 Clone,
18673 schemars :: JsonSchema,
18674 parse_display :: FromStr,
18675 parse_display :: Display,
18676)]
18677#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
18678#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
18679pub enum UnitForce {
18680 #[doc = "Dynes <https://en.wikipedia.org/wiki/Dyne>"]
18681 #[serde(rename = "dynes")]
18682 #[display("dynes")]
18683 Dynes,
18684 #[doc = "Kiloponds <https://en.wikipedia.org/wiki/Kilopond>"]
18685 #[serde(rename = "kiloponds")]
18686 #[display("kiloponds")]
18687 Kiloponds,
18688 #[doc = "Micronewtons <https://en.wikipedia.org/wiki/Newton_(unit)>"]
18689 #[serde(rename = "micronewtons")]
18690 #[display("micronewtons")]
18691 Micronewtons,
18692 #[doc = "Millinewtons <https://en.wikipedia.org/wiki/Newton_(unit)>"]
18693 #[serde(rename = "millinewtons")]
18694 #[display("millinewtons")]
18695 Millinewtons,
18696 #[doc = "Newtons <https://en.wikipedia.org/wiki/Newton_(unit)>"]
18697 #[serde(rename = "newtons")]
18698 #[display("newtons")]
18699 Newtons,
18700 #[doc = "Poundals <https://en.wikipedia.org/wiki/Poundal>"]
18701 #[serde(rename = "poundals")]
18702 #[display("poundals")]
18703 Poundals,
18704 #[doc = "Pounds <https://en.wikipedia.org/wiki/Pound_(force)>"]
18705 #[serde(rename = "pounds")]
18706 #[display("pounds")]
18707 Pounds,
18708}
18709
18710#[doc = "Result of converting between units."]
18711#[derive(
18712 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
18713)]
18714pub struct UnitForceConversion {
18715 #[doc = "The time and date the API call was completed."]
18716 #[serde(default, skip_serializing_if = "Option::is_none")]
18717 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
18718 #[doc = "The time and date the API call was created."]
18719 pub created_at: chrono::DateTime<chrono::Utc>,
18720 #[doc = "The error the function returned, if any."]
18721 #[serde(default, skip_serializing_if = "Option::is_none")]
18722 pub error: Option<String>,
18723 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
18724 pub id: uuid::Uuid,
18725 #[doc = "The input value."]
18726 #[serde(default, skip_serializing_if = "Option::is_none")]
18727 pub input: Option<f64>,
18728 #[doc = "The source format of the unit conversion."]
18729 pub input_unit: UnitForce,
18730 #[doc = "The resulting value."]
18731 #[serde(default, skip_serializing_if = "Option::is_none")]
18732 pub output: Option<f64>,
18733 #[doc = "The output format of the unit conversion."]
18734 pub output_unit: UnitForce,
18735 #[doc = "The time and date the API call was started."]
18736 #[serde(default, skip_serializing_if = "Option::is_none")]
18737 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
18738 #[doc = "The status of the API call."]
18739 pub status: ApiCallStatus,
18740 #[doc = "The time and date the API call was last updated."]
18741 pub updated_at: chrono::DateTime<chrono::Utc>,
18742 #[doc = "The user ID of the user who created the API call."]
18743 pub user_id: uuid::Uuid,
18744}
18745
18746impl std::fmt::Display for UnitForceConversion {
18747 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
18748 write!(
18749 f,
18750 "{}",
18751 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
18752 )
18753 }
18754}
18755
18756#[cfg(feature = "tabled")]
18757impl tabled::Tabled for UnitForceConversion {
18758 const LENGTH: usize = 12;
18759 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
18760 vec![
18761 if let Some(completed_at) = &self.completed_at {
18762 format!("{:?}", completed_at).into()
18763 } else {
18764 String::new().into()
18765 },
18766 format!("{:?}", self.created_at).into(),
18767 if let Some(error) = &self.error {
18768 format!("{:?}", error).into()
18769 } else {
18770 String::new().into()
18771 },
18772 format!("{:?}", self.id).into(),
18773 if let Some(input) = &self.input {
18774 format!("{:?}", input).into()
18775 } else {
18776 String::new().into()
18777 },
18778 format!("{:?}", self.input_unit).into(),
18779 if let Some(output) = &self.output {
18780 format!("{:?}", output).into()
18781 } else {
18782 String::new().into()
18783 },
18784 format!("{:?}", self.output_unit).into(),
18785 if let Some(started_at) = &self.started_at {
18786 format!("{:?}", started_at).into()
18787 } else {
18788 String::new().into()
18789 },
18790 format!("{:?}", self.status).into(),
18791 format!("{:?}", self.updated_at).into(),
18792 format!("{:?}", self.user_id).into(),
18793 ]
18794 }
18795
18796 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
18797 vec![
18798 "completed_at".into(),
18799 "created_at".into(),
18800 "error".into(),
18801 "id".into(),
18802 "input".into(),
18803 "input_unit".into(),
18804 "output".into(),
18805 "output_unit".into(),
18806 "started_at".into(),
18807 "status".into(),
18808 "updated_at".into(),
18809 "user_id".into(),
18810 ]
18811 }
18812}
18813
18814#[doc = "The valid types of frequency units."]
18815#[derive(
18816 serde :: Serialize,
18817 serde :: Deserialize,
18818 PartialEq,
18819 Hash,
18820 Debug,
18821 Clone,
18822 schemars :: JsonSchema,
18823 parse_display :: FromStr,
18824 parse_display :: Display,
18825)]
18826#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
18827#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
18828pub enum UnitFrequency {
18829 #[doc = "Gigahertz <https://en.wikipedia.org/wiki/Hertz>"]
18830 #[serde(rename = "gigahertz")]
18831 #[display("gigahertz")]
18832 Gigahertz,
18833 #[doc = "Hertz <https://en.wikipedia.org/wiki/Hertz>"]
18834 #[serde(rename = "hertz")]
18835 #[display("hertz")]
18836 Hertz,
18837 #[doc = "Kilohertz <https://en.wikipedia.org/wiki/Hertz>"]
18838 #[serde(rename = "kilohertz")]
18839 #[display("kilohertz")]
18840 Kilohertz,
18841 #[doc = "Megahertz <https://en.wikipedia.org/wiki/Hertz>"]
18842 #[serde(rename = "megahertz")]
18843 #[display("megahertz")]
18844 Megahertz,
18845 #[doc = "Microhertz <https://en.wikipedia.org/wiki/Hertz>"]
18846 #[serde(rename = "microhertz")]
18847 #[display("microhertz")]
18848 Microhertz,
18849 #[doc = "Millihertz <https://en.wikipedia.org/wiki/Hertz>"]
18850 #[serde(rename = "millihertz")]
18851 #[display("millihertz")]
18852 Millihertz,
18853 #[doc = "Nanohertz <https://en.wikipedia.org/wiki/Hertz>"]
18854 #[serde(rename = "nanohertz")]
18855 #[display("nanohertz")]
18856 Nanohertz,
18857 #[doc = "Terahertz <https://en.wikipedia.org/wiki/Hertz>"]
18858 #[serde(rename = "terahertz")]
18859 #[display("terahertz")]
18860 Terahertz,
18861}
18862
18863#[doc = "Result of converting between units."]
18864#[derive(
18865 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
18866)]
18867pub struct UnitFrequencyConversion {
18868 #[doc = "The time and date the API call was completed."]
18869 #[serde(default, skip_serializing_if = "Option::is_none")]
18870 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
18871 #[doc = "The time and date the API call was created."]
18872 pub created_at: chrono::DateTime<chrono::Utc>,
18873 #[doc = "The error the function returned, if any."]
18874 #[serde(default, skip_serializing_if = "Option::is_none")]
18875 pub error: Option<String>,
18876 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
18877 pub id: uuid::Uuid,
18878 #[doc = "The input value."]
18879 #[serde(default, skip_serializing_if = "Option::is_none")]
18880 pub input: Option<f64>,
18881 #[doc = "The source format of the unit conversion."]
18882 pub input_unit: UnitFrequency,
18883 #[doc = "The resulting value."]
18884 #[serde(default, skip_serializing_if = "Option::is_none")]
18885 pub output: Option<f64>,
18886 #[doc = "The output format of the unit conversion."]
18887 pub output_unit: UnitFrequency,
18888 #[doc = "The time and date the API call was started."]
18889 #[serde(default, skip_serializing_if = "Option::is_none")]
18890 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
18891 #[doc = "The status of the API call."]
18892 pub status: ApiCallStatus,
18893 #[doc = "The time and date the API call was last updated."]
18894 pub updated_at: chrono::DateTime<chrono::Utc>,
18895 #[doc = "The user ID of the user who created the API call."]
18896 pub user_id: uuid::Uuid,
18897}
18898
18899impl std::fmt::Display for UnitFrequencyConversion {
18900 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
18901 write!(
18902 f,
18903 "{}",
18904 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
18905 )
18906 }
18907}
18908
18909#[cfg(feature = "tabled")]
18910impl tabled::Tabled for UnitFrequencyConversion {
18911 const LENGTH: usize = 12;
18912 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
18913 vec![
18914 if let Some(completed_at) = &self.completed_at {
18915 format!("{:?}", completed_at).into()
18916 } else {
18917 String::new().into()
18918 },
18919 format!("{:?}", self.created_at).into(),
18920 if let Some(error) = &self.error {
18921 format!("{:?}", error).into()
18922 } else {
18923 String::new().into()
18924 },
18925 format!("{:?}", self.id).into(),
18926 if let Some(input) = &self.input {
18927 format!("{:?}", input).into()
18928 } else {
18929 String::new().into()
18930 },
18931 format!("{:?}", self.input_unit).into(),
18932 if let Some(output) = &self.output {
18933 format!("{:?}", output).into()
18934 } else {
18935 String::new().into()
18936 },
18937 format!("{:?}", self.output_unit).into(),
18938 if let Some(started_at) = &self.started_at {
18939 format!("{:?}", started_at).into()
18940 } else {
18941 String::new().into()
18942 },
18943 format!("{:?}", self.status).into(),
18944 format!("{:?}", self.updated_at).into(),
18945 format!("{:?}", self.user_id).into(),
18946 ]
18947 }
18948
18949 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
18950 vec![
18951 "completed_at".into(),
18952 "created_at".into(),
18953 "error".into(),
18954 "id".into(),
18955 "input".into(),
18956 "input_unit".into(),
18957 "output".into(),
18958 "output_unit".into(),
18959 "started_at".into(),
18960 "status".into(),
18961 "updated_at".into(),
18962 "user_id".into(),
18963 ]
18964 }
18965}
18966
18967#[doc = "The valid types of length units."]
18968#[derive(
18969 serde :: Serialize,
18970 serde :: Deserialize,
18971 PartialEq,
18972 Hash,
18973 Debug,
18974 Clone,
18975 schemars :: JsonSchema,
18976 parse_display :: FromStr,
18977 parse_display :: Display,
18978)]
18979#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
18980#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
18981pub enum UnitLength {
18982 #[doc = "Centimeters <https://en.wikipedia.org/wiki/Centimeter>"]
18983 #[serde(rename = "cm")]
18984 #[display("cm")]
18985 Cm,
18986 #[doc = "Feet <https://en.wikipedia.org/wiki/Foot_(unit)>"]
18987 #[serde(rename = "ft")]
18988 #[display("ft")]
18989 Ft,
18990 #[doc = "Inches <https://en.wikipedia.org/wiki/Inch>"]
18991 #[serde(rename = "in")]
18992 #[display("in")]
18993 In,
18994 #[doc = "Meters <https://en.wikipedia.org/wiki/Meter>"]
18995 #[serde(rename = "m")]
18996 #[display("m")]
18997 M,
18998 #[doc = "Millimeters <https://en.wikipedia.org/wiki/Millimeter>"]
18999 #[serde(rename = "mm")]
19000 #[display("mm")]
19001 Mm,
19002 #[doc = "Yards <https://en.wikipedia.org/wiki/Yard>"]
19003 #[serde(rename = "yd")]
19004 #[display("yd")]
19005 Yd,
19006}
19007
19008#[doc = "Result of converting between units."]
19009#[derive(
19010 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
19011)]
19012pub struct UnitLengthConversion {
19013 #[doc = "The time and date the API call was completed."]
19014 #[serde(default, skip_serializing_if = "Option::is_none")]
19015 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
19016 #[doc = "The time and date the API call was created."]
19017 pub created_at: chrono::DateTime<chrono::Utc>,
19018 #[doc = "The error the function returned, if any."]
19019 #[serde(default, skip_serializing_if = "Option::is_none")]
19020 pub error: Option<String>,
19021 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
19022 pub id: uuid::Uuid,
19023 #[doc = "The input value."]
19024 #[serde(default, skip_serializing_if = "Option::is_none")]
19025 pub input: Option<f64>,
19026 #[doc = "The source format of the unit conversion."]
19027 pub input_unit: UnitLength,
19028 #[doc = "The resulting value."]
19029 #[serde(default, skip_serializing_if = "Option::is_none")]
19030 pub output: Option<f64>,
19031 #[doc = "The output format of the unit conversion."]
19032 pub output_unit: UnitLength,
19033 #[doc = "The time and date the API call was started."]
19034 #[serde(default, skip_serializing_if = "Option::is_none")]
19035 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
19036 #[doc = "The status of the API call."]
19037 pub status: ApiCallStatus,
19038 #[doc = "The time and date the API call was last updated."]
19039 pub updated_at: chrono::DateTime<chrono::Utc>,
19040 #[doc = "The user ID of the user who created the API call."]
19041 pub user_id: uuid::Uuid,
19042}
19043
19044impl std::fmt::Display for UnitLengthConversion {
19045 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
19046 write!(
19047 f,
19048 "{}",
19049 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
19050 )
19051 }
19052}
19053
19054#[cfg(feature = "tabled")]
19055impl tabled::Tabled for UnitLengthConversion {
19056 const LENGTH: usize = 12;
19057 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
19058 vec![
19059 if let Some(completed_at) = &self.completed_at {
19060 format!("{:?}", completed_at).into()
19061 } else {
19062 String::new().into()
19063 },
19064 format!("{:?}", self.created_at).into(),
19065 if let Some(error) = &self.error {
19066 format!("{:?}", error).into()
19067 } else {
19068 String::new().into()
19069 },
19070 format!("{:?}", self.id).into(),
19071 if let Some(input) = &self.input {
19072 format!("{:?}", input).into()
19073 } else {
19074 String::new().into()
19075 },
19076 format!("{:?}", self.input_unit).into(),
19077 if let Some(output) = &self.output {
19078 format!("{:?}", output).into()
19079 } else {
19080 String::new().into()
19081 },
19082 format!("{:?}", self.output_unit).into(),
19083 if let Some(started_at) = &self.started_at {
19084 format!("{:?}", started_at).into()
19085 } else {
19086 String::new().into()
19087 },
19088 format!("{:?}", self.status).into(),
19089 format!("{:?}", self.updated_at).into(),
19090 format!("{:?}", self.user_id).into(),
19091 ]
19092 }
19093
19094 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
19095 vec![
19096 "completed_at".into(),
19097 "created_at".into(),
19098 "error".into(),
19099 "id".into(),
19100 "input".into(),
19101 "input_unit".into(),
19102 "output".into(),
19103 "output_unit".into(),
19104 "started_at".into(),
19105 "status".into(),
19106 "updated_at".into(),
19107 "user_id".into(),
19108 ]
19109 }
19110}
19111
19112#[doc = "The valid types of mass units."]
19113#[derive(
19114 serde :: Serialize,
19115 serde :: Deserialize,
19116 PartialEq,
19117 Hash,
19118 Debug,
19119 Clone,
19120 schemars :: JsonSchema,
19121 parse_display :: FromStr,
19122 parse_display :: Display,
19123)]
19124#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
19125#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
19126pub enum UnitMass {
19127 #[doc = "Grams <https://en.wikipedia.org/wiki/Gram>"]
19128 #[serde(rename = "g")]
19129 #[display("g")]
19130 G,
19131 #[doc = "Kilograms <https://en.wikipedia.org/wiki/Kilogram>"]
19132 #[serde(rename = "kg")]
19133 #[display("kg")]
19134 Kg,
19135 #[doc = "Pounds <https://en.wikipedia.org/wiki/Pound_(mass)>"]
19136 #[serde(rename = "lb")]
19137 #[display("lb")]
19138 Lb,
19139}
19140
19141#[doc = "Result of converting between units."]
19142#[derive(
19143 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
19144)]
19145pub struct UnitMassConversion {
19146 #[doc = "The time and date the API call was completed."]
19147 #[serde(default, skip_serializing_if = "Option::is_none")]
19148 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
19149 #[doc = "The time and date the API call was created."]
19150 pub created_at: chrono::DateTime<chrono::Utc>,
19151 #[doc = "The error the function returned, if any."]
19152 #[serde(default, skip_serializing_if = "Option::is_none")]
19153 pub error: Option<String>,
19154 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
19155 pub id: uuid::Uuid,
19156 #[doc = "The input value."]
19157 #[serde(default, skip_serializing_if = "Option::is_none")]
19158 pub input: Option<f64>,
19159 #[doc = "The source format of the unit conversion."]
19160 pub input_unit: UnitMass,
19161 #[doc = "The resulting value."]
19162 #[serde(default, skip_serializing_if = "Option::is_none")]
19163 pub output: Option<f64>,
19164 #[doc = "The output format of the unit conversion."]
19165 pub output_unit: UnitMass,
19166 #[doc = "The time and date the API call was started."]
19167 #[serde(default, skip_serializing_if = "Option::is_none")]
19168 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
19169 #[doc = "The status of the API call."]
19170 pub status: ApiCallStatus,
19171 #[doc = "The time and date the API call was last updated."]
19172 pub updated_at: chrono::DateTime<chrono::Utc>,
19173 #[doc = "The user ID of the user who created the API call."]
19174 pub user_id: uuid::Uuid,
19175}
19176
19177impl std::fmt::Display for UnitMassConversion {
19178 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
19179 write!(
19180 f,
19181 "{}",
19182 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
19183 )
19184 }
19185}
19186
19187#[cfg(feature = "tabled")]
19188impl tabled::Tabled for UnitMassConversion {
19189 const LENGTH: usize = 12;
19190 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
19191 vec![
19192 if let Some(completed_at) = &self.completed_at {
19193 format!("{:?}", completed_at).into()
19194 } else {
19195 String::new().into()
19196 },
19197 format!("{:?}", self.created_at).into(),
19198 if let Some(error) = &self.error {
19199 format!("{:?}", error).into()
19200 } else {
19201 String::new().into()
19202 },
19203 format!("{:?}", self.id).into(),
19204 if let Some(input) = &self.input {
19205 format!("{:?}", input).into()
19206 } else {
19207 String::new().into()
19208 },
19209 format!("{:?}", self.input_unit).into(),
19210 if let Some(output) = &self.output {
19211 format!("{:?}", output).into()
19212 } else {
19213 String::new().into()
19214 },
19215 format!("{:?}", self.output_unit).into(),
19216 if let Some(started_at) = &self.started_at {
19217 format!("{:?}", started_at).into()
19218 } else {
19219 String::new().into()
19220 },
19221 format!("{:?}", self.status).into(),
19222 format!("{:?}", self.updated_at).into(),
19223 format!("{:?}", self.user_id).into(),
19224 ]
19225 }
19226
19227 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
19228 vec![
19229 "completed_at".into(),
19230 "created_at".into(),
19231 "error".into(),
19232 "id".into(),
19233 "input".into(),
19234 "input_unit".into(),
19235 "output".into(),
19236 "output_unit".into(),
19237 "started_at".into(),
19238 "status".into(),
19239 "updated_at".into(),
19240 "user_id".into(),
19241 ]
19242 }
19243}
19244
19245#[doc = "The valid types of power units."]
19246#[derive(
19247 serde :: Serialize,
19248 serde :: Deserialize,
19249 PartialEq,
19250 Hash,
19251 Debug,
19252 Clone,
19253 schemars :: JsonSchema,
19254 parse_display :: FromStr,
19255 parse_display :: Display,
19256)]
19257#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
19258#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
19259pub enum UnitPower {
19260 #[doc = "British thermal units (BTU) per minute <https://en.wikipedia.org/wiki/British_thermal_unit>"]
19261 #[serde(rename = "btu_per_minute")]
19262 #[display("btu_per_minute")]
19263 BtuPerMinute,
19264 #[doc = "Horsepower (hp) <https://en.wikipedia.org/wiki/Horsepower>"]
19265 #[serde(rename = "horsepower")]
19266 #[display("horsepower")]
19267 Horsepower,
19268 #[doc = "Kilowatts <https://en.wikipedia.org/wiki/Kilowatt>"]
19269 #[serde(rename = "kilowatts")]
19270 #[display("kilowatts")]
19271 Kilowatts,
19272 #[doc = "Metric horsepower (PS) <https://en.wikipedia.org/wiki/Horsepower#Metric_horsepower>"]
19273 #[serde(rename = "metric_horsepower")]
19274 #[display("metric_horsepower")]
19275 MetricHorsepower,
19276 #[doc = "Microwatts <https://en.wikipedia.org/wiki/Microwatt>"]
19277 #[serde(rename = "microwatts")]
19278 #[display("microwatts")]
19279 Microwatts,
19280 #[doc = "Millwatts <https://en.wikipedia.org/wiki/Milliwatt>"]
19281 #[serde(rename = "milliwatts")]
19282 #[display("milliwatts")]
19283 Milliwatts,
19284 #[doc = "Watts <https://en.wikipedia.org/wiki/Watt>"]
19285 #[serde(rename = "watts")]
19286 #[display("watts")]
19287 Watts,
19288}
19289
19290#[doc = "Result of converting between units."]
19291#[derive(
19292 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
19293)]
19294pub struct UnitPowerConversion {
19295 #[doc = "The time and date the API call was completed."]
19296 #[serde(default, skip_serializing_if = "Option::is_none")]
19297 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
19298 #[doc = "The time and date the API call was created."]
19299 pub created_at: chrono::DateTime<chrono::Utc>,
19300 #[doc = "The error the function returned, if any."]
19301 #[serde(default, skip_serializing_if = "Option::is_none")]
19302 pub error: Option<String>,
19303 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
19304 pub id: uuid::Uuid,
19305 #[doc = "The input value."]
19306 #[serde(default, skip_serializing_if = "Option::is_none")]
19307 pub input: Option<f64>,
19308 #[doc = "The source format of the unit conversion."]
19309 pub input_unit: UnitPower,
19310 #[doc = "The resulting value."]
19311 #[serde(default, skip_serializing_if = "Option::is_none")]
19312 pub output: Option<f64>,
19313 #[doc = "The output format of the unit conversion."]
19314 pub output_unit: UnitPower,
19315 #[doc = "The time and date the API call was started."]
19316 #[serde(default, skip_serializing_if = "Option::is_none")]
19317 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
19318 #[doc = "The status of the API call."]
19319 pub status: ApiCallStatus,
19320 #[doc = "The time and date the API call was last updated."]
19321 pub updated_at: chrono::DateTime<chrono::Utc>,
19322 #[doc = "The user ID of the user who created the API call."]
19323 pub user_id: uuid::Uuid,
19324}
19325
19326impl std::fmt::Display for UnitPowerConversion {
19327 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
19328 write!(
19329 f,
19330 "{}",
19331 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
19332 )
19333 }
19334}
19335
19336#[cfg(feature = "tabled")]
19337impl tabled::Tabled for UnitPowerConversion {
19338 const LENGTH: usize = 12;
19339 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
19340 vec![
19341 if let Some(completed_at) = &self.completed_at {
19342 format!("{:?}", completed_at).into()
19343 } else {
19344 String::new().into()
19345 },
19346 format!("{:?}", self.created_at).into(),
19347 if let Some(error) = &self.error {
19348 format!("{:?}", error).into()
19349 } else {
19350 String::new().into()
19351 },
19352 format!("{:?}", self.id).into(),
19353 if let Some(input) = &self.input {
19354 format!("{:?}", input).into()
19355 } else {
19356 String::new().into()
19357 },
19358 format!("{:?}", self.input_unit).into(),
19359 if let Some(output) = &self.output {
19360 format!("{:?}", output).into()
19361 } else {
19362 String::new().into()
19363 },
19364 format!("{:?}", self.output_unit).into(),
19365 if let Some(started_at) = &self.started_at {
19366 format!("{:?}", started_at).into()
19367 } else {
19368 String::new().into()
19369 },
19370 format!("{:?}", self.status).into(),
19371 format!("{:?}", self.updated_at).into(),
19372 format!("{:?}", self.user_id).into(),
19373 ]
19374 }
19375
19376 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
19377 vec![
19378 "completed_at".into(),
19379 "created_at".into(),
19380 "error".into(),
19381 "id".into(),
19382 "input".into(),
19383 "input_unit".into(),
19384 "output".into(),
19385 "output_unit".into(),
19386 "started_at".into(),
19387 "status".into(),
19388 "updated_at".into(),
19389 "user_id".into(),
19390 ]
19391 }
19392}
19393
19394#[doc = "The valid types of pressure units."]
19395#[derive(
19396 serde :: Serialize,
19397 serde :: Deserialize,
19398 PartialEq,
19399 Hash,
19400 Debug,
19401 Clone,
19402 schemars :: JsonSchema,
19403 parse_display :: FromStr,
19404 parse_display :: Display,
19405)]
19406#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
19407#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
19408pub enum UnitPressure {
19409 #[doc = "Atmospheres <https://en.wikipedia.org/wiki/Standard_atmosphere_(unit)>"]
19410 #[serde(rename = "atmospheres")]
19411 #[display("atmospheres")]
19412 Atmospheres,
19413 #[doc = "Bars <https://en.wikipedia.org/wiki/Bar_(unit)>"]
19414 #[serde(rename = "bars")]
19415 #[display("bars")]
19416 Bars,
19417 #[doc = "Hectopascals <https://en.wikipedia.org/wiki/Hectopascal>"]
19418 #[serde(rename = "hectopascals")]
19419 #[display("hectopascals")]
19420 Hectopascals,
19421 #[doc = "Kilopascals <https://en.wikipedia.org/wiki/Kilopascal>"]
19422 #[serde(rename = "kilopascals")]
19423 #[display("kilopascals")]
19424 Kilopascals,
19425 #[doc = "Millibars <https://en.wikipedia.org/wiki/Bar_(unit)>"]
19426 #[serde(rename = "millibars")]
19427 #[display("millibars")]
19428 Millibars,
19429 #[doc = "Pascals <https://en.wikipedia.org/wiki/Pascal_(unit)>"]
19430 #[serde(rename = "pascals")]
19431 #[display("pascals")]
19432 Pascals,
19433 #[doc = "Pounds per square inch (PSI) - <https://en.wikipedia.org/wiki/Pound_per_square_inch>"]
19434 #[serde(rename = "psi")]
19435 #[display("psi")]
19436 Psi,
19437}
19438
19439#[doc = "Result of converting between units."]
19440#[derive(
19441 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
19442)]
19443pub struct UnitPressureConversion {
19444 #[doc = "The time and date the API call was completed."]
19445 #[serde(default, skip_serializing_if = "Option::is_none")]
19446 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
19447 #[doc = "The time and date the API call was created."]
19448 pub created_at: chrono::DateTime<chrono::Utc>,
19449 #[doc = "The error the function returned, if any."]
19450 #[serde(default, skip_serializing_if = "Option::is_none")]
19451 pub error: Option<String>,
19452 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
19453 pub id: uuid::Uuid,
19454 #[doc = "The input value."]
19455 #[serde(default, skip_serializing_if = "Option::is_none")]
19456 pub input: Option<f64>,
19457 #[doc = "The source format of the unit conversion."]
19458 pub input_unit: UnitPressure,
19459 #[doc = "The resulting value."]
19460 #[serde(default, skip_serializing_if = "Option::is_none")]
19461 pub output: Option<f64>,
19462 #[doc = "The output format of the unit conversion."]
19463 pub output_unit: UnitPressure,
19464 #[doc = "The time and date the API call was started."]
19465 #[serde(default, skip_serializing_if = "Option::is_none")]
19466 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
19467 #[doc = "The status of the API call."]
19468 pub status: ApiCallStatus,
19469 #[doc = "The time and date the API call was last updated."]
19470 pub updated_at: chrono::DateTime<chrono::Utc>,
19471 #[doc = "The user ID of the user who created the API call."]
19472 pub user_id: uuid::Uuid,
19473}
19474
19475impl std::fmt::Display for UnitPressureConversion {
19476 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
19477 write!(
19478 f,
19479 "{}",
19480 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
19481 )
19482 }
19483}
19484
19485#[cfg(feature = "tabled")]
19486impl tabled::Tabled for UnitPressureConversion {
19487 const LENGTH: usize = 12;
19488 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
19489 vec![
19490 if let Some(completed_at) = &self.completed_at {
19491 format!("{:?}", completed_at).into()
19492 } else {
19493 String::new().into()
19494 },
19495 format!("{:?}", self.created_at).into(),
19496 if let Some(error) = &self.error {
19497 format!("{:?}", error).into()
19498 } else {
19499 String::new().into()
19500 },
19501 format!("{:?}", self.id).into(),
19502 if let Some(input) = &self.input {
19503 format!("{:?}", input).into()
19504 } else {
19505 String::new().into()
19506 },
19507 format!("{:?}", self.input_unit).into(),
19508 if let Some(output) = &self.output {
19509 format!("{:?}", output).into()
19510 } else {
19511 String::new().into()
19512 },
19513 format!("{:?}", self.output_unit).into(),
19514 if let Some(started_at) = &self.started_at {
19515 format!("{:?}", started_at).into()
19516 } else {
19517 String::new().into()
19518 },
19519 format!("{:?}", self.status).into(),
19520 format!("{:?}", self.updated_at).into(),
19521 format!("{:?}", self.user_id).into(),
19522 ]
19523 }
19524
19525 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
19526 vec![
19527 "completed_at".into(),
19528 "created_at".into(),
19529 "error".into(),
19530 "id".into(),
19531 "input".into(),
19532 "input_unit".into(),
19533 "output".into(),
19534 "output_unit".into(),
19535 "started_at".into(),
19536 "status".into(),
19537 "updated_at".into(),
19538 "user_id".into(),
19539 ]
19540 }
19541}
19542
19543#[doc = "The valid types of temperature units."]
19544#[derive(
19545 serde :: Serialize,
19546 serde :: Deserialize,
19547 PartialEq,
19548 Hash,
19549 Debug,
19550 Clone,
19551 schemars :: JsonSchema,
19552 parse_display :: FromStr,
19553 parse_display :: Display,
19554)]
19555#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
19556#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
19557pub enum UnitTemperature {
19558 #[doc = "Celsius <https://en.wikipedia.org/wiki/Celsius>"]
19559 #[serde(rename = "celsius")]
19560 #[display("celsius")]
19561 Celsius,
19562 #[doc = "Fahrenheit <https://en.wikipedia.org/wiki/Fahrenheit>"]
19563 #[serde(rename = "fahrenheit")]
19564 #[display("fahrenheit")]
19565 Fahrenheit,
19566 #[doc = "Kelvin <https://en.wikipedia.org/wiki/Kelvin>"]
19567 #[serde(rename = "kelvin")]
19568 #[display("kelvin")]
19569 Kelvin,
19570 #[doc = "Rankine <https://en.wikipedia.org/wiki/Rankine_scale>"]
19571 #[serde(rename = "rankine")]
19572 #[display("rankine")]
19573 Rankine,
19574}
19575
19576#[doc = "Result of converting between units."]
19577#[derive(
19578 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
19579)]
19580pub struct UnitTemperatureConversion {
19581 #[doc = "The time and date the API call was completed."]
19582 #[serde(default, skip_serializing_if = "Option::is_none")]
19583 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
19584 #[doc = "The time and date the API call was created."]
19585 pub created_at: chrono::DateTime<chrono::Utc>,
19586 #[doc = "The error the function returned, if any."]
19587 #[serde(default, skip_serializing_if = "Option::is_none")]
19588 pub error: Option<String>,
19589 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
19590 pub id: uuid::Uuid,
19591 #[doc = "The input value."]
19592 #[serde(default, skip_serializing_if = "Option::is_none")]
19593 pub input: Option<f64>,
19594 #[doc = "The source format of the unit conversion."]
19595 pub input_unit: UnitTemperature,
19596 #[doc = "The resulting value."]
19597 #[serde(default, skip_serializing_if = "Option::is_none")]
19598 pub output: Option<f64>,
19599 #[doc = "The output format of the unit conversion."]
19600 pub output_unit: UnitTemperature,
19601 #[doc = "The time and date the API call was started."]
19602 #[serde(default, skip_serializing_if = "Option::is_none")]
19603 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
19604 #[doc = "The status of the API call."]
19605 pub status: ApiCallStatus,
19606 #[doc = "The time and date the API call was last updated."]
19607 pub updated_at: chrono::DateTime<chrono::Utc>,
19608 #[doc = "The user ID of the user who created the API call."]
19609 pub user_id: uuid::Uuid,
19610}
19611
19612impl std::fmt::Display for UnitTemperatureConversion {
19613 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
19614 write!(
19615 f,
19616 "{}",
19617 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
19618 )
19619 }
19620}
19621
19622#[cfg(feature = "tabled")]
19623impl tabled::Tabled for UnitTemperatureConversion {
19624 const LENGTH: usize = 12;
19625 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
19626 vec![
19627 if let Some(completed_at) = &self.completed_at {
19628 format!("{:?}", completed_at).into()
19629 } else {
19630 String::new().into()
19631 },
19632 format!("{:?}", self.created_at).into(),
19633 if let Some(error) = &self.error {
19634 format!("{:?}", error).into()
19635 } else {
19636 String::new().into()
19637 },
19638 format!("{:?}", self.id).into(),
19639 if let Some(input) = &self.input {
19640 format!("{:?}", input).into()
19641 } else {
19642 String::new().into()
19643 },
19644 format!("{:?}", self.input_unit).into(),
19645 if let Some(output) = &self.output {
19646 format!("{:?}", output).into()
19647 } else {
19648 String::new().into()
19649 },
19650 format!("{:?}", self.output_unit).into(),
19651 if let Some(started_at) = &self.started_at {
19652 format!("{:?}", started_at).into()
19653 } else {
19654 String::new().into()
19655 },
19656 format!("{:?}", self.status).into(),
19657 format!("{:?}", self.updated_at).into(),
19658 format!("{:?}", self.user_id).into(),
19659 ]
19660 }
19661
19662 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
19663 vec![
19664 "completed_at".into(),
19665 "created_at".into(),
19666 "error".into(),
19667 "id".into(),
19668 "input".into(),
19669 "input_unit".into(),
19670 "output".into(),
19671 "output_unit".into(),
19672 "started_at".into(),
19673 "status".into(),
19674 "updated_at".into(),
19675 "user_id".into(),
19676 ]
19677 }
19678}
19679
19680#[doc = "The valid types of torque units."]
19681#[derive(
19682 serde :: Serialize,
19683 serde :: Deserialize,
19684 PartialEq,
19685 Hash,
19686 Debug,
19687 Clone,
19688 schemars :: JsonSchema,
19689 parse_display :: FromStr,
19690 parse_display :: Display,
19691)]
19692#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
19693#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
19694pub enum UnitTorque {
19695 #[doc = "Newton metres <https://en.wikipedia.org/wiki/Newton_metre>"]
19696 #[serde(rename = "newton_metres")]
19697 #[display("newton_metres")]
19698 NewtonMetres,
19699 #[doc = "Pound foot <https://en.wikipedia.org/wiki/Pound-foot_(torque)>"]
19700 #[serde(rename = "pound_foot")]
19701 #[display("pound_foot")]
19702 PoundFoot,
19703}
19704
19705#[doc = "Result of converting between units."]
19706#[derive(
19707 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
19708)]
19709pub struct UnitTorqueConversion {
19710 #[doc = "The time and date the API call was completed."]
19711 #[serde(default, skip_serializing_if = "Option::is_none")]
19712 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
19713 #[doc = "The time and date the API call was created."]
19714 pub created_at: chrono::DateTime<chrono::Utc>,
19715 #[doc = "The error the function returned, if any."]
19716 #[serde(default, skip_serializing_if = "Option::is_none")]
19717 pub error: Option<String>,
19718 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
19719 pub id: uuid::Uuid,
19720 #[doc = "The input value."]
19721 #[serde(default, skip_serializing_if = "Option::is_none")]
19722 pub input: Option<f64>,
19723 #[doc = "The source format of the unit conversion."]
19724 pub input_unit: UnitTorque,
19725 #[doc = "The resulting value."]
19726 #[serde(default, skip_serializing_if = "Option::is_none")]
19727 pub output: Option<f64>,
19728 #[doc = "The output format of the unit conversion."]
19729 pub output_unit: UnitTorque,
19730 #[doc = "The time and date the API call was started."]
19731 #[serde(default, skip_serializing_if = "Option::is_none")]
19732 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
19733 #[doc = "The status of the API call."]
19734 pub status: ApiCallStatus,
19735 #[doc = "The time and date the API call was last updated."]
19736 pub updated_at: chrono::DateTime<chrono::Utc>,
19737 #[doc = "The user ID of the user who created the API call."]
19738 pub user_id: uuid::Uuid,
19739}
19740
19741impl std::fmt::Display for UnitTorqueConversion {
19742 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
19743 write!(
19744 f,
19745 "{}",
19746 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
19747 )
19748 }
19749}
19750
19751#[cfg(feature = "tabled")]
19752impl tabled::Tabled for UnitTorqueConversion {
19753 const LENGTH: usize = 12;
19754 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
19755 vec![
19756 if let Some(completed_at) = &self.completed_at {
19757 format!("{:?}", completed_at).into()
19758 } else {
19759 String::new().into()
19760 },
19761 format!("{:?}", self.created_at).into(),
19762 if let Some(error) = &self.error {
19763 format!("{:?}", error).into()
19764 } else {
19765 String::new().into()
19766 },
19767 format!("{:?}", self.id).into(),
19768 if let Some(input) = &self.input {
19769 format!("{:?}", input).into()
19770 } else {
19771 String::new().into()
19772 },
19773 format!("{:?}", self.input_unit).into(),
19774 if let Some(output) = &self.output {
19775 format!("{:?}", output).into()
19776 } else {
19777 String::new().into()
19778 },
19779 format!("{:?}", self.output_unit).into(),
19780 if let Some(started_at) = &self.started_at {
19781 format!("{:?}", started_at).into()
19782 } else {
19783 String::new().into()
19784 },
19785 format!("{:?}", self.status).into(),
19786 format!("{:?}", self.updated_at).into(),
19787 format!("{:?}", self.user_id).into(),
19788 ]
19789 }
19790
19791 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
19792 vec![
19793 "completed_at".into(),
19794 "created_at".into(),
19795 "error".into(),
19796 "id".into(),
19797 "input".into(),
19798 "input_unit".into(),
19799 "output".into(),
19800 "output_unit".into(),
19801 "started_at".into(),
19802 "status".into(),
19803 "updated_at".into(),
19804 "user_id".into(),
19805 ]
19806 }
19807}
19808
19809#[doc = "The valid types of volume units."]
19810#[derive(
19811 serde :: Serialize,
19812 serde :: Deserialize,
19813 PartialEq,
19814 Hash,
19815 Debug,
19816 Clone,
19817 schemars :: JsonSchema,
19818 parse_display :: FromStr,
19819 parse_display :: Display,
19820)]
19821#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
19822#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
19823pub enum UnitVolume {
19824 #[doc = "Cubic centimeters (cc or cm³) <https://en.wikipedia.org/wiki/Cubic_centimeter>"]
19825 #[serde(rename = "cm3")]
19826 #[display("cm3")]
19827 Cm3,
19828 #[doc = "Cubic feet (ft³) <https://en.wikipedia.org/wiki/Cubic_foot>"]
19829 #[serde(rename = "ft3")]
19830 #[display("ft3")]
19831 Ft3,
19832 #[doc = "Cubic inches (cu in or in³) <https://en.wikipedia.org/wiki/Cubic_inch>"]
19833 #[serde(rename = "in3")]
19834 #[display("in3")]
19835 In3,
19836 #[doc = "Cubic meters (m³) <https://en.wikipedia.org/wiki/Cubic_meter>"]
19837 #[serde(rename = "m3")]
19838 #[display("m3")]
19839 M3,
19840 #[doc = "Cubic yards (yd³) <https://en.wikipedia.org/wiki/Cubic_yard>"]
19841 #[serde(rename = "yd3")]
19842 #[display("yd3")]
19843 Yd3,
19844 #[doc = "US Fluid Ounces (fl oz) <https://en.wikipedia.org/wiki/Fluid_ounce>"]
19845 #[serde(rename = "usfloz")]
19846 #[display("usfloz")]
19847 Usfloz,
19848 #[doc = "US Gallons (gal US) <https://en.wikipedia.org/wiki/Gallon>"]
19849 #[serde(rename = "usgal")]
19850 #[display("usgal")]
19851 Usgal,
19852 #[doc = "Liters (l) <https://en.wikipedia.org/wiki/Litre>"]
19853 #[serde(rename = "l")]
19854 #[display("l")]
19855 L,
19856 #[doc = "Milliliters (ml) <https://en.wikipedia.org/wiki/Litre>"]
19857 #[serde(rename = "ml")]
19858 #[display("ml")]
19859 Ml,
19860}
19861
19862#[doc = "Result of converting between units."]
19863#[derive(
19864 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
19865)]
19866pub struct UnitVolumeConversion {
19867 #[doc = "The time and date the API call was completed."]
19868 #[serde(default, skip_serializing_if = "Option::is_none")]
19869 pub completed_at: Option<chrono::DateTime<chrono::Utc>>,
19870 #[doc = "The time and date the API call was created."]
19871 pub created_at: chrono::DateTime<chrono::Utc>,
19872 #[doc = "The error the function returned, if any."]
19873 #[serde(default, skip_serializing_if = "Option::is_none")]
19874 pub error: Option<String>,
19875 #[doc = "The unique identifier of the API call.\n\nThis is the same as the API call ID."]
19876 pub id: uuid::Uuid,
19877 #[doc = "The input value."]
19878 #[serde(default, skip_serializing_if = "Option::is_none")]
19879 pub input: Option<f64>,
19880 #[doc = "The source format of the unit conversion."]
19881 pub input_unit: UnitVolume,
19882 #[doc = "The resulting value."]
19883 #[serde(default, skip_serializing_if = "Option::is_none")]
19884 pub output: Option<f64>,
19885 #[doc = "The output format of the unit conversion."]
19886 pub output_unit: UnitVolume,
19887 #[doc = "The time and date the API call was started."]
19888 #[serde(default, skip_serializing_if = "Option::is_none")]
19889 pub started_at: Option<chrono::DateTime<chrono::Utc>>,
19890 #[doc = "The status of the API call."]
19891 pub status: ApiCallStatus,
19892 #[doc = "The time and date the API call was last updated."]
19893 pub updated_at: chrono::DateTime<chrono::Utc>,
19894 #[doc = "The user ID of the user who created the API call."]
19895 pub user_id: uuid::Uuid,
19896}
19897
19898impl std::fmt::Display for UnitVolumeConversion {
19899 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
19900 write!(
19901 f,
19902 "{}",
19903 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
19904 )
19905 }
19906}
19907
19908#[cfg(feature = "tabled")]
19909impl tabled::Tabled for UnitVolumeConversion {
19910 const LENGTH: usize = 12;
19911 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
19912 vec![
19913 if let Some(completed_at) = &self.completed_at {
19914 format!("{:?}", completed_at).into()
19915 } else {
19916 String::new().into()
19917 },
19918 format!("{:?}", self.created_at).into(),
19919 if let Some(error) = &self.error {
19920 format!("{:?}", error).into()
19921 } else {
19922 String::new().into()
19923 },
19924 format!("{:?}", self.id).into(),
19925 if let Some(input) = &self.input {
19926 format!("{:?}", input).into()
19927 } else {
19928 String::new().into()
19929 },
19930 format!("{:?}", self.input_unit).into(),
19931 if let Some(output) = &self.output {
19932 format!("{:?}", output).into()
19933 } else {
19934 String::new().into()
19935 },
19936 format!("{:?}", self.output_unit).into(),
19937 if let Some(started_at) = &self.started_at {
19938 format!("{:?}", started_at).into()
19939 } else {
19940 String::new().into()
19941 },
19942 format!("{:?}", self.status).into(),
19943 format!("{:?}", self.updated_at).into(),
19944 format!("{:?}", self.user_id).into(),
19945 ]
19946 }
19947
19948 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
19949 vec![
19950 "completed_at".into(),
19951 "created_at".into(),
19952 "error".into(),
19953 "id".into(),
19954 "input".into(),
19955 "input_unit".into(),
19956 "output".into(),
19957 "output_unit".into(),
19958 "started_at".into(),
19959 "status".into(),
19960 "updated_at".into(),
19961 "user_id".into(),
19962 ]
19963 }
19964}
19965
19966#[doc = "The response from the `UpdateAnnotation` endpoint."]
19967#[derive(
19968 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
19969)]
19970pub struct UpdateAnnotation {}
19971
19972impl std::fmt::Display for UpdateAnnotation {
19973 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
19974 write!(
19975 f,
19976 "{}",
19977 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
19978 )
19979 }
19980}
19981
19982#[cfg(feature = "tabled")]
19983impl tabled::Tabled for UpdateAnnotation {
19984 const LENGTH: usize = 0;
19985 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
19986 vec![]
19987 }
19988
19989 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
19990 vec![]
19991 }
19992}
19993
19994#[doc = "Data for updating a member of an org."]
19995#[derive(
19996 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
19997)]
19998pub struct UpdateMemberToOrgBody {
19999 #[doc = "The organization role to give the user."]
20000 pub role: UserOrgRole,
20001}
20002
20003impl std::fmt::Display for UpdateMemberToOrgBody {
20004 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
20005 write!(
20006 f,
20007 "{}",
20008 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
20009 )
20010 }
20011}
20012
20013#[cfg(feature = "tabled")]
20014impl tabled::Tabled for UpdateMemberToOrgBody {
20015 const LENGTH: usize = 1;
20016 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
20017 vec![format!("{:?}", self.role).into()]
20018 }
20019
20020 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
20021 vec!["role".into()]
20022 }
20023}
20024
20025#[doc = "The data for updating a balance."]
20026#[derive(
20027 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
20028)]
20029pub struct UpdatePaymentBalance {
20030 #[doc = "The monetary value of the monthy API credits remaining in the balance. This gets \
20031 re-upped every month,"]
20032 #[serde(default, skip_serializing_if = "Option::is_none")]
20033 pub monthly_api_credits_remaining_monetary_value: Option<f64>,
20034 #[doc = "The monetary value of stable API credits remaining in the balance. These do not get \
20035 reset or re-upped every month. This is separate from the monthly credits. Credits \
20036 will first pull from the monthly credits, then the stable credits. Stable just means \
20037 that they do not get reset every month. A user will have stable credits if a Zoo \
20038 employee granted them credits."]
20039 #[serde(default, skip_serializing_if = "Option::is_none")]
20040 pub stable_api_credits_remaining_monetary_value: Option<f64>,
20041}
20042
20043impl std::fmt::Display for UpdatePaymentBalance {
20044 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
20045 write!(
20046 f,
20047 "{}",
20048 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
20049 )
20050 }
20051}
20052
20053#[cfg(feature = "tabled")]
20054impl tabled::Tabled for UpdatePaymentBalance {
20055 const LENGTH: usize = 2;
20056 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
20057 vec![
20058 if let Some(monthly_api_credits_remaining_monetary_value) =
20059 &self.monthly_api_credits_remaining_monetary_value
20060 {
20061 format!("{:?}", monthly_api_credits_remaining_monetary_value).into()
20062 } else {
20063 String::new().into()
20064 },
20065 if let Some(stable_api_credits_remaining_monetary_value) =
20066 &self.stable_api_credits_remaining_monetary_value
20067 {
20068 format!("{:?}", stable_api_credits_remaining_monetary_value).into()
20069 } else {
20070 String::new().into()
20071 },
20072 ]
20073 }
20074
20075 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
20076 vec![
20077 "monthly_api_credits_remaining_monetary_value".into(),
20078 "stable_api_credits_remaining_monetary_value".into(),
20079 ]
20080 }
20081}
20082
20083#[doc = "Request to update a shortlink."]
20084#[derive(
20085 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
20086)]
20087pub struct UpdateShortlinkRequest {
20088 #[doc = "The password for the shortlink, if you want to restrict access to it. This can only \
20089 be set if your subscription allows for it. Otherwise, it will return an error. When \
20090 you access the link it will be required to enter this password through basic auth. \
20091 The username will be `{anything}` and the password will be the password you set here."]
20092 #[serde(default, skip_serializing_if = "Option::is_none")]
20093 pub password: Option<String>,
20094 #[doc = "If the shortlink should be restricted to the user's organization to view. This only \
20095 applies to org shortlinks. If you are creating a user shortlink and you are not a \
20096 member of a team or enterprise and you try to set this to true, it will fail."]
20097 pub restrict_to_org: bool,
20098}
20099
20100impl std::fmt::Display for UpdateShortlinkRequest {
20101 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
20102 write!(
20103 f,
20104 "{}",
20105 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
20106 )
20107 }
20108}
20109
20110#[cfg(feature = "tabled")]
20111impl tabled::Tabled for UpdateShortlinkRequest {
20112 const LENGTH: usize = 2;
20113 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
20114 vec![
20115 if let Some(password) = &self.password {
20116 format!("{:?}", password).into()
20117 } else {
20118 String::new().into()
20119 },
20120 format!("{:?}", self.restrict_to_org).into(),
20121 ]
20122 }
20123
20124 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
20125 vec!["password".into(), "restrict_to_org".into()]
20126 }
20127}
20128
20129#[doc = "The user-modifiable parts of a User."]
20130#[derive(
20131 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
20132)]
20133pub struct UpdateUser {
20134 #[doc = "The user's company."]
20135 #[serde(default, skip_serializing_if = "Option::is_none")]
20136 pub company: Option<String>,
20137 #[doc = "The user's Discord handle."]
20138 #[serde(default, skip_serializing_if = "Option::is_none")]
20139 pub discord: Option<String>,
20140 #[doc = "The user's first name."]
20141 #[serde(default, skip_serializing_if = "Option::is_none")]
20142 pub first_name: Option<String>,
20143 #[doc = "The user's GitHub handle."]
20144 #[serde(default, skip_serializing_if = "Option::is_none")]
20145 pub github: Option<String>,
20146 #[doc = "The image URL for the user. NOTE: If the user uses an OAuth2 provider, this will be \
20147 overwritten by the provider's image URL when the user logs in next."]
20148 pub image: String,
20149 #[doc = "If the user is now onboarded."]
20150 #[serde(default, skip_serializing_if = "Option::is_none")]
20151 pub is_onboarded: Option<bool>,
20152 #[doc = "The user's last name."]
20153 #[serde(default, skip_serializing_if = "Option::is_none")]
20154 pub last_name: Option<String>,
20155 #[doc = "The user's phone number."]
20156 #[serde(default, skip_serializing_if = "Option::is_none")]
20157 pub phone: phone_number::PhoneNumber,
20158}
20159
20160impl std::fmt::Display for UpdateUser {
20161 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
20162 write!(
20163 f,
20164 "{}",
20165 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
20166 )
20167 }
20168}
20169
20170#[cfg(feature = "tabled")]
20171impl tabled::Tabled for UpdateUser {
20172 const LENGTH: usize = 8;
20173 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
20174 vec![
20175 if let Some(company) = &self.company {
20176 format!("{:?}", company).into()
20177 } else {
20178 String::new().into()
20179 },
20180 if let Some(discord) = &self.discord {
20181 format!("{:?}", discord).into()
20182 } else {
20183 String::new().into()
20184 },
20185 if let Some(first_name) = &self.first_name {
20186 format!("{:?}", first_name).into()
20187 } else {
20188 String::new().into()
20189 },
20190 if let Some(github) = &self.github {
20191 format!("{:?}", github).into()
20192 } else {
20193 String::new().into()
20194 },
20195 self.image.clone().into(),
20196 if let Some(is_onboarded) = &self.is_onboarded {
20197 format!("{:?}", is_onboarded).into()
20198 } else {
20199 String::new().into()
20200 },
20201 if let Some(last_name) = &self.last_name {
20202 format!("{:?}", last_name).into()
20203 } else {
20204 String::new().into()
20205 },
20206 format!("{:?}", self.phone).into(),
20207 ]
20208 }
20209
20210 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
20211 vec![
20212 "company".into(),
20213 "discord".into(),
20214 "first_name".into(),
20215 "github".into(),
20216 "image".into(),
20217 "is_onboarded".into(),
20218 "last_name".into(),
20219 "phone".into(),
20220 ]
20221 }
20222}
20223
20224#[doc = "A user."]
20225#[derive(
20226 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
20227)]
20228pub struct User {
20229 #[doc = "If the user should be blocked and the reason why."]
20230 #[serde(default, skip_serializing_if = "Option::is_none")]
20231 pub block: Option<BlockReason>,
20232 #[doc = "If we can train on the user's data. If the user is a member of an organization, the \
20233 organization's setting will override this."]
20234 #[serde(default)]
20235 pub can_train_on_data: bool,
20236 #[doc = "The user's company."]
20237 #[serde(default, skip_serializing_if = "Option::is_none")]
20238 pub company: Option<String>,
20239 #[doc = "The date and time the user was created."]
20240 pub created_at: chrono::DateTime<chrono::Utc>,
20241 #[doc = "If the user is scheduled for deletion."]
20242 #[serde(default)]
20243 pub deletion_scheduled: bool,
20244 #[doc = "The user's Discord handle."]
20245 #[serde(default, skip_serializing_if = "Option::is_none")]
20246 pub discord: Option<String>,
20247 #[doc = "The email address of the user."]
20248 #[serde(default, skip_serializing_if = "Option::is_none")]
20249 pub email: Option<String>,
20250 #[doc = "The date and time the email address was verified."]
20251 #[serde(default, skip_serializing_if = "Option::is_none")]
20252 pub email_verified: Option<chrono::DateTime<chrono::Utc>>,
20253 #[doc = "The user's first name."]
20254 #[serde(default, skip_serializing_if = "Option::is_none")]
20255 pub first_name: Option<String>,
20256 #[doc = "The user's GitHub handle."]
20257 #[serde(default, skip_serializing_if = "Option::is_none")]
20258 pub github: Option<String>,
20259 #[doc = "The unique identifier for the user."]
20260 pub id: uuid::Uuid,
20261 #[doc = "The image avatar for the user. This is a URL."]
20262 pub image: String,
20263 #[doc = "If the user has finished onboarding."]
20264 #[serde(default)]
20265 pub is_onboarded: bool,
20266 #[doc = "If the user is tied to a service account."]
20267 #[serde(default)]
20268 pub is_service_account: bool,
20269 #[doc = "The user's last name."]
20270 #[serde(default, skip_serializing_if = "Option::is_none")]
20271 pub last_name: Option<String>,
20272 #[doc = "The name of the user. This is auto populated at first from the authentication \
20273 provider (if there was a name). It can be updated by the user by updating their \
20274 `first_name` and `last_name` fields."]
20275 #[serde(default, skip_serializing_if = "Option::is_none")]
20276 pub name: Option<String>,
20277 #[doc = "The user's phone number."]
20278 #[serde(default, skip_serializing_if = "Option::is_none")]
20279 pub phone: phone_number::PhoneNumber,
20280 #[doc = "The date and time the user was last updated."]
20281 pub updated_at: chrono::DateTime<chrono::Utc>,
20282}
20283
20284impl std::fmt::Display for User {
20285 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
20286 write!(
20287 f,
20288 "{}",
20289 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
20290 )
20291 }
20292}
20293
20294#[cfg(feature = "tabled")]
20295impl tabled::Tabled for User {
20296 const LENGTH: usize = 18;
20297 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
20298 vec![
20299 if let Some(block) = &self.block {
20300 format!("{:?}", block).into()
20301 } else {
20302 String::new().into()
20303 },
20304 format!("{:?}", self.can_train_on_data).into(),
20305 if let Some(company) = &self.company {
20306 format!("{:?}", company).into()
20307 } else {
20308 String::new().into()
20309 },
20310 format!("{:?}", self.created_at).into(),
20311 format!("{:?}", self.deletion_scheduled).into(),
20312 if let Some(discord) = &self.discord {
20313 format!("{:?}", discord).into()
20314 } else {
20315 String::new().into()
20316 },
20317 if let Some(email) = &self.email {
20318 format!("{:?}", email).into()
20319 } else {
20320 String::new().into()
20321 },
20322 if let Some(email_verified) = &self.email_verified {
20323 format!("{:?}", email_verified).into()
20324 } else {
20325 String::new().into()
20326 },
20327 if let Some(first_name) = &self.first_name {
20328 format!("{:?}", first_name).into()
20329 } else {
20330 String::new().into()
20331 },
20332 if let Some(github) = &self.github {
20333 format!("{:?}", github).into()
20334 } else {
20335 String::new().into()
20336 },
20337 format!("{:?}", self.id).into(),
20338 self.image.clone().into(),
20339 format!("{:?}", self.is_onboarded).into(),
20340 format!("{:?}", self.is_service_account).into(),
20341 if let Some(last_name) = &self.last_name {
20342 format!("{:?}", last_name).into()
20343 } else {
20344 String::new().into()
20345 },
20346 if let Some(name) = &self.name {
20347 format!("{:?}", name).into()
20348 } else {
20349 String::new().into()
20350 },
20351 format!("{:?}", self.phone).into(),
20352 format!("{:?}", self.updated_at).into(),
20353 ]
20354 }
20355
20356 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
20357 vec![
20358 "block".into(),
20359 "can_train_on_data".into(),
20360 "company".into(),
20361 "created_at".into(),
20362 "deletion_scheduled".into(),
20363 "discord".into(),
20364 "email".into(),
20365 "email_verified".into(),
20366 "first_name".into(),
20367 "github".into(),
20368 "id".into(),
20369 "image".into(),
20370 "is_onboarded".into(),
20371 "is_service_account".into(),
20372 "last_name".into(),
20373 "name".into(),
20374 "phone".into(),
20375 "updated_at".into(),
20376 ]
20377 }
20378}
20379
20380#[doc = "A user's information about an org, including their role."]
20381#[derive(
20382 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
20383)]
20384pub struct UserOrgInfo {
20385 #[doc = "If we should allow all future users who are created with email addresses from this \
20386 domain to join the org."]
20387 #[serde(default, skip_serializing_if = "Option::is_none")]
20388 pub allow_users_in_domain_to_auto_join: Option<bool>,
20389 #[doc = "The billing email address of the org."]
20390 #[serde(default, skip_serializing_if = "Option::is_none")]
20391 pub billing_email: Option<String>,
20392 #[doc = "The date and time the billing email address was verified."]
20393 #[serde(default, skip_serializing_if = "Option::is_none")]
20394 pub billing_email_verified: Option<chrono::DateTime<chrono::Utc>>,
20395 #[doc = "If the org should be blocked and the reason why."]
20396 #[serde(default, skip_serializing_if = "Option::is_none")]
20397 pub block: Option<BlockReason>,
20398 #[doc = "The date and time the org was created."]
20399 pub created_at: chrono::DateTime<chrono::Utc>,
20400 #[doc = "The org's domain."]
20401 #[serde(default, skip_serializing_if = "Option::is_none")]
20402 pub domain: Option<String>,
20403 #[doc = "The unique identifier for the org."]
20404 pub id: uuid::Uuid,
20405 #[doc = "The image for the org. This is a URL."]
20406 #[serde(default, skip_serializing_if = "Option::is_none")]
20407 pub image: Option<String>,
20408 #[doc = "The name of the org."]
20409 #[serde(default, skip_serializing_if = "Option::is_none")]
20410 pub name: Option<String>,
20411 #[doc = "The org's phone number."]
20412 #[serde(default, skip_serializing_if = "Option::is_none")]
20413 pub phone: phone_number::PhoneNumber,
20414 #[doc = "The user's role in the org."]
20415 pub role: OrgRole,
20416 #[doc = "The org's stripe id."]
20417 #[serde(default, skip_serializing_if = "Option::is_none")]
20418 pub stripe_id: Option<String>,
20419 #[doc = "The date and time the org was last updated."]
20420 pub updated_at: chrono::DateTime<chrono::Utc>,
20421}
20422
20423impl std::fmt::Display for UserOrgInfo {
20424 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
20425 write!(
20426 f,
20427 "{}",
20428 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
20429 )
20430 }
20431}
20432
20433#[cfg(feature = "tabled")]
20434impl tabled::Tabled for UserOrgInfo {
20435 const LENGTH: usize = 13;
20436 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
20437 vec![
20438 if let Some(allow_users_in_domain_to_auto_join) =
20439 &self.allow_users_in_domain_to_auto_join
20440 {
20441 format!("{:?}", allow_users_in_domain_to_auto_join).into()
20442 } else {
20443 String::new().into()
20444 },
20445 if let Some(billing_email) = &self.billing_email {
20446 format!("{:?}", billing_email).into()
20447 } else {
20448 String::new().into()
20449 },
20450 if let Some(billing_email_verified) = &self.billing_email_verified {
20451 format!("{:?}", billing_email_verified).into()
20452 } else {
20453 String::new().into()
20454 },
20455 if let Some(block) = &self.block {
20456 format!("{:?}", block).into()
20457 } else {
20458 String::new().into()
20459 },
20460 format!("{:?}", self.created_at).into(),
20461 if let Some(domain) = &self.domain {
20462 format!("{:?}", domain).into()
20463 } else {
20464 String::new().into()
20465 },
20466 format!("{:?}", self.id).into(),
20467 if let Some(image) = &self.image {
20468 format!("{:?}", image).into()
20469 } else {
20470 String::new().into()
20471 },
20472 if let Some(name) = &self.name {
20473 format!("{:?}", name).into()
20474 } else {
20475 String::new().into()
20476 },
20477 format!("{:?}", self.phone).into(),
20478 format!("{:?}", self.role).into(),
20479 if let Some(stripe_id) = &self.stripe_id {
20480 format!("{:?}", stripe_id).into()
20481 } else {
20482 String::new().into()
20483 },
20484 format!("{:?}", self.updated_at).into(),
20485 ]
20486 }
20487
20488 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
20489 vec![
20490 "allow_users_in_domain_to_auto_join".into(),
20491 "billing_email".into(),
20492 "billing_email_verified".into(),
20493 "block".into(),
20494 "created_at".into(),
20495 "domain".into(),
20496 "id".into(),
20497 "image".into(),
20498 "name".into(),
20499 "phone".into(),
20500 "role".into(),
20501 "stripe_id".into(),
20502 "updated_at".into(),
20503 ]
20504 }
20505}
20506
20507#[doc = "The roles for users in an organization."]
20508#[derive(
20509 serde :: Serialize,
20510 serde :: Deserialize,
20511 PartialEq,
20512 Hash,
20513 Debug,
20514 Clone,
20515 schemars :: JsonSchema,
20516 parse_display :: FromStr,
20517 parse_display :: Display,
20518)]
20519#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
20520#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
20521pub enum UserOrgRole {
20522 #[doc = "Admins can do anything in the org."]
20523 #[serde(rename = "admin")]
20524 #[display("admin")]
20525 Admin,
20526 #[doc = "Members of an org can not modify an org, but they belong in the org."]
20527 #[serde(rename = "member")]
20528 #[display("member")]
20529 Member,
20530}
20531
20532#[doc = "A single page of results"]
20533#[derive(
20534 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
20535)]
20536pub struct UserResultsPage {
20537 #[doc = "list of items on this page of results"]
20538 pub items: Vec<User>,
20539 #[doc = "token used to fetch the next page of results (if any)"]
20540 #[serde(default, skip_serializing_if = "Option::is_none")]
20541 pub next_page: Option<String>,
20542}
20543
20544impl std::fmt::Display for UserResultsPage {
20545 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
20546 write!(
20547 f,
20548 "{}",
20549 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
20550 )
20551 }
20552}
20553
20554#[cfg(feature = "requests")]
20555impl crate::types::paginate::Pagination for UserResultsPage {
20556 type Item = User;
20557 fn has_more_pages(&self) -> bool {
20558 self.next_page.is_some()
20559 }
20560
20561 fn next_page_token(&self) -> Option<String> {
20562 self.next_page.clone()
20563 }
20564
20565 fn next_page(
20566 &self,
20567 req: reqwest::Request,
20568 ) -> anyhow::Result<reqwest::Request, crate::types::error::Error> {
20569 let mut req = req.try_clone().ok_or_else(|| {
20570 crate::types::error::Error::InvalidRequest(format!(
20571 "failed to clone request: {:?}",
20572 req
20573 ))
20574 })?;
20575 req.url_mut()
20576 .query_pairs_mut()
20577 .append_pair("next_page", self.next_page.as_deref().unwrap_or(""));
20578 Ok(req)
20579 }
20580
20581 fn items(&self) -> Vec<Self::Item> {
20582 self.items.clone()
20583 }
20584}
20585
20586#[cfg(feature = "tabled")]
20587impl tabled::Tabled for UserResultsPage {
20588 const LENGTH: usize = 2;
20589 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
20590 vec![
20591 format!("{:?}", self.items).into(),
20592 if let Some(next_page) = &self.next_page {
20593 format!("{:?}", next_page).into()
20594 } else {
20595 String::new().into()
20596 },
20597 ]
20598 }
20599
20600 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
20601 vec!["items".into(), "next_page".into()]
20602 }
20603}
20604
20605#[doc = "A verification token response."]
20606#[derive(
20607 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
20608)]
20609pub struct VerificationTokenResponse {
20610 #[doc = "The date and time the verification token was created."]
20611 pub created_at: chrono::DateTime<chrono::Utc>,
20612 #[doc = "The date and time the verification token expires."]
20613 pub expires: chrono::DateTime<chrono::Utc>,
20614 #[doc = "The token used for verification. This is used as the id for the table since it is \
20615 unique per record."]
20616 pub id: uuid::Uuid,
20617 #[doc = "The identifier for the user. This is typically the user's email address since that \
20618 is what we are verifying."]
20619 #[serde(default, skip_serializing_if = "Option::is_none")]
20620 pub identifier: Option<String>,
20621 #[doc = "The URL to redirect to if the user requires SAML authentication or belongs somewhere \
20622 else."]
20623 #[serde(default, skip_serializing_if = "Option::is_none")]
20624 pub redirect_url: Option<String>,
20625 #[doc = "The date and time the verification token was last updated."]
20626 pub updated_at: chrono::DateTime<chrono::Utc>,
20627}
20628
20629impl std::fmt::Display for VerificationTokenResponse {
20630 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
20631 write!(
20632 f,
20633 "{}",
20634 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
20635 )
20636 }
20637}
20638
20639#[cfg(feature = "tabled")]
20640impl tabled::Tabled for VerificationTokenResponse {
20641 const LENGTH: usize = 6;
20642 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
20643 vec![
20644 format!("{:?}", self.created_at).into(),
20645 format!("{:?}", self.expires).into(),
20646 format!("{:?}", self.id).into(),
20647 if let Some(identifier) = &self.identifier {
20648 format!("{:?}", identifier).into()
20649 } else {
20650 String::new().into()
20651 },
20652 if let Some(redirect_url) = &self.redirect_url {
20653 format!("{:?}", redirect_url).into()
20654 } else {
20655 String::new().into()
20656 },
20657 format!("{:?}", self.updated_at).into(),
20658 ]
20659 }
20660
20661 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
20662 vec![
20663 "created_at".into(),
20664 "expires".into(),
20665 "id".into(),
20666 "identifier".into(),
20667 "redirect_url".into(),
20668 "updated_at".into(),
20669 ]
20670 }
20671}
20672
20673#[doc = "The response from the `ViewIsometric` command."]
20674#[derive(
20675 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
20676)]
20677pub struct ViewIsometric {
20678 #[doc = "Camera settings"]
20679 pub settings: CameraSettings,
20680}
20681
20682impl std::fmt::Display for ViewIsometric {
20683 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
20684 write!(
20685 f,
20686 "{}",
20687 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
20688 )
20689 }
20690}
20691
20692#[cfg(feature = "tabled")]
20693impl tabled::Tabled for ViewIsometric {
20694 const LENGTH: usize = 1;
20695 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
20696 vec![format!("{:?}", self.settings).into()]
20697 }
20698
20699 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
20700 vec!["settings".into()]
20701 }
20702}
20703
20704#[doc = "The volume response."]
20705#[derive(
20706 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
20707)]
20708pub struct Volume {
20709 #[doc = "The output unit for the volume."]
20710 pub output_unit: UnitVolume,
20711 #[doc = "The volume."]
20712 pub volume: f64,
20713}
20714
20715impl std::fmt::Display for Volume {
20716 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
20717 write!(
20718 f,
20719 "{}",
20720 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
20721 )
20722 }
20723}
20724
20725#[cfg(feature = "tabled")]
20726impl tabled::Tabled for Volume {
20727 const LENGTH: usize = 2;
20728 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
20729 vec![
20730 format!("{:?}", self.output_unit).into(),
20731 format!("{:?}", self.volume).into(),
20732 ]
20733 }
20734
20735 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
20736 vec!["output_unit".into(), "volume".into()]
20737 }
20738}
20739
20740#[doc = "The websocket messages the server receives."]
20741#[derive(
20742 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
20743)]
20744#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
20745#[serde(tag = "type")]
20746pub enum WebSocketRequest {
20747 #[doc = "The trickle ICE candidate request."]
20748 #[serde(rename = "trickle_ice")]
20749 TrickleIce {
20750 #[doc = "Information about the ICE candidate."]
20751 candidate: RtcIceCandidateInit,
20752 },
20753 #[doc = "The SDP offer request."]
20754 #[serde(rename = "sdp_offer")]
20755 SdpOffer {
20756 #[doc = "The session description."]
20757 offer: RtcSessionDescription,
20758 },
20759 #[doc = "The modeling command request."]
20760 #[serde(rename = "modeling_cmd_req")]
20761 ModelingCmdReq {
20762 #[doc = "Which command to submit to the Kittycad engine."]
20763 cmd: ModelingCmd,
20764 #[doc = "ID of command being submitted."]
20765 cmd_id: uuid::Uuid,
20766 },
20767 #[doc = "A sequence of modeling requests. If any request fails, following requests will not \
20768 be tried."]
20769 #[serde(rename = "modeling_cmd_batch_req")]
20770 ModelingCmdBatchReq {
20771 #[doc = "ID of batch being submitted. Each request has their own individual \
20772 ModelingCmdId, but this is the ID of the overall batch."]
20773 batch_id: uuid::Uuid,
20774 #[doc = "A sequence of modeling requests. If any request fails, following requests will \
20775 not be tried."]
20776 requests: Vec<ModelingCmdReq>,
20777 #[doc = "If false or omitted, responses to each batch command will just be Ok(()). If \
20778 true, responses will be the actual response data for that modeling command."]
20779 #[serde(default)]
20780 responses: bool,
20781 },
20782 #[doc = "The client-to-server Ping to ensure the WebSocket stays alive."]
20783 #[serde(rename = "ping")]
20784 Ping {},
20785 #[doc = "The response to a metrics collection request from the server."]
20786 #[serde(rename = "metrics_response")]
20787 MetricsResponse {
20788 #[doc = "Collected metrics from the Client's end of the engine connection."]
20789 metrics: ClientMetrics,
20790 },
20791 #[doc = "Return information about the connected instance"]
20792 #[serde(rename = "debug")]
20793 Debug {},
20794 #[doc = "Authentication header request."]
20795 #[serde(rename = "headers")]
20796 Headers {
20797 #[doc = "The authentication header."]
20798 headers: std::collections::HashMap<String, String>,
20799 },
20800}
20801
20802#[doc = "Websocket responses can either be successful or unsuccessful. Slightly different schemas \
20803 in either case."]
20804#[derive(
20805 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
20806)]
20807pub struct WebSocketResponse {
20808 #[doc = "Which request this is a response to. If the request was a modeling command, this is \
20809 the modeling command ID. If no request ID was sent, this will be null."]
20810 #[serde(default, skip_serializing_if = "Option::is_none")]
20811 pub request_id: Option<uuid::Uuid>,
20812 #[doc = "The data sent with a successful response. This will be flattened into a 'type' and \
20813 'data' field."]
20814 #[serde(default, skip_serializing_if = "Option::is_none")]
20815 pub resp: Option<OkWebSocketResponseData>,
20816 #[doc = "Always false"]
20817 #[serde(default, skip_serializing_if = "Option::is_none")]
20818 pub success: Option<bool>,
20819 #[doc = "The errors that occurred."]
20820 #[serde(default, skip_serializing_if = "Option::is_none")]
20821 pub errors: Option<Vec<ApiError>>,
20822}
20823
20824impl std::fmt::Display for WebSocketResponse {
20825 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
20826 write!(
20827 f,
20828 "{}",
20829 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
20830 )
20831 }
20832}
20833
20834#[cfg(feature = "tabled")]
20835impl tabled::Tabled for WebSocketResponse {
20836 const LENGTH: usize = 4;
20837 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
20838 vec![
20839 if let Some(request_id) = &self.request_id {
20840 format!("{:?}", request_id).into()
20841 } else {
20842 String::new().into()
20843 },
20844 if let Some(resp) = &self.resp {
20845 format!("{:?}", resp).into()
20846 } else {
20847 String::new().into()
20848 },
20849 if let Some(success) = &self.success {
20850 format!("{:?}", success).into()
20851 } else {
20852 String::new().into()
20853 },
20854 if let Some(errors) = &self.errors {
20855 format!("{:?}", errors).into()
20856 } else {
20857 String::new().into()
20858 },
20859 ]
20860 }
20861
20862 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
20863 vec![
20864 "request_id".into(),
20865 "resp".into(),
20866 "success".into(),
20867 "errors".into(),
20868 ]
20869 }
20870}
20871
20872#[derive(
20873 serde :: Serialize,
20874 serde :: Deserialize,
20875 PartialEq,
20876 Hash,
20877 Debug,
20878 Clone,
20879 schemars :: JsonSchema,
20880 parse_display :: FromStr,
20881 parse_display :: Display,
20882)]
20883#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
20884#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
20885pub enum WorldCoordinateSystem {
20886 #[serde(rename = "right_handed_up_z")]
20887 #[display("right_handed_up_z")]
20888 RightHandedUpZ,
20889 #[serde(rename = "right_handed_up_y")]
20890 #[display("right_handed_up_y")]
20891 RightHandedUpY,
20892}
20893
20894#[doc = "A subscription to the modeling app."]
20895#[derive(
20896 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
20897)]
20898pub struct ZooProductSubscription {
20899 #[doc = "Annual discount. The percentage off the monthly price if the user pays annually."]
20900 #[serde(default, skip_serializing_if = "Option::is_none")]
20901 pub annual_discount: Option<f64>,
20902 #[doc = "A description of the tier."]
20903 pub description: String,
20904 #[doc = "The Zoo API endpoints that are included when through an approved zoo tool."]
20905 #[serde(default, skip_serializing_if = "Option::is_none")]
20906 pub endpoints_included: Option<Vec<ApiEndpoint>>,
20907 #[doc = "Features that are included in the subscription."]
20908 #[serde(default, skip_serializing_if = "Option::is_none")]
20909 pub features: Option<Vec<SubscriptionTierFeature>>,
20910 #[doc = "The amount of pay-as-you-go API credits the individual or org gets outside the \
20911 modeling app per month. This re-ups on the 1st of each month. This is equivalent to \
20912 the monetary value divided by the price of an API credit."]
20913 #[serde(default, skip_serializing_if = "Option::is_none")]
20914 pub monthly_pay_as_you_go_api_credits: Option<u64>,
20915 #[doc = "The monetary value of pay-as-you-go API credits the individual or org gets outside \
20916 the modeling app per month. This re-ups on the 1st of each month."]
20917 pub monthly_pay_as_you_go_api_credits_monetary_value: f64,
20918 #[doc = "The name of the tier."]
20919 pub name: ModelingAppSubscriptionTierName,
20920 #[doc = "The price of an API credit (meaning 1 credit = 1 minute of API usage)."]
20921 #[serde(default, skip_serializing_if = "Option::is_none")]
20922 pub pay_as_you_go_api_credit_price: Option<f64>,
20923 #[doc = "The price of the tier per month. If this is for an individual, this is the price \
20924 they pay. If this is for an organization, this is the price the organization pays \
20925 per member in the org. This is in USD."]
20926 pub price: SubscriptionTierPrice,
20927 #[doc = "The options for sharable links through the modeling app."]
20928 #[serde(default, skip_serializing_if = "Option::is_none")]
20929 pub share_links: Option<Vec<ModelingAppShareLinks>>,
20930 #[doc = "The support tier the subscription provides."]
20931 pub support_tier: SupportTier,
20932 #[doc = "The behavior of the users data (can it be used for training, etc)."]
20933 pub training_data_behavior: SubscriptionTrainingDataBehavior,
20934 #[doc = "If the tier is offered for an individual or an org."]
20935 #[serde(rename = "type")]
20936 pub type_: SubscriptionTierType,
20937 #[doc = "The Zoo tools that you can call unlimited times with this tier."]
20938 #[serde(default, skip_serializing_if = "Option::is_none")]
20939 pub zoo_tools_included: Option<Vec<ZooTool>>,
20940}
20941
20942impl std::fmt::Display for ZooProductSubscription {
20943 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
20944 write!(
20945 f,
20946 "{}",
20947 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
20948 )
20949 }
20950}
20951
20952#[cfg(feature = "tabled")]
20953impl tabled::Tabled for ZooProductSubscription {
20954 const LENGTH: usize = 14;
20955 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
20956 vec![
20957 if let Some(annual_discount) = &self.annual_discount {
20958 format!("{:?}", annual_discount).into()
20959 } else {
20960 String::new().into()
20961 },
20962 self.description.clone().into(),
20963 if let Some(endpoints_included) = &self.endpoints_included {
20964 format!("{:?}", endpoints_included).into()
20965 } else {
20966 String::new().into()
20967 },
20968 if let Some(features) = &self.features {
20969 format!("{:?}", features).into()
20970 } else {
20971 String::new().into()
20972 },
20973 if let Some(monthly_pay_as_you_go_api_credits) = &self.monthly_pay_as_you_go_api_credits
20974 {
20975 format!("{:?}", monthly_pay_as_you_go_api_credits).into()
20976 } else {
20977 String::new().into()
20978 },
20979 format!(
20980 "{:?}",
20981 self.monthly_pay_as_you_go_api_credits_monetary_value
20982 )
20983 .into(),
20984 format!("{:?}", self.name).into(),
20985 if let Some(pay_as_you_go_api_credit_price) = &self.pay_as_you_go_api_credit_price {
20986 format!("{:?}", pay_as_you_go_api_credit_price).into()
20987 } else {
20988 String::new().into()
20989 },
20990 format!("{:?}", self.price).into(),
20991 if let Some(share_links) = &self.share_links {
20992 format!("{:?}", share_links).into()
20993 } else {
20994 String::new().into()
20995 },
20996 format!("{:?}", self.support_tier).into(),
20997 format!("{:?}", self.training_data_behavior).into(),
20998 format!("{:?}", self.type_).into(),
20999 if let Some(zoo_tools_included) = &self.zoo_tools_included {
21000 format!("{:?}", zoo_tools_included).into()
21001 } else {
21002 String::new().into()
21003 },
21004 ]
21005 }
21006
21007 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
21008 vec![
21009 "annual_discount".into(),
21010 "description".into(),
21011 "endpoints_included".into(),
21012 "features".into(),
21013 "monthly_pay_as_you_go_api_credits".into(),
21014 "monthly_pay_as_you_go_api_credits_monetary_value".into(),
21015 "name".into(),
21016 "pay_as_you_go_api_credit_price".into(),
21017 "price".into(),
21018 "share_links".into(),
21019 "support_tier".into(),
21020 "training_data_behavior".into(),
21021 "type_".into(),
21022 "zoo_tools_included".into(),
21023 ]
21024 }
21025}
21026
21027#[doc = "A struct of Zoo product subscriptions."]
21028#[derive(
21029 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
21030)]
21031pub struct ZooProductSubscriptions {
21032 #[doc = "A modeling app subscription."]
21033 pub modeling_app: ModelingAppSubscriptionTier,
21034}
21035
21036impl std::fmt::Display for ZooProductSubscriptions {
21037 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
21038 write!(
21039 f,
21040 "{}",
21041 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
21042 )
21043 }
21044}
21045
21046#[cfg(feature = "tabled")]
21047impl tabled::Tabled for ZooProductSubscriptions {
21048 const LENGTH: usize = 1;
21049 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
21050 vec![format!("{:?}", self.modeling_app).into()]
21051 }
21052
21053 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
21054 vec!["modeling_app".into()]
21055 }
21056}
21057
21058#[doc = "A struct of Zoo product subscriptions an organization can request."]
21059#[derive(
21060 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
21061)]
21062pub struct ZooProductSubscriptionsOrgRequest {
21063 #[doc = "A modeling app subscription."]
21064 #[serde(default, skip_serializing_if = "Option::is_none")]
21065 pub modeling_app: Option<ModelingAppOrganizationSubscriptionTier>,
21066 #[doc = "If the customer chooses to pay annually or monthly, we can add that here. The annual \
21067 discount will apply if there is a discount for the subscription."]
21068 #[serde(default, skip_serializing_if = "Option::is_none")]
21069 pub pay_annually: Option<bool>,
21070}
21071
21072impl std::fmt::Display for ZooProductSubscriptionsOrgRequest {
21073 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
21074 write!(
21075 f,
21076 "{}",
21077 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
21078 )
21079 }
21080}
21081
21082#[cfg(feature = "tabled")]
21083impl tabled::Tabled for ZooProductSubscriptionsOrgRequest {
21084 const LENGTH: usize = 2;
21085 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
21086 vec![
21087 if let Some(modeling_app) = &self.modeling_app {
21088 format!("{:?}", modeling_app).into()
21089 } else {
21090 String::new().into()
21091 },
21092 if let Some(pay_annually) = &self.pay_annually {
21093 format!("{:?}", pay_annually).into()
21094 } else {
21095 String::new().into()
21096 },
21097 ]
21098 }
21099
21100 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
21101 vec!["modeling_app".into(), "pay_annually".into()]
21102 }
21103}
21104
21105#[doc = "A struct of Zoo product subscriptions a user can request."]
21106#[derive(
21107 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
21108)]
21109pub struct ZooProductSubscriptionsUserRequest {
21110 #[doc = "A modeling app subscription."]
21111 #[serde(default, skip_serializing_if = "Option::is_none")]
21112 pub modeling_app: Option<ModelingAppIndividualSubscriptionTier>,
21113 #[doc = "If the customer chooses to pay annually or monthly, we can add that here. The annual \
21114 discount will apply if there is a discount for the subscription."]
21115 #[serde(default, skip_serializing_if = "Option::is_none")]
21116 pub pay_annually: Option<bool>,
21117}
21118
21119impl std::fmt::Display for ZooProductSubscriptionsUserRequest {
21120 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
21121 write!(
21122 f,
21123 "{}",
21124 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
21125 )
21126 }
21127}
21128
21129#[cfg(feature = "tabled")]
21130impl tabled::Tabled for ZooProductSubscriptionsUserRequest {
21131 const LENGTH: usize = 2;
21132 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
21133 vec![
21134 if let Some(modeling_app) = &self.modeling_app {
21135 format!("{:?}", modeling_app).into()
21136 } else {
21137 String::new().into()
21138 },
21139 if let Some(pay_annually) = &self.pay_annually {
21140 format!("{:?}", pay_annually).into()
21141 } else {
21142 String::new().into()
21143 },
21144 ]
21145 }
21146
21147 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
21148 vec!["modeling_app".into(), "pay_annually".into()]
21149 }
21150}
21151
21152#[doc = "The Zoo tools that can make API calls."]
21153#[derive(
21154 serde :: Serialize,
21155 serde :: Deserialize,
21156 PartialEq,
21157 Hash,
21158 Debug,
21159 Clone,
21160 schemars :: JsonSchema,
21161 parse_display :: FromStr,
21162 parse_display :: Display,
21163)]
21164#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
21165#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
21166pub enum ZooTool {
21167 #[doc = "The modeling app."]
21168 #[serde(rename = "modeling_app")]
21169 #[display("modeling_app")]
21170 ModelingApp,
21171 #[doc = "The Diff Chrome Extension."]
21172 #[serde(rename = "diff_chrome_extension")]
21173 #[display("diff_chrome_extension")]
21174 DiffChromeExtension,
21175 #[doc = "The Text-to-CAD UI."]
21176 #[serde(rename = "text_to_cad")]
21177 #[display("text_to_cad")]
21178 TextToCad,
21179}
21180
21181#[doc = "The response from the `ZoomToFit` command."]
21182#[derive(
21183 serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
21184)]
21185pub struct ZoomToFit {
21186 #[doc = "Camera settings"]
21187 pub settings: CameraSettings,
21188}
21189
21190impl std::fmt::Display for ZoomToFit {
21191 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
21192 write!(
21193 f,
21194 "{}",
21195 serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
21196 )
21197 }
21198}
21199
21200#[cfg(feature = "tabled")]
21201impl tabled::Tabled for ZoomToFit {
21202 const LENGTH: usize = 1;
21203 fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
21204 vec![format!("{:?}", self.settings).into()]
21205 }
21206
21207 fn headers() -> Vec<std::borrow::Cow<'static, str>> {
21208 vec!["settings".into()]
21209 }
21210}
21211
21212#[doc = "The field of an API call to group by."]
21213#[derive(
21214 serde :: Serialize,
21215 serde :: Deserialize,
21216 PartialEq,
21217 Hash,
21218 Debug,
21219 Clone,
21220 schemars :: JsonSchema,
21221 parse_display :: FromStr,
21222 parse_display :: Display,
21223)]
21224#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
21225#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
21226pub enum ApiCallQueryGroupBy {
21227 #[doc = "The email of the user that requested the API call."]
21228 #[serde(rename = "email")]
21229 #[display("email")]
21230 Email,
21231 #[doc = "The HTTP method of the API call."]
21232 #[serde(rename = "method")]
21233 #[display("method")]
21234 Method,
21235 #[doc = "The endpoint of the API call."]
21236 #[serde(rename = "endpoint")]
21237 #[display("endpoint")]
21238 Endpoint,
21239 #[doc = "The user ID of the user that requested the API call."]
21240 #[serde(rename = "user_id")]
21241 #[display("user_id")]
21242 UserId,
21243 #[doc = "The origin of the API call. This is parsed from the `Origin` header."]
21244 #[serde(rename = "origin")]
21245 #[display("origin")]
21246 Origin,
21247 #[doc = "The IP address of the user making the API call."]
21248 #[serde(rename = "ip_address")]
21249 #[display("ip_address")]
21250 IpAddress,
21251}
21252
21253#[doc = "Supported set of sort modes for scanning by created_at only.\n\nCurrently, we only \
21254 support scanning in ascending order."]
21255#[derive(
21256 serde :: Serialize,
21257 serde :: Deserialize,
21258 PartialEq,
21259 Hash,
21260 Debug,
21261 Clone,
21262 schemars :: JsonSchema,
21263 parse_display :: FromStr,
21264 parse_display :: Display,
21265)]
21266#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
21267#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
21268pub enum CreatedAtSortMode {
21269 #[doc = "Sort in increasing order of \"created_at\"."]
21270 #[serde(rename = "created_at_ascending")]
21271 #[display("created_at_ascending")]
21272 CreatedAtAscending,
21273 #[doc = "Sort in decreasing order of \"created_at\"."]
21274 #[serde(rename = "created_at_descending")]
21275 #[display("created_at_descending")]
21276 CreatedAtDescending,
21277}
21278
21279#[doc = "The language code is written in.\n\n<details><summary>JSON schema</summary>\n\n```json { \
21280 \"description\": \"The language code is written in.\", \"oneOf\": [ { \"description\": \
21281 \"The `go` programming language.\", \"type\": \"string\", \"enum\": [ \"go\" ] }, { \
21282 \"description\": \"The `python` programming language.\", \"type\": \"string\", \"enum\": \
21283 [ \"python\" ] }, { \"description\": \"The `node` programming language.\", \"type\": \
21284 \"string\", \"enum\": [ \"node\" ] } ] } ``` </details>"]
21285#[derive(
21286 serde :: Serialize,
21287 serde :: Deserialize,
21288 PartialEq,
21289 Hash,
21290 Debug,
21291 Clone,
21292 schemars :: JsonSchema,
21293 parse_display :: FromStr,
21294 parse_display :: Display,
21295)]
21296#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
21297#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
21298pub enum CodeLanguage {
21299 #[doc = "The `go` programming language."]
21300 #[serde(rename = "go")]
21301 #[display("go")]
21302 Go,
21303 #[doc = "The `python` programming language."]
21304 #[serde(rename = "python")]
21305 #[display("python")]
21306 Python,
21307 #[doc = "The `node` programming language."]
21308 #[serde(rename = "node")]
21309 #[display("node")]
21310 Node,
21311}
21312
21313#[doc = "Code option for running and verifying kcl.\n\n<details><summary>JSON \
21314 schema</summary>\n\n```json { \"title\": \"CodeOption\", \"description\": \"Code option \
21315 for running and verifying kcl.\", \"type\": \"string\", \"enum\": [ \"parse\", \
21316 \"execute\", \"cleanup\", \"mock_execute\" ] } ``` </details>"]
21317#[derive(
21318 serde :: Serialize,
21319 serde :: Deserialize,
21320 PartialEq,
21321 Hash,
21322 Debug,
21323 Clone,
21324 schemars :: JsonSchema,
21325 parse_display :: FromStr,
21326 parse_display :: Display,
21327)]
21328#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
21329#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
21330pub enum CodeOption {
21331 #[serde(rename = "parse")]
21332 #[display("parse")]
21333 Parse,
21334 #[serde(rename = "execute")]
21335 #[display("execute")]
21336 Execute,
21337 #[serde(rename = "cleanup")]
21338 #[display("cleanup")]
21339 Cleanup,
21340 #[serde(rename = "mock_execute")]
21341 #[display("mock_execute")]
21342 MockExecute,
21343}
21344
21345#[doc = "Post effect type"]
21346#[derive(
21347 serde :: Serialize,
21348 serde :: Deserialize,
21349 PartialEq,
21350 Hash,
21351 Debug,
21352 Clone,
21353 schemars :: JsonSchema,
21354 parse_display :: FromStr,
21355 parse_display :: Display,
21356)]
21357#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
21358#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
21359pub enum PostEffectType {
21360 #[serde(rename = "phosphor")]
21361 #[display("phosphor")]
21362 Phosphor,
21363 #[serde(rename = "ssao")]
21364 #[display("ssao")]
21365 Ssao,
21366 #[serde(rename = "noeffect")]
21367 #[display("noeffect")]
21368 Noeffect,
21369}