-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.go
45 lines (40 loc) · 1.15 KB
/
profile.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
package messenger
type (
// Field represents a field in facebook graph API
Field string
// Fields is a []Field
Fields []Field
)
// Stringify converts Fields to []string
func (f Fields) Stringify() []string {
var ret []string
for _, i := range f {
ret = append(ret, string(i))
}
return ret
}
// Available fields
// https://developers.facebook.com/docs/messenger-platform/identity/user-profile
const (
Name Field = "name"
FirstName Field = "first_name"
LastName Field = "last_name"
ProfilePicture Field = "profile_pic"
Locale Field = "locale"
Timezone Field = "timezone"
Gender Field = "gender"
)
// Profile struct holds data associated with Facebook profile
type Profile struct {
Name string `json:"name"`
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
ProfilePicture string `json:"profile_pic,omitempty"`
Locale string `json:"locale,omitempty"`
Timezone float64 `json:"timezone,omitempty"`
Gender string `json:"gender,omitempty"`
}
type accountLinking struct {
//Recipient is Page Scoped ID
Recipient string `json:"recipient"`
}