Skip to main content

MatiOS_SDK/syscalls/resources/
create_resource_v1.rs

1use crate::syscalls::SyscallRequest;
2use crate::uuid::Uuid;
3use alloc::boxed::Box;
4use alloc::string::String;
5use alloc::vec::Vec;
6pub struct CreateResourceV1 {
7    pub resource_type: Uuid,
8    pub owner: Uuid,
9    pub tags:Vec<Uuid>,
10
11}
12pub struct CreateResourceV1Response {
13    pub uuid: Uuid
14
15}
16impl CreateResourceV1 {
17    pub fn create(resource_type: Uuid, owner: Uuid,tags:Vec<Uuid>) -> Box<SyscallRequest<Self>> {
18        Box::new(SyscallRequest {
19            size: size_of::<Self>(),
20            uuid: crate::uuid::Uuid::from_u128(0xb2828475_e770_4bdc_86e0_695695d6bab0)                ,
21            payload: Self {
22                resource_type,
23                owner,
24                tags,
25            },
26        })
27    }
28}