j_api/resource/identifier_object/mod.rs
1use super::ResourceTrait;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
5pub struct ResourceIdentifierObject {
6 r#type: String,
7 id: String,
8}
9
10impl ResourceIdentifierObject {
11 pub fn new(r#type: String, id: String) -> Self {
12 ResourceIdentifierObject { r#type, id }
13 }
14
15 pub fn from(resource: impl ResourceTrait) -> ResourceIdentifierObject {
16 resource.to_identifier()
17 }
18}