Skip to main content

pasty_rs/
model.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Deserialize, Debug)]
4pub struct ApplicationInformation {
5    #[serde(rename = "modificationTokens")]
6    pub modification_tokens: bool,
7    #[serde(rename = "pasteLifetime")]
8    pub paste_lifetime: isize,
9    pub reports: bool,
10    pub version: String,
11}
12
13#[derive(Deserialize, Serialize, Debug)]
14pub struct PfEncryption {
15    pub alg: String,
16    pub iv: String,
17}
18
19#[derive(Deserialize, Serialize, Debug)]
20pub struct Metadata {
21    pub pf_encryption: Option<PfEncryption>,
22}
23
24#[derive(Deserialize, Debug)]
25pub struct Paste {
26    pub id: String,
27    pub content: String,
28    pub created: usize,
29    pub metadata: Option<Metadata>,
30}
31
32#[derive(Serialize, Debug)]
33pub struct CreatePasteRequest {
34    pub content: String,
35    pub metadata: Option<Metadata>,
36}
37
38#[derive(Deserialize, Debug)]
39pub struct CreatedPaste {
40    #[serde(rename = "modificationToken")]
41    pub modification_token: String,
42    #[serde(flatten)]
43    pub paste: Paste,
44}