pub struct MemberActionRequest {
pub node: DidNostr,
pub operation_id: OperationId,
}Expand description
The body of POST /api/v1/members/{pk}/suspend, …/resume and
…/archive: the node it is addressed to and the operation ID.
The operation ID is bound by the node to the action, the member, the
member’s generation and the SHA-256 of this body; a resend returns the
stored response, and any other reuse is 409 conflict.
§Examples
use stratum_node_core::{DidNostr, MemberActionRequest};
let node = DidNostr::from_hex(&"79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798")?;
let body = MemberActionRequest { node, operation_id: "suspend-1".parse()? };
let bytes = serde_json::to_vec(&body)?;
assert!(bytes.starts_with(b"{\"node\":\"did:nostr:"));
assert_eq!(serde_json::from_slice::<MemberActionRequest>(&bytes)?, body);
assert!(serde_json::from_str::<MemberActionRequest>(
r#"{"node":"did:nostr:79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","operation_id":"x","extra":1}"#
).is_err());Fields§
§node: DidNostrThe node the request is addressed to.
operation_id: OperationIdThe administrator’s operation ID.
Trait Implementations§
Source§impl Clone for MemberActionRequest
impl Clone for MemberActionRequest
Source§impl Debug for MemberActionRequest
impl Debug for MemberActionRequest
Source§impl<'de> Deserialize<'de> for MemberActionRequest
impl<'de> Deserialize<'de> for MemberActionRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for MemberActionRequest
Source§impl Hash for MemberActionRequest
impl Hash for MemberActionRequest
Source§impl PartialEq for MemberActionRequest
impl PartialEq for MemberActionRequest
Source§impl Serialize for MemberActionRequest
impl Serialize for MemberActionRequest
impl StructuralPartialEq for MemberActionRequest
Auto Trait Implementations§
impl Forget for MemberActionRequest
impl Freeze for MemberActionRequest
impl Move for MemberActionRequest
impl RefUnwindSafe for MemberActionRequest
impl Send for MemberActionRequestwhere
RawVecInner: Send,
impl Sync for MemberActionRequestwhere
RawVecInner: Sync,
impl Unpin for MemberActionRequest
impl UnsafeUnpin for MemberActionRequest
impl UnwindSafe for MemberActionRequestwhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more