-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmember_info.go
More file actions
32 lines (28 loc) · 879 Bytes
/
member_info.go
File metadata and controls
32 lines (28 loc) · 879 Bytes
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
package flashduty
import (
"context"
"fmt"
)
type MemberInfo struct {
AccountID uint64 `json:"account_id"`
AccountName string `json:"account_name"`
MemberID uint64 `json:"member_id"`
MemberName string `json:"member_name"`
Email string `json:"email"`
Phone string `json:"phone,omitempty"`
CountryCode string `json:"country_code,omitempty"`
Avatar string `json:"avatar,omitempty"`
Locale string `json:"locale,omitempty"`
TimeZone string `json:"time_zone,omitempty"`
CreatedAt int64 `json:"created_at"`
}
func (c *Client) GetMemberInfo(ctx context.Context) (*MemberInfo, error) {
data, err := postOptionalData[MemberInfo](c, ctx, "/member/info", map[string]any{}, "unable to get member info")
if err != nil {
return nil, err
}
if data == nil {
return nil, fmt.Errorf("empty member info in response")
}
return data, nil
}