-
Notifications
You must be signed in to change notification settings - Fork 13
/
historicaladherencedaymetrics.go
180 lines (120 loc) · 6.16 KB
/
historicaladherencedaymetrics.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
package platformclientv2
import (
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Historicaladherencedaymetrics
type Historicaladherencedaymetrics struct {
// DayStartOffsetSecs - Start of day offset in seconds relative to query start time
DayStartOffsetSecs *int `json:"dayStartOffsetSecs,omitempty"`
// AdherenceScheduleSecs - Duration of schedule in seconds included for adherence percentage calculation
AdherenceScheduleSecs *int `json:"adherenceScheduleSecs,omitempty"`
// ConformanceScheduleSecs - Total scheduled duration in seconds for OnQueue activities
ConformanceScheduleSecs *int `json:"conformanceScheduleSecs,omitempty"`
// ConformanceActualSecs - Total actually worked duration in seconds for OnQueue activities
ConformanceActualSecs *int `json:"conformanceActualSecs,omitempty"`
// ExceptionCount - Total number of adherence exceptions for this user
ExceptionCount *int `json:"exceptionCount,omitempty"`
// ExceptionDurationSecs - Total duration in seconds of adherence exceptions for this user
ExceptionDurationSecs *int `json:"exceptionDurationSecs,omitempty"`
// ImpactSeconds - The impact duration in seconds of current adherence state for this user
ImpactSeconds *int `json:"impactSeconds,omitempty"`
// ScheduleLengthSecs - Total duration in seconds for all scheduled activities
ScheduleLengthSecs *int `json:"scheduleLengthSecs,omitempty"`
// ActualLengthSecs - Total duration in seconds for all actually worked activities
ActualLengthSecs *int `json:"actualLengthSecs,omitempty"`
// AdherencePercentage - Total adherence percentage for this user, in the scale of 0 - 100
AdherencePercentage *float64 `json:"adherencePercentage,omitempty"`
// ConformancePercentage - Total conformance percentage for this user, in the scale of 0 - 100. Conformance percentage can be greater than 100 when the actual on queue time is greater than the scheduled on queue time for the same period.
ConformancePercentage *float64 `json:"conformancePercentage,omitempty"`
}
func (o *Historicaladherencedaymetrics) MarshalJSON() ([]byte, error) {
// Redundant initialization to avoid unused import errors for models with no Time values
_ = timeutil.Timedelta{}
type Alias Historicaladherencedaymetrics
return json.Marshal(&struct {
DayStartOffsetSecs *int `json:"dayStartOffsetSecs,omitempty"`
AdherenceScheduleSecs *int `json:"adherenceScheduleSecs,omitempty"`
ConformanceScheduleSecs *int `json:"conformanceScheduleSecs,omitempty"`
ConformanceActualSecs *int `json:"conformanceActualSecs,omitempty"`
ExceptionCount *int `json:"exceptionCount,omitempty"`
ExceptionDurationSecs *int `json:"exceptionDurationSecs,omitempty"`
ImpactSeconds *int `json:"impactSeconds,omitempty"`
ScheduleLengthSecs *int `json:"scheduleLengthSecs,omitempty"`
ActualLengthSecs *int `json:"actualLengthSecs,omitempty"`
AdherencePercentage *float64 `json:"adherencePercentage,omitempty"`
ConformancePercentage *float64 `json:"conformancePercentage,omitempty"`
*Alias
}{
DayStartOffsetSecs: o.DayStartOffsetSecs,
AdherenceScheduleSecs: o.AdherenceScheduleSecs,
ConformanceScheduleSecs: o.ConformanceScheduleSecs,
ConformanceActualSecs: o.ConformanceActualSecs,
ExceptionCount: o.ExceptionCount,
ExceptionDurationSecs: o.ExceptionDurationSecs,
ImpactSeconds: o.ImpactSeconds,
ScheduleLengthSecs: o.ScheduleLengthSecs,
ActualLengthSecs: o.ActualLengthSecs,
AdherencePercentage: o.AdherencePercentage,
ConformancePercentage: o.ConformancePercentage,
Alias: (*Alias)(o),
})
}
func (o *Historicaladherencedaymetrics) UnmarshalJSON(b []byte) error {
var HistoricaladherencedaymetricsMap map[string]interface{}
err := json.Unmarshal(b, &HistoricaladherencedaymetricsMap)
if err != nil {
return err
}
if DayStartOffsetSecs, ok := HistoricaladherencedaymetricsMap["dayStartOffsetSecs"].(float64); ok {
DayStartOffsetSecsInt := int(DayStartOffsetSecs)
o.DayStartOffsetSecs = &DayStartOffsetSecsInt
}
if AdherenceScheduleSecs, ok := HistoricaladherencedaymetricsMap["adherenceScheduleSecs"].(float64); ok {
AdherenceScheduleSecsInt := int(AdherenceScheduleSecs)
o.AdherenceScheduleSecs = &AdherenceScheduleSecsInt
}
if ConformanceScheduleSecs, ok := HistoricaladherencedaymetricsMap["conformanceScheduleSecs"].(float64); ok {
ConformanceScheduleSecsInt := int(ConformanceScheduleSecs)
o.ConformanceScheduleSecs = &ConformanceScheduleSecsInt
}
if ConformanceActualSecs, ok := HistoricaladherencedaymetricsMap["conformanceActualSecs"].(float64); ok {
ConformanceActualSecsInt := int(ConformanceActualSecs)
o.ConformanceActualSecs = &ConformanceActualSecsInt
}
if ExceptionCount, ok := HistoricaladherencedaymetricsMap["exceptionCount"].(float64); ok {
ExceptionCountInt := int(ExceptionCount)
o.ExceptionCount = &ExceptionCountInt
}
if ExceptionDurationSecs, ok := HistoricaladherencedaymetricsMap["exceptionDurationSecs"].(float64); ok {
ExceptionDurationSecsInt := int(ExceptionDurationSecs)
o.ExceptionDurationSecs = &ExceptionDurationSecsInt
}
if ImpactSeconds, ok := HistoricaladherencedaymetricsMap["impactSeconds"].(float64); ok {
ImpactSecondsInt := int(ImpactSeconds)
o.ImpactSeconds = &ImpactSecondsInt
}
if ScheduleLengthSecs, ok := HistoricaladherencedaymetricsMap["scheduleLengthSecs"].(float64); ok {
ScheduleLengthSecsInt := int(ScheduleLengthSecs)
o.ScheduleLengthSecs = &ScheduleLengthSecsInt
}
if ActualLengthSecs, ok := HistoricaladherencedaymetricsMap["actualLengthSecs"].(float64); ok {
ActualLengthSecsInt := int(ActualLengthSecs)
o.ActualLengthSecs = &ActualLengthSecsInt
}
if AdherencePercentage, ok := HistoricaladherencedaymetricsMap["adherencePercentage"].(float64); ok {
o.AdherencePercentage = &AdherencePercentage
}
if ConformancePercentage, ok := HistoricaladherencedaymetricsMap["conformancePercentage"].(float64); ok {
o.ConformancePercentage = &ConformancePercentage
}
return nil
}
// String returns a JSON representation of the model
func (o *Historicaladherencedaymetrics) String() string {
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
}