/
QueryDevicePage.go
205 lines (172 loc) · 6.16 KB
/
QueryDevicePage.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
// Copyright 2018 JDCLOUD.COM
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// NOTE: This class is auto generated by the jdcloud code generator program.
package apis
import (
"github.com/jdcloud-api/jdcloud-sdk-go/core"
iothub "github.com/jdcloud-api/jdcloud-sdk-go/services/iothub/models"
)
type QueryDevicePageRequest struct {
core.JDCloudRequest
/* 设备归属的实例所在区域 */
RegionId string `json:"regionId"`
/* 设备名称,模糊匹配 (Optional) */
DeviceName *string `json:"deviceName"`
/* 设备状态 0-未激活,1-激活离线,2-激活在线 (Optional) */
Status *int `json:"status"`
/* 设备所归属的产品Key (Optional) */
ProductKey *string `json:"productKey"`
/* 设备类型,同产品类型,0-设备,1-网关 (Optional) */
DeviceType *int `json:"deviceType"`
/* 当前页数 (Optional) */
NowPage *int `json:"nowPage"`
/* 每页的数据条数 (Optional) */
PageSize *int `json:"pageSize"`
/* 排序关键字--name,type,productKey,status--最多支持一个字段 (Optional) */
Order *string `json:"order"`
/* 顺序,升序降序--asc,desc (Optional) */
Direction *string `json:"direction"`
/* 父设备Id (Optional) */
ParentId *string `json:"parentId"`
}
/*
* param regionId: 设备归属的实例所在区域 (Required)
*
* @Deprecated, not compatible when mandatory parameters changed
*/
func NewQueryDevicePageRequest(
regionId string,
) *QueryDevicePageRequest {
return &QueryDevicePageRequest{
JDCloudRequest: core.JDCloudRequest{
URL: "/regions/{regionId}/devices:queryPage",
Method: "GET",
Header: nil,
Version: "v2",
},
RegionId: regionId,
}
}
/*
* param regionId: 设备归属的实例所在区域 (Required)
* param deviceName: 设备名称,模糊匹配 (Optional)
* param status: 设备状态 0-未激活,1-激活离线,2-激活在线 (Optional)
* param productKey: 设备所归属的产品Key (Optional)
* param deviceType: 设备类型,同产品类型,0-设备,1-网关 (Optional)
* param nowPage: 当前页数 (Optional)
* param pageSize: 每页的数据条数 (Optional)
* param order: 排序关键字--name,type,productKey,status--最多支持一个字段 (Optional)
* param direction: 顺序,升序降序--asc,desc (Optional)
* param parentId: 父设备Id (Optional)
*/
func NewQueryDevicePageRequestWithAllParams(
regionId string,
deviceName *string,
status *int,
productKey *string,
deviceType *int,
nowPage *int,
pageSize *int,
order *string,
direction *string,
parentId *string,
) *QueryDevicePageRequest {
return &QueryDevicePageRequest{
JDCloudRequest: core.JDCloudRequest{
URL: "/regions/{regionId}/devices:queryPage",
Method: "GET",
Header: nil,
Version: "v2",
},
RegionId: regionId,
DeviceName: deviceName,
Status: status,
ProductKey: productKey,
DeviceType: deviceType,
NowPage: nowPage,
PageSize: pageSize,
Order: order,
Direction: direction,
ParentId: parentId,
}
}
/* This constructor has better compatible ability when API parameters changed */
func NewQueryDevicePageRequestWithoutParam() *QueryDevicePageRequest {
return &QueryDevicePageRequest{
JDCloudRequest: core.JDCloudRequest{
URL: "/regions/{regionId}/devices:queryPage",
Method: "GET",
Header: nil,
Version: "v2",
},
}
}
/* param regionId: 设备归属的实例所在区域(Required) */
func (r *QueryDevicePageRequest) SetRegionId(regionId string) {
r.RegionId = regionId
}
/* param deviceName: 设备名称,模糊匹配(Optional) */
func (r *QueryDevicePageRequest) SetDeviceName(deviceName string) {
r.DeviceName = &deviceName
}
/* param status: 设备状态 0-未激活,1-激活离线,2-激活在线(Optional) */
func (r *QueryDevicePageRequest) SetStatus(status int) {
r.Status = &status
}
/* param productKey: 设备所归属的产品Key(Optional) */
func (r *QueryDevicePageRequest) SetProductKey(productKey string) {
r.ProductKey = &productKey
}
/* param deviceType: 设备类型,同产品类型,0-设备,1-网关(Optional) */
func (r *QueryDevicePageRequest) SetDeviceType(deviceType int) {
r.DeviceType = &deviceType
}
/* param nowPage: 当前页数(Optional) */
func (r *QueryDevicePageRequest) SetNowPage(nowPage int) {
r.NowPage = &nowPage
}
/* param pageSize: 每页的数据条数(Optional) */
func (r *QueryDevicePageRequest) SetPageSize(pageSize int) {
r.PageSize = &pageSize
}
/* param order: 排序关键字--name,type,productKey,status--最多支持一个字段(Optional) */
func (r *QueryDevicePageRequest) SetOrder(order string) {
r.Order = &order
}
/* param direction: 顺序,升序降序--asc,desc(Optional) */
func (r *QueryDevicePageRequest) SetDirection(direction string) {
r.Direction = &direction
}
/* param parentId: 父设备Id(Optional) */
func (r *QueryDevicePageRequest) SetParentId(parentId string) {
r.ParentId = &parentId
}
// GetRegionId returns path parameter 'regionId' if exist,
// otherwise return empty string
func (r QueryDevicePageRequest) GetRegionId() string {
return r.RegionId
}
type QueryDevicePageResponse struct {
RequestID string `json:"requestId"`
Error core.ErrorResponse `json:"error"`
Result QueryDevicePageResult `json:"result"`
}
type QueryDevicePageResult struct {
PageSize int `json:"pageSize"`
NowPage int `json:"nowPage"`
TotalSize int `json:"totalSize"`
TotalPage int `json:"totalPage"`
Data []iothub.DeviceVO `json:"data"`
}