use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CommitteeMembersInner {
#[serde(rename = "cc_cold_id")]
pub cc_cold_id: String,
#[serde(rename = "cc_cold_hex")]
pub cc_cold_hex: String,
#[serde(rename = "cc_cold_has_script")]
pub cc_cold_has_script: bool,
#[serde(rename = "cc_hot_id", deserialize_with = "Option::deserialize")]
pub cc_hot_id: Option<String>,
#[serde(rename = "cc_hot_hex", deserialize_with = "Option::deserialize")]
pub cc_hot_hex: Option<String>,
#[serde(rename = "cc_hot_has_script", deserialize_with = "Option::deserialize")]
pub cc_hot_has_script: Option<bool>,
#[serde(rename = "status")]
pub status: Status,
#[serde(rename = "expiration_epoch")]
pub expiration_epoch: i32,
}
impl CommitteeMembersInner {
pub fn new(cc_cold_id: String, cc_cold_hex: String, cc_cold_has_script: bool, cc_hot_id: Option<String>, cc_hot_hex: Option<String>, cc_hot_has_script: Option<bool>, status: Status, expiration_epoch: i32) -> CommitteeMembersInner {
CommitteeMembersInner {
cc_cold_id,
cc_cold_hex,
cc_cold_has_script,
cc_hot_id,
cc_hot_hex,
cc_hot_has_script,
status,
expiration_epoch,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Status {
#[serde(rename = "authorized")]
Authorized,
#[serde(rename = "not_authorized")]
NotAuthorized,
#[serde(rename = "resigned")]
Resigned,
}
impl Default for Status {
fn default() -> Status {
Self::Authorized
}
}