From 39456677cdc9768ad0dea76be4fd36735eec3ed2 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 16 May 2018 20:55:01 -0700 Subject: simplify API a bit --- rust/fatcat-api/src/models.rs | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) (limited to 'rust/fatcat-api/src') diff --git a/rust/fatcat-api/src/models.rs b/rust/fatcat-api/src/models.rs index 2b187eaf..82fe7bad 100644 --- a/rust/fatcat-api/src/models.rs +++ b/rust/fatcat-api/src/models.rs @@ -42,10 +42,6 @@ pub struct ContainerEntity { #[serde(skip_serializing_if = "Option::is_none")] pub publisher: Option, - #[serde(rename = "parent")] - #[serde(skip_serializing_if = "Option::is_none")] - pub parent: Option, - #[serde(rename = "name")] pub name: String, @@ -76,7 +72,6 @@ impl ContainerEntity { ContainerEntity { issn: None, publisher: None, - parent: None, name: name, state: None, ident: None, @@ -275,17 +270,16 @@ pub struct ReleaseEntity { #[serde(skip_serializing_if = "Option::is_none")] pub release_type: Option, - #[serde(rename = "license")] + #[serde(rename = "container_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub license: Option, + pub container_id: Option, - #[serde(rename = "container")] + #[serde(rename = "work_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub container: Option, + pub work_id: Option, - #[serde(rename = "work")] - #[serde(skip_serializing_if = "Option::is_none")] - pub work: Option, + #[serde(rename = "title")] + pub title: String, // Note: inline enums are not fully supported by swagger-codegen #[serde(rename = "state")] @@ -310,16 +304,16 @@ pub struct ReleaseEntity { } impl ReleaseEntity { - pub fn new() -> ReleaseEntity { + pub fn new(title: String) -> ReleaseEntity { ReleaseEntity { issue: None, pages: None, volume: None, doi: None, release_type: None, - license: None, - container: None, - work: None, + container_id: None, + work_id: None, + title: title, state: None, ident: None, revision: None, -- cgit v1.2.3