diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2018-05-16 20:55:01 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2018-05-16 20:55:01 -0700 |
commit | 39456677cdc9768ad0dea76be4fd36735eec3ed2 (patch) | |
tree | 378dbea08ba05030a6ede6ca17233bc18fc6c756 /rust/fatcat-api/src/models.rs | |
parent | 7476d63f0b9adec8087919a776b1bc4bf14b157d (diff) | |
download | fatcat-39456677cdc9768ad0dea76be4fd36735eec3ed2.tar.gz fatcat-39456677cdc9768ad0dea76be4fd36735eec3ed2.zip |
simplify API a bit
Diffstat (limited to 'rust/fatcat-api/src/models.rs')
-rw-r--r-- | rust/fatcat-api/src/models.rs | 26 |
1 files changed, 10 insertions, 16 deletions
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<String>, - #[serde(rename = "parent")] - #[serde(skip_serializing_if = "Option::is_none")] - pub parent: Option<String>, - #[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<String>, - #[serde(rename = "license")] + #[serde(rename = "container_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub license: Option<String>, + pub container_id: Option<String>, - #[serde(rename = "container")] + #[serde(rename = "work_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub container: Option<String>, + pub work_id: Option<String>, - #[serde(rename = "work")] - #[serde(skip_serializing_if = "Option::is_none")] - pub work: Option<String>, + #[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, |