hubspot_contacts/
types.rs

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<'de> Visitor<'de> 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    #[doc = " An attachement to a multipart form."]
140    #[derive(Debug, Clone, PartialEq, Eq, Hash)]
141    pub struct Attachment {
142        #[doc = " The name of the field."]
143        pub name: String,
144        #[doc = " The filename of the attachment."]
145        pub filename: Option<String>,
146        #[doc = " The content type of the attachment."]
147        pub content_type: Option<String>,
148        #[doc = " The data of the attachment."]
149        pub data: Vec<u8>,
150    }
151
152    impl std::convert::TryFrom<Attachment> for reqwest::multipart::Part {
153        type Error = reqwest::Error;
154        fn try_from(attachment: Attachment) -> Result<Self, Self::Error> {
155            let mut part = reqwest::multipart::Part::bytes(attachment.data);
156            if let Some(filename) = attachment.filename {
157                part = part.file_name(filename);
158            }
159            if let Some(content_type) = attachment.content_type {
160                part = part.mime_str(&content_type)?;
161            }
162            Ok(part)
163        }
164    }
165
166    impl std::convert::TryFrom<std::path::PathBuf> for Attachment {
167        type Error = std::io::Error;
168        fn try_from(path: std::path::PathBuf) -> Result<Self, Self::Error> {
169            let filename = path
170                .file_name()
171                .ok_or_else(|| {
172                    std::io::Error::new(std::io::ErrorKind::InvalidData, "invalid filename")
173                })?
174                .to_str()
175                .ok_or_else(|| {
176                    std::io::Error::new(std::io::ErrorKind::InvalidData, "invalid filename")
177                })?
178                .to_string();
179            let content_type = mime_guess::from_path(&path).first_raw();
180            let data = std::fs::read(path)?;
181            Ok(Attachment {
182                name: "file".to_string(),
183                filename: Some(filename),
184                content_type: content_type.map(|s| s.to_string()),
185                data,
186            })
187        }
188    }
189}
190
191#[cfg(feature = "requests")]
192pub mod paginate {
193    #![doc = " Utility functions used for pagination."]
194    use anyhow::Result;
195    #[doc = " A trait for types that allow pagination."]
196    pub trait Pagination {
197        #[doc = " The item that is paginated."]
198        type Item: serde::de::DeserializeOwned;
199        #[doc = " Returns true if the response has more pages."]
200        fn has_more_pages(&self) -> bool;
201        #[doc = " Returns the next page token."]
202        fn next_page_token(&self) -> Option<String>;
203        #[doc = " Modify a request to get the next page."]
204        fn next_page(
205            &self,
206            req: reqwest::Request,
207        ) -> Result<reqwest::Request, crate::types::error::Error>;
208        #[doc = " Get the items from a page."]
209        fn items(&self) -> Vec<Self::Item>;
210    }
211}
212
213pub mod phone_number {
214    #![doc = " A library to implement phone numbers for our database and JSON serialization and \
215              deserialization."]
216    use std::str::FromStr;
217
218    use schemars::JsonSchema;
219    #[doc = " A phone number."]
220    #[derive(Debug, Default, Clone, PartialEq, Hash, Eq)]
221    pub struct PhoneNumber(pub Option<phonenumber::PhoneNumber>);
222    impl From<phonenumber::PhoneNumber> for PhoneNumber {
223        fn from(id: phonenumber::PhoneNumber) -> PhoneNumber {
224            PhoneNumber(Some(id))
225        }
226    }
227
228    impl AsRef<Option<phonenumber::PhoneNumber>> for PhoneNumber {
229        fn as_ref(&self) -> &Option<phonenumber::PhoneNumber> {
230            &self.0
231        }
232    }
233
234    impl std::ops::Deref for PhoneNumber {
235        type Target = Option<phonenumber::PhoneNumber>;
236        fn deref(&self) -> &Self::Target {
237            &self.0
238        }
239    }
240
241    impl serde::ser::Serialize for PhoneNumber {
242        fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
243        where
244            S: serde::ser::Serializer,
245        {
246            serializer.serialize_str(&self.to_string())
247        }
248    }
249
250    impl<'de> serde::de::Deserialize<'de> for PhoneNumber {
251        fn deserialize<D>(deserializer: D) -> Result<PhoneNumber, D::Error>
252        where
253            D: serde::de::Deserializer<'de>,
254        {
255            let s = String::deserialize(deserializer).unwrap_or_default();
256            PhoneNumber::from_str(&s).map_err(serde::de::Error::custom)
257        }
258    }
259
260    impl std::str::FromStr for PhoneNumber {
261        type Err = anyhow::Error;
262        fn from_str(s: &str) -> Result<Self, Self::Err> {
263            if s.trim().is_empty() {
264                return Ok(PhoneNumber(None));
265            }
266            let s = if !s.trim().starts_with('+') {
267                format!("+1{s}")
268            } else {
269                s.to_string()
270            }
271            .replace(['-', '(', ')', ' '], "");
272            Ok(PhoneNumber(Some(phonenumber::parse(None, &s).map_err(
273                |e| anyhow::anyhow!("invalid phone number `{}`: {}", s, e),
274            )?)))
275        }
276    }
277
278    impl std::fmt::Display for PhoneNumber {
279        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
280            let s = if let Some(phone) = &self.0 {
281                phone
282                    .format()
283                    .mode(phonenumber::Mode::International)
284                    .to_string()
285            } else {
286                String::new()
287            };
288            write!(f, "{}", s)
289        }
290    }
291
292    impl JsonSchema for PhoneNumber {
293        fn schema_name() -> String {
294            "PhoneNumber".to_string()
295        }
296
297        fn json_schema(gen: &mut schemars::gen::SchemaGenerator) -> schemars::schema::Schema {
298            let mut obj = gen.root_schema_for::<String>().schema;
299            obj.format = Some("phone".to_string());
300            schemars::schema::Schema::Object(obj)
301        }
302
303        fn is_referenceable() -> bool {
304            false
305        }
306    }
307
308    #[cfg(test)]
309    mod test {
310        use pretty_assertions::assert_eq;
311
312        use super::PhoneNumber;
313        #[test]
314        fn test_parse_phone_number() {
315            let mut phone = "+1-555-555-5555";
316            let mut phone_parsed: PhoneNumber =
317                serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
318            let mut expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap()));
319            assert_eq!(phone_parsed, expected);
320            let mut expected_str = "+1 555-555-5555";
321            assert_eq!(expected_str, serde_json::json!(phone_parsed));
322            phone = "555-555-5555";
323            phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
324            assert_eq!(phone_parsed, expected);
325            assert_eq!(expected_str, serde_json::json!(phone_parsed));
326            phone = "+1 555-555-5555";
327            phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
328            assert_eq!(phone_parsed, expected);
329            assert_eq!(expected_str, serde_json::json!(phone_parsed));
330            phone = "5555555555";
331            phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
332            assert_eq!(phone_parsed, expected);
333            assert_eq!(expected_str, serde_json::json!(phone_parsed));
334            phone = "(510) 864-1234";
335            phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
336            expected = PhoneNumber(Some(phonenumber::parse(None, "+15108641234").unwrap()));
337            assert_eq!(phone_parsed, expected);
338            expected_str = "+1 510-864-1234";
339            assert_eq!(expected_str, serde_json::json!(phone_parsed));
340            phone = "(510)8641234";
341            phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
342            assert_eq!(phone_parsed, expected);
343            expected_str = "+1 510-864-1234";
344            assert_eq!(expected_str, serde_json::json!(phone_parsed));
345            phone = "";
346            phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
347            assert_eq!(phone_parsed, PhoneNumber(None));
348            assert_eq!("", serde_json::json!(phone_parsed));
349            phone = "+49 30  1234 1234";
350            phone_parsed = serde_json::from_str(&format!(r#""{}""#, phone)).unwrap();
351            expected = PhoneNumber(Some(phonenumber::parse(None, phone).unwrap()));
352            assert_eq!(phone_parsed, expected);
353            expected_str = "+49 30 12341234";
354            assert_eq!(expected_str, serde_json::json!(phone_parsed));
355        }
356    }
357}
358
359#[cfg(feature = "requests")]
360pub mod error {
361    #![doc = " Error methods."]
362    #[doc = " Error produced by generated client methods."]
363    pub enum Error {
364        #[doc = " The request did not conform to API requirements."]
365        InvalidRequest(String),
366        #[cfg(feature = "retry")]
367        #[doc = " A server error either due to the data, or with the connection."]
368        CommunicationError(reqwest_middleware::Error),
369        #[doc = " A request error, caused when building the request."]
370        RequestError(reqwest::Error),
371        #[doc = " An expected response whose deserialization failed."]
372        SerdeError {
373            #[doc = " The error."]
374            error: format_serde_error::SerdeError,
375            #[doc = " The response status."]
376            status: reqwest::StatusCode,
377        },
378        #[doc = " An expected error response."]
379        InvalidResponsePayload {
380            #[cfg(feature = "retry")]
381            #[doc = " The error."]
382            error: reqwest_middleware::Error,
383            #[cfg(not(feature = "retry"))]
384            #[doc = " The error."]
385            error: reqwest::Error,
386            #[doc = " The full response."]
387            response: reqwest::Response,
388        },
389        #[doc = " An error from the server."]
390        Server {
391            #[doc = " The text from the body."]
392            body: String,
393            #[doc = " The response status."]
394            status: reqwest::StatusCode,
395        },
396        #[doc = " A response not listed in the API description. This may represent a"]
397        #[doc = " success or failure response; check `status().is_success()`."]
398        UnexpectedResponse(reqwest::Response),
399    }
400
401    impl Error {
402        #[doc = " Returns the status code, if the error was generated from a response."]
403        pub fn status(&self) -> Option<reqwest::StatusCode> {
404            match self {
405                Error::InvalidRequest(_) => None,
406                Error::RequestError(e) => e.status(),
407                #[cfg(feature = "retry")]
408                Error::CommunicationError(reqwest_middleware::Error::Reqwest(e)) => e.status(),
409                #[cfg(feature = "retry")]
410                Error::CommunicationError(reqwest_middleware::Error::Middleware(_)) => None,
411                Error::SerdeError { error: _, status } => Some(*status),
412                Error::InvalidResponsePayload { error: _, response } => Some(response.status()),
413                Error::Server { body: _, status } => Some(*status),
414                Error::UnexpectedResponse(r) => Some(r.status()),
415            }
416        }
417
418        #[doc = " Creates a new error from a response status and a serde error."]
419        pub fn from_serde_error(
420            e: format_serde_error::SerdeError,
421            status: reqwest::StatusCode,
422        ) -> Self {
423            Self::SerdeError { error: e, status }
424        }
425    }
426
427    #[cfg(feature = "retry")]
428    impl From<reqwest_middleware::Error> for Error {
429        fn from(e: reqwest_middleware::Error) -> Self {
430            Self::CommunicationError(e)
431        }
432    }
433
434    impl From<reqwest::Error> for Error {
435        fn from(e: reqwest::Error) -> Self {
436            Self::RequestError(e)
437        }
438    }
439
440    impl From<serde_json::Error> for Error {
441        fn from(e: serde_json::Error) -> Self {
442            Self::SerdeError {
443                error: format_serde_error::SerdeError::new(String::new(), e),
444                status: reqwest::StatusCode::INTERNAL_SERVER_ERROR,
445            }
446        }
447    }
448
449    impl std::fmt::Display for Error {
450        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
451            match self {
452                Error::InvalidRequest(s) => {
453                    write!(f, "Invalid Request: {}", s)
454                }
455                #[cfg(feature = "retry")]
456                Error::CommunicationError(e) => {
457                    write!(f, "Communication Error: {}", e)
458                }
459                Error::RequestError(e) => {
460                    write!(f, "Request Error: {}", e)
461                }
462                Error::SerdeError { error, status: _ } => {
463                    write!(f, "Serde Error: {}", error)
464                }
465                Error::InvalidResponsePayload { error, response: _ } => {
466                    write!(f, "Invalid Response Payload: {}", error)
467                }
468                Error::Server { body, status } => {
469                    write!(f, "Server Error: {} {}", status, body)
470                }
471                Error::UnexpectedResponse(r) => {
472                    write!(f, "Unexpected Response: {:?}", r)
473                }
474            }
475        }
476    }
477
478    impl std::fmt::Debug for Error {
479        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
480            std::fmt::Display::fmt(self, f)
481        }
482    }
483
484    impl std::error::Error for Error {
485        fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
486            match self {
487                #[cfg(feature = "retry")]
488                Error::CommunicationError(e) => Some(e),
489                Error::SerdeError { error, status: _ } => Some(error),
490                Error::InvalidResponsePayload { error, response: _ } => Some(error),
491                _ => None,
492            }
493        }
494    }
495}
496
497#[derive(
498    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
499)]
500pub struct StandardError {
501    #[serde(
502        rename = "subCategory",
503        default,
504        skip_serializing_if = "Option::is_none"
505    )]
506    pub sub_category: Option<String>,
507    pub context: std::collections::HashMap<String, Vec<String>>,
508    pub links: std::collections::HashMap<String, String>,
509    #[serde(default, skip_serializing_if = "Option::is_none")]
510    pub id: Option<String>,
511    pub category: String,
512    pub message: String,
513    pub errors: Vec<ErrorDetail>,
514    pub status: String,
515}
516
517impl std::fmt::Display for StandardError {
518    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
519        write!(
520            f,
521            "{}",
522            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
523        )
524    }
525}
526
527#[cfg(feature = "tabled")]
528impl tabled::Tabled for StandardError {
529    const LENGTH: usize = 8;
530    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
531        vec![
532            if let Some(sub_category) = &self.sub_category {
533                format!("{:?}", sub_category).into()
534            } else {
535                String::new().into()
536            },
537            format!("{:?}", self.context).into(),
538            format!("{:?}", self.links).into(),
539            if let Some(id) = &self.id {
540                format!("{:?}", id).into()
541            } else {
542                String::new().into()
543            },
544            self.category.clone().into(),
545            self.message.clone().into(),
546            format!("{:?}", self.errors).into(),
547            self.status.clone().into(),
548        ]
549    }
550
551    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
552        vec![
553            "sub_category".into(),
554            "context".into(),
555            "links".into(),
556            "id".into(),
557            "category".into(),
558            "message".into(),
559            "errors".into(),
560            "status".into(),
561        ]
562    }
563}
564
565#[derive(
566    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
567)]
568pub struct CollectionResponseAssociatedId {
569    #[serde(default, skip_serializing_if = "Option::is_none")]
570    pub paging: Option<Paging>,
571    pub results: Vec<AssociatedId>,
572}
573
574impl std::fmt::Display for CollectionResponseAssociatedId {
575    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
576        write!(
577            f,
578            "{}",
579            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
580        )
581    }
582}
583
584#[cfg(feature = "tabled")]
585impl tabled::Tabled for CollectionResponseAssociatedId {
586    const LENGTH: usize = 2;
587    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
588        vec![
589            if let Some(paging) = &self.paging {
590                format!("{:?}", paging).into()
591            } else {
592                String::new().into()
593            },
594            format!("{:?}", self.results).into(),
595        ]
596    }
597
598    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
599        vec!["paging".into(), "results".into()]
600    }
601}
602
603#[derive(
604    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
605)]
606pub struct PublicAssociationsForObject {
607    pub types: Vec<AssociationSpec>,
608    pub to: PublicObjectId,
609}
610
611impl std::fmt::Display for PublicAssociationsForObject {
612    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
613        write!(
614            f,
615            "{}",
616            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
617        )
618    }
619}
620
621#[cfg(feature = "tabled")]
622impl tabled::Tabled for PublicAssociationsForObject {
623    const LENGTH: usize = 2;
624    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
625        vec![
626            format!("{:?}", self.types).into(),
627            format!("{:?}", self.to).into(),
628        ]
629    }
630
631    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
632        vec!["types".into(), "to".into()]
633    }
634}
635
636#[derive(
637    serde :: Serialize,
638    serde :: Deserialize,
639    PartialEq,
640    Hash,
641    Debug,
642    Clone,
643    schemars :: JsonSchema,
644    parse_display :: FromStr,
645    parse_display :: Display,
646)]
647#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
648#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
649pub enum Status {
650    #[serde(rename = "PENDING")]
651    #[display("PENDING")]
652    Pending,
653    #[serde(rename = "PROCESSING")]
654    #[display("PROCESSING")]
655    Processing,
656    #[serde(rename = "CANCELED")]
657    #[display("CANCELED")]
658    Canceled,
659    #[serde(rename = "COMPLETE")]
660    #[display("COMPLETE")]
661    Complete,
662}
663
664#[derive(
665    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
666)]
667pub struct BatchResponseSimplePublicObject {
668    #[serde(rename = "completedAt")]
669    pub completed_at: chrono::DateTime<chrono::Utc>,
670    #[serde(
671        rename = "requestedAt",
672        default,
673        skip_serializing_if = "Option::is_none"
674    )]
675    pub requested_at: Option<chrono::DateTime<chrono::Utc>>,
676    #[serde(rename = "startedAt")]
677    pub started_at: chrono::DateTime<chrono::Utc>,
678    #[serde(default, skip_serializing_if = "Option::is_none")]
679    pub links: Option<std::collections::HashMap<String, String>>,
680    pub results: Vec<SimplePublicObject>,
681    pub status: Status,
682}
683
684impl std::fmt::Display for BatchResponseSimplePublicObject {
685    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
686        write!(
687            f,
688            "{}",
689            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
690        )
691    }
692}
693
694#[cfg(feature = "tabled")]
695impl tabled::Tabled for BatchResponseSimplePublicObject {
696    const LENGTH: usize = 6;
697    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
698        vec![
699            format!("{:?}", self.completed_at).into(),
700            if let Some(requested_at) = &self.requested_at {
701                format!("{:?}", requested_at).into()
702            } else {
703                String::new().into()
704            },
705            format!("{:?}", self.started_at).into(),
706            if let Some(links) = &self.links {
707                format!("{:?}", links).into()
708            } else {
709                String::new().into()
710            },
711            format!("{:?}", self.results).into(),
712            format!("{:?}", self.status).into(),
713        ]
714    }
715
716    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
717        vec![
718            "completed_at".into(),
719            "requested_at".into(),
720            "started_at".into(),
721            "links".into(),
722            "results".into(),
723            "status".into(),
724        ]
725    }
726}
727
728#[derive(
729    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
730)]
731pub struct FilterGroup {
732    pub filters: Vec<Filter>,
733}
734
735impl std::fmt::Display for FilterGroup {
736    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
737        write!(
738            f,
739            "{}",
740            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
741        )
742    }
743}
744
745#[cfg(feature = "tabled")]
746impl tabled::Tabled for FilterGroup {
747    const LENGTH: usize = 1;
748    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
749        vec![format!("{:?}", self.filters).into()]
750    }
751
752    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
753        vec!["filters".into()]
754    }
755}
756
757#[derive(
758    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
759)]
760pub struct ErrorDetail {
761    #[doc = "A specific category that contains more specific detail about the error"]
762    #[serde(
763        rename = "subCategory",
764        default,
765        skip_serializing_if = "Option::is_none"
766    )]
767    pub sub_category: Option<String>,
768    #[doc = "The status code associated with the error detail"]
769    #[serde(default, skip_serializing_if = "Option::is_none")]
770    pub code: Option<String>,
771    #[doc = "The name of the field or parameter in which the error was found."]
772    #[serde(rename = "in", default, skip_serializing_if = "Option::is_none")]
773    pub in_: Option<String>,
774    #[doc = "Context about the error condition"]
775    #[serde(default, skip_serializing_if = "Option::is_none")]
776    pub context: Option<std::collections::HashMap<String, Vec<String>>>,
777    #[doc = "A human readable message describing the error along with remediation steps where \
778             appropriate"]
779    pub message: String,
780}
781
782impl std::fmt::Display for ErrorDetail {
783    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
784        write!(
785            f,
786            "{}",
787            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
788        )
789    }
790}
791
792#[cfg(feature = "tabled")]
793impl tabled::Tabled for ErrorDetail {
794    const LENGTH: usize = 5;
795    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
796        vec![
797            if let Some(sub_category) = &self.sub_category {
798                format!("{:?}", sub_category).into()
799            } else {
800                String::new().into()
801            },
802            if let Some(code) = &self.code {
803                format!("{:?}", code).into()
804            } else {
805                String::new().into()
806            },
807            if let Some(in_) = &self.in_ {
808                format!("{:?}", in_).into()
809            } else {
810                String::new().into()
811            },
812            if let Some(context) = &self.context {
813                format!("{:?}", context).into()
814            } else {
815                String::new().into()
816            },
817            self.message.clone().into(),
818        ]
819    }
820
821    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
822        vec![
823            "sub_category".into(),
824            "code".into(),
825            "in_".into(),
826            "context".into(),
827            "message".into(),
828        ]
829    }
830}
831
832#[derive(
833    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
834)]
835pub struct ForwardPaging {
836    #[serde(default, skip_serializing_if = "Option::is_none")]
837    pub next: Option<NextPage>,
838}
839
840impl std::fmt::Display for ForwardPaging {
841    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
842        write!(
843            f,
844            "{}",
845            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
846        )
847    }
848}
849
850#[cfg(feature = "tabled")]
851impl tabled::Tabled for ForwardPaging {
852    const LENGTH: usize = 1;
853    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
854        vec![if let Some(next) = &self.next {
855            format!("{:?}", next).into()
856        } else {
857            String::new().into()
858        }]
859    }
860
861    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
862        vec!["next".into()]
863    }
864}
865
866#[derive(
867    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
868)]
869pub struct SimplePublicObjectId {
870    pub id: String,
871}
872
873impl std::fmt::Display for SimplePublicObjectId {
874    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
875        write!(
876            f,
877            "{}",
878            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
879        )
880    }
881}
882
883#[cfg(feature = "tabled")]
884impl tabled::Tabled for SimplePublicObjectId {
885    const LENGTH: usize = 1;
886    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
887        vec![self.id.clone().into()]
888    }
889
890    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
891        vec!["id".into()]
892    }
893}
894
895#[derive(
896    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
897)]
898pub struct BatchReadInputSimplePublicObjectId {
899    #[serde(rename = "propertiesWithHistory")]
900    pub properties_with_history: Vec<String>,
901    #[serde(
902        rename = "idProperty",
903        default,
904        skip_serializing_if = "Option::is_none"
905    )]
906    pub id_property: Option<String>,
907    pub inputs: Vec<SimplePublicObjectId>,
908    pub properties: Vec<String>,
909}
910
911impl std::fmt::Display for BatchReadInputSimplePublicObjectId {
912    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
913        write!(
914            f,
915            "{}",
916            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
917        )
918    }
919}
920
921#[cfg(feature = "tabled")]
922impl tabled::Tabled for BatchReadInputSimplePublicObjectId {
923    const LENGTH: usize = 4;
924    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
925        vec![
926            format!("{:?}", self.properties_with_history).into(),
927            if let Some(id_property) = &self.id_property {
928                format!("{:?}", id_property).into()
929            } else {
930                String::new().into()
931            },
932            format!("{:?}", self.inputs).into(),
933            format!("{:?}", self.properties).into(),
934        ]
935    }
936
937    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
938        vec![
939            "properties_with_history".into(),
940            "id_property".into(),
941            "inputs".into(),
942            "properties".into(),
943        ]
944    }
945}
946
947#[derive(
948    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
949)]
950pub struct BatchInputSimplePublicObjectId {
951    pub inputs: Vec<SimplePublicObjectId>,
952}
953
954impl std::fmt::Display for BatchInputSimplePublicObjectId {
955    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
956        write!(
957            f,
958            "{}",
959            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
960        )
961    }
962}
963
964#[cfg(feature = "tabled")]
965impl tabled::Tabled for BatchInputSimplePublicObjectId {
966    const LENGTH: usize = 1;
967    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
968        vec![format!("{:?}", self.inputs).into()]
969    }
970
971    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
972        vec!["inputs".into()]
973    }
974}
975
976#[derive(
977    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
978)]
979pub struct ValueWithTimestamp {
980    #[serde(rename = "sourceId", default, skip_serializing_if = "Option::is_none")]
981    pub source_id: Option<String>,
982    #[serde(rename = "sourceType")]
983    pub source_type: String,
984    #[serde(
985        rename = "sourceLabel",
986        default,
987        skip_serializing_if = "Option::is_none"
988    )]
989    pub source_label: Option<String>,
990    #[serde(
991        rename = "updatedByUserId",
992        default,
993        skip_serializing_if = "Option::is_none"
994    )]
995    pub updated_by_user_id: Option<i32>,
996    pub value: String,
997    pub timestamp: chrono::DateTime<chrono::Utc>,
998}
999
1000impl std::fmt::Display for ValueWithTimestamp {
1001    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1002        write!(
1003            f,
1004            "{}",
1005            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1006        )
1007    }
1008}
1009
1010#[cfg(feature = "tabled")]
1011impl tabled::Tabled for ValueWithTimestamp {
1012    const LENGTH: usize = 6;
1013    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1014        vec![
1015            if let Some(source_id) = &self.source_id {
1016                format!("{:?}", source_id).into()
1017            } else {
1018                String::new().into()
1019            },
1020            self.source_type.clone().into(),
1021            if let Some(source_label) = &self.source_label {
1022                format!("{:?}", source_label).into()
1023            } else {
1024                String::new().into()
1025            },
1026            if let Some(updated_by_user_id) = &self.updated_by_user_id {
1027                format!("{:?}", updated_by_user_id).into()
1028            } else {
1029                String::new().into()
1030            },
1031            self.value.clone().into(),
1032            format!("{:?}", self.timestamp).into(),
1033        ]
1034    }
1035
1036    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1037        vec![
1038            "source_id".into(),
1039            "source_type".into(),
1040            "source_label".into(),
1041            "updated_by_user_id".into(),
1042            "value".into(),
1043            "timestamp".into(),
1044        ]
1045    }
1046}
1047
1048#[derive(
1049    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1050)]
1051pub struct CollectionResponseWithTotalSimplePublicObjectForwardPaging {
1052    pub total: i32,
1053    #[serde(default, skip_serializing_if = "Option::is_none")]
1054    pub paging: Option<ForwardPaging>,
1055    pub results: Vec<SimplePublicObject>,
1056}
1057
1058impl std::fmt::Display for CollectionResponseWithTotalSimplePublicObjectForwardPaging {
1059    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1060        write!(
1061            f,
1062            "{}",
1063            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1064        )
1065    }
1066}
1067
1068#[cfg(feature = "tabled")]
1069impl tabled::Tabled for CollectionResponseWithTotalSimplePublicObjectForwardPaging {
1070    const LENGTH: usize = 3;
1071    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1072        vec![
1073            format!("{:?}", self.total).into(),
1074            if let Some(paging) = &self.paging {
1075                format!("{:?}", paging).into()
1076            } else {
1077                String::new().into()
1078            },
1079            format!("{:?}", self.results).into(),
1080        ]
1081    }
1082
1083    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1084        vec!["total".into(), "paging".into(), "results".into()]
1085    }
1086}
1087
1088#[derive(
1089    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1090)]
1091pub struct SimplePublicObject {
1092    #[serde(rename = "createdAt")]
1093    pub created_at: chrono::DateTime<chrono::Utc>,
1094    #[serde(default, skip_serializing_if = "Option::is_none")]
1095    pub archived: Option<bool>,
1096    #[serde(
1097        rename = "archivedAt",
1098        default,
1099        skip_serializing_if = "Option::is_none"
1100    )]
1101    pub archived_at: Option<chrono::DateTime<chrono::Utc>>,
1102    #[serde(
1103        rename = "propertiesWithHistory",
1104        default,
1105        skip_serializing_if = "Option::is_none"
1106    )]
1107    pub properties_with_history: Option<std::collections::HashMap<String, Vec<ValueWithTimestamp>>>,
1108    pub id: String,
1109    pub properties: std::collections::HashMap<String, Option<String>>,
1110    #[serde(rename = "updatedAt")]
1111    pub updated_at: chrono::DateTime<chrono::Utc>,
1112}
1113
1114impl std::fmt::Display for SimplePublicObject {
1115    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1116        write!(
1117            f,
1118            "{}",
1119            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1120        )
1121    }
1122}
1123
1124#[cfg(feature = "tabled")]
1125impl tabled::Tabled for SimplePublicObject {
1126    const LENGTH: usize = 7;
1127    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1128        vec![
1129            format!("{:?}", self.created_at).into(),
1130            if let Some(archived) = &self.archived {
1131                format!("{:?}", archived).into()
1132            } else {
1133                String::new().into()
1134            },
1135            if let Some(archived_at) = &self.archived_at {
1136                format!("{:?}", archived_at).into()
1137            } else {
1138                String::new().into()
1139            },
1140            if let Some(properties_with_history) = &self.properties_with_history {
1141                format!("{:?}", properties_with_history).into()
1142            } else {
1143                String::new().into()
1144            },
1145            self.id.clone().into(),
1146            format!("{:?}", self.properties).into(),
1147            format!("{:?}", self.updated_at).into(),
1148        ]
1149    }
1150
1151    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1152        vec![
1153            "created_at".into(),
1154            "archived".into(),
1155            "archived_at".into(),
1156            "properties_with_history".into(),
1157            "id".into(),
1158            "properties".into(),
1159            "updated_at".into(),
1160        ]
1161    }
1162}
1163
1164#[derive(
1165    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1166)]
1167pub struct PublicObjectId {
1168    pub id: String,
1169}
1170
1171impl std::fmt::Display for PublicObjectId {
1172    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1173        write!(
1174            f,
1175            "{}",
1176            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1177        )
1178    }
1179}
1180
1181#[cfg(feature = "tabled")]
1182impl tabled::Tabled for PublicObjectId {
1183    const LENGTH: usize = 1;
1184    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1185        vec![self.id.clone().into()]
1186    }
1187
1188    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1189        vec!["id".into()]
1190    }
1191}
1192
1193#[derive(
1194    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1195)]
1196pub struct Paging {
1197    #[serde(default, skip_serializing_if = "Option::is_none")]
1198    pub next: Option<NextPage>,
1199    #[serde(default, skip_serializing_if = "Option::is_none")]
1200    pub prev: Option<PreviousPage>,
1201}
1202
1203impl std::fmt::Display for Paging {
1204    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1205        write!(
1206            f,
1207            "{}",
1208            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1209        )
1210    }
1211}
1212
1213#[cfg(feature = "tabled")]
1214impl tabled::Tabled for Paging {
1215    const LENGTH: usize = 2;
1216    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1217        vec![
1218            if let Some(next) = &self.next {
1219                format!("{:?}", next).into()
1220            } else {
1221                String::new().into()
1222            },
1223            if let Some(prev) = &self.prev {
1224                format!("{:?}", prev).into()
1225            } else {
1226                String::new().into()
1227            },
1228        ]
1229    }
1230
1231    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1232        vec!["next".into(), "prev".into()]
1233    }
1234}
1235
1236#[derive(
1237    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1238)]
1239pub struct PublicObjectSearchRequest {
1240    #[serde(default, skip_serializing_if = "Option::is_none")]
1241    pub query: Option<String>,
1242    pub limit: i32,
1243    pub after: String,
1244    pub sorts: Vec<String>,
1245    pub properties: Vec<String>,
1246    #[serde(rename = "filterGroups")]
1247    pub filter_groups: Vec<FilterGroup>,
1248}
1249
1250impl std::fmt::Display for PublicObjectSearchRequest {
1251    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1252        write!(
1253            f,
1254            "{}",
1255            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1256        )
1257    }
1258}
1259
1260#[cfg(feature = "tabled")]
1261impl tabled::Tabled for PublicObjectSearchRequest {
1262    const LENGTH: usize = 6;
1263    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1264        vec![
1265            if let Some(query) = &self.query {
1266                format!("{:?}", query).into()
1267            } else {
1268                String::new().into()
1269            },
1270            format!("{:?}", self.limit).into(),
1271            self.after.clone().into(),
1272            format!("{:?}", self.sorts).into(),
1273            format!("{:?}", self.properties).into(),
1274            format!("{:?}", self.filter_groups).into(),
1275        ]
1276    }
1277
1278    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1279        vec![
1280            "query".into(),
1281            "limit".into(),
1282            "after".into(),
1283            "sorts".into(),
1284            "properties".into(),
1285            "filter_groups".into(),
1286        ]
1287    }
1288}
1289
1290#[derive(
1291    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1292)]
1293pub struct Error {
1294    #[doc = "A specific category that contains more specific detail about the error"]
1295    #[serde(
1296        rename = "subCategory",
1297        default,
1298        skip_serializing_if = "Option::is_none"
1299    )]
1300    pub sub_category: Option<String>,
1301    #[doc = "Context about the error condition"]
1302    #[serde(default, skip_serializing_if = "Option::is_none")]
1303    pub context: Option<std::collections::HashMap<String, Vec<String>>>,
1304    #[doc = "A unique identifier for the request. Include this value with any error reports or \
1305             support tickets"]
1306    #[serde(rename = "correlationId")]
1307    pub correlation_id: uuid::Uuid,
1308    #[doc = "A map of link names to associated URIs containing documentation about the error or \
1309             recommended remediation steps"]
1310    #[serde(default, skip_serializing_if = "Option::is_none")]
1311    pub links: Option<std::collections::HashMap<String, String>>,
1312    #[doc = "A human readable message describing the error along with remediation steps where \
1313             appropriate"]
1314    pub message: String,
1315    #[doc = "The error category"]
1316    pub category: String,
1317    #[doc = "further information about the error"]
1318    #[serde(default, skip_serializing_if = "Option::is_none")]
1319    pub errors: Option<Vec<ErrorDetail>>,
1320}
1321
1322impl std::fmt::Display for Error {
1323    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1324        write!(
1325            f,
1326            "{}",
1327            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1328        )
1329    }
1330}
1331
1332#[cfg(feature = "tabled")]
1333impl tabled::Tabled for Error {
1334    const LENGTH: usize = 7;
1335    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1336        vec![
1337            if let Some(sub_category) = &self.sub_category {
1338                format!("{:?}", sub_category).into()
1339            } else {
1340                String::new().into()
1341            },
1342            if let Some(context) = &self.context {
1343                format!("{:?}", context).into()
1344            } else {
1345                String::new().into()
1346            },
1347            format!("{:?}", self.correlation_id).into(),
1348            if let Some(links) = &self.links {
1349                format!("{:?}", links).into()
1350            } else {
1351                String::new().into()
1352            },
1353            self.message.clone().into(),
1354            self.category.clone().into(),
1355            if let Some(errors) = &self.errors {
1356                format!("{:?}", errors).into()
1357            } else {
1358                String::new().into()
1359            },
1360        ]
1361    }
1362
1363    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1364        vec![
1365            "sub_category".into(),
1366            "context".into(),
1367            "correlation_id".into(),
1368            "links".into(),
1369            "message".into(),
1370            "category".into(),
1371            "errors".into(),
1372        ]
1373    }
1374}
1375
1376#[derive(
1377    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1378)]
1379pub struct BatchResponseSimplePublicObjectWithErrors {
1380    #[serde(rename = "completedAt")]
1381    pub completed_at: chrono::DateTime<chrono::Utc>,
1382    #[serde(rename = "numErrors", default, skip_serializing_if = "Option::is_none")]
1383    pub num_errors: Option<i32>,
1384    #[serde(
1385        rename = "requestedAt",
1386        default,
1387        skip_serializing_if = "Option::is_none"
1388    )]
1389    pub requested_at: Option<chrono::DateTime<chrono::Utc>>,
1390    #[serde(rename = "startedAt")]
1391    pub started_at: chrono::DateTime<chrono::Utc>,
1392    #[serde(default, skip_serializing_if = "Option::is_none")]
1393    pub links: Option<std::collections::HashMap<String, String>>,
1394    pub results: Vec<SimplePublicObject>,
1395    #[serde(default, skip_serializing_if = "Option::is_none")]
1396    pub errors: Option<Vec<StandardError>>,
1397    pub status: Status,
1398}
1399
1400impl std::fmt::Display for BatchResponseSimplePublicObjectWithErrors {
1401    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1402        write!(
1403            f,
1404            "{}",
1405            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1406        )
1407    }
1408}
1409
1410#[cfg(feature = "tabled")]
1411impl tabled::Tabled for BatchResponseSimplePublicObjectWithErrors {
1412    const LENGTH: usize = 8;
1413    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1414        vec![
1415            format!("{:?}", self.completed_at).into(),
1416            if let Some(num_errors) = &self.num_errors {
1417                format!("{:?}", num_errors).into()
1418            } else {
1419                String::new().into()
1420            },
1421            if let Some(requested_at) = &self.requested_at {
1422                format!("{:?}", requested_at).into()
1423            } else {
1424                String::new().into()
1425            },
1426            format!("{:?}", self.started_at).into(),
1427            if let Some(links) = &self.links {
1428                format!("{:?}", links).into()
1429            } else {
1430                String::new().into()
1431            },
1432            format!("{:?}", self.results).into(),
1433            if let Some(errors) = &self.errors {
1434                format!("{:?}", errors).into()
1435            } else {
1436                String::new().into()
1437            },
1438            format!("{:?}", self.status).into(),
1439        ]
1440    }
1441
1442    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1443        vec![
1444            "completed_at".into(),
1445            "num_errors".into(),
1446            "requested_at".into(),
1447            "started_at".into(),
1448            "links".into(),
1449            "results".into(),
1450            "errors".into(),
1451            "status".into(),
1452        ]
1453    }
1454}
1455
1456#[derive(
1457    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1458)]
1459pub struct PublicGdprDeleteInput {
1460    #[serde(
1461        rename = "idProperty",
1462        default,
1463        skip_serializing_if = "Option::is_none"
1464    )]
1465    pub id_property: Option<String>,
1466    #[serde(rename = "objectId")]
1467    pub object_id: String,
1468}
1469
1470impl std::fmt::Display for PublicGdprDeleteInput {
1471    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1472        write!(
1473            f,
1474            "{}",
1475            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1476        )
1477    }
1478}
1479
1480#[cfg(feature = "tabled")]
1481impl tabled::Tabled for PublicGdprDeleteInput {
1482    const LENGTH: usize = 2;
1483    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1484        vec![
1485            if let Some(id_property) = &self.id_property {
1486                format!("{:?}", id_property).into()
1487            } else {
1488                String::new().into()
1489            },
1490            self.object_id.clone().into(),
1491        ]
1492    }
1493
1494    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1495        vec!["id_property".into(), "object_id".into()]
1496    }
1497}
1498
1499#[derive(
1500    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1501)]
1502pub struct SimplePublicObjectInput {
1503    pub properties: std::collections::HashMap<String, String>,
1504}
1505
1506impl std::fmt::Display for SimplePublicObjectInput {
1507    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1508        write!(
1509            f,
1510            "{}",
1511            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1512        )
1513    }
1514}
1515
1516#[cfg(feature = "tabled")]
1517impl tabled::Tabled for SimplePublicObjectInput {
1518    const LENGTH: usize = 1;
1519    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1520        vec![format!("{:?}", self.properties).into()]
1521    }
1522
1523    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1524        vec!["properties".into()]
1525    }
1526}
1527
1528#[derive(
1529    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1530)]
1531pub struct CollectionResponseSimplePublicObjectWithAssociationsForwardPaging {
1532    #[serde(default, skip_serializing_if = "Option::is_none")]
1533    pub paging: Option<ForwardPaging>,
1534    pub results: Vec<SimplePublicObjectWithAssociations>,
1535}
1536
1537impl std::fmt::Display for CollectionResponseSimplePublicObjectWithAssociationsForwardPaging {
1538    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1539        write!(
1540            f,
1541            "{}",
1542            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1543        )
1544    }
1545}
1546
1547#[cfg(feature = "tabled")]
1548impl tabled::Tabled for CollectionResponseSimplePublicObjectWithAssociationsForwardPaging {
1549    const LENGTH: usize = 2;
1550    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1551        vec![
1552            if let Some(paging) = &self.paging {
1553                format!("{:?}", paging).into()
1554            } else {
1555                String::new().into()
1556            },
1557            format!("{:?}", self.results).into(),
1558        ]
1559    }
1560
1561    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1562        vec!["paging".into(), "results".into()]
1563    }
1564}
1565
1566#[derive(
1567    serde :: Serialize,
1568    serde :: Deserialize,
1569    PartialEq,
1570    Hash,
1571    Debug,
1572    Clone,
1573    schemars :: JsonSchema,
1574    parse_display :: FromStr,
1575    parse_display :: Display,
1576)]
1577#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1578#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1579pub enum AssociationCategory {
1580    #[serde(rename = "HUBSPOT_DEFINED")]
1581    #[display("HUBSPOT_DEFINED")]
1582    HubspotDefined,
1583    #[serde(rename = "USER_DEFINED")]
1584    #[display("USER_DEFINED")]
1585    UserDefined,
1586    #[serde(rename = "INTEGRATOR_DEFINED")]
1587    #[display("INTEGRATOR_DEFINED")]
1588    IntegratorDefined,
1589}
1590
1591#[derive(
1592    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1593)]
1594pub struct AssociationSpec {
1595    #[serde(rename = "associationCategory")]
1596    pub association_category: AssociationCategory,
1597    #[serde(rename = "associationTypeId")]
1598    pub association_type_id: i32,
1599}
1600
1601impl std::fmt::Display for AssociationSpec {
1602    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1603        write!(
1604            f,
1605            "{}",
1606            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1607        )
1608    }
1609}
1610
1611#[cfg(feature = "tabled")]
1612impl tabled::Tabled for AssociationSpec {
1613    const LENGTH: usize = 2;
1614    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1615        vec![
1616            format!("{:?}", self.association_category).into(),
1617            format!("{:?}", self.association_type_id).into(),
1618        ]
1619    }
1620
1621    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1622        vec!["association_category".into(), "association_type_id".into()]
1623    }
1624}
1625
1626#[derive(
1627    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1628)]
1629pub struct PublicMergeInput {
1630    #[serde(rename = "objectIdToMerge")]
1631    pub object_id_to_merge: String,
1632    #[serde(rename = "primaryObjectId")]
1633    pub primary_object_id: String,
1634}
1635
1636impl std::fmt::Display for PublicMergeInput {
1637    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1638        write!(
1639            f,
1640            "{}",
1641            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1642        )
1643    }
1644}
1645
1646#[cfg(feature = "tabled")]
1647impl tabled::Tabled for PublicMergeInput {
1648    const LENGTH: usize = 2;
1649    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1650        vec![
1651            self.object_id_to_merge.clone().into(),
1652            self.primary_object_id.clone().into(),
1653        ]
1654    }
1655
1656    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1657        vec!["object_id_to_merge".into(), "primary_object_id".into()]
1658    }
1659}
1660
1661#[derive(
1662    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1663)]
1664pub struct SimplePublicObjectWithAssociations {
1665    #[serde(default, skip_serializing_if = "Option::is_none")]
1666    pub associations: Option<std::collections::HashMap<String, CollectionResponseAssociatedId>>,
1667    #[serde(rename = "createdAt")]
1668    pub created_at: chrono::DateTime<chrono::Utc>,
1669    #[serde(default, skip_serializing_if = "Option::is_none")]
1670    pub archived: Option<bool>,
1671    #[serde(
1672        rename = "archivedAt",
1673        default,
1674        skip_serializing_if = "Option::is_none"
1675    )]
1676    pub archived_at: Option<chrono::DateTime<chrono::Utc>>,
1677    #[serde(
1678        rename = "propertiesWithHistory",
1679        default,
1680        skip_serializing_if = "Option::is_none"
1681    )]
1682    pub properties_with_history: Option<std::collections::HashMap<String, Vec<ValueWithTimestamp>>>,
1683    pub id: String,
1684    pub properties: std::collections::HashMap<String, Option<String>>,
1685    #[serde(rename = "updatedAt")]
1686    pub updated_at: chrono::DateTime<chrono::Utc>,
1687}
1688
1689impl std::fmt::Display for SimplePublicObjectWithAssociations {
1690    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1691        write!(
1692            f,
1693            "{}",
1694            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1695        )
1696    }
1697}
1698
1699#[cfg(feature = "tabled")]
1700impl tabled::Tabled for SimplePublicObjectWithAssociations {
1701    const LENGTH: usize = 8;
1702    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1703        vec![
1704            if let Some(associations) = &self.associations {
1705                format!("{:?}", associations).into()
1706            } else {
1707                String::new().into()
1708            },
1709            format!("{:?}", self.created_at).into(),
1710            if let Some(archived) = &self.archived {
1711                format!("{:?}", archived).into()
1712            } else {
1713                String::new().into()
1714            },
1715            if let Some(archived_at) = &self.archived_at {
1716                format!("{:?}", archived_at).into()
1717            } else {
1718                String::new().into()
1719            },
1720            if let Some(properties_with_history) = &self.properties_with_history {
1721                format!("{:?}", properties_with_history).into()
1722            } else {
1723                String::new().into()
1724            },
1725            self.id.clone().into(),
1726            format!("{:?}", self.properties).into(),
1727            format!("{:?}", self.updated_at).into(),
1728        ]
1729    }
1730
1731    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1732        vec![
1733            "associations".into(),
1734            "created_at".into(),
1735            "archived".into(),
1736            "archived_at".into(),
1737            "properties_with_history".into(),
1738            "id".into(),
1739            "properties".into(),
1740            "updated_at".into(),
1741        ]
1742    }
1743}
1744
1745#[doc = "null"]
1746#[derive(
1747    serde :: Serialize,
1748    serde :: Deserialize,
1749    PartialEq,
1750    Hash,
1751    Debug,
1752    Clone,
1753    schemars :: JsonSchema,
1754    parse_display :: FromStr,
1755    parse_display :: Display,
1756)]
1757#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
1758#[cfg_attr(feature = "tabled", derive(tabled::Tabled))]
1759pub enum Operator {
1760    #[serde(rename = "EQ")]
1761    #[display("EQ")]
1762    Eq,
1763    #[serde(rename = "NEQ")]
1764    #[display("NEQ")]
1765    Neq,
1766    #[serde(rename = "LT")]
1767    #[display("LT")]
1768    Lt,
1769    #[serde(rename = "LTE")]
1770    #[display("LTE")]
1771    Lte,
1772    #[serde(rename = "GT")]
1773    #[display("GT")]
1774    Gt,
1775    #[serde(rename = "GTE")]
1776    #[display("GTE")]
1777    Gte,
1778    #[serde(rename = "BETWEEN")]
1779    #[display("BETWEEN")]
1780    Between,
1781    #[serde(rename = "IN")]
1782    #[display("IN")]
1783    In,
1784    #[serde(rename = "NOT_IN")]
1785    #[display("NOT_IN")]
1786    NotIn,
1787    #[serde(rename = "HAS_PROPERTY")]
1788    #[display("HAS_PROPERTY")]
1789    HasProperty,
1790    #[serde(rename = "NOT_HAS_PROPERTY")]
1791    #[display("NOT_HAS_PROPERTY")]
1792    NotHasProperty,
1793    #[serde(rename = "CONTAINS_TOKEN")]
1794    #[display("CONTAINS_TOKEN")]
1795    ContainsToken,
1796    #[serde(rename = "NOT_CONTAINS_TOKEN")]
1797    #[display("NOT_CONTAINS_TOKEN")]
1798    NotContainsToken,
1799}
1800
1801#[derive(
1802    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1803)]
1804pub struct Filter {
1805    #[serde(rename = "highValue", default, skip_serializing_if = "Option::is_none")]
1806    pub high_value: Option<String>,
1807    #[serde(rename = "propertyName")]
1808    pub property_name: String,
1809    #[serde(default, skip_serializing_if = "Option::is_none")]
1810    pub values: Option<Vec<String>>,
1811    #[serde(default, skip_serializing_if = "Option::is_none")]
1812    pub value: Option<String>,
1813    #[doc = "null"]
1814    pub operator: Operator,
1815}
1816
1817impl std::fmt::Display for Filter {
1818    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1819        write!(
1820            f,
1821            "{}",
1822            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1823        )
1824    }
1825}
1826
1827#[cfg(feature = "tabled")]
1828impl tabled::Tabled for Filter {
1829    const LENGTH: usize = 5;
1830    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1831        vec![
1832            if let Some(high_value) = &self.high_value {
1833                format!("{:?}", high_value).into()
1834            } else {
1835                String::new().into()
1836            },
1837            self.property_name.clone().into(),
1838            if let Some(values) = &self.values {
1839                format!("{:?}", values).into()
1840            } else {
1841                String::new().into()
1842            },
1843            if let Some(value) = &self.value {
1844                format!("{:?}", value).into()
1845            } else {
1846                String::new().into()
1847            },
1848            format!("{:?}", self.operator).into(),
1849        ]
1850    }
1851
1852    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1853        vec![
1854            "high_value".into(),
1855            "property_name".into(),
1856            "values".into(),
1857            "value".into(),
1858            "operator".into(),
1859        ]
1860    }
1861}
1862
1863#[derive(
1864    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1865)]
1866pub struct BatchInputSimplePublicObjectBatchInput {
1867    pub inputs: Vec<SimplePublicObjectBatchInput>,
1868}
1869
1870impl std::fmt::Display for BatchInputSimplePublicObjectBatchInput {
1871    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1872        write!(
1873            f,
1874            "{}",
1875            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1876        )
1877    }
1878}
1879
1880#[cfg(feature = "tabled")]
1881impl tabled::Tabled for BatchInputSimplePublicObjectBatchInput {
1882    const LENGTH: usize = 1;
1883    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1884        vec![format!("{:?}", self.inputs).into()]
1885    }
1886
1887    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1888        vec!["inputs".into()]
1889    }
1890}
1891
1892#[derive(
1893    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1894)]
1895pub struct BatchInputSimplePublicObjectInputForCreate {
1896    pub inputs: Vec<SimplePublicObjectInputForCreate>,
1897}
1898
1899impl std::fmt::Display for BatchInputSimplePublicObjectInputForCreate {
1900    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1901        write!(
1902            f,
1903            "{}",
1904            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1905        )
1906    }
1907}
1908
1909#[cfg(feature = "tabled")]
1910impl tabled::Tabled for BatchInputSimplePublicObjectInputForCreate {
1911    const LENGTH: usize = 1;
1912    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1913        vec![format!("{:?}", self.inputs).into()]
1914    }
1915
1916    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1917        vec!["inputs".into()]
1918    }
1919}
1920
1921#[derive(
1922    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1923)]
1924pub struct PreviousPage {
1925    pub before: String,
1926    #[serde(default, skip_serializing_if = "Option::is_none")]
1927    pub link: Option<String>,
1928}
1929
1930impl std::fmt::Display for PreviousPage {
1931    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1932        write!(
1933            f,
1934            "{}",
1935            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1936        )
1937    }
1938}
1939
1940#[cfg(feature = "tabled")]
1941impl tabled::Tabled for PreviousPage {
1942    const LENGTH: usize = 2;
1943    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1944        vec![
1945            self.before.clone().into(),
1946            if let Some(link) = &self.link {
1947                format!("{:?}", link).into()
1948            } else {
1949                String::new().into()
1950            },
1951        ]
1952    }
1953
1954    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1955        vec!["before".into(), "link".into()]
1956    }
1957}
1958
1959#[derive(
1960    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
1961)]
1962pub struct SimplePublicObjectBatchInput {
1963    #[serde(
1964        rename = "idProperty",
1965        default,
1966        skip_serializing_if = "Option::is_none"
1967    )]
1968    pub id_property: Option<String>,
1969    pub id: String,
1970    pub properties: std::collections::HashMap<String, String>,
1971}
1972
1973impl std::fmt::Display for SimplePublicObjectBatchInput {
1974    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
1975        write!(
1976            f,
1977            "{}",
1978            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
1979        )
1980    }
1981}
1982
1983#[cfg(feature = "tabled")]
1984impl tabled::Tabled for SimplePublicObjectBatchInput {
1985    const LENGTH: usize = 3;
1986    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
1987        vec![
1988            if let Some(id_property) = &self.id_property {
1989                format!("{:?}", id_property).into()
1990            } else {
1991                String::new().into()
1992            },
1993            self.id.clone().into(),
1994            format!("{:?}", self.properties).into(),
1995        ]
1996    }
1997
1998    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
1999        vec!["id_property".into(), "id".into(), "properties".into()]
2000    }
2001}
2002
2003#[derive(
2004    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2005)]
2006pub struct AssociatedId {
2007    pub id: String,
2008    #[serde(rename = "type")]
2009    pub type_: String,
2010}
2011
2012impl std::fmt::Display for AssociatedId {
2013    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2014        write!(
2015            f,
2016            "{}",
2017            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2018        )
2019    }
2020}
2021
2022#[cfg(feature = "tabled")]
2023impl tabled::Tabled for AssociatedId {
2024    const LENGTH: usize = 2;
2025    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2026        vec![self.id.clone().into(), self.type_.clone().into()]
2027    }
2028
2029    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2030        vec!["id".into(), "type_".into()]
2031    }
2032}
2033
2034#[derive(
2035    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2036)]
2037pub struct NextPage {
2038    #[serde(default, skip_serializing_if = "Option::is_none")]
2039    pub link: Option<String>,
2040    pub after: String,
2041}
2042
2043impl std::fmt::Display for NextPage {
2044    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2045        write!(
2046            f,
2047            "{}",
2048            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2049        )
2050    }
2051}
2052
2053#[cfg(feature = "tabled")]
2054impl tabled::Tabled for NextPage {
2055    const LENGTH: usize = 2;
2056    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2057        vec![
2058            if let Some(link) = &self.link {
2059                format!("{:?}", link).into()
2060            } else {
2061                String::new().into()
2062            },
2063            self.after.clone().into(),
2064        ]
2065    }
2066
2067    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2068        vec!["link".into(), "after".into()]
2069    }
2070}
2071
2072#[derive(
2073    serde :: Serialize, serde :: Deserialize, PartialEq, Debug, Clone, schemars :: JsonSchema,
2074)]
2075pub struct SimplePublicObjectInputForCreate {
2076    pub associations: Vec<PublicAssociationsForObject>,
2077    pub properties: std::collections::HashMap<String, String>,
2078}
2079
2080impl std::fmt::Display for SimplePublicObjectInputForCreate {
2081    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
2082        write!(
2083            f,
2084            "{}",
2085            serde_json::to_string_pretty(self).map_err(|_| std::fmt::Error)?
2086        )
2087    }
2088}
2089
2090#[cfg(feature = "tabled")]
2091impl tabled::Tabled for SimplePublicObjectInputForCreate {
2092    const LENGTH: usize = 2;
2093    fn fields(&self) -> Vec<std::borrow::Cow<'static, str>> {
2094        vec![
2095            format!("{:?}", self.associations).into(),
2096            format!("{:?}", self.properties).into(),
2097        ]
2098    }
2099
2100    fn headers() -> Vec<std::borrow::Cow<'static, str>> {
2101        vec!["associations".into(), "properties".into()]
2102    }
2103}