-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.yaml
75 lines (74 loc) · 1.94 KB
/
schema.yaml
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
version: v1-draft
exports:
onEmail:
description: |
This function takes a IncomingEmail. What you do with it is up
to you.
codeSamples:
- lang: c++
source: |
auto res = pdk::deliver(input);
return res;
input:
contentType: application/json
$ref: "#/components/schemas/IncomingEmail"
output:
contentType: application/json
type: integer
description: sendmail return code, set to non-zero to bounce
imports:
deliver:
description: |
send it to the inbox, may only be called once
input:
contentType: application/json
$ref: "#/components/schemas/IncomingEmail"
output:
contentType: application/json
type: integer
description: sendmail return code
#$ref: "#/components/schemas/DeliverResult"
reply:
description: |
reply back, may only be called once
input:
contentType: application/json
$ref: "#/components/schemas/ReplyEmail"
output:
contentType: application/json
type: integer
description: sendmail return code
#$ref: "#/components/schemas/DeliverResult"
components:
schemas:
IncomingEmail:
description: the incoming email
properties:
sender:
type: string
description: from
receiver:
type: string
description: to
headers:
type: object
description: to, from, subject, etc
body:
type: string
description: body of email
ReplyEmail:
description: the incoming email
properties:
subject:
type: string
description: email subject
body:
type: string
description: body of email
#DeliverResult:
# description: Result of sending the email to the inbox
# type: integer
#properties:
# rc:
# type: integer
# description: sendmail return code