diff --git a/src/error.rs b/src/error.rs index 5d791f3..64866ab 100644 --- a/src/error.rs +++ b/src/error.rs @@ -170,7 +170,7 @@ impl From for Error { impl From for Error { fn from(e: crate::openapi::models::model_409_error::Model409Error) -> Self { match e.code { - crate::openapi::models::model_409_error::Code::HasNoPasskeys => { + crate::openapi::models::model_409_error::Code::UserHasNoPasskeys => { Error::UserHasNoPasskeys } _ => Error::Other(e.error), diff --git a/src/lib.rs b/src/lib.rs index 818935a..7607bc8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -58,6 +58,8 @@ impl fmt::Display for Error { mod error; pub mod models; + +#[rustfmt::skip] pub mod openapi; pub mod passage_flex; diff --git a/src/openapi/apis/apps_api.rs b/src/openapi/apis/apps_api.rs index c5cfa50..40bcc62 100644 --- a/src/openapi/apis/apps_api.rs +++ b/src/openapi/apis/apps_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{configuration, Error}; -use crate::openapi::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize}; +use crate::openapi::{apis::ResponseContent, models}; +use super::{Error, configuration}; + /// struct for typed errors of method [`get_app`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -23,21 +25,18 @@ pub enum GetAppError { UnknownValue(serde_json::Value), } + /// Get app information. -pub async fn get_app( - configuration: &configuration::Configuration, -) -> Result> { +pub async fn get_app(configuration: &configuration::Configuration, ) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/", local_var_configuration.base_path); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); @@ -53,11 +52,8 @@ pub async fn get_app( serde_json::from_str(&local_var_content).map_err(Error::from) } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } + diff --git a/src/openapi/apis/authenticate_api.rs b/src/openapi/apis/authenticate_api.rs index 89e2bcc..2bc7246 100644 --- a/src/openapi/apis/authenticate_api.rs +++ b/src/openapi/apis/authenticate_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{configuration, Error}; -use crate::openapi::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize}; +use crate::openapi::{apis::ResponseContent, models}; +use super::{Error, configuration}; + /// struct for typed errors of method [`authenticate_verify_nonce`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -25,22 +27,18 @@ pub enum AuthenticateVerifyNonceError { UnknownValue(serde_json::Value), } + /// Verify the nonce received from a WebAuthn registration or authentication ceremony. This endpoint checks that the nonce for the given application is valid, then returns a success or error message to the caller. -pub async fn authenticate_verify_nonce( - configuration: &configuration::Configuration, - body: models::Nonce, -) -> Result> { +pub async fn authenticate_verify_nonce(configuration: &configuration::Configuration, body: models::Nonce) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/authenticate/verify", local_var_configuration.base_path); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); @@ -56,13 +54,9 @@ pub async fn authenticate_verify_nonce( if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } + diff --git a/src/openapi/apis/configuration.rs b/src/openapi/apis/configuration.rs index 5892f6d..1539814 100644 --- a/src/openapi/apis/configuration.rs +++ b/src/openapi/apis/configuration.rs @@ -8,6 +8,8 @@ * Generated by: https://openapi-generator.tech */ + + #[derive(Debug, Clone)] pub struct Configuration { pub base_path: String, @@ -17,7 +19,6 @@ pub struct Configuration { pub oauth_access_token: Option, pub bearer_access_token: Option, pub api_key: Option, - // TODO: take an oauth2 token source, similar to the go one } pub type BasicAuth = (String, Option); @@ -28,6 +29,7 @@ pub struct ApiKey { pub key: String, } + impl Configuration { pub fn new() -> Configuration { Configuration::default() diff --git a/src/openapi/apis/mod.rs b/src/openapi/apis/mod.rs index eaf5336..defe715 100644 --- a/src/openapi/apis/mod.rs +++ b/src/openapi/apis/mod.rs @@ -16,7 +16,7 @@ pub enum Error { ResponseError(ResponseContent), } -impl fmt::Display for Error { +impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let (module, e) = match self { Error::Reqwest(e) => ("reqwest", e.to_string()), @@ -28,7 +28,7 @@ impl fmt::Display for Error { } } -impl error::Error for Error { +impl error::Error for Error { fn source(&self) -> Option<&(dyn error::Error + 'static)> { Some(match self { Error::Reqwest(e) => e, @@ -39,19 +39,19 @@ impl error::Error for Error { } } -impl From for Error { +impl From for Error { fn from(e: reqwest::Error) -> Self { Error::Reqwest(e) } } -impl From for Error { +impl From for Error { fn from(e: serde_json::Error) -> Self { Error::Serde(e) } } -impl From for Error { +impl From for Error { fn from(e: std::io::Error) -> Self { Error::Io(e) } @@ -78,10 +78,8 @@ pub fn parse_deep_object(prefix: &str, value: &serde_json::Value) -> Vec<(String value, )); } - } - serde_json::Value::String(s) => { - params.push((format!("{}[{}]", prefix, key), s.clone())) - } + }, + serde_json::Value::String(s) => params.push((format!("{}[{}]", prefix, key), s.clone())), _ => params.push((format!("{}[{}]", prefix, key), value.to_string())), } } diff --git a/src/openapi/apis/transactions_api.rs b/src/openapi/apis/transactions_api.rs index f7967d5..0f66418 100644 --- a/src/openapi/apis/transactions_api.rs +++ b/src/openapi/apis/transactions_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{configuration, Error}; -use crate::openapi::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize}; +use crate::openapi::{apis::ResponseContent, models}; +use super::{Error, configuration}; + /// struct for typed errors of method [`create_authenticate_transaction`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -38,24 +40,17 @@ pub enum CreateRegisterTransactionError { UnknownValue(serde_json::Value), } -pub async fn create_authenticate_transaction( - configuration: &configuration::Configuration, - create_transaction_authenticate_request: models::CreateTransactionAuthenticateRequest, -) -> Result> { + +pub async fn create_authenticate_transaction(configuration: &configuration::Configuration, create_transaction_authenticate_request: models::CreateTransactionAuthenticateRequest) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!( - "{}/transactions/authenticate", - local_var_configuration.base_path - ); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!("{}/transactions/authenticate", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); @@ -71,35 +66,22 @@ pub async fn create_authenticate_transaction( if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } -pub async fn create_register_transaction( - configuration: &configuration::Configuration, - create_transaction_register_request: models::CreateTransactionRegisterRequest, -) -> Result> { +pub async fn create_register_transaction(configuration: &configuration::Configuration, create_transaction_register_request: models::CreateTransactionRegisterRequest) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!( - "{}/transactions/register", - local_var_configuration.base_path - ); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); + let local_var_uri_str = format!("{}/transactions/register", local_var_configuration.base_path); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::POST, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); @@ -115,13 +97,9 @@ pub async fn create_register_transaction( if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } + diff --git a/src/openapi/apis/user_devices_api.rs b/src/openapi/apis/user_devices_api.rs index e7fc6a7..037fedb 100644 --- a/src/openapi/apis/user_devices_api.rs +++ b/src/openapi/apis/user_devices_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{configuration, Error}; -use crate::openapi::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize}; +use crate::openapi::{apis::ResponseContent, models}; +use super::{Error, configuration}; + /// struct for typed errors of method [`delete_user_devices`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -33,28 +35,18 @@ pub enum ListUserDevicesError { UnknownValue(serde_json::Value), } + /// Delete a device for a user. -pub async fn delete_user_devices( - configuration: &configuration::Configuration, - user_id: &str, - device_id: &str, -) -> Result<(), Error> { +pub async fn delete_user_devices(configuration: &configuration::Configuration, user_id: &str, device_id: &str) -> Result<(), Error> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!( - "{}/users/{user_id}/devices/{device_id}", - local_var_configuration.base_path, - user_id = crate::openapi::apis::urlencode(user_id), - device_id = crate::openapi::apis::urlencode(device_id) - ); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); + let local_var_uri_str = format!("{}/users/{user_id}/devices/{device_id}", local_var_configuration.base_path, user_id=crate::openapi::apis::urlencode(user_id), device_id=crate::openapi::apis::urlencode(device_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::DELETE, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); @@ -69,37 +61,23 @@ pub async fn delete_user_devices( if !local_var_status.is_client_error() && !local_var_status.is_server_error() { Ok(()) } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// List user devices. -pub async fn list_user_devices( - configuration: &configuration::Configuration, - user_id: &str, -) -> Result> { +pub async fn list_user_devices(configuration: &configuration::Configuration, user_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!( - "{}/users/{user_id}/devices", - local_var_configuration.base_path, - user_id = crate::openapi::apis::urlencode(user_id) - ); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!("{}/users/{user_id}/devices", local_var_configuration.base_path, user_id=crate::openapi::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); @@ -114,13 +92,9 @@ pub async fn list_user_devices( if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } + diff --git a/src/openapi/apis/users_api.rs b/src/openapi/apis/users_api.rs index 5e1544b..312e98f 100644 --- a/src/openapi/apis/users_api.rs +++ b/src/openapi/apis/users_api.rs @@ -8,10 +8,12 @@ * Generated by: https://openapi-generator.tech */ -use super::{configuration, Error}; -use crate::openapi::{apis::ResponseContent, models}; + use reqwest; use serde::{Deserialize, Serialize}; +use crate::openapi::{apis::ResponseContent, models}; +use super::{Error, configuration}; + /// struct for typed errors of method [`get_user`] #[derive(Debug, Clone, Serialize, Deserialize)] @@ -34,26 +36,18 @@ pub enum ListPaginatedUsersError { UnknownValue(serde_json::Value), } + /// Get information about a user. -pub async fn get_user( - configuration: &configuration::Configuration, - user_id: &str, -) -> Result> { +pub async fn get_user(configuration: &configuration::Configuration, user_id: &str) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; - let local_var_uri_str = format!( - "{}/users/{user_id}", - local_var_configuration.base_path, - user_id = crate::openapi::apis::urlencode(user_id) - ); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let local_var_uri_str = format!("{}/users/{user_id}", local_var_configuration.base_path, user_id=crate::openapi::apis::urlencode(user_id)); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); @@ -69,84 +63,55 @@ pub async fn get_user( serde_json::from_str(&local_var_content).map_err(Error::from) } else { let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } /// List users for an app. -pub async fn list_paginated_users( - configuration: &configuration::Configuration, - page: Option, - limit: Option, - created_before: Option, - order_by: Option<&str>, - identifier: Option<&str>, - id: Option<&str>, - login_count: Option, - status: Option<&str>, - created_at: Option<&str>, - updated_at: Option<&str>, - last_login_at: Option<&str>, -) -> Result> { +pub async fn list_paginated_users(configuration: &configuration::Configuration, page: Option, limit: Option, created_before: Option, order_by: Option<&str>, identifier: Option<&str>, id: Option<&str>, login_count: Option, status: Option<&str>, created_at: Option<&str>, updated_at: Option<&str>, last_login_at: Option<&str>) -> Result> { let local_var_configuration = configuration; let local_var_client = &local_var_configuration.client; let local_var_uri_str = format!("{}/users", local_var_configuration.base_path); - let mut local_var_req_builder = - local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); + let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str()); if let Some(ref local_var_str) = page { - local_var_req_builder = - local_var_req_builder.query(&[("page", &local_var_str.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("page", &local_var_str.to_string())]); } if let Some(ref local_var_str) = limit { - local_var_req_builder = - local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("limit", &local_var_str.to_string())]); } if let Some(ref local_var_str) = created_before { - local_var_req_builder = - local_var_req_builder.query(&[("created_before", &local_var_str.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("created_before", &local_var_str.to_string())]); } if let Some(ref local_var_str) = order_by { - local_var_req_builder = - local_var_req_builder.query(&[("order_by", &local_var_str.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("order_by", &local_var_str.to_string())]); } if let Some(ref local_var_str) = identifier { - local_var_req_builder = - local_var_req_builder.query(&[("identifier", &local_var_str.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("identifier", &local_var_str.to_string())]); } if let Some(ref local_var_str) = id { local_var_req_builder = local_var_req_builder.query(&[("id", &local_var_str.to_string())]); } if let Some(ref local_var_str) = login_count { - local_var_req_builder = - local_var_req_builder.query(&[("login_count", &local_var_str.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("login_count", &local_var_str.to_string())]); } if let Some(ref local_var_str) = status { - local_var_req_builder = - local_var_req_builder.query(&[("status", &local_var_str.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("status", &local_var_str.to_string())]); } if let Some(ref local_var_str) = created_at { - local_var_req_builder = - local_var_req_builder.query(&[("created_at", &local_var_str.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("created_at", &local_var_str.to_string())]); } if let Some(ref local_var_str) = updated_at { - local_var_req_builder = - local_var_req_builder.query(&[("updated_at", &local_var_str.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("updated_at", &local_var_str.to_string())]); } if let Some(ref local_var_str) = last_login_at { - local_var_req_builder = - local_var_req_builder.query(&[("last_login_at", &local_var_str.to_string())]); + local_var_req_builder = local_var_req_builder.query(&[("last_login_at", &local_var_str.to_string())]); } if let Some(ref local_var_user_agent) = local_var_configuration.user_agent { - local_var_req_builder = - local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); + local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone()); } if let Some(ref local_var_token) = local_var_configuration.bearer_access_token { local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned()); @@ -161,13 +126,9 @@ pub async fn list_paginated_users( if !local_var_status.is_client_error() && !local_var_status.is_server_error() { serde_json::from_str(&local_var_content).map_err(Error::from) } else { - let local_var_entity: Option = - serde_json::from_str(&local_var_content).ok(); - let local_var_error = ResponseContent { - status: local_var_status, - content: local_var_content, - entity: local_var_entity, - }; + let local_var_entity: Option = serde_json::from_str(&local_var_content).ok(); + let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity }; Err(Error::ResponseError(local_var_error)) } } + diff --git a/src/openapi/mod.rs b/src/openapi/mod.rs index 017c027..83cba0a 100644 --- a/src/openapi/mod.rs +++ b/src/openapi/mod.rs @@ -3,11 +3,11 @@ #![allow(unused_imports)] #![allow(clippy::too_many_arguments)] -extern crate reqwest; +extern crate serde_repr; extern crate serde; extern crate serde_json; -extern crate serde_repr; extern crate url; +extern crate reqwest; pub mod apis; pub mod models; diff --git a/src/openapi/models/app_info.rs b/src/openapi/models/app_info.rs index 5d8aee2..7774a3e 100644 --- a/src/openapi/models/app_info.rs +++ b/src/openapi/models/app_info.rs @@ -36,6 +36,7 @@ pub struct AppInfo { pub auth_methods: Box, #[serde(rename = "auth_origin")] pub auth_origin: String, + /// Deprecated Property. Please use `hosted_theme` to set hosted page theming instead. #[serde(rename = "auto_theme_enabled")] pub auto_theme_enabled: bool, #[serde(rename = "created_at")] @@ -54,12 +55,14 @@ pub struct AppInfo { pub dark_logo_url: Option, #[serde(rename = "name")] pub name: String, - /// whether or not the app's login page hosted by passage + /// whether or not the app's login page is hosted by Passage #[serde(rename = "hosted")] pub hosted: bool, /// the subdomain of the app's hosted login page #[serde(rename = "hosted_subdomain")] pub hosted_subdomain: String, + #[serde(rename = "hosted_theme")] + pub hosted_theme: models::ThemeType, #[serde(rename = "id_token_lifetime", skip_serializing_if = "Option::is_none")] pub id_token_lifetime: Option, #[serde(rename = "passage_branding")] @@ -103,7 +106,7 @@ pub struct AppInfo { pub element_customization_dark: Box, } -/// +/// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Type { #[serde(rename = "complete")] @@ -111,3 +114,5 @@ pub enum Type { #[serde(rename = "flex")] Flex, } + + diff --git a/src/openapi/models/app_response.rs b/src/openapi/models/app_response.rs index 86b50d4..3442d26 100644 --- a/src/openapi/models/app_response.rs +++ b/src/openapi/models/app_response.rs @@ -16,3 +16,5 @@ pub struct AppResponse { #[serde(rename = "app")] pub app: Box, } + + diff --git a/src/openapi/models/apple_user_social_connection.rs b/src/openapi/models/apple_user_social_connection.rs index dc910b1..e3a457d 100644 --- a/src/openapi/models/apple_user_social_connection.rs +++ b/src/openapi/models/apple_user_social_connection.rs @@ -24,3 +24,5 @@ pub struct AppleUserSocialConnection { #[serde(rename = "provider_identifier")] pub provider_identifier: String, } + + diff --git a/src/openapi/models/auth_methods.rs b/src/openapi/models/auth_methods.rs index ee9a1d8..50c369e 100644 --- a/src/openapi/models/auth_methods.rs +++ b/src/openapi/models/auth_methods.rs @@ -21,3 +21,5 @@ pub struct AuthMethods { #[serde(rename = "magic_link")] pub magic_link: Box, } + + diff --git a/src/openapi/models/authenticate_verify_nonce_response.rs b/src/openapi/models/authenticate_verify_nonce_response.rs index 1a24789..06987bf 100644 --- a/src/openapi/models/authenticate_verify_nonce_response.rs +++ b/src/openapi/models/authenticate_verify_nonce_response.rs @@ -17,3 +17,5 @@ pub struct AuthenticateVerifyNonceResponse { #[serde(rename = "external_id")] pub external_id: String, } + + diff --git a/src/openapi/models/create_transaction_authenticate_request.rs b/src/openapi/models/create_transaction_authenticate_request.rs index 47161a9..fed3e57 100644 --- a/src/openapi/models/create_transaction_authenticate_request.rs +++ b/src/openapi/models/create_transaction_authenticate_request.rs @@ -17,3 +17,5 @@ pub struct CreateTransactionAuthenticateRequest { #[serde(rename = "external_id")] pub external_id: String, } + + diff --git a/src/openapi/models/create_transaction_register_request.rs b/src/openapi/models/create_transaction_register_request.rs index 0a894f3..44c7f8f 100644 --- a/src/openapi/models/create_transaction_register_request.rs +++ b/src/openapi/models/create_transaction_register_request.rs @@ -20,3 +20,5 @@ pub struct CreateTransactionRegisterRequest { #[serde(rename = "passkey_display_name")] pub passkey_display_name: String, } + + diff --git a/src/openapi/models/create_transaction_response.rs b/src/openapi/models/create_transaction_response.rs index f1d0af0..5d76895 100644 --- a/src/openapi/models/create_transaction_response.rs +++ b/src/openapi/models/create_transaction_response.rs @@ -17,3 +17,5 @@ pub struct CreateTransactionResponse { #[serde(rename = "transaction_id")] pub transaction_id: String, } + + diff --git a/src/openapi/models/element_customization.rs b/src/openapi/models/element_customization.rs index 4ce5340..2f1bb9b 100644 --- a/src/openapi/models/element_customization.rs +++ b/src/openapi/models/element_customization.rs @@ -13,122 +13,64 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] pub struct ElementCustomization { - /// Container background color in hex. Default is `#ffffff` in light mode & `#383838` in dark mode. - #[serde( - rename = "passage_container_background_color", - skip_serializing_if = "Option::is_none" - )] + /// Container background color in hex. Default is `#ffffff` in light mode & `#383838` in dark mode. + #[serde(rename = "passage_container_background_color", skip_serializing_if = "Option::is_none")] pub passage_container_background_color: Option, /// Maximum width of container (px) - #[serde( - rename = "passage_container_max_width", - skip_serializing_if = "Option::is_none" - )] + #[serde(rename = "passage_container_max_width", skip_serializing_if = "Option::is_none")] pub passage_container_max_width: Option, - /// Input box background color in hex. Default is `#ffffff` in light mode & `#4b4b4b` in dark mode. - #[serde( - rename = "passage_input_box_background_color", - skip_serializing_if = "Option::is_none" - )] + /// Input box background color in hex. Default is `#ffffff` in light mode & `#4b4b4b` in dark mode. + #[serde(rename = "passage_input_box_background_color", skip_serializing_if = "Option::is_none")] pub passage_input_box_background_color: Option, /// Input box border radius (px) - #[serde( - rename = "passage_input_box_border_radius", - skip_serializing_if = "Option::is_none" - )] + #[serde(rename = "passage_input_box_border_radius", skip_serializing_if = "Option::is_none")] pub passage_input_box_border_radius: Option, - #[serde( - rename = "passage_header_font_family", - skip_serializing_if = "Option::is_none" - )] + #[serde(rename = "passage_header_font_family", skip_serializing_if = "Option::is_none")] pub passage_header_font_family: Option, - #[serde( - rename = "passage_body_font_family", - skip_serializing_if = "Option::is_none" - )] + #[serde(rename = "passage_body_font_family", skip_serializing_if = "Option::is_none")] pub passage_body_font_family: Option, - /// Header text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode. - #[serde( - rename = "passage_header_text_color", - skip_serializing_if = "Option::is_none" - )] + /// Header text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode. + #[serde(rename = "passage_header_text_color", skip_serializing_if = "Option::is_none")] pub passage_header_text_color: Option, - /// Body text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode. - #[serde( - rename = "passage_body_text_color", - skip_serializing_if = "Option::is_none" - )] + /// Body text color in hex. Default is `#222222` in light mode & `#f3f3f3` in dark mode. + #[serde(rename = "passage_body_text_color", skip_serializing_if = "Option::is_none")] pub passage_body_text_color: Option, /// Primary button background colour (hex) - #[serde( - rename = "passage_primary_button_background_color", - skip_serializing_if = "Option::is_none" - )] + #[serde(rename = "passage_primary_button_background_color", skip_serializing_if = "Option::is_none")] pub passage_primary_button_background_color: Option, /// Primary button font colour (hex) - #[serde( - rename = "passage_primary_button_text_color", - skip_serializing_if = "Option::is_none" - )] + #[serde(rename = "passage_primary_button_text_color", skip_serializing_if = "Option::is_none")] pub passage_primary_button_text_color: Option, /// Primary button background on hover (hex) - #[serde( - rename = "passage_primary_button_hover_color", - skip_serializing_if = "Option::is_none" - )] + #[serde(rename = "passage_primary_button_hover_color", skip_serializing_if = "Option::is_none")] pub passage_primary_button_hover_color: Option, /// Primary button border radius (px) - #[serde( - rename = "passage_primary_button_border_radius", - skip_serializing_if = "Option::is_none" - )] + #[serde(rename = "passage_primary_button_border_radius", skip_serializing_if = "Option::is_none")] pub passage_primary_button_border_radius: Option, /// Primary button border color - #[serde( - rename = "passage_primary_button_border_color", - skip_serializing_if = "Option::is_none" - )] + #[serde(rename = "passage_primary_button_border_color", skip_serializing_if = "Option::is_none")] pub passage_primary_button_border_color: Option, /// Primary button border width (px) - #[serde( - rename = "passage_primary_button_border_width", - skip_serializing_if = "Option::is_none" - )] + #[serde(rename = "passage_primary_button_border_width", skip_serializing_if = "Option::is_none")] pub passage_primary_button_border_width: Option, /// Secondary button background colour (hex) - #[serde( - rename = "passage_secondary_button_background_color", - skip_serializing_if = "Option::is_none" - )] + #[serde(rename = "passage_secondary_button_background_color", skip_serializing_if = "Option::is_none")] pub passage_secondary_button_background_color: Option, /// Secondary button font colour (hex) - #[serde( - rename = "passage_secondary_button_text_color", - skip_serializing_if = "Option::is_none" - )] + #[serde(rename = "passage_secondary_button_text_color", skip_serializing_if = "Option::is_none")] pub passage_secondary_button_text_color: Option, /// Secondary button background on hover (hex) - #[serde( - rename = "passage_secondary_button_hover_color", - skip_serializing_if = "Option::is_none" - )] + #[serde(rename = "passage_secondary_button_hover_color", skip_serializing_if = "Option::is_none")] pub passage_secondary_button_hover_color: Option, /// Secondary button border radius (px) - #[serde( - rename = "passage_secondary_button_border_radius", - skip_serializing_if = "Option::is_none" - )] + #[serde(rename = "passage_secondary_button_border_radius", skip_serializing_if = "Option::is_none")] pub passage_secondary_button_border_radius: Option, /// Secondary button border color - #[serde( - rename = "passage_secondary_button_border_color", - skip_serializing_if = "Option::is_none" - )] + #[serde(rename = "passage_secondary_button_border_color", skip_serializing_if = "Option::is_none")] pub passage_secondary_button_border_color: Option, /// Secondary button border width (px) - #[serde( - rename = "passage_secondary_button_border_width", - skip_serializing_if = "Option::is_none" - )] + #[serde(rename = "passage_secondary_button_border_width", skip_serializing_if = "Option::is_none")] pub passage_secondary_button_border_width: Option, } + + diff --git a/src/openapi/models/font_family.rs b/src/openapi/models/font_family.rs index 2654dcd..2b5b1bb 100644 --- a/src/openapi/models/font_family.rs +++ b/src/openapi/models/font_family.rs @@ -55,6 +55,7 @@ pub enum FontFamily { Luminari, #[serde(rename = "Comic Sans MS")] ComicSansMs, + } impl std::fmt::Display for FontFamily { @@ -83,3 +84,5 @@ impl std::fmt::Display for FontFamily { } } } + + diff --git a/src/openapi/models/github_user_social_connection.rs b/src/openapi/models/github_user_social_connection.rs index 22fb726..fde0855 100644 --- a/src/openapi/models/github_user_social_connection.rs +++ b/src/openapi/models/github_user_social_connection.rs @@ -24,3 +24,5 @@ pub struct GithubUserSocialConnection { #[serde(rename = "provider_identifier")] pub provider_identifier: String, } + + diff --git a/src/openapi/models/google_user_social_connection.rs b/src/openapi/models/google_user_social_connection.rs index 3caaf69..af360ef 100644 --- a/src/openapi/models/google_user_social_connection.rs +++ b/src/openapi/models/google_user_social_connection.rs @@ -24,3 +24,5 @@ pub struct GoogleUserSocialConnection { #[serde(rename = "provider_identifier")] pub provider_identifier: String, } + + diff --git a/src/openapi/models/layout_config.rs b/src/openapi/models/layout_config.rs index 42bb939..b6d66df 100644 --- a/src/openapi/models/layout_config.rs +++ b/src/openapi/models/layout_config.rs @@ -24,3 +24,5 @@ pub struct LayoutConfig { #[serde(rename = "y")] pub y: i32, } + + diff --git a/src/openapi/models/layouts.rs b/src/openapi/models/layouts.rs index d4bcff9..b09bd34 100644 --- a/src/openapi/models/layouts.rs +++ b/src/openapi/models/layouts.rs @@ -18,3 +18,5 @@ pub struct Layouts { #[serde(rename = "registration")] pub registration: Vec, } + + diff --git a/src/openapi/models/link.rs b/src/openapi/models/link.rs index e5af3f4..31b727b 100644 --- a/src/openapi/models/link.rs +++ b/src/openapi/models/link.rs @@ -16,3 +16,5 @@ pub struct Link { #[serde(rename = "href")] pub href: String, } + + diff --git a/src/openapi/models/list_devices_response.rs b/src/openapi/models/list_devices_response.rs index 218e821..7cf7d44 100644 --- a/src/openapi/models/list_devices_response.rs +++ b/src/openapi/models/list_devices_response.rs @@ -16,3 +16,5 @@ pub struct ListDevicesResponse { #[serde(rename = "devices")] pub devices: Vec, } + + diff --git a/src/openapi/models/list_paginated_users_item.rs b/src/openapi/models/list_paginated_users_item.rs index 5611047..07e2635 100644 --- a/src/openapi/models/list_paginated_users_item.rs +++ b/src/openapi/models/list_paginated_users_item.rs @@ -39,3 +39,5 @@ pub struct ListPaginatedUsersItem { #[serde(rename = "user_metadata", deserialize_with = "Option::deserialize")] pub user_metadata: Option, } + + diff --git a/src/openapi/models/list_paginated_users_response.rs b/src/openapi/models/list_paginated_users_response.rs index 3169cf4..4c04291 100644 --- a/src/openapi/models/list_paginated_users_response.rs +++ b/src/openapi/models/list_paginated_users_response.rs @@ -28,3 +28,5 @@ pub struct ListPaginatedUsersResponse { #[serde(rename = "users")] pub users: Vec, } + + diff --git a/src/openapi/models/magic_link_auth_method.rs b/src/openapi/models/magic_link_auth_method.rs index b714d6f..41dacce 100644 --- a/src/openapi/models/magic_link_auth_method.rs +++ b/src/openapi/models/magic_link_auth_method.rs @@ -21,3 +21,5 @@ pub struct MagicLinkAuthMethod { #[serde(rename = "ttl_display_unit")] pub ttl_display_unit: models::TtlDisplayUnit, } + + diff --git a/src/openapi/models/mod.rs b/src/openapi/models/mod.rs index a6a4c5f..2423543 100644 --- a/src/openapi/models/mod.rs +++ b/src/openapi/models/mod.rs @@ -56,10 +56,16 @@ pub mod paginated_links; pub use self::paginated_links::PaginatedLinks; pub mod passkeys_auth_method; pub use self::passkeys_auth_method::PasskeysAuthMethod; +pub mod social_connection_type; +pub use self::social_connection_type::SocialConnectionType; pub mod technologies; pub use self::technologies::Technologies; +pub mod theme_type; +pub use self::theme_type::ThemeType; pub mod ttl_display_unit; pub use self::ttl_display_unit::TtlDisplayUnit; +pub mod user_event_action; +pub use self::user_event_action::UserEventAction; pub mod user_event_status; pub use self::user_event_status::UserEventStatus; pub mod user_info; diff --git a/src/openapi/models/model_400_error.rs b/src/openapi/models/model_400_error.rs index 1443ff5..8db9194 100644 --- a/src/openapi/models/model_400_error.rs +++ b/src/openapi/models/model_400_error.rs @@ -19,7 +19,7 @@ pub struct Model400Error { pub error: String, } -/// +/// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Code { #[serde(rename = "invalid_request")] @@ -27,3 +27,5 @@ pub enum Code { #[serde(rename = "custom_provider_required")] CustomProviderRequired, } + + diff --git a/src/openapi/models/model_401_error.rs b/src/openapi/models/model_401_error.rs index a4d0772..9d0ac2f 100644 --- a/src/openapi/models/model_401_error.rs +++ b/src/openapi/models/model_401_error.rs @@ -19,7 +19,7 @@ pub struct Model401Error { pub error: String, } -/// +/// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Code { #[serde(rename = "invalid_access_token")] @@ -27,3 +27,5 @@ pub enum Code { #[serde(rename = "invalid_nonce")] Nonce, } + + diff --git a/src/openapi/models/model_403_error.rs b/src/openapi/models/model_403_error.rs index 7da1120..4397995 100644 --- a/src/openapi/models/model_403_error.rs +++ b/src/openapi/models/model_403_error.rs @@ -19,7 +19,7 @@ pub struct Model403Error { pub error: String, } -/// +/// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Code { #[serde(rename = "cannot_create_organization_billing_portal_session")] @@ -35,3 +35,5 @@ pub enum Code { #[serde(rename = "operation_not_allowed")] OperationNotAllowed, } + + diff --git a/src/openapi/models/model_404_error.rs b/src/openapi/models/model_404_error.rs index 104c28e..70bf493 100644 --- a/src/openapi/models/model_404_error.rs +++ b/src/openapi/models/model_404_error.rs @@ -19,7 +19,7 @@ pub struct Model404Error { pub error: String, } -/// +/// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Code { #[serde(rename = "admin_not_found")] @@ -58,4 +58,8 @@ pub enum Code { SocialConnectionNotFound, #[serde(rename = "user_not_found")] UserNotFound, + #[serde(rename = "native_client_not_found")] + NativeClientNotFound, } + + diff --git a/src/openapi/models/model_409_error.rs b/src/openapi/models/model_409_error.rs index 12c9a54..4760ddd 100644 --- a/src/openapi/models/model_409_error.rs +++ b/src/openapi/models/model_409_error.rs @@ -19,13 +19,19 @@ pub struct Model409Error { pub error: String, } -/// +/// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Code { #[serde(rename = "user_already_admin")] - AlreadyAdmin, + UserAlreadyAdmin, #[serde(rename = "user_already_organization_member")] - AlreadyOrganizationMember, + UserAlreadyOrganizationMember, #[serde(rename = "user_has_no_passkeys")] - HasNoPasskeys, + UserHasNoPasskeys, + #[serde(rename = "native_client_already_exists")] + NativeClientAlreadyExists, + #[serde(rename = "failed_to_sync_email_preferences")] + FailedToSyncEmailPreferences, } + + diff --git a/src/openapi/models/model_500_error.rs b/src/openapi/models/model_500_error.rs index a168a65..f011f65 100644 --- a/src/openapi/models/model_500_error.rs +++ b/src/openapi/models/model_500_error.rs @@ -19,9 +19,11 @@ pub struct Model500Error { pub error: String, } -/// +/// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Code { #[serde(rename = "internal_server_error")] InternalServerError, } + + diff --git a/src/openapi/models/nonce.rs b/src/openapi/models/nonce.rs index 66faf39..3401fe8 100644 --- a/src/openapi/models/nonce.rs +++ b/src/openapi/models/nonce.rs @@ -17,3 +17,5 @@ pub struct Nonce { #[serde(rename = "nonce")] pub nonce: String, } + + diff --git a/src/openapi/models/otp_auth_method.rs b/src/openapi/models/otp_auth_method.rs index 01695f8..e4e03f9 100644 --- a/src/openapi/models/otp_auth_method.rs +++ b/src/openapi/models/otp_auth_method.rs @@ -21,3 +21,5 @@ pub struct OtpAuthMethod { #[serde(rename = "ttl_display_unit")] pub ttl_display_unit: models::TtlDisplayUnit, } + + diff --git a/src/openapi/models/paginated_links.rs b/src/openapi/models/paginated_links.rs index c446878..b6c81ea 100644 --- a/src/openapi/models/paginated_links.rs +++ b/src/openapi/models/paginated_links.rs @@ -24,3 +24,5 @@ pub struct PaginatedLinks { #[serde(rename = "self")] pub param_self: Box, } + + diff --git a/src/openapi/models/passkeys_auth_method.rs b/src/openapi/models/passkeys_auth_method.rs index 64c049c..9967c67 100644 --- a/src/openapi/models/passkeys_auth_method.rs +++ b/src/openapi/models/passkeys_auth_method.rs @@ -16,3 +16,5 @@ pub struct PasskeysAuthMethod { #[serde(rename = "enabled")] pub enabled: bool, } + + diff --git a/src/openapi/models/social_connection_type.rs b/src/openapi/models/social_connection_type.rs new file mode 100644 index 0000000..523e0ff --- /dev/null +++ b/src/openapi/models/social_connection_type.rs @@ -0,0 +1,36 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::openapi::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum SocialConnectionType { + #[serde(rename = "apple")] + Apple, + #[serde(rename = "github")] + Github, + #[serde(rename = "google")] + Google, + +} + +impl std::fmt::Display for SocialConnectionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Apple => write!(f, "apple"), + Self::Github => write!(f, "github"), + Self::Google => write!(f, "google"), + } + } +} + + diff --git a/src/openapi/models/technologies.rs b/src/openapi/models/technologies.rs index c195005..02d3b3c 100644 --- a/src/openapi/models/technologies.rs +++ b/src/openapi/models/technologies.rs @@ -11,7 +11,7 @@ use crate::openapi::models; use serde::{Deserialize, Serialize}; -/// +/// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum Technologies { #[serde(rename = "react")] @@ -30,6 +30,7 @@ pub enum Technologies { Ios, #[serde(rename = "android")] Android, + } impl std::fmt::Display for Technologies { @@ -46,3 +47,5 @@ impl std::fmt::Display for Technologies { } } } + + diff --git a/src/openapi/models/theme_type.rs b/src/openapi/models/theme_type.rs new file mode 100644 index 0000000..7b7af41 --- /dev/null +++ b/src/openapi/models/theme_type.rs @@ -0,0 +1,36 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::openapi::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ThemeType { + #[serde(rename = "auto")] + Auto, + #[serde(rename = "light")] + Light, + #[serde(rename = "dark")] + Dark, + +} + +impl std::fmt::Display for ThemeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Auto => write!(f, "auto"), + Self::Light => write!(f, "light"), + Self::Dark => write!(f, "dark"), + } + } +} + + diff --git a/src/openapi/models/ttl_display_unit.rs b/src/openapi/models/ttl_display_unit.rs index 819ef8b..6cde34f 100644 --- a/src/openapi/models/ttl_display_unit.rs +++ b/src/openapi/models/ttl_display_unit.rs @@ -11,8 +11,8 @@ use crate::openapi::models; use serde::{Deserialize, Serialize}; -/// TtlDisplayUnit : Deprecated Property. The preferred unit for displaying the TTL. This value is for display only. * `s` - seconds * `m` - minutes * `h` - hours * `d` - days -/// Deprecated Property. The preferred unit for displaying the TTL. This value is for display only. * `s` - seconds * `m` - minutes * `h` - hours * `d` - days +/// TtlDisplayUnit : Deprecated Property. The preferred unit for displaying the TTL. This value is for display only. * `s` - seconds * `m` - minutes * `h` - hours * `d` - days +/// Deprecated Property. The preferred unit for displaying the TTL. This value is for display only. * `s` - seconds * `m` - minutes * `h` - hours * `d` - days #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum TtlDisplayUnit { #[serde(rename = "s")] @@ -23,6 +23,7 @@ pub enum TtlDisplayUnit { H, #[serde(rename = "d")] D, + } impl std::fmt::Display for TtlDisplayUnit { @@ -35,3 +36,5 @@ impl std::fmt::Display for TtlDisplayUnit { } } } + + diff --git a/src/openapi/models/user_event_action.rs b/src/openapi/models/user_event_action.rs new file mode 100644 index 0000000..2b7f4cb --- /dev/null +++ b/src/openapi/models/user_event_action.rs @@ -0,0 +1,36 @@ +/* + * Passage Management API + * + * Passage's management API to manage your Passage apps and users. + * + * The version of the OpenAPI document: 1 + * Contact: support@passage.id + * Generated by: https://openapi-generator.tech + */ + +use crate::openapi::models; +use serde::{Deserialize, Serialize}; + +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum UserEventAction { + #[serde(rename = "register")] + Register, + #[serde(rename = "login")] + Login, + #[serde(rename = "other")] + Other, + +} + +impl std::fmt::Display for UserEventAction { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Self::Register => write!(f, "register"), + Self::Login => write!(f, "login"), + Self::Other => write!(f, "other"), + } + } +} + + diff --git a/src/openapi/models/user_event_status.rs b/src/openapi/models/user_event_status.rs index dfea859..f59b7a8 100644 --- a/src/openapi/models/user_event_status.rs +++ b/src/openapi/models/user_event_status.rs @@ -11,13 +11,14 @@ use crate::openapi::models; use serde::{Deserialize, Serialize}; -/// +/// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum UserEventStatus { #[serde(rename = "complete")] Complete, #[serde(rename = "incomplete")] Incomplete, + } impl std::fmt::Display for UserEventStatus { @@ -28,3 +29,5 @@ impl std::fmt::Display for UserEventStatus { } } } + + diff --git a/src/openapi/models/user_info.rs b/src/openapi/models/user_info.rs index aba0b0e..2371ba5 100644 --- a/src/openapi/models/user_info.rs +++ b/src/openapi/models/user_info.rs @@ -50,3 +50,5 @@ pub struct UserInfo { #[serde(rename = "webauthn_types")] pub webauthn_types: Vec, } + + diff --git a/src/openapi/models/user_metadata_field.rs b/src/openapi/models/user_metadata_field.rs index bf4728f..a8ec93c 100644 --- a/src/openapi/models/user_metadata_field.rs +++ b/src/openapi/models/user_metadata_field.rs @@ -26,3 +26,5 @@ pub struct UserMetadataField { #[serde(rename = "type")] pub r#type: models::UserMetadataFieldType, } + + diff --git a/src/openapi/models/user_metadata_field_type.rs b/src/openapi/models/user_metadata_field_type.rs index 011fa93..e222869 100644 --- a/src/openapi/models/user_metadata_field_type.rs +++ b/src/openapi/models/user_metadata_field_type.rs @@ -11,7 +11,7 @@ use crate::openapi::models; use serde::{Deserialize, Serialize}; -/// +/// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum UserMetadataFieldType { #[serde(rename = "string")] @@ -26,6 +26,7 @@ pub enum UserMetadataFieldType { Phone, #[serde(rename = "email")] Email, + } impl std::fmt::Display for UserMetadataFieldType { @@ -40,3 +41,5 @@ impl std::fmt::Display for UserMetadataFieldType { } } } + + diff --git a/src/openapi/models/user_recent_event.rs b/src/openapi/models/user_recent_event.rs index ebf0ba9..7cce0ac 100644 --- a/src/openapi/models/user_recent_event.rs +++ b/src/openapi/models/user_recent_event.rs @@ -25,6 +25,16 @@ pub struct UserRecentEvent { pub status: models::UserEventStatus, #[serde(rename = "type")] pub r#type: String, + /// The raw user agent value from the originating device #[serde(rename = "user_agent")] pub user_agent: String, + /// A display-friendly version of the user agent + #[serde(rename = "user_agent_display")] + pub user_agent_display: String, + #[serde(rename = "action")] + pub action: models::UserEventAction, + #[serde(rename = "social_login_type", deserialize_with = "Option::deserialize")] + pub social_login_type: Option, } + + diff --git a/src/openapi/models/user_response.rs b/src/openapi/models/user_response.rs index 299391b..1ffd993 100644 --- a/src/openapi/models/user_response.rs +++ b/src/openapi/models/user_response.rs @@ -16,3 +16,5 @@ pub struct UserResponse { #[serde(rename = "user")] pub user: Box, } + + diff --git a/src/openapi/models/user_social_connections.rs b/src/openapi/models/user_social_connections.rs index 5a19544..8ca16a5 100644 --- a/src/openapi/models/user_social_connections.rs +++ b/src/openapi/models/user_social_connections.rs @@ -20,3 +20,5 @@ pub struct UserSocialConnections { #[serde(rename = "google", skip_serializing_if = "Option::is_none")] pub google: Option>, } + + diff --git a/src/openapi/models/user_status.rs b/src/openapi/models/user_status.rs index 97b505f..4fd1999 100644 --- a/src/openapi/models/user_status.rs +++ b/src/openapi/models/user_status.rs @@ -11,7 +11,7 @@ use crate::openapi::models; use serde::{Deserialize, Serialize}; -/// +/// #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum UserStatus { #[serde(rename = "active")] @@ -20,6 +20,7 @@ pub enum UserStatus { Inactive, #[serde(rename = "pending")] Pending, + } impl std::fmt::Display for UserStatus { @@ -31,3 +32,5 @@ impl std::fmt::Display for UserStatus { } } } + + diff --git a/src/openapi/models/web_authn_devices.rs b/src/openapi/models/web_authn_devices.rs index 778a77a..bcd13c2 100644 --- a/src/openapi/models/web_authn_devices.rs +++ b/src/openapi/models/web_authn_devices.rs @@ -39,3 +39,5 @@ pub struct WebAuthnDevices { #[serde(rename = "icons")] pub icons: Box, } + + diff --git a/src/openapi/models/web_authn_icons.rs b/src/openapi/models/web_authn_icons.rs index ab10d14..60e13f5 100644 --- a/src/openapi/models/web_authn_icons.rs +++ b/src/openapi/models/web_authn_icons.rs @@ -19,3 +19,5 @@ pub struct WebAuthnIcons { #[serde(rename = "dark", deserialize_with = "Option::deserialize")] pub dark: Option, } + + diff --git a/src/openapi/models/web_authn_type.rs b/src/openapi/models/web_authn_type.rs index 0de1398..7ebf553 100644 --- a/src/openapi/models/web_authn_type.rs +++ b/src/openapi/models/web_authn_type.rs @@ -21,6 +21,7 @@ pub enum WebAuthnType { SecurityKey, #[serde(rename = "platform")] Platform, + } impl std::fmt::Display for WebAuthnType { @@ -32,3 +33,5 @@ impl std::fmt::Display for WebAuthnType { } } } + + diff --git a/src/passage_flex/test.rs b/src/passage_flex/test.rs index bcbd62c..62c9da4 100644 --- a/src/passage_flex/test.rs +++ b/src/passage_flex/test.rs @@ -378,53 +378,56 @@ async fn test_get_app() { "allowed_logout_urls": [], "application_login_uri": "", "auth_fallback_method": "none", - "auth_fallback_method_ttl": 0, + "auth_fallback_method_ttl": 300, "auth_methods": { - "passkeys": { "enabled": false }, - "otp": { + "magic_link": { "enabled": false, - "ttl": 0, + "ttl": 300, "ttl_display_unit": "s" }, - "magic_link": { + "otp": { "enabled": false, - "ttl": 0, + "ttl": 300, "ttl_display_unit": "s" + }, + "passkeys": { + "enabled": true } }, "auth_origin": "https://auth.test.com", - "auto_theme_enabled": false, + "auto_theme_enabled": true, "created_at": "2021-01-01T00:00:00Z", "default_language": "en", + "element_customization": {}, + "element_customization_dark": {}, + "hosted": false, + "hosted_subdomain": "test", + "hosted_theme": "auto", "id": "test_app_id", + "id_token_lifetime": 600, "layouts": { "profile": [], "registration": [] }, - "login_url": "", + "login_url": "/", "name": "Test App", - "hosted": false, - "hosted_subdomain": "", - "id_token_lifetime": null, - "passage_branding": false, + "passage_branding": true, "profile_management": false, "public_signup": false, - "redirect_url": "", - "refresh_absolute_lifetime": 0, + "redirect_url": "/", + "refresh_absolute_lifetime": 2592000, "refresh_enabled": false, - "refresh_inactivity_lifetime": 0, + "refresh_inactivity_lifetime": 432000, "require_email_verification": false, "require_identifier_verification": false, - "required_identifier": "", + "required_identifier": "external", "role": "", "rsa_public_key": "", "secret": null, - "session_timeout_length": 0, - "type": "flex", - "user_metadata_schema": [], + "session_timeout_length": 5, "technologies": [], - "element_customization": {}, - "element_customization_dark": {} + "type": "flex", + "user_metadata_schema": [] } }"#, )