-
Notifications
You must be signed in to change notification settings - Fork 0
/
switchm_switchmodel.go
81 lines (68 loc) · 1.78 KB
/
switchm_switchmodel.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
package bigdog
// API Version: v9_1
import (
"errors"
"io"
)
// SwitchMSwitchModelModelList
//
// Definition: switchModel_modelList
type SwitchMSwitchModelModelList struct {
// Model
// Switch Model
Model *string `json:"model,omitempty"`
}
func NewSwitchMSwitchModelModelList() *SwitchMSwitchModelModelList {
m := new(SwitchMSwitchModelModelList)
return m
}
// SwitchMSwitchModelResult
//
// Definition: switchModel_result
type SwitchMSwitchModelResult struct {
// Extra
// Extra field
Extra interface{} `json:"extra,omitempty"`
// FirstIndex
// The first data index for current reulst
FirstIndex *int `json:"firstIndex,omitempty"`
// HasMore
// Indicator of remaining data
HasMore *bool `json:"hasMore,omitempty"`
List []*SwitchMSwitchModelModelList `json:"list,omitempty"`
// RawDataTotalCount
// Total Data Count
RawDataTotalCount *int `json:"rawDataTotalCount,omitempty"`
// TotalCount
// Total Data Count
TotalCount *int `json:"totalCount,omitempty"`
}
type SwitchMSwitchModelResultAPIResponse struct {
*RawAPIResponse
Data *SwitchMSwitchModelResult
}
func newSwitchMSwitchModelResultAPIResponse(src APISource, meta APIResponseMeta, body io.ReadCloser) APIResponse {
r := new(SwitchMSwitchModelResultAPIResponse)
r.RawAPIResponse = newRawAPIResponse(src, meta, body).(*RawAPIResponse)
return r
}
func (r *SwitchMSwitchModelResultAPIResponse) Hydrate() (interface{}, error) {
r.mu.Lock()
defer r.mu.Unlock()
if r.err != nil {
if errors.Is(r.err, ErrResponseHydrated) {
return r.Data, nil
}
return nil, r.err
}
data := new(SwitchMSwitchModelResult)
if err := r.doHydrate(data); err != nil {
return nil, err
}
r.Data = data
return r.Data, nil
}
func NewSwitchMSwitchModelResult() *SwitchMSwitchModelResult {
m := new(SwitchMSwitchModelResult)
return m
}