-
Notifications
You must be signed in to change notification settings - Fork 21
/
account_config.go
45 lines (39 loc) · 1.21 KB
/
account_config.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 kavenegar
import (
"net/url"
)
//AccountConfig ...
type AccountConfig struct {
Apilogs AccountAPILogType `json:"apilogs"`
Dailyreport AccountDailyReportType `json:"dailyreport"`
Debugmode AccountDebugModeType `json:"debugmode"`
Defaultsender string `json:"defaultsender"`
Mincreditalarm string `json:"mincreditalarm"`
Resendfailed AccountResendFailedType `json:"resendfailed"`
}
//AccountConfigParam ...
type AccountConfigParam struct {
Apilogs AccountAPILogType
Dailyreport AccountDailyReportType
Debugmode AccountDebugModeType
Defaultsender string
Mincreditalarm string
Resendfailed AccountResendFailedType
}
//AccountConfigResult ...
type AccountConfigResult struct {
*Return `json:"return"`
Entries AccountConfig `json:"entries"`
}
//Config ...
func (c *AccountService) Config(param *AccountConfigParam) (AccountConfig, error) {
v := structToURLValues(param)
return c.CreateConfig(v)
}
//CreateConfig ..
func (c *AccountService) CreateConfig(v url.Values) (AccountConfig, error) {
u := c.client.EndPoint("account", "info")
m := new(AccountConfigResult)
err := c.client.Execute(u.String(), v, m)
return m.Entries, err
}