thoth_api/publisher/
model.rs

1use uuid::Uuid;
2
3#[cfg(feature = "backend")]
4use crate::schema::publisher;
5
6#[cfg_attr(feature = "backend", derive(Queryable))]
7pub struct Publisher {
8    pub publisher_id: Uuid,
9    pub publisher_name: String,
10    pub publisher_shortname: Option<String>,
11    pub publisher_url: Option<String>,
12}
13
14#[cfg_attr(
15    feature = "backend",
16    derive(juniper::GraphQLInputObject, Insertable),
17    table_name = "publisher"
18)]
19pub struct NewPublisher {
20    pub publisher_name: String,
21    pub publisher_shortname: Option<String>,
22    pub publisher_url: Option<String>,
23}
24
25#[cfg_attr(
26    feature = "backend",
27    derive(juniper::GraphQLInputObject, AsChangeset),
28    changeset_options(treat_none_as_null = "true"),
29    table_name = "publisher"
30)]
31pub struct PatchPublisher {
32    pub publisher_id: Uuid,
33    pub publisher_name: String,
34    pub publisher_shortname: Option<String>,
35    pub publisher_url: Option<String>,
36}