1 use crate::newtypes::InstanceId;
2 #[cfg(feature = "full")]
3 use crate::schema::instance;
4 use serde::{Deserialize, Serialize};
5 use serde_with::skip_serializing_none;
7 #[cfg(feature = "full")]
9 use typed_builder::TypedBuilder;
11 #[skip_serializing_none]
12 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
13 #[cfg_attr(feature = "full", derive(Queryable, Identifiable, TS))]
14 #[cfg_attr(feature = "full", diesel(table_name = instance))]
15 #[cfg_attr(feature = "full", ts(export))]
16 /// A federated instance / site.
20 pub published: chrono::NaiveDateTime,
21 pub updated: Option<chrono::NaiveDateTime>,
22 pub software: Option<String>,
23 pub version: Option<String>,
26 #[derive(Clone, TypedBuilder)]
27 #[builder(field_defaults(default))]
28 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
29 #[cfg_attr(feature = "full", diesel(table_name = instance))]
30 pub struct InstanceForm {
33 pub software: Option<String>,
34 pub version: Option<String>,
35 pub updated: Option<chrono::NaiveDateTime>,