-
Notifications
You must be signed in to change notification settings - Fork 1
/
servertemppassword.go
59 lines (51 loc) · 1.77 KB
/
servertemppassword.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
package go_ts3
// servertemppasswordadd `manage_scope, write_scope`
type serverTempPasswordAddRequest struct {
Password string `schema:"pw"`
Description string `schema:"desc"`
Duration int `schema:"duration"`
TargetChannelId int `schema:"tcid"`
TargetChannelPassword string `schema:"tcpw"`
}
func (c *TeamspeakHttpClient) ServerTempPasswordAdd(password string, description string, duration int, targetChannelId int, targetChannelPassword string) error {
return c.requestWithParams(
"servertemppasswordadd",
serverTempPasswordAddRequest{
Password: password,
Description: description,
Duration: duration,
TargetChannelId: targetChannelId,
TargetChannelPassword: targetChannelPassword,
},
nil,
)
}
// servertemppassworddel `manage_scope, write_scope`
type serverTempPasswordDeleteRequest struct {
Password string `schema:"pw"`
}
func (c *TeamspeakHttpClient) ServerTempPasswordDelete(password string) error {
return c.requestWithParams(
"servertemppassworddel",
serverTempPasswordDeleteRequest{Password: password},
nil,
)
}
// servertemppasswordlist `manage_scope, write_scope, read_scope`
type ServerTempPassword struct {
Nickname string `json:"nickname"`
UID string `json:"uid"`
Description string `json:"desc"`
CleartextPassword string `json:"pw_clear"`
Start int `json:"start,string"`
End int `json:"end,string"`
TargetChannelId int `json:"tcid,string"`
}
func (c *TeamspeakHttpClient) ServerTempPasswordList() (*[]ServerTempPassword, error) {
var passwords []ServerTempPassword
err := c.request("servertemppasswordlist", passwords)
if err != nil {
return nil, err
}
return &passwords, nil
}