From 91c080a2e82ec4e8908cb8e3916a543519151847 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 11 Sep 2018 16:10:47 -0700 Subject: implement new editgroup_id behavior --- rust/fatcat-api-spec/src/client.rs | 113 ++++++++++++++++++++++++++++++------- rust/fatcat-api-spec/src/lib.rs | 80 +++++++++++++------------- rust/fatcat-api-spec/src/models.rs | 55 ++++++++---------- rust/fatcat-api-spec/src/server.rs | 60 ++++++++++++++++---- 4 files changed, 208 insertions(+), 100 deletions(-) (limited to 'rust/fatcat-api-spec/src') diff --git a/rust/fatcat-api-spec/src/client.rs b/rust/fatcat-api-spec/src/client.rs index a08e3cfe..c403515b 100644 --- a/rust/fatcat-api-spec/src/client.rs +++ b/rust/fatcat-api-spec/src/client.rs @@ -233,8 +233,11 @@ impl Api for Client { Box::new(futures::done(result)) } - fn create_container(&self, param_entity: models::ContainerEntity, context: &Context) -> Box + Send> { - let url = format!("{}/v0/container", self.base_path); + fn create_container(&self, param_entity: models::ContainerEntity, param_editgroup: Option, context: &Context) -> Box + Send> { + // Query parameters + let query_editgroup = param_editgroup.map_or_else(String::new, |query| format!("editgroup={editgroup}&", editgroup = query.to_string())); + + let url = format!("{}/v0/container?{editgroup}", self.base_path, editgroup = utf8_percent_encode(&query_editgroup, QUERY_ENCODE_SET)); let body = serde_json::to_string(¶m_entity).expect("impossible to fail to serialize"); @@ -378,8 +381,11 @@ impl Api for Client { Box::new(futures::done(result)) } - fn create_creator(&self, param_entity: models::CreatorEntity, context: &Context) -> Box + Send> { - let url = format!("{}/v0/creator", self.base_path); + fn create_creator(&self, param_entity: models::CreatorEntity, param_editgroup: Option, context: &Context) -> Box + Send> { + // Query parameters + let query_editgroup = param_editgroup.map_or_else(String::new, |query| format!("editgroup={editgroup}&", editgroup = query.to_string())); + + let url = format!("{}/v0/creator?{editgroup}", self.base_path, editgroup = utf8_percent_encode(&query_editgroup, QUERY_ENCODE_SET)); let body = serde_json::to_string(¶m_entity).expect("impossible to fail to serialize"); @@ -581,8 +587,11 @@ impl Api for Client { Box::new(futures::done(result)) } - fn create_file(&self, param_entity: models::FileEntity, context: &Context) -> Box + Send> { - let url = format!("{}/v0/file", self.base_path); + fn create_file(&self, param_entity: models::FileEntity, param_editgroup: Option, context: &Context) -> Box + Send> { + // Query parameters + let query_editgroup = param_editgroup.map_or_else(String::new, |query| format!("editgroup={editgroup}&", editgroup = query.to_string())); + + let url = format!("{}/v0/file?{editgroup}", self.base_path, editgroup = utf8_percent_encode(&query_editgroup, QUERY_ENCODE_SET)); let body = serde_json::to_string(¶m_entity).expect("impossible to fail to serialize"); @@ -726,8 +735,11 @@ impl Api for Client { Box::new(futures::done(result)) } - fn create_release(&self, param_entity: models::ReleaseEntity, context: &Context) -> Box + Send> { - let url = format!("{}/v0/release", self.base_path); + fn create_release(&self, param_entity: models::ReleaseEntity, param_editgroup: Option, context: &Context) -> Box + Send> { + // Query parameters + let query_editgroup = param_editgroup.map_or_else(String::new, |query| format!("editgroup={editgroup}&", editgroup = query.to_string())); + + let url = format!("{}/v0/release?{editgroup}", self.base_path, editgroup = utf8_percent_encode(&query_editgroup, QUERY_ENCODE_SET)); let body = serde_json::to_string(¶m_entity).expect("impossible to fail to serialize"); @@ -871,8 +883,11 @@ impl Api for Client { Box::new(futures::done(result)) } - fn create_work(&self, param_entity: models::WorkEntity, context: &Context) -> Box + Send> { - let url = format!("{}/v0/work", self.base_path); + fn create_work(&self, param_entity: models::WorkEntity, param_editgroup: Option, context: &Context) -> Box + Send> { + // Query parameters + let query_editgroup = param_editgroup.map_or_else(String::new, |query| format!("editgroup={editgroup}&", editgroup = query.to_string())); + + let url = format!("{}/v0/work?{editgroup}", self.base_path, editgroup = utf8_percent_encode(&query_editgroup, QUERY_ENCODE_SET)); let body = serde_json::to_string(¶m_entity).expect("impossible to fail to serialize"); @@ -2799,8 +2814,22 @@ impl Api for Client { Box::new(futures::done(result)) } - fn update_container(&self, param_id: String, param_entity: models::ContainerEntity, context: &Context) -> Box + Send> { - let url = format!("{}/v0/container/{id}", self.base_path, id = utf8_percent_encode(¶m_id.to_string(), PATH_SEGMENT_ENCODE_SET)); + fn update_container( + &self, + param_id: String, + param_entity: models::ContainerEntity, + param_editgroup: Option, + context: &Context, + ) -> Box + Send> { + // Query parameters + let query_editgroup = param_editgroup.map_or_else(String::new, |query| format!("editgroup={editgroup}&", editgroup = query.to_string())); + + let url = format!( + "{}/v0/container/{id}?{editgroup}", + self.base_path, + id = utf8_percent_encode(¶m_id.to_string(), PATH_SEGMENT_ENCODE_SET), + editgroup = utf8_percent_encode(&query_editgroup, QUERY_ENCODE_SET) + ); let body = serde_json::to_string(¶m_entity).expect("impossible to fail to serialize"); @@ -2864,8 +2893,22 @@ impl Api for Client { Box::new(futures::done(result)) } - fn update_creator(&self, param_id: String, param_entity: models::CreatorEntity, context: &Context) -> Box + Send> { - let url = format!("{}/v0/creator/{id}", self.base_path, id = utf8_percent_encode(¶m_id.to_string(), PATH_SEGMENT_ENCODE_SET)); + fn update_creator( + &self, + param_id: String, + param_entity: models::CreatorEntity, + param_editgroup: Option, + context: &Context, + ) -> Box + Send> { + // Query parameters + let query_editgroup = param_editgroup.map_or_else(String::new, |query| format!("editgroup={editgroup}&", editgroup = query.to_string())); + + let url = format!( + "{}/v0/creator/{id}?{editgroup}", + self.base_path, + id = utf8_percent_encode(¶m_id.to_string(), PATH_SEGMENT_ENCODE_SET), + editgroup = utf8_percent_encode(&query_editgroup, QUERY_ENCODE_SET) + ); let body = serde_json::to_string(¶m_entity).expect("impossible to fail to serialize"); @@ -2929,8 +2972,16 @@ impl Api for Client { Box::new(futures::done(result)) } - fn update_file(&self, param_id: String, param_entity: models::FileEntity, context: &Context) -> Box + Send> { - let url = format!("{}/v0/file/{id}", self.base_path, id = utf8_percent_encode(¶m_id.to_string(), PATH_SEGMENT_ENCODE_SET)); + fn update_file(&self, param_id: String, param_entity: models::FileEntity, param_editgroup: Option, context: &Context) -> Box + Send> { + // Query parameters + let query_editgroup = param_editgroup.map_or_else(String::new, |query| format!("editgroup={editgroup}&", editgroup = query.to_string())); + + let url = format!( + "{}/v0/file/{id}?{editgroup}", + self.base_path, + id = utf8_percent_encode(¶m_id.to_string(), PATH_SEGMENT_ENCODE_SET), + editgroup = utf8_percent_encode(&query_editgroup, QUERY_ENCODE_SET) + ); let body = serde_json::to_string(¶m_entity).expect("impossible to fail to serialize"); @@ -2994,8 +3045,22 @@ impl Api for Client { Box::new(futures::done(result)) } - fn update_release(&self, param_id: String, param_entity: models::ReleaseEntity, context: &Context) -> Box + Send> { - let url = format!("{}/v0/release/{id}", self.base_path, id = utf8_percent_encode(¶m_id.to_string(), PATH_SEGMENT_ENCODE_SET)); + fn update_release( + &self, + param_id: String, + param_entity: models::ReleaseEntity, + param_editgroup: Option, + context: &Context, + ) -> Box + Send> { + // Query parameters + let query_editgroup = param_editgroup.map_or_else(String::new, |query| format!("editgroup={editgroup}&", editgroup = query.to_string())); + + let url = format!( + "{}/v0/release/{id}?{editgroup}", + self.base_path, + id = utf8_percent_encode(¶m_id.to_string(), PATH_SEGMENT_ENCODE_SET), + editgroup = utf8_percent_encode(&query_editgroup, QUERY_ENCODE_SET) + ); let body = serde_json::to_string(¶m_entity).expect("impossible to fail to serialize"); @@ -3059,8 +3124,16 @@ impl Api for Client { Box::new(futures::done(result)) } - fn update_work(&self, param_id: String, param_entity: models::WorkEntity, context: &Context) -> Box + Send> { - let url = format!("{}/v0/work/{id}", self.base_path, id = utf8_percent_encode(¶m_id.to_string(), PATH_SEGMENT_ENCODE_SET)); + fn update_work(&self, param_id: String, param_entity: models::WorkEntity, param_editgroup: Option, context: &Context) -> Box + Send> { + // Query parameters + let query_editgroup = param_editgroup.map_or_else(String::new, |query| format!("editgroup={editgroup}&", editgroup = query.to_string())); + + let url = format!( + "{}/v0/work/{id}?{editgroup}", + self.base_path, + id = utf8_percent_encode(¶m_id.to_string(), PATH_SEGMENT_ENCODE_SET), + editgroup = utf8_percent_encode(&query_editgroup, QUERY_ENCODE_SET) + ); let body = serde_json::to_string(¶m_entity).expect("impossible to fail to serialize"); diff --git a/rust/fatcat-api-spec/src/lib.rs b/rust/fatcat-api-spec/src/lib.rs index a08c6e04..a246bb43 100644 --- a/rust/fatcat-api-spec/src/lib.rs +++ b/rust/fatcat-api-spec/src/lib.rs @@ -566,7 +566,7 @@ pub enum UpdateWorkResponse { pub trait Api { fn accept_editgroup(&self, id: String, context: &Context) -> Box + Send>; - fn create_container(&self, entity: models::ContainerEntity, context: &Context) -> Box + Send>; + fn create_container(&self, entity: models::ContainerEntity, editgroup: Option, context: &Context) -> Box + Send>; fn create_container_batch( &self, @@ -576,7 +576,7 @@ pub trait Api { context: &Context, ) -> Box + Send>; - fn create_creator(&self, entity: models::CreatorEntity, context: &Context) -> Box + Send>; + fn create_creator(&self, entity: models::CreatorEntity, editgroup: Option, context: &Context) -> Box + Send>; fn create_creator_batch( &self, @@ -588,7 +588,7 @@ pub trait Api { fn create_editgroup(&self, entity: models::Editgroup, context: &Context) -> Box + Send>; - fn create_file(&self, entity: models::FileEntity, context: &Context) -> Box + Send>; + fn create_file(&self, entity: models::FileEntity, editgroup: Option, context: &Context) -> Box + Send>; fn create_file_batch( &self, @@ -598,7 +598,7 @@ pub trait Api { context: &Context, ) -> Box + Send>; - fn create_release(&self, entity: models::ReleaseEntity, context: &Context) -> Box + Send>; + fn create_release(&self, entity: models::ReleaseEntity, editgroup: Option, context: &Context) -> Box + Send>; fn create_release_batch( &self, @@ -608,7 +608,7 @@ pub trait Api { context: &Context, ) -> Box + Send>; - fn create_work(&self, entity: models::WorkEntity, context: &Context) -> Box + Send>; + fn create_work(&self, entity: models::WorkEntity, editgroup: Option, context: &Context) -> Box + Send>; fn create_work_batch( &self, @@ -674,22 +674,22 @@ pub trait Api { fn lookup_release(&self, doi: String, context: &Context) -> Box + Send>; - fn update_container(&self, id: String, entity: models::ContainerEntity, context: &Context) -> Box + Send>; + fn update_container(&self, id: String, entity: models::ContainerEntity, editgroup: Option, context: &Context) -> Box + Send>; - fn update_creator(&self, id: String, entity: models::CreatorEntity, context: &Context) -> Box + Send>; + fn update_creator(&self, id: String, entity: models::CreatorEntity, editgroup: Option, context: &Context) -> Box + Send>; - fn update_file(&self, id: String, entity: models::FileEntity, context: &Context) -> Box + Send>; + fn update_file(&self, id: String, entity: models::FileEntity, editgroup: Option, context: &Context) -> Box + Send>; - fn update_release(&self, id: String, entity: models::ReleaseEntity, context: &Context) -> Box + Send>; + fn update_release(&self, id: String, entity: models::ReleaseEntity, editgroup: Option, context: &Context) -> Box + Send>; - fn update_work(&self, id: String, entity: models::WorkEntity, context: &Context) -> Box + Send>; + fn update_work(&self, id: String, entity: models::WorkEntity, editgroup: Option, context: &Context) -> Box + Send>; } /// API without a `Context` pub trait ApiNoContext { fn accept_editgroup(&self, id: String) -> Box + Send>; - fn create_container(&self, entity: models::ContainerEntity) -> Box + Send>; + fn create_container(&self, entity: models::ContainerEntity, editgroup: Option) -> Box + Send>; fn create_container_batch( &self, @@ -698,7 +698,7 @@ pub trait ApiNoContext { editgroup: Option, ) -> Box + Send>; - fn create_creator(&self, entity: models::CreatorEntity) -> Box + Send>; + fn create_creator(&self, entity: models::CreatorEntity, editgroup: Option) -> Box + Send>; fn create_creator_batch( &self, @@ -709,11 +709,11 @@ pub trait ApiNoContext { fn create_editgroup(&self, entity: models::Editgroup) -> Box + Send>; - fn create_file(&self, entity: models::FileEntity) -> Box + Send>; + fn create_file(&self, entity: models::FileEntity, editgroup: Option) -> Box + Send>; fn create_file_batch(&self, entity_list: &Vec, autoaccept: Option, editgroup: Option) -> Box + Send>; - fn create_release(&self, entity: models::ReleaseEntity) -> Box + Send>; + fn create_release(&self, entity: models::ReleaseEntity, editgroup: Option) -> Box + Send>; fn create_release_batch( &self, @@ -722,7 +722,7 @@ pub trait ApiNoContext { editgroup: Option, ) -> Box + Send>; - fn create_work(&self, entity: models::WorkEntity) -> Box + Send>; + fn create_work(&self, entity: models::WorkEntity, editgroup: Option) -> Box + Send>; fn create_work_batch(&self, entity_list: &Vec, autoaccept: Option, editgroup: Option) -> Box + Send>; @@ -782,15 +782,15 @@ pub trait ApiNoContext { fn lookup_release(&self, doi: String) -> Box + Send>; - fn update_container(&self, id: String, entity: models::ContainerEntity) -> Box + Send>; + fn update_container(&self, id: String, entity: models::ContainerEntity, editgroup: Option) -> Box + Send>; - fn update_creator(&self, id: String, entity: models::CreatorEntity) -> Box + Send>; + fn update_creator(&self, id: String, entity: models::CreatorEntity, editgroup: Option) -> Box + Send>; - fn update_file(&self, id: String, entity: models::FileEntity) -> Box + Send>; + fn update_file(&self, id: String, entity: models::FileEntity, editgroup: Option) -> Box + Send>; - fn update_release(&self, id: String, entity: models::ReleaseEntity) -> Box + Send>; + fn update_release(&self, id: String, entity: models::ReleaseEntity, editgroup: Option) -> Box + Send>; - fn update_work(&self, id: String, entity: models::WorkEntity) -> Box + Send>; + fn update_work(&self, id: String, entity: models::WorkEntity, editgroup: Option) -> Box + Send>; } /// Trait to extend an API to make it easy to bind it to a context. @@ -813,8 +813,8 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().accept_editgroup(id, &self.context()) } - fn create_container(&self, entity: models::ContainerEntity) -> Box + Send> { - self.api().create_container(entity, &self.context()) + fn create_container(&self, entity: models::ContainerEntity, editgroup: Option) -> Box + Send> { + self.api().create_container(entity, editgroup, &self.context()) } fn create_container_batch( @@ -826,8 +826,8 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().create_container_batch(entity_list, autoaccept, editgroup, &self.context()) } - fn create_creator(&self, entity: models::CreatorEntity) -> Box + Send> { - self.api().create_creator(entity, &self.context()) + fn create_creator(&self, entity: models::CreatorEntity, editgroup: Option) -> Box + Send> { + self.api().create_creator(entity, editgroup, &self.context()) } fn create_creator_batch( @@ -843,16 +843,16 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().create_editgroup(entity, &self.context()) } - fn create_file(&self, entity: models::FileEntity) -> Box + Send> { - self.api().create_file(entity, &self.context()) + fn create_file(&self, entity: models::FileEntity, editgroup: Option) -> Box + Send> { + self.api().create_file(entity, editgroup, &self.context()) } fn create_file_batch(&self, entity_list: &Vec, autoaccept: Option, editgroup: Option) -> Box + Send> { self.api().create_file_batch(entity_list, autoaccept, editgroup, &self.context()) } - fn create_release(&self, entity: models::ReleaseEntity) -> Box + Send> { - self.api().create_release(entity, &self.context()) + fn create_release(&self, entity: models::ReleaseEntity, editgroup: Option) -> Box + Send> { + self.api().create_release(entity, editgroup, &self.context()) } fn create_release_batch( @@ -864,8 +864,8 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().create_release_batch(entity_list, autoaccept, editgroup, &self.context()) } - fn create_work(&self, entity: models::WorkEntity) -> Box + Send> { - self.api().create_work(entity, &self.context()) + fn create_work(&self, entity: models::WorkEntity, editgroup: Option) -> Box + Send> { + self.api().create_work(entity, editgroup, &self.context()) } fn create_work_batch(&self, entity_list: &Vec, autoaccept: Option, editgroup: Option) -> Box + Send> { @@ -984,24 +984,24 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().lookup_release(doi, &self.context()) } - fn update_container(&self, id: String, entity: models::ContainerEntity) -> Box + Send> { - self.api().update_container(id, entity, &self.context()) + fn update_container(&self, id: String, entity: models::ContainerEntity, editgroup: Option) -> Box + Send> { + self.api().update_container(id, entity, editgroup, &self.context()) } - fn update_creator(&self, id: String, entity: models::CreatorEntity) -> Box + Send> { - self.api().update_creator(id, entity, &self.context()) + fn update_creator(&self, id: String, entity: models::CreatorEntity, editgroup: Option) -> Box + Send> { + self.api().update_creator(id, entity, editgroup, &self.context()) } - fn update_file(&self, id: String, entity: models::FileEntity) -> Box + Send> { - self.api().update_file(id, entity, &self.context()) + fn update_file(&self, id: String, entity: models::FileEntity, editgroup: Option) -> Box + Send> { + self.api().update_file(id, entity, editgroup, &self.context()) } - fn update_release(&self, id: String, entity: models::ReleaseEntity) -> Box + Send> { - self.api().update_release(id, entity, &self.context()) + fn update_release(&self, id: String, entity: models::ReleaseEntity, editgroup: Option) -> Box + Send> { + self.api().update_release(id, entity, editgroup, &self.context()) } - fn update_work(&self, id: String, entity: models::WorkEntity) -> Box + Send> { - self.api().update_work(id, entity, &self.context()) + fn update_work(&self, id: String, entity: models::WorkEntity, editgroup: Option) -> Box + Send> { + self.api().update_work(id, entity, editgroup, &self.context()) } } diff --git a/rust/fatcat-api-spec/src/models.rs b/rust/fatcat-api-spec/src/models.rs index 81701b70..980d3059 100644 --- a/rust/fatcat-api-spec/src/models.rs +++ b/rust/fatcat-api-spec/src/models.rs @@ -61,14 +61,13 @@ pub struct ContainerEntity { #[serde(rename = "name")] pub name: String, - #[serde(rename = "extra")] + #[serde(rename = "edit_extra")] #[serde(skip_serializing_if = "Option::is_none")] - pub extra: Option, + pub edit_extra: Option, - /// base32-encoded unique identifier - #[serde(rename = "editgroup_id")] + #[serde(rename = "extra")] #[serde(skip_serializing_if = "Option::is_none")] - pub editgroup_id: Option, + pub extra: Option, /// base32-encoded unique identifier #[serde(rename = "redirect")] @@ -100,8 +99,8 @@ impl ContainerEntity { issnl: None, publisher: None, name: name, + edit_extra: None, extra: None, - editgroup_id: None, redirect: None, revision: None, ident: None, @@ -151,14 +150,13 @@ pub struct CreatorEntity { #[serde(skip_serializing_if = "Option::is_none")] pub redirect: Option, - /// base32-encoded unique identifier - #[serde(rename = "editgroup_id")] - #[serde(skip_serializing_if = "Option::is_none")] - pub editgroup_id: Option, - #[serde(rename = "extra")] #[serde(skip_serializing_if = "Option::is_none")] pub extra: Option, + + #[serde(rename = "edit_extra")] + #[serde(skip_serializing_if = "Option::is_none")] + pub edit_extra: Option, } impl CreatorEntity { @@ -173,8 +171,8 @@ impl CreatorEntity { ident: None, revision: None, redirect: None, - editgroup_id: None, extra: None, + edit_extra: None, } } } @@ -372,14 +370,13 @@ pub struct FileEntity { #[serde(skip_serializing_if = "Option::is_none")] pub size: Option, - #[serde(rename = "extra")] + #[serde(rename = "edit_extra")] #[serde(skip_serializing_if = "Option::is_none")] - pub extra: Option, + pub edit_extra: Option, - /// base32-encoded unique identifier - #[serde(rename = "editgroup_id")] + #[serde(rename = "extra")] #[serde(skip_serializing_if = "Option::is_none")] - pub editgroup_id: Option, + pub extra: Option, /// base32-encoded unique identifier #[serde(rename = "redirect")] @@ -412,8 +409,8 @@ impl FileEntity { md5: None, sha1: None, size: None, + edit_extra: None, extra: None, - editgroup_id: None, redirect: None, revision: None, ident: None, @@ -590,14 +587,13 @@ pub struct ReleaseEntity { #[serde(skip_serializing_if = "Option::is_none")] pub redirect: Option, - /// base32-encoded unique identifier - #[serde(rename = "editgroup_id")] - #[serde(skip_serializing_if = "Option::is_none")] - pub editgroup_id: Option, - #[serde(rename = "extra")] #[serde(skip_serializing_if = "Option::is_none")] pub extra: Option, + + #[serde(rename = "edit_extra")] + #[serde(skip_serializing_if = "Option::is_none")] + pub edit_extra: Option, } impl ReleaseEntity { @@ -629,8 +625,8 @@ impl ReleaseEntity { ident: None, revision: None, redirect: None, - editgroup_id: None, extra: None, + edit_extra: None, } } } @@ -742,14 +738,13 @@ impl Success { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct WorkEntity { - #[serde(rename = "extra")] + #[serde(rename = "edit_extra")] #[serde(skip_serializing_if = "Option::is_none")] - pub extra: Option, + pub edit_extra: Option, - /// base32-encoded unique identifier - #[serde(rename = "editgroup_id")] + #[serde(rename = "extra")] #[serde(skip_serializing_if = "Option::is_none")] - pub editgroup_id: Option, + pub extra: Option, /// base32-encoded unique identifier #[serde(rename = "redirect")] @@ -775,8 +770,8 @@ pub struct WorkEntity { impl WorkEntity { pub fn new() -> WorkEntity { WorkEntity { + edit_extra: None, extra: None, - editgroup_id: None, redirect: None, revision: None, ident: None, diff --git a/rust/fatcat-api-spec/src/server.rs b/rust/fatcat-api-spec/src/server.rs index 5510b34d..8c699065 100644 --- a/rust/fatcat-api-spec/src/server.rs +++ b/rust/fatcat-api-spec/src/server.rs @@ -204,6 +204,10 @@ where context.auth_data = req.extensions.remove::(); context.authorization = req.extensions.remove::(); + // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) + let query_params = req.get::().unwrap_or_default(); + let param_editgroup = query_params.get("editgroup").and_then(|list| list.first()).and_then(|x| x.parse::().ok()); + // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -229,7 +233,7 @@ where }; let param_entity = param_entity.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity".to_string())))?; - match api.create_container(param_entity, context).wait() { + match api.create_container(param_entity, param_editgroup, context).wait() { Ok(rsp) => match rsp { CreateContainerResponse::CreatedEntity(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -423,6 +427,10 @@ where context.auth_data = req.extensions.remove::(); context.authorization = req.extensions.remove::(); + // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) + let query_params = req.get::().unwrap_or_default(); + let param_editgroup = query_params.get("editgroup").and_then(|list| list.first()).and_then(|x| x.parse::().ok()); + // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -448,7 +456,7 @@ where }; let param_entity = param_entity.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity".to_string())))?; - match api.create_creator(param_entity, context).wait() { + match api.create_creator(param_entity, param_editgroup, context).wait() { Ok(rsp) => match rsp { CreateCreatorResponse::CreatedEntity(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -736,6 +744,10 @@ where context.auth_data = req.extensions.remove::(); context.authorization = req.extensions.remove::(); + // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) + let query_params = req.get::().unwrap_or_default(); + let param_editgroup = query_params.get("editgroup").and_then(|list| list.first()).and_then(|x| x.parse::().ok()); + // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -761,7 +773,7 @@ where }; let param_entity = param_entity.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity".to_string())))?; - match api.create_file(param_entity, context).wait() { + match api.create_file(param_entity, param_editgroup, context).wait() { Ok(rsp) => match rsp { CreateFileResponse::CreatedEntity(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -955,6 +967,10 @@ where context.auth_data = req.extensions.remove::(); context.authorization = req.extensions.remove::(); + // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) + let query_params = req.get::().unwrap_or_default(); + let param_editgroup = query_params.get("editgroup").and_then(|list| list.first()).and_then(|x| x.parse::().ok()); + // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -980,7 +996,7 @@ where }; let param_entity = param_entity.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity".to_string())))?; - match api.create_release(param_entity, context).wait() { + match api.create_release(param_entity, param_editgroup, context).wait() { Ok(rsp) => match rsp { CreateReleaseResponse::CreatedEntity(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -1174,6 +1190,10 @@ where context.auth_data = req.extensions.remove::(); context.authorization = req.extensions.remove::(); + // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) + let query_params = req.get::().unwrap_or_default(); + let param_editgroup = query_params.get("editgroup").and_then(|list| list.first()).and_then(|x| x.parse::().ok()); + // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -1199,7 +1219,7 @@ where }; let param_entity = param_entity.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity".to_string())))?; - match api.create_work(param_entity, context).wait() { + match api.create_work(param_entity, param_editgroup, context).wait() { Ok(rsp) => match rsp { CreateWorkResponse::CreatedEntity(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -3868,6 +3888,10 @@ where .map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter id: {}", e))))? }; + // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) + let query_params = req.get::().unwrap_or_default(); + let param_editgroup = query_params.get("editgroup").and_then(|list| list.first()).and_then(|x| x.parse::().ok()); + // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -3893,7 +3917,7 @@ where }; let param_entity = param_entity.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity".to_string())))?; - match api.update_container(param_id, param_entity, context).wait() { + match api.update_container(param_id, param_entity, param_editgroup, context).wait() { Ok(rsp) => match rsp { UpdateContainerResponse::UpdatedEntity(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -3990,6 +4014,10 @@ where .map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter id: {}", e))))? }; + // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) + let query_params = req.get::().unwrap_or_default(); + let param_editgroup = query_params.get("editgroup").and_then(|list| list.first()).and_then(|x| x.parse::().ok()); + // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -4015,7 +4043,7 @@ where }; let param_entity = param_entity.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity".to_string())))?; - match api.update_creator(param_id, param_entity, context).wait() { + match api.update_creator(param_id, param_entity, param_editgroup, context).wait() { Ok(rsp) => match rsp { UpdateCreatorResponse::UpdatedEntity(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -4112,6 +4140,10 @@ where .map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter id: {}", e))))? }; + // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) + let query_params = req.get::().unwrap_or_default(); + let param_editgroup = query_params.get("editgroup").and_then(|list| list.first()).and_then(|x| x.parse::().ok()); + // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -4137,7 +4169,7 @@ where }; let param_entity = param_entity.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity".to_string())))?; - match api.update_file(param_id, param_entity, context).wait() { + match api.update_file(param_id, param_entity, param_editgroup, context).wait() { Ok(rsp) => match rsp { UpdateFileResponse::UpdatedEntity(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -4234,6 +4266,10 @@ where .map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter id: {}", e))))? }; + // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) + let query_params = req.get::().unwrap_or_default(); + let param_editgroup = query_params.get("editgroup").and_then(|list| list.first()).and_then(|x| x.parse::().ok()); + // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -4259,7 +4295,7 @@ where }; let param_entity = param_entity.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity".to_string())))?; - match api.update_release(param_id, param_entity, context).wait() { + match api.update_release(param_id, param_entity, param_editgroup, context).wait() { Ok(rsp) => match rsp { UpdateReleaseResponse::UpdatedEntity(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); @@ -4356,6 +4392,10 @@ where .map_err(|e| Response::with((status::BadRequest, format!("Couldn't parse path parameter id: {}", e))))? }; + // Query parameters (note that non-required or collection query parameters will ignore garbage values, rather than causing a 400 response) + let query_params = req.get::().unwrap_or_default(); + let param_editgroup = query_params.get("editgroup").and_then(|list| list.first()).and_then(|x| x.parse::().ok()); + // Body parameters (note that non-required body parameters will ignore garbage // values, rather than causing a 400 response). Produce warning header and logs for // any unused fields. @@ -4381,7 +4421,7 @@ where }; let param_entity = param_entity.ok_or_else(|| Response::with((status::BadRequest, "Missing required body parameter entity".to_string())))?; - match api.update_work(param_id, param_entity, context).wait() { + match api.update_work(param_id, param_entity, param_editgroup, context).wait() { Ok(rsp) => match rsp { UpdateWorkResponse::UpdatedEntity(body) => { let body_string = serde_json::to_string(&body).expect("impossible to fail to serialize"); -- cgit v1.2.3