1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookDto {
#[serde(rename = "basicAuth", skip_serializing_if = "Option::is_none")]
pub basic_auth: Option<bool>,
#[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[serde(rename = "id", skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "inboxId", skip_serializing_if = "Option::is_none")]
pub inbox_id: Option<String>,
#[serde(rename = "method", skip_serializing_if = "Option::is_none")]
pub method: Option<Method>,
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "payloadJsonSchema", skip_serializing_if = "Option::is_none")]
pub payload_json_schema: Option<String>,
#[serde(rename = "updatedAt")]
pub updated_at: String,
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
}
impl WebhookDto {
pub fn new(updated_at: String) -> WebhookDto {
WebhookDto {
basic_auth: None,
created_at: None,
id: None,
inbox_id: None,
method: None,
name: None,
payload_json_schema: None,
updated_at,
url: None,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Method {
#[serde(rename = "GET")]
GET,
#[serde(rename = "HEAD")]
HEAD,
#[serde(rename = "POST")]
POST,
#[serde(rename = "PUT")]
PUT,
#[serde(rename = "PATCH")]
PATCH,
#[serde(rename = "DELETE")]
DELETE,
#[serde(rename = "OPTIONS")]
OPTIONS,
#[serde(rename = "TRACE")]
TRACE,
}