From edc000220baee1f91811345aba87bdab2d259c61 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 18 Sep 2019 17:48:56 -0700 Subject: codegen rust v0.3.1 --- rust/fatcat-openapi/src/lib.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (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 da4f23af..ac434c31 100644 --- a/rust/fatcat-openapi/src/lib.rs +++ b/rust/fatcat-openapi/src/lib.rs @@ -64,6 +64,20 @@ pub enum AuthOidcResponse { GenericError(models::ErrorResponse), } +#[derive(Debug, PartialEq)] +pub enum CreateAuthTokenResponse { + /// Success + Success(models::AuthTokenResult), + /// Bad Request + BadRequest(models::ErrorResponse), + /// Not Authorized + NotAuthorized { body: models::ErrorResponse, www_authenticate: String }, + /// Forbidden + Forbidden(models::ErrorResponse), + /// Generic Error + GenericError(models::ErrorResponse), +} + #[derive(Debug, PartialEq)] pub enum GetChangelogResponse { /// Success @@ -1342,6 +1356,8 @@ pub trait Api { fn auth_oidc(&self, oidc_params: models::AuthOidc, context: &Context) -> Box + Send>; + fn create_auth_token(&self, editor_id: String, duration_seconds: Option, context: &Context) -> Box + Send>; + fn get_changelog(&self, limit: Option, context: &Context) -> Box + Send>; fn get_changelog_entry(&self, index: i64, context: &Context) -> Box + Send>; @@ -1596,6 +1612,8 @@ pub trait ApiNoContext { fn auth_oidc(&self, oidc_params: models::AuthOidc) -> Box + Send>; + fn create_auth_token(&self, editor_id: String, duration_seconds: Option) -> Box + Send>; + fn get_changelog(&self, limit: Option) -> Box + Send>; fn get_changelog_entry(&self, index: i64) -> Box + Send>; @@ -1850,6 +1868,10 @@ impl<'a, T: Api> ApiNoContext for ContextWrapper<'a, T> { self.api().auth_oidc(oidc_params, &self.context()) } + fn create_auth_token(&self, editor_id: String, duration_seconds: Option) -> Box + Send> { + self.api().create_auth_token(editor_id, duration_seconds, &self.context()) + } + fn get_changelog(&self, limit: Option) -> Box + Send> { self.api().get_changelog(limit, &self.context()) } -- cgit v1.2.3