pub struct MemberView {Show 17 fields
pub did: DidNostr,
pub state: MemberState,
pub generation: u64,
pub suspension: u64,
pub reserved_at: UnixTime,
pub provisioned_at: Option<UnixTime>,
pub activated_at: Option<UnixTime>,
pub suspended_at: Option<UnixTime>,
pub cancelled_at: Option<UnixTime>,
pub removed_at: Option<UnixTime>,
pub enforcement: Option<Enforcement>,
pub over_quota: bool,
pub pod_bytes: Option<u64>,
pub measured_at: Option<UnixTime>,
pub measurement_ms: Option<u64>,
pub purge_not_before: Option<UnixTime>,
pub archive: Option<EventId>,
}Expand description
The answer to GET /api/v1/members/{pk}: one member as it is now.
This route takes no operation ID and its answer is never stored, so
enforcement is current. Times are Unix seconds; a time is null when
the event has not happened in the current generation.
§Examples
use stratum_node_core::{DidNostr, Enforcement, MemberState, MemberView, UnixTime};
let did = DidNostr::from_hex("79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798")?;
let view = MemberView {
did,
state: MemberState::Suspended,
generation: 1,
suspension: 2,
reserved_at: UnixTime::from_secs(1_700_000_000),
provisioned_at: Some(UnixTime::from_secs(1_700_000_010)),
activated_at: Some(UnixTime::from_secs(1_700_000_020)),
suspended_at: Some(UnixTime::from_secs(1_700_000_900)),
cancelled_at: None,
removed_at: None,
enforcement: Some(Enforcement::Enforced),
over_quota: false,
pod_bytes: Some(4096),
measured_at: Some(UnixTime::from_secs(1_700_000_600)),
measurement_ms: Some(12),
purge_not_before: None,
archive: None,
};
let text = serde_json::to_string(&view)?;
assert_eq!(serde_json::from_str::<MemberView>(&text)?, view);Fields§
§did: DidNostrThe member’s identity.
state: MemberStateThe membership state.
generation: u64The generation: 1 for the first admission, raised by one on each re-admission.
suspension: u64The number of suspensions within this generation.
reserved_at: UnixTimeWhen the current generation’s slot was reserved.
provisioned_at: Option<UnixTime>When the pod server created the pod, in this generation.
activated_at: Option<UnixTime>When the owner confirmed the pod, in this generation.
suspended_at: Option<UnixTime>When the current suspension began; null unless suspended.
cancelled_at: Option<UnixTime>When the administrator cancelled the membership, if they did.
removed_at: Option<UnixTime>When the administrator removed the member, if they did.
enforcement: Option<Enforcement>Enforcement of the current suspension; null unless suspended.
over_quota: boolWhether the gate refuses PUT to this member’s pod with 507.
pod_bytes: Option<u64>The pod’s size in bytes at the last measurement for this generation, if one has completed.
measured_at: Option<UnixTime>When the last measurement completed.
measurement_ms: Option<u64>How long the last measurement took, in milliseconds.
purge_not_before: Option<UnixTime>The earliest time purge may delete the pod data; set when the
member is removed or cancelled.
archive: Option<EventId>The reference of the archive taken in the current suspension, if any.