ferrtable 0.0.2

Ferris the crab's favorite Airtable library
Documentation
use std::fmt::Debug;

#[cfg(feature = "chrono")]
use chrono::{DateTime, Utc};
use serde::Deserialize;

// TODO: Write custom implementation of `Debug` trait that allows the `T: Debug`
// bound to be removed.
#[derive(Clone, Debug, Deserialize)]
pub struct AirtableRecord<T>
where
    T: Clone + Debug,
{
    /// Record ID.
    pub id: String,

    /// Timestamp of record creation.
    #[cfg(feature = "chrono")]
    #[serde(rename = "createdTime")]
    pub created_time: DateTime<Utc>,

    /// Timestamp of record creation.
    #[cfg(not(feature = "chrono"))]
    #[serde(rename = "createdTime")]
    pub created_time: String,

    /// Contents of record data.
    pub fields: T,

    /// The number of comments (if there are any) on the record.
    ///
    /// Only received when explicitly requested.
    #[serde(rename = "commentCount")]
    pub comment_count: Option<usize>,
}