From 65fa084379a159db81fc5424deda18013f01194b Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 3 Jan 2019 17:53:04 -0800 Subject: rust codegen --- rust/fatcat-api-spec/src/lib.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'rust/fatcat-api-spec/src/lib.rs') diff --git a/rust/fatcat-api-spec/src/lib.rs b/rust/fatcat-api-spec/src/lib.rs index c89dc90c..258b635b 100644 --- a/rust/fatcat-api-spec/src/lib.rs +++ b/rust/fatcat-api-spec/src/lib.rs @@ -390,6 +390,22 @@ pub enum GetEditorChangelogResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum UpdateEditorResponse { + /// Updated Editor + UpdatedEditor(models::Editor), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, + /// Forbidden + Forbidden(models::ErrorResponse), + /// Not Found + NotFound(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum AcceptEditgroupResponse { /// Merged Successfully @@ -1305,6 +1321,8 @@ pub trait Api { fn get_editor_changelog(&self, editor_id: String, context: &Context) -> Box + Send>; + fn update_editor(&self, editor_id: String, editor: models::Editor, context: &Context) -> Box + Send>; + fn accept_editgroup(&self, editgroup_id: String, context: &Context) -> Box + Send>; fn create_editgroup(&self, editgroup: models::Editgroup, context: &Context) -> Box + Send>; @@ -1553,6 +1571,8 @@ pub trait ApiNoContext { fn get_editor_changelog(&self, editor_id: String) -> Box + Send>; + fn update_editor(&self, editor_id: String, editor: models::Editor) -> Box + Send>; + fn accept_editgroup(&self, editgroup_id: String) -> Box + Send>; fn create_editgroup(&self, editgroup: models::Editgroup) -> Box + Send>; @@ -1844,6 +1864,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().get_editor_changelog(editor_id, &self.context()) } + fn update_editor(&self, editor_id: String, editor: models::Editor) -> Box + Send> { + self.api().update_editor(editor_id, editor, &self.context()) + } + fn accept_editgroup(&self, editgroup_id: String) -> Box + Send> { self.api().accept_editgroup(editgroup_id, &self.context()) } -- cgit v1.2.3