-
Notifications
You must be signed in to change notification settings - Fork 12
/
TaobaoSubuserFullinfoGetAPIRequest.go
110 lines (93 loc) · 4.36 KB
/
TaobaoSubuserFullinfoGetAPIRequest.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
package subuser
import (
"net/url"
"sync"
"github.com/bububa/opentaobao/model"
)
// TaobaoSubuserFullinfoGetAPIRequest 获取指定账户子账号的详细信息 API请求
// taobao.subuser.fullinfo.get
//
// 获取指定账户子账号的详细信息,其中包括子账号的账号信息以及员工、部门、职务信息(只能通过主账号登陆并查询属于该主账号下的某个子账号详细信息)
type TaobaoSubuserFullinfoGetAPIRequest struct {
model.Params
// 子账号用户名(传参中sub_id和sub_nick至少需要其中一个,若sub_id与sub_nick同时传入并且合法,那么sub_nick优先,以sub_nick查询子账号)
_subNick string
// 传入所需要的参数信息(若不需要获取子账号或主账号的企业邮箱地址,则无需传入该参数;若需要获取子账号或主账号的企业邮箱地址,则需要传入fields;可选参数值为subuser_email和user_email,传入其他参数值均无效;两个参数都需要则以逗号隔开传入即可,例如:subuser_email,user_email)
_fields string
// 子账号ID(传参中sub_id和sub_nick至少需要其中一个,若sub_id与sub_nick同时传入并且合法,那么sub_nick优先,以sub_nick查询子账号)
_subId int64
}
// NewTaobaoSubuserFullinfoGetRequest 初始化TaobaoSubuserFullinfoGetAPIRequest对象
func NewTaobaoSubuserFullinfoGetRequest() *TaobaoSubuserFullinfoGetAPIRequest {
return &TaobaoSubuserFullinfoGetAPIRequest{
Params: model.NewParams(3),
}
}
// Reset IRequest interface 方法, 清空结构体
func (r *TaobaoSubuserFullinfoGetAPIRequest) Reset() {
r._subNick = ""
r._fields = ""
r._subId = 0
r.Params.ToZero()
}
// GetApiMethodName IRequest interface 方法, 获取Api method
func (r TaobaoSubuserFullinfoGetAPIRequest) GetApiMethodName() string {
return "taobao.subuser.fullinfo.get"
}
// GetApiParams IRequest interface 方法, 获取API参数
func (r TaobaoSubuserFullinfoGetAPIRequest) GetApiParams(params url.Values) {
for k, v := range r.Params {
params.Set(k, v.String())
}
}
// GetRawParams IRequest interface 方法, 获取API原始参数
func (r TaobaoSubuserFullinfoGetAPIRequest) GetRawParams() model.Params {
return r.Params
}
// SetSubNick is SubNick Setter
// 子账号用户名(传参中sub_id和sub_nick至少需要其中一个,若sub_id与sub_nick同时传入并且合法,那么sub_nick优先,以sub_nick查询子账号)
func (r *TaobaoSubuserFullinfoGetAPIRequest) SetSubNick(_subNick string) error {
r._subNick = _subNick
r.Set("sub_nick", _subNick)
return nil
}
// GetSubNick SubNick Getter
func (r TaobaoSubuserFullinfoGetAPIRequest) GetSubNick() string {
return r._subNick
}
// SetFields is Fields Setter
// 传入所需要的参数信息(若不需要获取子账号或主账号的企业邮箱地址,则无需传入该参数;若需要获取子账号或主账号的企业邮箱地址,则需要传入fields;可选参数值为subuser_email和user_email,传入其他参数值均无效;两个参数都需要则以逗号隔开传入即可,例如:subuser_email,user_email)
func (r *TaobaoSubuserFullinfoGetAPIRequest) SetFields(_fields string) error {
r._fields = _fields
r.Set("fields", _fields)
return nil
}
// GetFields Fields Getter
func (r TaobaoSubuserFullinfoGetAPIRequest) GetFields() string {
return r._fields
}
// SetSubId is SubId Setter
// 子账号ID(传参中sub_id和sub_nick至少需要其中一个,若sub_id与sub_nick同时传入并且合法,那么sub_nick优先,以sub_nick查询子账号)
func (r *TaobaoSubuserFullinfoGetAPIRequest) SetSubId(_subId int64) error {
r._subId = _subId
r.Set("sub_id", _subId)
return nil
}
// GetSubId SubId Getter
func (r TaobaoSubuserFullinfoGetAPIRequest) GetSubId() int64 {
return r._subId
}
var poolTaobaoSubuserFullinfoGetAPIRequest = sync.Pool{
New: func() any {
return NewTaobaoSubuserFullinfoGetRequest()
},
}
// GetTaobaoSubuserFullinfoGetRequest 从 sync.Pool 获取 TaobaoSubuserFullinfoGetAPIRequest
func GetTaobaoSubuserFullinfoGetAPIRequest() *TaobaoSubuserFullinfoGetAPIRequest {
return poolTaobaoSubuserFullinfoGetAPIRequest.Get().(*TaobaoSubuserFullinfoGetAPIRequest)
}
// ReleaseTaobaoSubuserFullinfoGetAPIRequest 将 TaobaoSubuserFullinfoGetAPIRequest 放入 sync.Pool
func ReleaseTaobaoSubuserFullinfoGetAPIRequest(v *TaobaoSubuserFullinfoGetAPIRequest) {
v.Reset()
poolTaobaoSubuserFullinfoGetAPIRequest.Put(v)
}