forked from zoom-lib-golang/zoom-lib-golang
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuser_update.go
More file actions
29 lines (24 loc) · 982 Bytes
/
user_update.go
File metadata and controls
29 lines (24 loc) · 982 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
package zoom
import "fmt"
// UpdateUserPath - v2 path for update a user
const UpdateUserPath = "/users/%s"
// UpdateUserOpts contains options for UpdateUser
type UpdateUserOpts struct {
EmailOrID string `url:"-"`
LoginType *UserLoginType `url:"login_type,omitempty"` // use pointer so it can be null
RemoveTspCredentials bool `url:"remove_tsp_credentials,omitempty"`
}
// UpdateUser calls /users/{userId}, update for a user by ID or email, using the default client
func UpdateUser(user User, opts UpdateUserOpts) error {
return defaultClient.UpdateUser(user, opts)
}
// UpdateUser calls /users/{userId}, update for a user by ID or email, using the specific client
func (c *Client) UpdateUser(user User, opts UpdateUserOpts) error {
return c.requestV2(requestV2Opts{
Method: Patch,
Path: fmt.Sprintf(UpdateUserPath, opts.EmailOrID),
URLParameters: opts,
DataParameters: user,
HeadResponse: true,
})
}