From 8e92be6e1e9396f4920c0f947337e1be643e1994 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 25 May 2018 14:03:37 -0700 Subject: edit lists, refs, contribs --- rust/fatcat-api/src/models.rs | 107 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 106 insertions(+), 1 deletion(-) (limited to 'rust/fatcat-api/src') diff --git a/rust/fatcat-api/src/models.rs b/rust/fatcat-api/src/models.rs index 6c13e091..5118872f 100644 --- a/rust/fatcat-api/src/models.rs +++ b/rust/fatcat-api/src/models.rs @@ -1,7 +1,7 @@ #![allow(unused_imports, unused_qualifications, unused_extern_crates)] extern crate chrono; -extern crate uuid; extern crate serde_json; +extern crate uuid; use serde::ser::Serializer; @@ -213,6 +213,10 @@ pub struct Editgroup { #[serde(rename = "extra")] #[serde(skip_serializing_if = "Option::is_none")] pub extra: Option, + + #[serde(rename = "edits")] + #[serde(skip_serializing_if = "Option::is_none")] + pub edits: Option, } impl Editgroup { @@ -222,6 +226,42 @@ impl Editgroup { editor_id: editor_id, description: None, extra: None, + edits: None, + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct EditgroupEdits { + #[serde(rename = "containers")] + #[serde(skip_serializing_if = "Option::is_none")] + pub containers: Option>, + + #[serde(rename = "creators")] + #[serde(skip_serializing_if = "Option::is_none")] + pub creators: Option>, + + #[serde(rename = "files")] + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option>, + + #[serde(rename = "releases")] + #[serde(skip_serializing_if = "Option::is_none")] + pub releases: Option>, + + #[serde(rename = "works")] + #[serde(skip_serializing_if = "Option::is_none")] + pub works: Option>, +} + +impl EditgroupEdits { + pub fn new() -> EditgroupEdits { + EditgroupEdits { + containers: None, + creators: None, + files: None, + releases: None, + works: None, } } } @@ -341,8 +381,46 @@ impl FileEntity { } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ReleaseContrib { + #[serde(rename = "index")] + #[serde(skip_serializing_if = "Option::is_none")] + pub index: Option, + + #[serde(rename = "creator_id")] + #[serde(skip_serializing_if = "Option::is_none")] + pub creator_id: Option, + + #[serde(rename = "creator_stub")] + #[serde(skip_serializing_if = "Option::is_none")] + pub creator_stub: Option, + + #[serde(rename = "contrib_type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub contrib_type: Option, +} + +impl ReleaseContrib { + pub fn new() -> ReleaseContrib { + ReleaseContrib { + index: None, + creator_id: None, + creator_stub: None, + contrib_type: None, + } + } +} + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ReleaseEntity { + #[serde(rename = "refs")] + #[serde(skip_serializing_if = "Option::is_none")] + pub refs: Option>, + + #[serde(rename = "contribs")] + #[serde(skip_serializing_if = "Option::is_none")] + pub contribs: Option>, + #[serde(rename = "issue")] #[serde(skip_serializing_if = "Option::is_none")] pub issue: Option, @@ -402,6 +480,8 @@ pub struct ReleaseEntity { impl ReleaseEntity { pub fn new(work_id: String, title: String) -> ReleaseEntity { ReleaseEntity { + refs: None, + contribs: None, issue: None, pages: None, volume: None, @@ -420,6 +500,31 @@ impl ReleaseEntity { } } +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct ReleaseRef { + #[serde(rename = "index")] + #[serde(skip_serializing_if = "Option::is_none")] + pub index: Option, + + #[serde(rename = "target_release_id")] + #[serde(skip_serializing_if = "Option::is_none")] + pub target_release_id: Option, + + #[serde(rename = "stub")] + #[serde(skip_serializing_if = "Option::is_none")] + pub stub: Option, +} + +impl ReleaseRef { + pub fn new() -> ReleaseRef { + ReleaseRef { + index: None, + target_release_id: None, + stub: None, + } + } +} + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Success { #[serde(rename = "message")] -- cgit v1.2.3