-
Notifications
You must be signed in to change notification settings - Fork 2
/
monitoringstat.go
52 lines (40 loc) · 1.29 KB
/
monitoringstat.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
package files_sdk
import (
"encoding/json"
lib "github.com/Files-com/files-sdk-go/v2/lib"
)
type MonitoringStat struct {
Alerts string `json:"alerts,omitempty" path:"alerts,omitempty" url:"alerts,omitempty"`
Info string `json:"info,omitempty" path:"info,omitempty" url:"info,omitempty"`
}
// Identifier no path or id
type MonitoringStatCollection []MonitoringStat
type MonitoringStatListParams struct {
Action string `url:"action,omitempty" required:"false" json:"action,omitempty" path:"action"`
ListParams
}
func (m *MonitoringStat) UnmarshalJSON(data []byte) error {
type monitoringStat MonitoringStat
var v monitoringStat
if err := json.Unmarshal(data, &v); err != nil {
return lib.ErrorWithOriginalResponse{}.ProcessError(data, err, map[string]interface{}{})
}
*m = MonitoringStat(v)
return nil
}
func (m *MonitoringStatCollection) UnmarshalJSON(data []byte) error {
type monitoringStats MonitoringStatCollection
var v monitoringStats
if err := json.Unmarshal(data, &v); err != nil {
return lib.ErrorWithOriginalResponse{}.ProcessError(data, err, []map[string]interface{}{})
}
*m = MonitoringStatCollection(v)
return nil
}
func (m *MonitoringStatCollection) ToSlice() *[]interface{} {
ret := make([]interface{}, len(*m))
for i, v := range *m {
ret[i] = v
}
return &ret
}