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