dtz_core/models/
context_response.rs1#[allow(unused_imports)]
12use crate::models;
13#[allow(unused_imports)]
14use serde::{Deserialize, Serialize};
15
16#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
17pub struct ContextResponse {
18 #[serde(rename = "contextId")]
19 pub context_id: dtz_identifier::ContextId,
20 #[serde(rename = "owner")]
21 pub owner: dtz_identifier::IdentityId,
22 #[serde(rename = "created")]
23 pub created: String,
24 #[serde(rename = "alias", skip_serializing_if = "Option::is_none")]
25 pub alias: Option<String>,
26}
27
28impl ContextResponse {
29 pub fn new(context_id: dtz_identifier::ContextId, owner: dtz_identifier::IdentityId, created: String) -> ContextResponse {
30 ContextResponse {
31 context_id,
32 owner,
33 created,
34 alias: None,
35 }
36 }
37}
38