pub type NoxyIdentityAddress = String;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(i32)]
pub enum NoxyDeliveryStatus {
Delivered = 0,
Queued = 1,
NoDevices = 2,
Rejected = 3,
Error = 4,
}
impl From<i32> for NoxyDeliveryStatus {
fn from(v: i32) -> Self {
match v {
0 => Self::Delivered,
1 => Self::Queued,
2 => Self::NoDevices,
3 => Self::Rejected,
4 => Self::Error,
_ => Self::Error,
}
}
}
#[derive(Debug, Clone)]
pub struct NoxyDeliveryOutcome {
pub status: NoxyDeliveryStatus,
pub request_id: String,
pub decision_id: String,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(i32)]
pub enum NoxyHumanDecisionOutcome {
Pending = 0,
Approved = 1,
Rejected = 2,
Expired = 3,
}
impl From<i32> for NoxyHumanDecisionOutcome {
fn from(v: i32) -> Self {
match v {
0 => Self::Pending,
1 => Self::Approved,
2 => Self::Rejected,
3 => Self::Expired,
_ => Self::Pending,
}
}
}
#[derive(Debug, Clone)]
pub struct NoxyGetDecisionOutcomeResponse {
pub request_id: String,
pub pending: bool,
pub outcome: NoxyHumanDecisionOutcome,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(i32)]
pub enum NoxyQuotaStatus {
QuotaActive = 0,
QuotaSuspended = 1,
QuotaDeleted = 2,
}
impl From<i32> for NoxyQuotaStatus {
fn from(v: i32) -> Self {
match v {
0 => Self::QuotaActive,
1 => Self::QuotaSuspended,
2 => Self::QuotaDeleted,
_ => Self::QuotaActive,
}
}
}
#[derive(Debug, Clone)]
pub struct NoxyGetQuotaResponse {
pub request_id: String,
pub app_name: String,
pub quota_total: u64,
pub quota_remaining: u64,
pub status: NoxyQuotaStatus,
}
#[derive(Debug, Clone)]
pub struct NoxyIdentityDevice {
pub device_id: String,
pub public_key: Vec<u8>,
pub pq_public_key: Vec<u8>,
}