From 63db335123d8dde1c4e701668c07805094ff88e8 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 24 May 2018 01:31:44 -0700 Subject: WIP on API spec improvements Fixes a bunch of i64/i32/isize stuff --- rust/fatcat-api/src/client.rs | 4 ++-- rust/fatcat-api/src/lib.rs | 12 +++++------ rust/fatcat-api/src/models.rs | 50 ++++++++++++++++++++++++++----------------- 3 files changed, 38 insertions(+), 28 deletions(-) (limited to 'rust/fatcat-api/src') diff --git a/rust/fatcat-api/src/client.rs b/rust/fatcat-api/src/client.rs index 4fa084f9..517d9705 100644 --- a/rust/fatcat-api/src/client.rs +++ b/rust/fatcat-api/src/client.rs @@ -537,7 +537,7 @@ impl Api for Client { Box::new(futures::done(result)) } - fn editgroup_id_accept_post(&self, param_id: i32, context: &Context) -> Box + Send> { + fn editgroup_id_accept_post(&self, param_id: i64, context: &Context) -> Box + Send> { let url = format!("{}/v0/editgroup/{id}/accept", self.base_path, id = utf8_percent_encode(¶m_id.to_string(), PATH_SEGMENT_ENCODE_SET)); let hyper_client = (self.hyper_client)(); @@ -597,7 +597,7 @@ impl Api for Client { Box::new(futures::done(result)) } - fn editgroup_id_get(&self, param_id: i32, context: &Context) -> Box + Send> { + fn editgroup_id_get(&self, param_id: i64, context: &Context) -> Box + Send> { let url = format!("{}/v0/editgroup/{id}", self.base_path, id = utf8_percent_encode(¶m_id.to_string(), PATH_SEGMENT_ENCODE_SET)); let hyper_client = (self.hyper_client)(); diff --git a/rust/fatcat-api/src/lib.rs b/rust/fatcat-api/src/lib.rs index abd68f04..94633e00 100644 --- a/rust/fatcat-api/src/lib.rs +++ b/rust/fatcat-api/src/lib.rs @@ -268,9 +268,9 @@ pub trait Api { fn creator_post(&self, body: models::CreatorEntity, context: &Context) -> Box + Send>; - fn editgroup_id_accept_post(&self, id: i32, context: &Context) -> Box + Send>; + fn editgroup_id_accept_post(&self, id: i64, context: &Context) -> Box + Send>; - fn editgroup_id_get(&self, id: i32, context: &Context) -> Box + Send>; + fn editgroup_id_get(&self, id: i64, context: &Context) -> Box + Send>; fn editgroup_post(&self, body: models::Editgroup, context: &Context) -> Box + Send>; @@ -309,9 +309,9 @@ pub trait ApiNoContext { fn creator_post(&self, body: models::CreatorEntity) -> Box + Send>; - fn editgroup_id_accept_post(&self, id: i32) -> Box + Send>; + fn editgroup_id_accept_post(&self, id: i64) -> Box + Send>; - fn editgroup_id_get(&self, id: i32) -> Box + Send>; + fn editgroup_id_get(&self, id: i64) -> Box + Send>; fn editgroup_post(&self, body: models::Editgroup) -> Box + Send>; @@ -376,11 +376,11 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().creator_post(body, &self.context()) } - fn editgroup_id_accept_post(&self, id: i32) -> Box + Send> { + fn editgroup_id_accept_post(&self, id: i64) -> Box + Send> { self.api().editgroup_id_accept_post(id, &self.context()) } - fn editgroup_id_get(&self, id: i32) -> Box + Send> { + fn editgroup_id_get(&self, id: i64) -> Box + Send> { self.api().editgroup_id_get(id, &self.context()) } diff --git a/rust/fatcat-api/src/models.rs b/rust/fatcat-api/src/models.rs index 784068e3..9609e5ec 100644 --- a/rust/fatcat-api/src/models.rs +++ b/rust/fatcat-api/src/models.rs @@ -72,17 +72,17 @@ impl ::std::ops::DerefMut for Changelogentries { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct ChangelogentriesInner { #[serde(rename = "index")] - pub index: isize, + pub index: i64, #[serde(rename = "editgroup_id")] - pub editgroup_id: isize, + pub editgroup_id: i64, #[serde(rename = "timestamp")] pub timestamp: chrono::DateTime, } impl ChangelogentriesInner { - pub fn new(index: isize, editgroup_id: isize, timestamp: chrono::DateTime) -> ChangelogentriesInner { + pub fn new(index: i64, editgroup_id: i64, timestamp: chrono::DateTime) -> ChangelogentriesInner { ChangelogentriesInner { index: index, editgroup_id: editgroup_id, @@ -115,7 +115,7 @@ pub struct ContainerEntity { #[serde(rename = "revision")] #[serde(skip_serializing_if = "Option::is_none")] - pub revision: Option, + pub revision: Option, #[serde(rename = "redirect")] #[serde(skip_serializing_if = "Option::is_none")] @@ -123,7 +123,7 @@ pub struct ContainerEntity { #[serde(rename = "editgroup_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub editgroup_id: Option, + pub editgroup_id: Option, } impl ContainerEntity { @@ -152,7 +152,7 @@ pub struct CreatorEntity { #[serde(rename = "editgroup_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub editgroup_id: Option, + pub editgroup_id: Option, #[serde(rename = "redirect")] #[serde(skip_serializing_if = "Option::is_none")] @@ -160,7 +160,7 @@ pub struct CreatorEntity { #[serde(rename = "revision")] #[serde(skip_serializing_if = "Option::is_none")] - pub revision: Option, + pub revision: Option, #[serde(rename = "ident")] #[serde(skip_serializing_if = "Option::is_none")] @@ -190,22 +190,32 @@ impl CreatorEntity { pub struct Editgroup { #[serde(rename = "id")] #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, + pub id: Option, #[serde(rename = "editor_id")] - pub editor_id: isize, + pub editor_id: i64, #[serde(rename = "description")] #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, + + #[serde(rename = "container_edits")] + #[serde(skip_serializing_if = "Option::is_none")] + pub container_edits: Option, + + #[serde(rename = "extra")] + #[serde(skip_serializing_if = "Option::is_none")] + pub extra: Option>, } impl Editgroup { - pub fn new(editor_id: isize) -> Editgroup { + pub fn new(editor_id: i64) -> Editgroup { Editgroup { id: None, editor_id: editor_id, description: None, + container_edits: None, + extra: None, } } } @@ -226,11 +236,11 @@ impl Editor { pub struct EntityEdit { #[serde(rename = "editgroup_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub editgroup_id: Option, + pub editgroup_id: Option, #[serde(rename = "revision")] #[serde(skip_serializing_if = "Option::is_none")] - pub revision: Option, + pub revision: Option, #[serde(rename = "ident")] #[serde(skip_serializing_if = "Option::is_none")] @@ -238,7 +248,7 @@ pub struct EntityEdit { #[serde(rename = "edit_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub edit_id: Option, + pub edit_id: Option, } impl EntityEdit { @@ -276,11 +286,11 @@ pub struct FileEntity { #[serde(rename = "size")] #[serde(skip_serializing_if = "Option::is_none")] - pub size: Option, + pub size: Option, #[serde(rename = "editgroup_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub editgroup_id: Option, + pub editgroup_id: Option, #[serde(rename = "redirect")] #[serde(skip_serializing_if = "Option::is_none")] @@ -288,7 +298,7 @@ pub struct FileEntity { #[serde(rename = "revision")] #[serde(skip_serializing_if = "Option::is_none")] - pub revision: Option, + pub revision: Option, #[serde(rename = "ident")] #[serde(skip_serializing_if = "Option::is_none")] @@ -358,7 +368,7 @@ pub struct ReleaseEntity { #[serde(rename = "revision")] #[serde(skip_serializing_if = "Option::is_none")] - pub revision: Option, + pub revision: Option, #[serde(rename = "redirect")] #[serde(skip_serializing_if = "Option::is_none")] @@ -366,7 +376,7 @@ pub struct ReleaseEntity { #[serde(rename = "editgroup_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub editgroup_id: Option, + pub editgroup_id: Option, } impl ReleaseEntity { @@ -409,7 +419,7 @@ pub struct WorkEntity { #[serde(rename = "editgroup_id")] #[serde(skip_serializing_if = "Option::is_none")] - pub editgroup_id: Option, + pub editgroup_id: Option, #[serde(rename = "redirect")] #[serde(skip_serializing_if = "Option::is_none")] @@ -417,7 +427,7 @@ pub struct WorkEntity { #[serde(rename = "revision")] #[serde(skip_serializing_if = "Option::is_none")] - pub revision: Option, + pub revision: Option, #[serde(rename = "ident")] #[serde(skip_serializing_if = "Option::is_none")] -- cgit v1.2.3