Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
585 B
3
Indexable
Never
type Error = variant { NotFound : record { msg : text } };
type Message = record {
  id : nat64;
  title : text;
  updated_at : opt nat64;
  body : text;
  created_at : nat64;
  attachment_url : text;
};
type MessagePayload = record {
  title : text;
  body : text;
  attachment_url : text;
};
type Result = variant { Ok : Message; Err : Error };
service : {
  add_message : (MessagePayload) -> (opt Message);
  delete_message : (nat64) -> (Result);
  get_message : (nat64) -> (Result) query;
  greet : (text) -> (text) query;
  update_message : (nat64, MessagePayload) -> (Result);
}
Leave a Comment