aboutsummaryrefslogtreecommitdiffstats
path: root/rust/fatcat-api-spec/src/lib.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-03 17:53:04 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-03 17:53:04 -0800
commit65fa084379a159db81fc5424deda18013f01194b (patch)
tree6a8563e716c646a75326eda324ce28aaf0ad018d /rust/fatcat-api-spec/src/lib.rs
parentb10ee85c04816f16738ff30b84262a6ab8440307 (diff)
downloadfatcat-65fa084379a159db81fc5424deda18013f01194b.tar.gz
fatcat-65fa084379a159db81fc5424deda18013f01194b.zip
rust codegen
Diffstat (limited to 'rust/fatcat-api-spec/src/lib.rs')
-rw-r--r--rust/fatcat-api-spec/src/lib.rs24
1 files changed, 24 insertions, 0 deletions
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
@@ -391,6 +391,22 @@ pub enum GetEditorChangelogResponse {
}
#[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
MergedSuccessfully(models::Success),
@@ -1305,6 +1321,8 @@ pub trait Api {
fn get_editor_changelog(&self, editor_id: String, context: &Context) -> Box<Future<Item = GetEditorChangelogResponse, Error = ApiError> + Send>;
+ fn update_editor(&self, editor_id: String, editor: models::Editor, context: &Context) -> Box<Future<Item = UpdateEditorResponse, Error = ApiError> + Send>;
+
fn accept_editgroup(&self, editgroup_id: String, context: &Context) -> Box<Future<Item = AcceptEditgroupResponse, Error = ApiError> + Send>;
fn create_editgroup(&self, editgroup: models::Editgroup, context: &Context) -> Box<Future<Item = CreateEditgroupResponse, Error = ApiError> + Send>;
@@ -1553,6 +1571,8 @@ pub trait ApiNoContext {
fn get_editor_changelog(&self, editor_id: String) -> Box<Future<Item = GetEditorChangelogResponse, Error = ApiError> + Send>;
+ fn update_editor(&self, editor_id: String, editor: models::Editor) -> Box<Future<Item = UpdateEditorResponse, Error = ApiError> + Send>;
+
fn accept_editgroup(&self, editgroup_id: String) -> Box<Future<Item = AcceptEditgroupResponse, Error = ApiError> + Send>;
fn create_editgroup(&self, editgroup: models::Editgroup) -> Box<Future<Item = CreateEditgroupResponse, Error = ApiError> + 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<Future<Item = UpdateEditorResponse, Error = ApiError> + Send> {
+ self.api().update_editor(editor_id, editor, &self.context())
+ }
+
fn accept_editgroup(&self, editgroup_id: String) -> Box<Future<Item = AcceptEditgroupResponse, Error = ApiError> + Send> {
self.api().accept_editgroup(editgroup_id, &self.context())
}