-
Notifications
You must be signed in to change notification settings - Fork 9
/
TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest.go
142 lines (121 loc) · 4.89 KB
/
TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
package wdk
import (
"net/url"
"sync"
"github.com/bububa/opentaobao/model"
)
// TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest 获取mqtt设备信息 API请求
// taobao.wdk.iot.deviceadmin.mqtt.device.getwithtoken
//
// 智能硬件设备动态注册和获取mqtt设备信息
type TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest struct {
model.Params
// 设备的唯一标识码,比如网卡的MAC地址
_deviceId string
// 访问令牌
_applyAccessToken string
// 业务编码,具体编码请联系杜尘
_businessCode int64
// 设备类型编码,具体编码请联系杜尘
_deviceType int64
// 环境编码,0日常,1预发,2线上
_enviroCode int64
}
// NewTaobaoWdkIotDeviceadminMqttDeviceGetwithtokenRequest 初始化TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest对象
func NewTaobaoWdkIotDeviceadminMqttDeviceGetwithtokenRequest() *TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest {
return &TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest{
Params: model.NewParams(5),
}
}
// Reset IRequest interface 方法, 清空结构体
func (r *TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest) Reset() {
r._deviceId = ""
r._applyAccessToken = ""
r._businessCode = 0
r._deviceType = 0
r._enviroCode = 0
r.Params.ToZero()
}
// GetApiMethodName IRequest interface 方法, 获取Api method
func (r TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest) GetApiMethodName() string {
return "taobao.wdk.iot.deviceadmin.mqtt.device.getwithtoken"
}
// GetApiParams IRequest interface 方法, 获取API参数
func (r TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest) GetApiParams(params url.Values) {
for k, v := range r.Params {
params.Set(k, v.String())
}
}
// GetRawParams IRequest interface 方法, 获取API原始参数
func (r TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest) GetRawParams() model.Params {
return r.Params
}
// SetDeviceId is DeviceId Setter
// 设备的唯一标识码,比如网卡的MAC地址
func (r *TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest) SetDeviceId(_deviceId string) error {
r._deviceId = _deviceId
r.Set("device_id", _deviceId)
return nil
}
// GetDeviceId DeviceId Getter
func (r TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest) GetDeviceId() string {
return r._deviceId
}
// SetApplyAccessToken is ApplyAccessToken Setter
// 访问令牌
func (r *TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest) SetApplyAccessToken(_applyAccessToken string) error {
r._applyAccessToken = _applyAccessToken
r.Set("apply_access_token", _applyAccessToken)
return nil
}
// GetApplyAccessToken ApplyAccessToken Getter
func (r TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest) GetApplyAccessToken() string {
return r._applyAccessToken
}
// SetBusinessCode is BusinessCode Setter
// 业务编码,具体编码请联系杜尘
func (r *TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest) SetBusinessCode(_businessCode int64) error {
r._businessCode = _businessCode
r.Set("business_code", _businessCode)
return nil
}
// GetBusinessCode BusinessCode Getter
func (r TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest) GetBusinessCode() int64 {
return r._businessCode
}
// SetDeviceType is DeviceType Setter
// 设备类型编码,具体编码请联系杜尘
func (r *TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest) SetDeviceType(_deviceType int64) error {
r._deviceType = _deviceType
r.Set("device_type", _deviceType)
return nil
}
// GetDeviceType DeviceType Getter
func (r TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest) GetDeviceType() int64 {
return r._deviceType
}
// SetEnviroCode is EnviroCode Setter
// 环境编码,0日常,1预发,2线上
func (r *TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest) SetEnviroCode(_enviroCode int64) error {
r._enviroCode = _enviroCode
r.Set("enviro_code", _enviroCode)
return nil
}
// GetEnviroCode EnviroCode Getter
func (r TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest) GetEnviroCode() int64 {
return r._enviroCode
}
var poolTaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest = sync.Pool{
New: func() any {
return NewTaobaoWdkIotDeviceadminMqttDeviceGetwithtokenRequest()
},
}
// GetTaobaoWdkIotDeviceadminMqttDeviceGetwithtokenRequest 从 sync.Pool 获取 TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest
func GetTaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest() *TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest {
return poolTaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest.Get().(*TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest)
}
// ReleaseTaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest 将 TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest 放入 sync.Pool
func ReleaseTaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest(v *TaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest) {
v.Reset()
poolTaobaoWdkIotDeviceadminMqttDeviceGetwithtokenAPIRequest.Put(v)
}