aboutsummaryrefslogtreecommitdiff
path: root/lockchain-http/src/models/mod.rs
blob: 0ca7480274cfd8663dcb55b6638e2983f57a73e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//! Data models specific to the lockchain API

pub mod inputs;
pub mod responses;

use serde::{de::DeserializeOwned, Serialize};
use std::error::Error;

/// A wrapper model for various API response types
#[derive(Serialize, Deserialize)]
pub enum Response{
    /// Indicate general success of an operation
    Success,
    /// Indicate a failure of some kind
    Failure(responses::OperationFailed),
    /// Returns a login token
    Token(responses::TokenMessage),
    /// Returns general API information
    Api(responses::ApiInformation),
    /// Returns a list of all vaults
    Vaults(responses::VaultList),
}