-
Notifications
You must be signed in to change notification settings - Fork 9
/
TaobaoSubuserDepartmentsGetAPIResponse.go
55 lines (46 loc) · 1.99 KB
/
TaobaoSubuserDepartmentsGetAPIResponse.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 subuser
import (
"encoding/xml"
"sync"
"github.com/bububa/opentaobao/model"
)
// TaobaoSubuserDepartmentsGetAPIResponse 获取指定账户的所有部门列表 API返回值
// taobao.subuser.departments.get
//
// 获取指定账户的所有部门列表,其实包括有每个部门的ID、父部门ID、部门名称(通过主账号登陆只能查询属于该主账号下的所有部门信息)。
type TaobaoSubuserDepartmentsGetAPIResponse struct {
model.CommonResponse
TaobaoSubuserDepartmentsGetAPIResponseModel
}
// Reset 清空结构体
func (m *TaobaoSubuserDepartmentsGetAPIResponse) Reset() {
(&m.CommonResponse).Reset()
(&m.TaobaoSubuserDepartmentsGetAPIResponseModel).Reset()
}
// TaobaoSubuserDepartmentsGetAPIResponseModel is 获取指定账户的所有部门列表 成功返回结果
type TaobaoSubuserDepartmentsGetAPIResponseModel struct {
XMLName xml.Name `xml:"subuser_departments_get_response"`
// 平台颁发的每次请求访问的唯一标识
RequestId string `json:"request_id,omitempty" xml:"request_id,omitempty"`
// 部门信息
Departments []Department `json:"departments,omitempty" xml:"departments>department,omitempty"`
}
// Reset 清空结构体
func (m *TaobaoSubuserDepartmentsGetAPIResponseModel) Reset() {
m.RequestId = ""
m.Departments = m.Departments[:0]
}
var poolTaobaoSubuserDepartmentsGetAPIResponse = sync.Pool{
New: func() any {
return new(TaobaoSubuserDepartmentsGetAPIResponse)
},
}
// GetTaobaoSubuserDepartmentsGetAPIResponse 从 sync.Pool 获取 TaobaoSubuserDepartmentsGetAPIResponse
func GetTaobaoSubuserDepartmentsGetAPIResponse() *TaobaoSubuserDepartmentsGetAPIResponse {
return poolTaobaoSubuserDepartmentsGetAPIResponse.Get().(*TaobaoSubuserDepartmentsGetAPIResponse)
}
// ReleaseTaobaoSubuserDepartmentsGetAPIResponse 将 TaobaoSubuserDepartmentsGetAPIResponse 保存到 sync.Pool
func ReleaseTaobaoSubuserDepartmentsGetAPIResponse(v *TaobaoSubuserDepartmentsGetAPIResponse) {
v.Reset()
poolTaobaoSubuserDepartmentsGetAPIResponse.Put(v)
}