From b8991aed0f4c9f58daad1865a3873fc31bdc96bd Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 2 Feb 2021 11:42:43 -0800 Subject: re-codegen openapi stuff --- rust/fatcat-openapi/src/lib.rs | 1700 +++++++++++++++++++++------------------- 1 file changed, 907 insertions(+), 793 deletions(-) (limited to 'rust/fatcat-openapi/src/lib.rs') diff --git a/rust/fatcat-openapi/src/lib.rs b/rust/fatcat-openapi/src/lib.rs index 1438bdf..ba49f27 100644 --- a/rust/fatcat-openapi/src/lib.rs +++ b/rust/fatcat-openapi/src/lib.rs @@ -8,16 +8,16 @@ non_camel_case_types )] +use async_trait::async_trait; use futures::Stream; -use std::io::Error; +use std::error::Error; +use std::task::{Context, Poll}; +use swagger::{ApiError, ContextWrapper}; -#[deprecated(note = "Import futures directly")] -pub use futures::Future; -#[deprecated(note = "Import swagger-rs directly")] -pub use swagger::{ApiError, ContextWrapper}; +type ServiceError = Box; pub const BASE_PATH: &'static str = "/v0"; -pub const API_VERSION: &'static str = "0.3.1"; +pub const API_VERSION: &'static str = "0.3.3"; #[derive(Debug, PartialEq)] #[must_use] @@ -29,7 +29,7 @@ pub enum AcceptEditgroupResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -51,7 +51,7 @@ pub enum AuthCheckResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -71,7 +71,7 @@ pub enum AuthOidcResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -91,7 +91,7 @@ pub enum CreateAuthTokenResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -109,7 +109,7 @@ pub enum CreateContainerResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -129,7 +129,7 @@ pub enum CreateContainerAutoBatchResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -149,7 +149,7 @@ pub enum CreateCreatorResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -169,7 +169,7 @@ pub enum CreateCreatorAutoBatchResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -189,7 +189,7 @@ pub enum CreateEditgroupResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -209,7 +209,7 @@ pub enum CreateEditgroupAnnotationResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -229,7 +229,7 @@ pub enum CreateFileResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -249,7 +249,7 @@ pub enum CreateFileAutoBatchResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -269,7 +269,7 @@ pub enum CreateFilesetResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -289,7 +289,7 @@ pub enum CreateFilesetAutoBatchResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -309,7 +309,7 @@ pub enum CreateReleaseResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -329,7 +329,7 @@ pub enum CreateReleaseAutoBatchResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -349,7 +349,7 @@ pub enum CreateWebcaptureResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -369,7 +369,7 @@ pub enum CreateWebcaptureAutoBatchResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -389,7 +389,7 @@ pub enum CreateWorkResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -409,7 +409,7 @@ pub enum CreateWorkAutoBatchResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -429,7 +429,7 @@ pub enum DeleteContainerResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -449,7 +449,7 @@ pub enum DeleteContainerEditResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -469,7 +469,7 @@ pub enum DeleteCreatorResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -489,7 +489,7 @@ pub enum DeleteCreatorEditResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -509,7 +509,7 @@ pub enum DeleteFileResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -529,7 +529,7 @@ pub enum DeleteFileEditResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -549,7 +549,7 @@ pub enum DeleteFilesetResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -569,7 +569,7 @@ pub enum DeleteFilesetEditResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -589,7 +589,7 @@ pub enum DeleteReleaseResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -609,7 +609,7 @@ pub enum DeleteReleaseEditResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -629,7 +629,7 @@ pub enum DeleteWebcaptureResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -649,7 +649,7 @@ pub enum DeleteWebcaptureEditResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -669,7 +669,7 @@ pub enum DeleteWorkResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -689,7 +689,7 @@ pub enum DeleteWorkEditResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -889,7 +889,7 @@ pub enum GetEditgroupAnnotationsResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -935,7 +935,7 @@ pub enum GetEditorAnnotationsResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -1397,7 +1397,7 @@ pub enum UpdateContainerResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -1417,7 +1417,7 @@ pub enum UpdateCreatorResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -1437,7 +1437,7 @@ pub enum UpdateEditgroupResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -1457,7 +1457,7 @@ pub enum UpdateEditorResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -1477,7 +1477,7 @@ pub enum UpdateFileResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -1497,7 +1497,7 @@ pub enum UpdateFilesetResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -1517,7 +1517,7 @@ pub enum UpdateReleaseResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -1537,7 +1537,7 @@ pub enum UpdateWebcaptureResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -1557,7 +1557,7 @@ pub enum UpdateWorkResponse { /// Not Authorized NotAuthorized { body: models::ErrorResponse, - www_authenticate: String, + www_authenticate: Option, }, /// Forbidden Forbidden(models::ErrorResponse), @@ -1568,591 +1568,599 @@ pub enum UpdateWorkResponse { } /// API -pub trait Api { - fn accept_editgroup( +#[async_trait] +pub trait Api { + fn poll_ready( + &self, + _cx: &mut Context, + ) -> Poll>> { + Poll::Ready(Ok(())) + } + + async fn accept_editgroup( &self, editgroup_id: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn auth_check( + async fn auth_check( &self, role: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn auth_oidc( + async fn auth_oidc( &self, auth_oidc: models::AuthOidc, context: &C, - ) -> Box + Send>; + ) -> Result; - fn create_auth_token( + async fn create_auth_token( &self, editor_id: String, duration_seconds: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn create_container( + async fn create_container( &self, editgroup_id: String, container_entity: models::ContainerEntity, context: &C, - ) -> Box + Send>; + ) -> Result; - fn create_container_auto_batch( + async fn create_container_auto_batch( &self, container_auto_batch: models::ContainerAutoBatch, context: &C, - ) -> Box + Send>; + ) -> Result; - fn create_creator( + async fn create_creator( &self, editgroup_id: String, creator_entity: models::CreatorEntity, context: &C, - ) -> Box + Send>; + ) -> Result; - fn create_creator_auto_batch( + async fn create_creator_auto_batch( &self, creator_auto_batch: models::CreatorAutoBatch, context: &C, - ) -> Box + Send>; + ) -> Result; - fn create_editgroup( + async fn create_editgroup( &self, editgroup: models::Editgroup, context: &C, - ) -> Box + Send>; + ) -> Result; - fn create_editgroup_annotation( + async fn create_editgroup_annotation( &self, editgroup_id: String, editgroup_annotation: models::EditgroupAnnotation, context: &C, - ) -> Box + Send>; + ) -> Result; - fn create_file( + async fn create_file( &self, editgroup_id: String, file_entity: models::FileEntity, context: &C, - ) -> Box + Send>; + ) -> Result; - fn create_file_auto_batch( + async fn create_file_auto_batch( &self, file_auto_batch: models::FileAutoBatch, context: &C, - ) -> Box + Send>; + ) -> Result; - fn create_fileset( + async fn create_fileset( &self, editgroup_id: String, fileset_entity: models::FilesetEntity, context: &C, - ) -> Box + Send>; + ) -> Result; - fn create_fileset_auto_batch( + async fn create_fileset_auto_batch( &self, fileset_auto_batch: models::FilesetAutoBatch, context: &C, - ) -> Box + Send>; + ) -> Result; - fn create_release( + async fn create_release( &self, editgroup_id: String, release_entity: models::ReleaseEntity, context: &C, - ) -> Box + Send>; + ) -> Result; - fn create_release_auto_batch( + async fn create_release_auto_batch( &self, release_auto_batch: models::ReleaseAutoBatch, context: &C, - ) -> Box + Send>; + ) -> Result; - fn create_webcapture( + async fn create_webcapture( &self, editgroup_id: String, webcapture_entity: models::WebcaptureEntity, context: &C, - ) -> Box + Send>; + ) -> Result; - fn create_webcapture_auto_batch( + async fn create_webcapture_auto_batch( &self, webcapture_auto_batch: models::WebcaptureAutoBatch, context: &C, - ) -> Box + Send>; + ) -> Result; - fn create_work( + async fn create_work( &self, editgroup_id: String, work_entity: models::WorkEntity, context: &C, - ) -> Box + Send>; + ) -> Result; - fn create_work_auto_batch( + async fn create_work_auto_batch( &self, work_auto_batch: models::WorkAutoBatch, context: &C, - ) -> Box + Send>; + ) -> Result; - fn delete_container( + async fn delete_container( &self, editgroup_id: String, ident: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn delete_container_edit( + async fn delete_container_edit( &self, editgroup_id: String, edit_id: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn delete_creator( + async fn delete_creator( &self, editgroup_id: String, ident: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn delete_creator_edit( + async fn delete_creator_edit( &self, editgroup_id: String, edit_id: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn delete_file( + async fn delete_file( &self, editgroup_id: String, ident: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn delete_file_edit( + async fn delete_file_edit( &self, editgroup_id: String, edit_id: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn delete_fileset( + async fn delete_fileset( &self, editgroup_id: String, ident: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn delete_fileset_edit( + async fn delete_fileset_edit( &self, editgroup_id: String, edit_id: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn delete_release( + async fn delete_release( &self, editgroup_id: String, ident: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn delete_release_edit( + async fn delete_release_edit( &self, editgroup_id: String, edit_id: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn delete_webcapture( + async fn delete_webcapture( &self, editgroup_id: String, ident: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn delete_webcapture_edit( + async fn delete_webcapture_edit( &self, editgroup_id: String, edit_id: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn delete_work( + async fn delete_work( &self, editgroup_id: String, ident: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn delete_work_edit( + async fn delete_work_edit( &self, editgroup_id: String, edit_id: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_changelog( + async fn get_changelog( &self, limit: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_changelog_entry( + async fn get_changelog_entry( &self, index: i64, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_container( + async fn get_container( &self, ident: String, expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_container_edit( + async fn get_container_edit( &self, edit_id: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_container_history( + async fn get_container_history( &self, ident: String, limit: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_container_redirects( + async fn get_container_redirects( &self, ident: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_container_revision( + async fn get_container_revision( &self, rev_id: String, expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_creator( + async fn get_creator( &self, ident: String, expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_creator_edit( + async fn get_creator_edit( &self, edit_id: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_creator_history( + async fn get_creator_history( &self, ident: String, limit: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_creator_redirects( + async fn get_creator_redirects( &self, ident: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_creator_releases( + async fn get_creator_releases( &self, ident: String, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_creator_revision( + async fn get_creator_revision( &self, rev_id: String, expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_editgroup( + async fn get_editgroup( &self, editgroup_id: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_editgroup_annotations( + async fn get_editgroup_annotations( &self, editgroup_id: String, expand: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_editgroups_reviewable( + async fn get_editgroups_reviewable( &self, expand: Option, limit: Option, before: Option>, since: Option>, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_editor( + async fn get_editor( &self, editor_id: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_editor_annotations( + async fn get_editor_annotations( &self, editor_id: String, limit: Option, before: Option>, since: Option>, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_editor_editgroups( + async fn get_editor_editgroups( &self, editor_id: String, limit: Option, before: Option>, since: Option>, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_file( + async fn get_file( &self, ident: String, expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_file_edit( + async fn get_file_edit( &self, edit_id: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_file_history( + async fn get_file_history( &self, ident: String, limit: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_file_redirects( + async fn get_file_redirects( &self, ident: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_file_revision( + async fn get_file_revision( &self, rev_id: String, expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_fileset( + async fn get_fileset( &self, ident: String, expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_fileset_edit( + async fn get_fileset_edit( &self, edit_id: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_fileset_history( + async fn get_fileset_history( &self, ident: String, limit: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_fileset_redirects( + async fn get_fileset_redirects( &self, ident: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_fileset_revision( + async fn get_fileset_revision( &self, rev_id: String, expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_release( + async fn get_release( &self, ident: String, expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_release_edit( + async fn get_release_edit( &self, edit_id: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_release_files( + async fn get_release_files( &self, ident: String, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_release_filesets( + async fn get_release_filesets( &self, ident: String, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_release_history( + async fn get_release_history( &self, ident: String, limit: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_release_redirects( + async fn get_release_redirects( &self, ident: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_release_revision( + async fn get_release_revision( &self, rev_id: String, expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_release_webcaptures( + async fn get_release_webcaptures( &self, ident: String, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_webcapture( + async fn get_webcapture( &self, ident: String, expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_webcapture_edit( + async fn get_webcapture_edit( &self, edit_id: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_webcapture_history( + async fn get_webcapture_history( &self, ident: String, limit: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_webcapture_redirects( + async fn get_webcapture_redirects( &self, ident: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_webcapture_revision( + async fn get_webcapture_revision( &self, rev_id: String, expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_work( + async fn get_work( &self, ident: String, expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_work_edit( + async fn get_work_edit( &self, edit_id: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_work_history( + async fn get_work_history( &self, ident: String, limit: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_work_redirects( + async fn get_work_redirects( &self, ident: String, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_work_releases( + async fn get_work_releases( &self, ident: String, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn get_work_revision( + async fn get_work_revision( &self, rev_id: String, expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn lookup_container( + async fn lookup_container( &self, issnl: Option, wikidata_qid: Option, expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn lookup_creator( + async fn lookup_creator( &self, orcid: Option, wikidata_qid: Option, expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn lookup_file( + async fn lookup_file( &self, md5: Option, sha1: Option, @@ -2160,9 +2168,9 @@ pub trait Api { expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn lookup_release( + async fn lookup_release( &self, doi: Option, wikidata_qid: Option, @@ -2174,594 +2182,568 @@ pub trait Api { jstor: Option, ark: Option, mag: Option, + doaj: Option, + dblp: Option, + oai: Option, expand: Option, hide: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn update_container( + async fn update_container( &self, editgroup_id: String, ident: String, container_entity: models::ContainerEntity, context: &C, - ) -> Box + Send>; + ) -> Result; - fn update_creator( + async fn update_creator( &self, editgroup_id: String, ident: String, creator_entity: models::CreatorEntity, context: &C, - ) -> Box + Send>; + ) -> Result; - fn update_editgroup( + async fn update_editgroup( &self, editgroup_id: String, editgroup: models::Editgroup, submit: Option, context: &C, - ) -> Box + Send>; + ) -> Result; - fn update_editor( + async fn update_editor( &self, editor_id: String, editor: models::Editor, context: &C, - ) -> Box + Send>; + ) -> Result; - fn update_file( + async fn update_file( &self, editgroup_id: String, ident: String, file_entity: models::FileEntity, context: &C, - ) -> Box + Send>; + ) -> Result; - fn update_fileset( + async fn update_fileset( &self, editgroup_id: String, ident: String, fileset_entity: models::FilesetEntity, context: &C, - ) -> Box + Send>; + ) -> Result; - fn update_release( + async fn update_release( &self, editgroup_id: String, ident: String, release_entity: models::ReleaseEntity, context: &C, - ) -> Box + Send>; + ) -> Result; - fn update_webcapture( + async fn update_webcapture( &self, editgroup_id: String, ident: String, webcapture_entity: models::WebcaptureEntity, context: &C, - ) -> Box + Send>; + ) -> Result; - fn update_work( + async fn update_work( &self, editgroup_id: String, ident: String, work_entity: models::WorkEntity, context: &C, - ) -> Box + Send>; + ) -> Result; } -/// API without a `Context` -pub trait ApiNoContext { - fn accept_editgroup( +/// API where `Context` isn't passed on every API call +#[async_trait] +pub trait ApiNoContext { + fn poll_ready( &self, - editgroup_id: String, - ) -> Box + Send>; + _cx: &mut Context, + ) -> Poll>>; - fn auth_check( - &self, - role: Option, - ) -> Box + Send>; + fn context(&self) -> &C; - fn auth_oidc( + async fn accept_editgroup( &self, - auth_oidc: models::AuthOidc, - ) -> Box + Send>; + editgroup_id: String, + ) -> Result; + + async fn auth_check(&self, role: Option) -> Result; - fn create_auth_token( + async fn auth_oidc(&self, auth_oidc: models::AuthOidc) -> Result; + + async fn create_auth_token( &self, editor_id: String, duration_seconds: Option, - ) -> Box + Send>; + ) -> Result; - fn create_container( + async fn create_container( &self, editgroup_id: String, container_entity: models::ContainerEntity, - ) -> Box + Send>; + ) -> Result; - fn create_container_auto_batch( + async fn create_container_auto_batch( &self, container_auto_batch: models::ContainerAutoBatch, - ) -> Box + Send>; + ) -> Result; - fn create_creator( + async fn create_creator( &self, editgroup_id: String, creator_entity: models::CreatorEntity, - ) -> Box + Send>; + ) -> Result; - fn create_creator_auto_batch( + async fn create_creator_auto_batch( &self, creator_auto_batch: models::CreatorAutoBatch, - ) -> Box + Send>; + ) -> Result; - fn create_editgroup( + async fn create_editgroup( &self, editgroup: models::Editgroup, - ) -> Box + Send>; + ) -> Result; - fn create_editgroup_annotation( + async fn create_editgroup_annotation( &self, editgroup_id: String, editgroup_annotation: models::EditgroupAnnotation, - ) -> Box + Send>; + ) -> Result; - fn create_file( + async fn create_file( &self, editgroup_id: String, file_entity: models::FileEntity, - ) -> Box + Send>; + ) -> Result; - fn create_file_auto_batch( + async fn create_file_auto_batch( &self, file_auto_batch: models::FileAutoBatch, - ) -> Box + Send>; + ) -> Result; - fn create_fileset( + async fn create_fileset( &self, editgroup_id: String, fileset_entity: models::FilesetEntity, - ) -> Box + Send>; + ) -> Result; - fn create_fileset_auto_batch( + async fn create_fileset_auto_batch( &self, fileset_auto_batch: models::FilesetAutoBatch, - ) -> Box + Send>; + ) -> Result; - fn create_release( + async fn create_release( &self, editgroup_id: String, release_entity: models::ReleaseEntity, - ) -> Box + Send>; + ) -> Result; - fn create_release_auto_batch( + async fn create_release_auto_batch( &self, release_auto_batch: models::ReleaseAutoBatch, - ) -> Box + Send>; + ) -> Result; - fn create_webcapture( + async fn create_webcapture( &self, editgroup_id: String, webcapture_entity: models::WebcaptureEntity, - ) -> Box + Send>; + ) -> Result; - fn create_webcapture_auto_batch( + async fn create_webcapture_auto_batch( &self, webcapture_auto_batch: models::WebcaptureAutoBatch, - ) -> Box + Send>; + ) -> Result; - fn create_work( + async fn create_work( &self, editgroup_id: String, work_entity: models::WorkEntity, - ) -> Box + Send>; + ) -> Result; - fn create_work_auto_batch( + async fn create_work_auto_batch( &self, work_auto_batch: models::WorkAutoBatch, - ) -> Box + Send>; + ) -> Result; - fn delete_container( + async fn delete_container( &self, editgroup_id: String, ident: String, - ) -> Box + Send>; + ) -> Result; - fn delete_container_edit( + async fn delete_container_edit( &self, editgroup_id: String, edit_id: String, - ) -> Box + Send>; + ) -> Result; - fn delete_creator( + async fn delete_creator( &self, editgroup_id: String, ident: String, - ) -> Box + Send>; + ) -> Result; - fn delete_creator_edit( + async fn delete_creator_edit( &self, editgroup_id: String, edit_id: String, - ) -> Box + Send>; + ) -> Result; - fn delete_file( + async fn delete_file( &self, editgroup_id: String, ident: String, - ) -> Box + Send>; + ) -> Result; - fn delete_file_edit( + async fn delete_file_edit( &self, editgroup_id: String, edit_id: String, - ) -> Box + Send>; + ) -> Result; - fn delete_fileset( + async fn delete_fileset( &self, editgroup_id: String, ident: String, - ) -> Box + Send>; + ) -> Result; - fn delete_fileset_edit( + async fn delete_fileset_edit( &self, editgroup_id: String, edit_id: String, - ) -> Box + Send>; + ) -> Result; - fn delete_release( + async fn delete_release( &self, editgroup_id: String, ident: String, - ) -> Box + Send>; + ) -> Result; - fn delete_release_edit( + async fn delete_release_edit( &self, editgroup_id: String, edit_id: String, - ) -> Box + Send>; + ) -> Result; - fn delete_webcapture( + async fn delete_webcapture( &self, editgroup_id: String, ident: String, - ) -> Box + Send>; + ) -> Result; - fn delete_webcapture_edit( + async fn delete_webcapture_edit( &self, editgroup_id: String, edit_id: String, - ) -> Box + Send>; + ) -> Result; - fn delete_work( + async fn delete_work( &self, editgroup_id: String, ident: String, - ) -> Box + Send>; + ) -> Result; - fn delete_work_edit( + async fn delete_work_edit( &self, editgroup_id: String, edit_id: String, - ) -> Box + Send>; + ) -> Result; - fn get_changelog( - &self, - limit: Option, - ) -> Box + Send>; + async fn get_changelog(&self, limit: Option) -> Result; - fn get_changelog_entry( - &self, - index: i64, - ) -> Box + Send>; + async fn get_changelog_entry(&self, index: i64) -> Result; - fn get_container( + async fn get_container( &self, ident: String, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_container_edit( + async fn get_container_edit( &self, edit_id: String, - ) -> Box + Send>; + ) -> Result; - fn get_container_history( + async fn get_container_history( &self, ident: String, limit: Option, - ) -> Box + Send>; + ) -> Result; - fn get_container_redirects( + async fn get_container_redirects( &self, ident: String, - ) -> Box + Send>; + ) -> Result; - fn get_container_revision( + async fn get_container_revision( &self, rev_id: String, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_creator( + async fn get_creator( &self, ident: String, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_creator_edit( - &self, - edit_id: String, - ) -> Box + Send>; + async fn get_creator_edit(&self, edit_id: String) -> Result; - fn get_creator_history( + async fn get_creator_history( &self, ident: String, limit: Option, - ) -> Box + Send>; + ) -> Result; - fn get_creator_redirects( + async fn get_creator_redirects( &self, ident: String, - ) -> Box + Send>; + ) -> Result; - fn get_creator_releases( + async fn get_creator_releases( &self, ident: String, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_creator_revision( + async fn get_creator_revision( &self, rev_id: String, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_editgroup( - &self, - editgroup_id: String, - ) -> Box + Send>; + async fn get_editgroup(&self, editgroup_id: String) -> Result; - fn get_editgroup_annotations( + async fn get_editgroup_annotations( &self, editgroup_id: String, expand: Option, - ) -> Box + Send>; + ) -> Result; - fn get_editgroups_reviewable( + async fn get_editgroups_reviewable( &self, expand: Option, limit: Option, before: Option>, since: Option>, - ) -> Box + Send>; + ) -> Result; - fn get_editor( - &self, - editor_id: String, - ) -> Box + Send>; + async fn get_editor(&self, editor_id: String) -> Result; - fn get_editor_annotations( + async fn get_editor_annotations( &self, editor_id: String, limit: Option, before: Option>, since: Option>, - ) -> Box + Send>; + ) -> Result; - fn get_editor_editgroups( + async fn get_editor_editgroups( &self, editor_id: String, limit: Option, before: Option>, since: Option>, - ) -> Box + Send>; + ) -> Result; - fn get_file( + async fn get_file( &self, ident: String, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_file_edit( - &self, - edit_id: String, - ) -> Box + Send>; + async fn get_file_edit(&self, edit_id: String) -> Result; - fn get_file_history( + async fn get_file_history( &self, ident: String, limit: Option, - ) -> Box + Send>; + ) -> Result; - fn get_file_redirects( - &self, - ident: String, - ) -> Box + Send>; + async fn get_file_redirects(&self, ident: String) + -> Result; - fn get_file_revision( + async fn get_file_revision( &self, rev_id: String, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_fileset( + async fn get_fileset( &self, ident: String, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_fileset_edit( - &self, - edit_id: String, - ) -> Box + Send>; + async fn get_fileset_edit(&self, edit_id: String) -> Result; - fn get_fileset_history( + async fn get_fileset_history( &self, ident: String, limit: Option, - ) -> Box + Send>; + ) -> Result; - fn get_fileset_redirects( + async fn get_fileset_redirects( &self, ident: String, - ) -> Box + Send>; + ) -> Result; - fn get_fileset_revision( + async fn get_fileset_revision( &self, rev_id: String, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_release( + async fn get_release( &self, ident: String, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_release_edit( - &self, - edit_id: String, - ) -> Box + Send>; + async fn get_release_edit(&self, edit_id: String) -> Result; - fn get_release_files( + async fn get_release_files( &self, ident: String, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_release_filesets( + async fn get_release_filesets( &self, ident: String, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_release_history( + async fn get_release_history( &self, ident: String, limit: Option, - ) -> Box + Send>; + ) -> Result; - fn get_release_redirects( + async fn get_release_redirects( &self, ident: String, - ) -> Box + Send>; + ) -> Result; - fn get_release_revision( + async fn get_release_revision( &self, rev_id: String, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_release_webcaptures( + async fn get_release_webcaptures( &self, ident: String, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_webcapture( + async fn get_webcapture( &self, ident: String, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_webcapture_edit( + async fn get_webcapture_edit( &self, edit_id: String, - ) -> Box + Send>; + ) -> Result; - fn get_webcapture_history( + async fn get_webcapture_history( &self, ident: String, limit: Option, - ) -> Box + Send>; + ) -> Result; - fn get_webcapture_redirects( + async fn get_webcapture_redirects( &self, ident: String, - ) -> Box + Send>; + ) -> Result; - fn get_webcapture_revision( + async fn get_webcapture_revision( &self, rev_id: String, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_work( + async fn get_work( &self, ident: String, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_work_edit( - &self, - edit_id: String, - ) -> Box + Send>; + async fn get_work_edit(&self, edit_id: String) -> Result; - fn get_work_history( + async fn get_work_history( &self, ident: String, limit: Option, - ) -> Box + Send>; + ) -> Result; - fn get_work_redirects( - &self, - ident: String, - ) -> Box + Send>; + async fn get_work_redirects(&self, ident: String) + -> Result; - fn get_work_releases( + async fn get_work_releases( &self, ident: String, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn get_work_revision( + async fn get_work_revision( &self, rev_id: String, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn lookup_container( + async fn lookup_container( &self, issnl: Option, wikidata_qid: Option, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn lookup_creator( + async fn lookup_creator( &self, orcid: Option, wikidata_qid: Option, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn lookup_file( + async fn lookup_file( &self, md5: Option, sha1: Option, sha256: Option, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn lookup_release( + async fn lookup_release( &self, doi: Option, wikidata_qid: Option, @@ -2773,820 +2755,926 @@ pub trait ApiNoContext { jstor: Option, ark: Option, mag: Option, + doaj: Option, + dblp: Option, + oai: Option, expand: Option, hide: Option, - ) -> Box + Send>; + ) -> Result; - fn update_container( + async fn update_container( &self, editgroup_id: String, ident: String, container_entity: models::ContainerEntity, - ) -> Box + Send>; + ) -> Result; - fn update_creator( + async fn update_creator( &self, editgroup_id: String, ident: String, creator_entity: models::CreatorEntity, - ) -> Box + Send>; + ) -> Result; - fn update_editgroup( + async fn update_editgroup( &self, editgroup_id: String, editgroup: models::Editgroup, submit: Option, - ) -> Box + Send>; + ) -> Result; - fn update_editor( + async fn update_editor( &self, editor_id: String, editor: models::Editor, - ) -> Box + Send>; + ) -> Result; - fn update_file( + async fn update_file( &self, editgroup_id: String, ident: String, file_entity: models::FileEntity, - ) -> Box + Send>; + ) -> Result; - fn update_fileset( + async fn update_fileset( &self, editgroup_id: String, ident: String, fileset_entity: models::FilesetEntity, - ) -> Box + Send>; + ) -> Result; - fn update_release( + async fn update_release( &self, editgroup_id: String, ident: String, release_entity: models::ReleaseEntity, - ) -> Box + Send>; + ) -> Result; - fn update_webcapture( + async fn update_webcapture( &self, editgroup_id: String, ident: String, webcapture_entity: models::WebcaptureEntity, - ) -> Box + Send>; + ) -> Result; - fn update_work( + async fn update_work( &self, editgroup_id: String, ident: String, work_entity: models::WorkEntity, - ) -> Box + Send>; + ) -> Result; } /// Trait to extend an API to make it easy to bind it to a context. -pub trait ContextWrapperExt<'a, C> +pub trait ContextWrapperExt where Self: Sized, { /// Binds this API to a context. - fn with_context(self: &'a Self, context: C) -> ContextWrapper<'a, Self, C>; + fn with_context(self: Self, context: C) -> ContextWrapper; } -impl<'a, T: Api + Sized, C> ContextWrapperExt<'a, C> for T { - fn with_context(self: &'a T, context: C) -> ContextWrapper<'a, T, C> { +impl + Send + Sync, C: Clone + Send + Sync> ContextWrapperExt for T { + fn with_context(self: T, context: C) -> ContextWrapper { ContextWrapper::::new(self, context) } } -impl<'a, T: Api, C> ApiNoContext for ContextWrapper<'a, T, C> { - fn accept_editgroup( +#[async_trait] +impl + Send + Sync, C: Clone + Send + Sync> ApiNoContext for ContextWrapper { + fn poll_ready(&self, cx: &mut Context) -> Poll> { + self.api().poll_ready(cx) + } + + fn context(&self) -> &C { + ContextWrapper::context(self) + } + + async fn accept_editgroup( &self, editgroup_id: String, - ) -> Box + Send> { - self.api().accept_editgroup(editgroup_id, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().accept_editgroup(editgroup_id, &context).await } - fn auth_check( - &self, - role: Option, - ) -> Box + Send> { - self.api().auth_check(role, &self.context()) + async fn auth_check(&self, role: Option) -> Result { + let context = self.context().clone(); + self.api().auth_check(role, &context).await } - fn auth_oidc( - &self, - auth_oidc: models::AuthOidc, - ) -> Box + Send> { - self.api().auth_oidc(auth_oidc, &self.context()) + async fn auth_oidc(&self, auth_oidc: models::AuthOidc) -> Result { + let context = self.context().clone(); + self.api().auth_oidc(auth_oidc, &context).await } - fn create_auth_token( + async fn create_auth_token( &self, editor_id: String, duration_seconds: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .create_auth_token(editor_id, duration_seconds, &self.context()) + .create_auth_token(editor_id, duration_seconds, &context) + .await } - fn create_container( + async fn create_container( &self, editgroup_id: String, container_entity: models::ContainerEntity, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .create_container(editgroup_id, container_entity, &self.context()) + .create_container(editgroup_id, container_entity, &context) + .await } - fn create_container_auto_batch( + async fn create_container_auto_batch( &self, container_auto_batch: models::ContainerAutoBatch, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .create_container_auto_batch(container_auto_batch, &self.context()) + .create_container_auto_batch(container_auto_batch, &context) + .await } - fn create_creator( + async fn create_creator( &self, editgroup_id: String, creator_entity: models::CreatorEntity, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .create_creator(editgroup_id, creator_entity, &self.context()) + .create_creator(editgroup_id, creator_entity, &context) + .await } - fn create_creator_auto_batch( + async fn create_creator_auto_batch( &self, creator_auto_batch: models::CreatorAutoBatch, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .create_creator_auto_batch(creator_auto_batch, &self.context()) + .create_creator_auto_batch(creator_auto_batch, &context) + .await } - fn create_editgroup( + async fn create_editgroup( &self, editgroup: models::Editgroup, - ) -> Box + Send> { - self.api().create_editgroup(editgroup, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().create_editgroup(editgroup, &context).await } - fn create_editgroup_annotation( + async fn create_editgroup_annotation( &self, editgroup_id: String, editgroup_annotation: models::EditgroupAnnotation, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .create_editgroup_annotation(editgroup_id, editgroup_annotation, &self.context()) + .create_editgroup_annotation(editgroup_id, editgroup_annotation, &context) + .await } - fn create_file( + async fn create_file( &self, editgroup_id: String, file_entity: models::FileEntity, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .create_file(editgroup_id, file_entity, &self.context()) + .create_file(editgroup_id, file_entity, &context) + .await } - fn create_file_auto_batch( + async fn create_file_auto_batch( &self, file_auto_batch: models::FileAutoBatch, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .create_file_auto_batch(file_auto_batch, &self.context()) + .create_file_auto_batch(file_auto_batch, &context) + .await } - fn create_fileset( + async fn create_fileset( &self, editgroup_id: String, fileset_entity: models::FilesetEntity, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .create_fileset(editgroup_id, fileset_entity, &self.context()) + .create_fileset(editgroup_id, fileset_entity, &context) + .await } - fn create_fileset_auto_batch( + async fn create_fileset_auto_batch( &self, fileset_auto_batch: models::FilesetAutoBatch, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .create_fileset_auto_batch(fileset_auto_batch, &self.context()) + .create_fileset_auto_batch(fileset_auto_batch, &context) + .await } - fn create_release( + async fn create_release( &self, editgroup_id: String, release_entity: models::ReleaseEntity, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .create_release(editgroup_id, release_entity, &self.context()) + .create_release(editgroup_id, release_entity, &context) + .await } - fn create_release_auto_batch( + async fn create_release_auto_batch( &self, release_auto_batch: models::ReleaseAutoBatch, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .create_release_auto_batch(release_auto_batch, &self.context()) + .create_release_auto_batch(release_auto_batch, &context) + .await } - fn create_webcapture( + async fn create_webcapture( &self, editgroup_id: String, webcapture_entity: models::WebcaptureEntity, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .create_webcapture(editgroup_id, webcapture_entity, &self.context()) + .create_webcapture(editgroup_id, webcapture_entity, &context) + .await } - fn create_webcapture_auto_batch( + async fn create_webcapture_auto_batch( &self, webcapture_auto_batch: models::WebcaptureAutoBatch, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .create_webcapture_auto_batch(webcapture_auto_batch, &self.context()) + .create_webcapture_auto_batch(webcapture_auto_batch, &context) + .await } - fn create_work( + async fn create_work( &self, editgroup_id: String, work_entity: models::WorkEntity, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .create_work(editgroup_id, work_entity, &self.context()) + .create_work(editgroup_id, work_entity, &context) + .await } - fn create_work_auto_batch( + async fn create_work_auto_batch( &self, work_auto_batch: models::WorkAutoBatch, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .create_work_auto_batch(work_auto_batch, &self.context()) + .create_work_auto_batch(work_auto_batch, &context) + .await } - fn delete_container( + async fn delete_container( &self, editgroup_id: String, ident: String, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .delete_container(editgroup_id, ident, &self.context()) + .delete_container(editgroup_id, ident, &context) + .await } - fn delete_container_edit( + async fn delete_container_edit( &self, editgroup_id: String, edit_id: String, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .delete_container_edit(editgroup_id, edit_id, &self.context()) + .delete_container_edit(editgroup_id, edit_id, &context) + .await } - fn delete_creator( + async fn delete_creator( &self, editgroup_id: String, ident: String, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .delete_creator(editgroup_id, ident, &self.context()) + .delete_creator(editgroup_id, ident, &context) + .await } - fn delete_creator_edit( + async fn delete_creator_edit( &self, editgroup_id: String, edit_id: String, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .delete_creator_edit(editgroup_id, edit_id, &self.context()) + .delete_creator_edit(editgroup_id, edit_id, &context) + .await } - fn delete_file( + async fn delete_file( &self, editgroup_id: String, ident: String, - ) -> Box + Send> { - self.api().delete_file(editgroup_id, ident, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().delete_file(editgroup_id, ident, &context).await } - fn delete_file_edit( + async fn delete_file_edit( &self, editgroup_id: String, edit_id: String, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .delete_file_edit(editgroup_id, edit_id, &self.context()) + .delete_file_edit(editgroup_id, edit_id, &context) + .await } - fn delete_fileset( + async fn delete_fileset( &self, editgroup_id: String, ident: String, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .delete_fileset(editgroup_id, ident, &self.context()) + .delete_fileset(editgroup_id, ident, &context) + .await } - fn delete_fileset_edit( + async fn delete_fileset_edit( &self, editgroup_id: String, edit_id: String, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .delete_fileset_edit(editgroup_id, edit_id, &self.context()) + .delete_fileset_edit(editgroup_id, edit_id, &context) + .await } - fn delete_release( + async fn delete_release( &self, editgroup_id: String, ident: String, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .delete_release(editgroup_id, ident, &self.context()) + .delete_release(editgroup_id, ident, &context) + .await } - fn delete_release_edit( + async fn delete_release_edit( &self, editgroup_id: String, edit_id: String, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .delete_release_edit(editgroup_id, edit_id, &self.context()) + .delete_release_edit(editgroup_id, edit_id, &context) + .await } - fn delete_webcapture( + async fn delete_webcapture( &self, editgroup_id: String, ident: String, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .delete_webcapture(editgroup_id, ident, &self.context()) + .delete_webcapture(editgroup_id, ident, &context) + .await } - fn delete_webcapture_edit( + async fn delete_webcapture_edit( &self, editgroup_id: String, edit_id: String, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .delete_webcapture_edit(editgroup_id, edit_id, &self.context()) + .delete_webcapture_edit(editgroup_id, edit_id, &context) + .await } - fn delete_work( + async fn delete_work( &self, editgroup_id: String, ident: String, - ) -> Box + Send> { - self.api().delete_work(editgroup_id, ident, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().delete_work(editgroup_id, ident, &context).await } - fn delete_work_edit( + async fn delete_work_edit( &self, editgroup_id: String, edit_id: String, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .delete_work_edit(editgroup_id, edit_id, &self.context()) + .delete_work_edit(editgroup_id, edit_id, &context) + .await } - fn get_changelog( - &self, - limit: Option, - ) -> Box + Send> { - self.api().get_changelog(limit, &self.context()) + async fn get_changelog(&self, limit: Option) -> Result { + let context = self.context().clone(); + self.api().get_changelog(limit, &context).await } - fn get_changelog_entry( - &self, - index: i64, - ) -> Box + Send> { - self.api().get_changelog_entry(index, &self.context()) + async fn get_changelog_entry(&self, index: i64) -> Result { + let context = self.context().clone(); + self.api().get_changelog_entry(index, &context).await } - fn get_container( + async fn get_container( &self, ident: String, expand: Option, hide: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .get_container(ident, expand, hide, &self.context()) + .get_container(ident, expand, hide, &context) + .await } - fn get_container_edit( + async fn get_container_edit( &self, edit_id: String, - ) -> Box + Send> { - self.api().get_container_edit(edit_id, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_container_edit(edit_id, &context).await } - fn get_container_history( + async fn get_container_history( &self, ident: String, limit: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .get_container_history(ident, limit, &self.context()) + .get_container_history(ident, limit, &context) + .await } - fn get_container_redirects( + async fn get_container_redirects( &self, ident: String, - ) -> Box + Send> { - self.api().get_container_redirects(ident, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_container_redirects(ident, &context).await } - fn get_container_revision( + async fn get_container_revision( &self, rev_id: String, expand: Option, hide: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .get_container_revision(rev_id, expand, hide, &self.context()) + .get_container_revision(rev_id, expand, hide, &context) + .await } - fn get_creator( + async fn get_creator( &self, ident: String, expand: Option, hide: Option, - ) -> Box + Send> { - self.api().get_creator(ident, expand, hide, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_creator(ident, expand, hide, &context).await } - fn get_creator_edit( - &self, - edit_id: String, - ) -> Box + Send> { - self.api().get_creator_edit(edit_id, &self.context()) + async fn get_creator_edit(&self, edit_id: String) -> Result { + let context = self.context().clone(); + self.api().get_creator_edit(edit_id, &context).await } - fn get_creator_history( + async fn get_creator_history( &self, ident: String, limit: Option, - ) -> Box + Send> { - self.api() - .get_creator_history(ident, limit, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_creator_history(ident, limit, &context).await } - fn get_creator_redirects( + async fn get_creator_redirects( &self, ident: String, - ) -> Box + Send> { - self.api().get_creator_redirects(ident, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_creator_redirects(ident, &context).await } - fn get_creator_releases( + async fn get_creator_releases( &self, ident: String, hide: Option, - ) -> Box + Send> { - self.api() - .get_creator_releases(ident, hide, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_creator_releases(ident, hide, &context).await } - fn get_creator_revision( + async fn get_creator_revision( &self, rev_id: String, expand: Option, hide: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .get_creator_revision(rev_id, expand, hide, &self.context()) + .get_creator_revision(rev_id, expand, hide, &context) + .await } - fn get_editgroup( - &self, - editgroup_id: String, - ) -> Box + Send> { - self.api().get_editgroup(editgroup_id, &self.context()) + async fn get_editgroup(&self, editgroup_id: String) -> Result { + let context = self.context().clone(); + self.api().get_editgroup(editgroup_id, &context).await } - fn get_editgroup_annotations( + async fn get_editgroup_annotations( &self, editgroup_id: String, expand: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .get_editgroup_annotations(editgroup_id, expand, &self.context()) + .get_editgroup_annotations(editgroup_id, expand, &context) + .await } - fn get_editgroups_reviewable( + async fn get_editgroups_reviewable( &self, expand: Option, limit: Option, before: Option>, since: Option>, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .get_editgroups_reviewable(expand, limit, before, since, &self.context()) + .get_editgroups_reviewable(expand, limit, before, since, &context) + .await } - fn get_editor( - &self, - editor_id: String, - ) -> Box + Send> { - self.api().get_editor(editor_id, &self.context()) + async fn get_editor(&self, editor_id: String) -> Result { + let context = self.context().clone(); + self.api().get_editor(editor_id, &context).await } - fn get_editor_annotations( + async fn get_editor_annotations( &self, editor_id: String, limit: Option, before: Option>, since: Option>, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .get_editor_annotations(editor_id, limit, before, since, &self.context()) + .get_editor_annotations(editor_id, limit, before, since, &context) + .await } - fn get_editor_editgroups( + async fn get_editor_editgroups( &self, editor_id: String, limit: Option, before: Option>, since: Option>, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .get_editor_editgroups(editor_id, limit, before, since, &self.context()) + .get_editor_editgroups(editor_id, limit, before, since, &context) + .await } - fn get_file( + async fn get_file( &self, ident: String, expand: Option, hide: Option, - ) -> Box + Send> { - self.api().get_file(ident, expand, hide, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_file(ident, expand, hide, &context).await } - fn get_file_edit( - &self, - edit_id: String, - ) -> Box + Send> { - self.api().get_file_edit(edit_id, &self.context()) + async fn get_file_edit(&self, edit_id: String) -> Result { + let context = self.context().clone(); + self.api().get_file_edit(edit_id, &context).await } - fn get_file_history( + async fn get_file_history( &self, ident: String, limit: Option, - ) -> Box + Send> { - self.api().get_file_history(ident, limit, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_file_history(ident, limit, &context).await } - fn get_file_redirects( + async fn get_file_redirects( &self, ident: String, - ) -> Box + Send> { - self.api().get_file_redirects(ident, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_file_redirects(ident, &context).await } - fn get_file_revision( + async fn get_file_revision( &self, rev_id: String, expand: Option, hide: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .get_file_revision(rev_id, expand, hide, &self.context()) + .get_file_revision(rev_id, expand, hide, &context) + .await } - fn get_fileset( + async fn get_fileset( &self, ident: String, expand: Option, hide: Option, - ) -> Box + Send> { - self.api().get_fileset(ident, expand, hide, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_fileset(ident, expand, hide, &context).await } - fn get_fileset_edit( - &self, - edit_id: String, - ) -> Box + Send> { - self.api().get_fileset_edit(edit_id, &self.context()) + async fn get_fileset_edit(&self, edit_id: String) -> Result { + let context = self.context().clone(); + self.api().get_fileset_edit(edit_id, &context).await } - fn get_fileset_history( + async fn get_fileset_history( &self, ident: String, limit: Option, - ) -> Box + Send> { - self.api() - .get_fileset_history(ident, limit, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_fileset_history(ident, limit, &context).await } - fn get_fileset_redirects( + async fn get_fileset_redirects( &self, ident: String, - ) -> Box + Send> { - self.api().get_fileset_redirects(ident, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_fileset_redirects(ident, &context).await } - fn get_fileset_revision( + async fn get_fileset_revision( &self, rev_id: String, expand: Option, hide: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .get_fileset_revision(rev_id, expand, hide, &self.context()) + .get_fileset_revision(rev_id, expand, hide, &context) + .await } - fn get_release( + async fn get_release( &self, ident: String, expand: Option, hide: Option, - ) -> Box + Send> { - self.api().get_release(ident, expand, hide, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_release(ident, expand, hide, &context).await } - fn get_release_edit( - &self, - edit_id: String, - ) -> Box + Send> { - self.api().get_release_edit(edit_id, &self.context()) + async fn get_release_edit(&self, edit_id: String) -> Result { + let context = self.context().clone(); + self.api().get_release_edit(edit_id, &context).await } - fn get_release_files( + async fn get_release_files( &self, ident: String, hide: Option, - ) -> Box + Send> { - self.api().get_release_files(ident, hide, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_release_files(ident, hide, &context).await } - fn get_release_filesets( + async fn get_release_filesets( &self, ident: String, hide: Option, - ) -> Box + Send> { - self.api() - .get_release_filesets(ident, hide, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_release_filesets(ident, hide, &context).await } - fn get_release_history( + async fn get_release_history( &self, ident: String, limit: Option, - ) -> Box + Send> { - self.api() - .get_release_history(ident, limit, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_release_history(ident, limit, &context).await } - fn get_release_redirects( + async fn get_release_redirects( &self, ident: String, - ) -> Box + Send> { - self.api().get_release_redirects(ident, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_release_redirects(ident, &context).await } - fn get_release_revision( + async fn get_release_revision( &self, rev_id: String, expand: Option, hide: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .get_release_revision(rev_id, expand, hide, &self.context()) + .get_release_revision(rev_id, expand, hide, &context) + .await } - fn get_release_webcaptures( + async fn get_release_webcaptures( &self, ident: String, hide: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .get_release_webcaptures(ident, hide, &self.context()) + .get_release_webcaptures(ident, hide, &context) + .await } - fn get_webcapture( + async fn get_webcapture( &self, ident: String, expand: Option, hide: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .get_webcapture(ident, expand, hide, &self.context()) + .get_webcapture(ident, expand, hide, &context) + .await } - fn get_webcapture_edit( + async fn get_webcapture_edit( &self, edit_id: String, - ) -> Box + Send> { - self.api().get_webcapture_edit(edit_id, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_webcapture_edit(edit_id, &context).await } - fn get_webcapture_history( + async fn get_webcapture_history( &self, ident: String, limit: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .get_webcapture_history(ident, limit, &self.context()) + .get_webcapture_history(ident, limit, &context) + .await } - fn get_webcapture_redirects( + async fn get_webcapture_redirects( &self, ident: String, - ) -> Box + Send> { - self.api().get_webcapture_redirects(ident, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_webcapture_redirects(ident, &context).await } - fn get_webcapture_revision( + async fn get_webcapture_revision( &self, rev_id: String, expand: Option, hide: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .get_webcapture_revision(rev_id, expand, hide, &self.context()) + .get_webcapture_revision(rev_id, expand, hide, &context) + .await } - fn get_work( + async fn get_work( &self, ident: String, expand: Option, hide: Option, - ) -> Box + Send> { - self.api().get_work(ident, expand, hide, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_work(ident, expand, hide, &context).await } - fn get_work_edit( - &self, - edit_id: String, - ) -> Box + Send> { - self.api().get_work_edit(edit_id, &self.context()) + async fn get_work_edit(&self, edit_id: String) -> Result { + let context = self.context().clone(); + self.api().get_work_edit(edit_id, &context).await } - fn get_work_history( + async fn get_work_history( &self, ident: String, limit: Option, - ) -> Box + Send> { - self.api().get_work_history(ident, limit, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_work_history(ident, limit, &context).await } - fn get_work_redirects( + async fn get_work_redirects( &self, ident: String, - ) -> Box + Send> { - self.api().get_work_redirects(ident, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_work_redirects(ident, &context).await } - fn get_work_releases( + async fn get_work_releases( &self, ident: String, hide: Option, - ) -> Box + Send> { - self.api().get_work_releases(ident, hide, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().get_work_releases(ident, hide, &context).await } - fn get_work_revision( + async fn get_work_revision( &self, rev_id: String, expand: Option, hide: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .get_work_revision(rev_id, expand, hide, &self.context()) + .get_work_revision(rev_id, expand, hide, &context) + .await } - fn lookup_container( + async fn lookup_container( &self, issnl: Option, wikidata_qid: Option, expand: Option, hide: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .lookup_container(issnl, wikidata_qid, expand, hide, &self.context()) + .lookup_container(issnl, wikidata_qid, expand, hide, &context) + .await } - fn lookup_creator( + async fn lookup_creator( &self, orcid: Option, wikidata_qid: Option, expand: Option, hide: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .lookup_creator(orcid, wikidata_qid, expand, hide, &self.context()) + .lookup_creator(orcid, wikidata_qid, expand, hide, &context) + .await } - fn lookup_file( + async fn lookup_file( &self, md5: Option, sha1: Option, sha256: Option, expand: Option, hide: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .lookup_file(md5, sha1, sha256, expand, hide, &self.context()) + .lookup_file(md5, sha1, sha256, expand, hide, &context) + .await } - fn lookup_release( + async fn lookup_release( &self, doi: Option, wikidata_qid: Option, @@ -3598,112 +3686,138 @@ impl<'a, T: Api, C> ApiNoContext for ContextWrapper<'a, T, C> { jstor: Option, ark: Option, mag: Option, + doaj: Option, + dblp: Option, + oai: Option, expand: Option, hide: Option, - ) -> Box + Send> { - self.api().lookup_release( - doi, - wikidata_qid, - isbn13, - pmid, - pmcid, - core, - arxiv, - jstor, - ark, - mag, - expand, - hide, - &self.context(), - ) - } - - fn update_container( + ) -> Result { + let context = self.context().clone(); + self.api() + .lookup_release( + doi, + wikidata_qid, + isbn13, + pmid, + pmcid, + core, + arxiv, + jstor, + ark, + mag, + doaj, + dblp, + oai, + expand, + hide, + &context, + ) + .await + } + + async fn update_container( &self, editgroup_id: String, ident: String, container_entity: models::ContainerEntity, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .update_container(editgroup_id, ident, container_entity, &self.context()) + .update_container(editgroup_id, ident, container_entity, &context) + .await } - fn update_creator( + async fn update_creator( &self, editgroup_id: String, ident: String, creator_entity: models::CreatorEntity, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .update_creator(editgroup_id, ident, creator_entity, &self.context()) + .update_creator(editgroup_id, ident, creator_entity, &context) + .await } - fn update_editgroup( + async fn update_editgroup( &self, editgroup_id: String, editgroup: models::Editgroup, submit: Option, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .update_editgroup(editgroup_id, editgroup, submit, &self.context()) + .update_editgroup(editgroup_id, editgroup, submit, &context) + .await } - fn update_editor( + async fn update_editor( &self, editor_id: String, editor: models::Editor, - ) -> Box + Send> { - self.api().update_editor(editor_id, editor, &self.context()) + ) -> Result { + let context = self.context().clone(); + self.api().update_editor(editor_id, editor, &context).await } - fn update_file( + async fn update_file( &self, editgroup_id: String, ident: String, file_entity: models::FileEntity, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .update_file(editgroup_id, ident, file_entity, &self.context()) + .update_file(editgroup_id, ident, file_entity, &context) + .await } - fn update_fileset( + async fn update_fileset( &self, editgroup_id: String, ident: String, fileset_entity: models::FilesetEntity, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .update_fileset(editgroup_id, ident, fileset_entity, &self.context()) + .update_fileset(editgroup_id, ident, fileset_entity, &context) + .await } - fn update_release( + async fn update_release( &self, editgroup_id: String, ident: String, release_entity: models::ReleaseEntity, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .update_release(editgroup_id, ident, release_entity, &self.context()) + .update_release(editgroup_id, ident, release_entity, &context) + .await } - fn update_webcapture( + async fn update_webcapture( &self, editgroup_id: String, ident: String, webcapture_entity: models::WebcaptureEntity, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .update_webcapture(editgroup_id, ident, webcapture_entity, &self.context()) + .update_webcapture(editgroup_id, ident, webcapture_entity, &context) + .await } - fn update_work( + async fn update_work( &self, editgroup_id: String, ident: String, work_entity: models::WorkEntity, - ) -> Box + Send> { + ) -> Result { + let context = self.context().clone(); self.api() - .update_work(editgroup_id, ident, work_entity, &self.context()) + .update_work(editgroup_id, ident, work_entity, &context) + .await } } -- cgit v1.2.3