forked from MyPureCloud/platform-client-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
agentactivity.go
218 lines (143 loc) · 5.98 KB
/
agentactivity.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
206
207
208
209
210
211
212
213
214
215
216
217
218
package platformclientv2
import (
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Agentactivity
type Agentactivity struct {
// Id - The globally unique identifier for the object.
Id *string `json:"id"`
// Name
Name *string `json:"name"`
// Agent
Agent *User `json:"agent"`
// NumEvaluations
NumEvaluations *int `json:"numEvaluations"`
// AverageEvaluationScore
AverageEvaluationScore *int `json:"averageEvaluationScore"`
// NumCriticalEvaluations
NumCriticalEvaluations *int `json:"numCriticalEvaluations"`
// AverageCriticalScore
AverageCriticalScore *float32 `json:"averageCriticalScore"`
// HighestEvaluationScore
HighestEvaluationScore *float32 `json:"highestEvaluationScore"`
// LowestEvaluationScore
LowestEvaluationScore *float32 `json:"lowestEvaluationScore"`
// HighestCriticalScore
HighestCriticalScore *float32 `json:"highestCriticalScore"`
// LowestCriticalScore
LowestCriticalScore *float32 `json:"lowestCriticalScore"`
// AgentEvaluatorActivityList
AgentEvaluatorActivityList *[]Agentevaluatoractivity `json:"agentEvaluatorActivityList"`
// NumEvaluationsWithoutViewPermission
NumEvaluationsWithoutViewPermission *int `json:"numEvaluationsWithoutViewPermission"`
// SelfUri - The URI for this object
SelfUri *string `json:"selfUri"`
}
func (o *Agentactivity) MarshalJSON() ([]byte, error) {
// Redundant initialization to avoid unused import errors for models with no Time values
_ = timeutil.Timedelta{}
type Alias Agentactivity
return json.Marshal(&struct {
Id *string `json:"id"`
Name *string `json:"name"`
Agent *User `json:"agent"`
NumEvaluations *int `json:"numEvaluations"`
AverageEvaluationScore *int `json:"averageEvaluationScore"`
NumCriticalEvaluations *int `json:"numCriticalEvaluations"`
AverageCriticalScore *float32 `json:"averageCriticalScore"`
HighestEvaluationScore *float32 `json:"highestEvaluationScore"`
LowestEvaluationScore *float32 `json:"lowestEvaluationScore"`
HighestCriticalScore *float32 `json:"highestCriticalScore"`
LowestCriticalScore *float32 `json:"lowestCriticalScore"`
AgentEvaluatorActivityList *[]Agentevaluatoractivity `json:"agentEvaluatorActivityList"`
NumEvaluationsWithoutViewPermission *int `json:"numEvaluationsWithoutViewPermission"`
SelfUri *string `json:"selfUri"`
*Alias
}{
Id: o.Id,
Name: o.Name,
Agent: o.Agent,
NumEvaluations: o.NumEvaluations,
AverageEvaluationScore: o.AverageEvaluationScore,
NumCriticalEvaluations: o.NumCriticalEvaluations,
AverageCriticalScore: o.AverageCriticalScore,
HighestEvaluationScore: o.HighestEvaluationScore,
LowestEvaluationScore: o.LowestEvaluationScore,
HighestCriticalScore: o.HighestCriticalScore,
LowestCriticalScore: o.LowestCriticalScore,
AgentEvaluatorActivityList: o.AgentEvaluatorActivityList,
NumEvaluationsWithoutViewPermission: o.NumEvaluationsWithoutViewPermission,
SelfUri: o.SelfUri,
Alias: (*Alias)(o),
})
}
func (o *Agentactivity) UnmarshalJSON(b []byte) error {
var AgentactivityMap map[string]interface{}
err := json.Unmarshal(b, &AgentactivityMap)
if err != nil {
return err
}
if Id, ok := AgentactivityMap["id"].(string); ok {
o.Id = &Id
}
if Name, ok := AgentactivityMap["name"].(string); ok {
o.Name = &Name
}
if Agent, ok := AgentactivityMap["agent"].(map[string]interface{}); ok {
AgentString, _ := json.Marshal(Agent)
json.Unmarshal(AgentString, &o.Agent)
}
if NumEvaluations, ok := AgentactivityMap["numEvaluations"].(float64); ok {
NumEvaluationsInt := int(NumEvaluations)
o.NumEvaluations = &NumEvaluationsInt
}
if AverageEvaluationScore, ok := AgentactivityMap["averageEvaluationScore"].(float64); ok {
AverageEvaluationScoreInt := int(AverageEvaluationScore)
o.AverageEvaluationScore = &AverageEvaluationScoreInt
}
if NumCriticalEvaluations, ok := AgentactivityMap["numCriticalEvaluations"].(float64); ok {
NumCriticalEvaluationsInt := int(NumCriticalEvaluations)
o.NumCriticalEvaluations = &NumCriticalEvaluationsInt
}
if AverageCriticalScore, ok := AgentactivityMap["averageCriticalScore"].(float64); ok {
AverageCriticalScoreFloat32 := float32(AverageCriticalScore)
o.AverageCriticalScore = &AverageCriticalScoreFloat32
}
if HighestEvaluationScore, ok := AgentactivityMap["highestEvaluationScore"].(float64); ok {
HighestEvaluationScoreFloat32 := float32(HighestEvaluationScore)
o.HighestEvaluationScore = &HighestEvaluationScoreFloat32
}
if LowestEvaluationScore, ok := AgentactivityMap["lowestEvaluationScore"].(float64); ok {
LowestEvaluationScoreFloat32 := float32(LowestEvaluationScore)
o.LowestEvaluationScore = &LowestEvaluationScoreFloat32
}
if HighestCriticalScore, ok := AgentactivityMap["highestCriticalScore"].(float64); ok {
HighestCriticalScoreFloat32 := float32(HighestCriticalScore)
o.HighestCriticalScore = &HighestCriticalScoreFloat32
}
if LowestCriticalScore, ok := AgentactivityMap["lowestCriticalScore"].(float64); ok {
LowestCriticalScoreFloat32 := float32(LowestCriticalScore)
o.LowestCriticalScore = &LowestCriticalScoreFloat32
}
if AgentEvaluatorActivityList, ok := AgentactivityMap["agentEvaluatorActivityList"].([]interface{}); ok {
AgentEvaluatorActivityListString, _ := json.Marshal(AgentEvaluatorActivityList)
json.Unmarshal(AgentEvaluatorActivityListString, &o.AgentEvaluatorActivityList)
}
if NumEvaluationsWithoutViewPermission, ok := AgentactivityMap["numEvaluationsWithoutViewPermission"].(float64); ok {
NumEvaluationsWithoutViewPermissionInt := int(NumEvaluationsWithoutViewPermission)
o.NumEvaluationsWithoutViewPermission = &NumEvaluationsWithoutViewPermissionInt
}
if SelfUri, ok := AgentactivityMap["selfUri"].(string); ok {
o.SelfUri = &SelfUri
}
return nil
}
// String returns a JSON representation of the model
func (o *Agentactivity) String() string {
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
}