-
Notifications
You must be signed in to change notification settings - Fork 0
/
attachment.go
67 lines (54 loc) · 1.3 KB
/
attachment.go
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
package messenger
import "encoding/json"
// AttachmentType is an attachment specific string
type AttachmentType string
// AttachmentType* are defining attachment types
const (
AttachmentTypeTemplate AttachmentType = "template"
AttachmentTypeImage AttachmentType = "image"
AttachmentTypeVideo AttachmentType = "video"
AttachmentTypeAudio AttachmentType = "audio"
AttachmentTypeFile AttachmentType = "file"
AttachmentTypeLocation AttachmentType = "location"
)
// Attachment ...
type Attachment struct {
Type AttachmentType `json:"type"`
Payload json.RawMessage `json:"payload"`
}
// AttachmentPayload ...
type AttachmentPayload interface{}
// ImagePayload ...
type ImagePayload struct {
Url string `json:"url"`
}
// VideoPayload ...
type VideoPayload struct {
Url string `json:"url"`
}
// AudioPayload ...
type AudioPayload struct {
Url string `json:"url"`
}
// FilePayload ...
type FilePayload struct {
Url string `json:"url"`
}
// Coordinates ...
type Coordinates struct {
Lat float64
Long float64
}
// Location ...
type Location struct {
Coordinates Coordinates
}
// Resource ...
type Resource struct {
URL string `json:"url"`
Reusable bool `json:"is_reusable,omitempty"`
}
// ReusableAttachment ...
type ReusableAttachment struct {
AttachmentID string `json:"attachment_id"`
}