-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathuser.go
55 lines (49 loc) · 1.97 KB
/
user.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
package yousign
import (
"net/http"
"time"
)
type UserService struct {
client *Client
}
type User struct {
ID *string `json:"id,omitempty"`
Firstname *string `json:"firstname,omitempty"`
Lastname *string `json:"lastname,omitempty"`
FullName *string `json:"fullName,omitempty"`
Title *string `json:"title,omitempty"`
Email *string `json:"email,omitempty"`
Phone *string `json:"phone,omitempty"`
Status *string `json:"status,omitempty"`
Company *string `json:"company,omitempty"`
CreatedAt *time.Time `json:"createdAt,omitempty"`
UpdatedAt *time.Time `json:"updatedAt,omitempty"`
Config interface{} `json:"config,omitempty"`
SamlNameID *string `json:"samlNameId,omitempty"`
DefaultSignImage *string `json:"defaultSignImage,omitempty"`
FastSign *bool `json:"fastSign,omitempty"`
Group *UserGroup `json:"group,omitempty"`
Notifications interface{} `json:"notifications,omitempty"`
Deleted *bool `json:"deleted,omitempty"`
DeletedAt *time.Time `json:"deletedAt,omitempty"`
}
type UserRequest struct {
Firstname *string `json:"firstname,omitempty"`
Lastname *string `json:"lastname,omitempty"`
Title *string `json:"title,omitempty"`
Phone *string `json:"phone,omitempty"`
Company *string `json:"company,omitempty"`
Config interface{} `json:"config,omitempty"`
Group *string `json:"group,omitempty"`
DefaultSignImage *string `json:"defaultSignImage,omitempty"`
Notifications *string `json:"notifications,omitempty"`
}
func (s *UserService) All() ([]User, *http.Response, error) {
req, err := s.client.NewRequest("GET", "users", nil, nil)
if err != nil {
return nil, nil, err
}
var users []User
resp, err := s.client.Do(req, &users)
return users, resp, err
}