-
Notifications
You must be signed in to change notification settings - Fork 13
/
userscheduleadherence.go
207 lines (121 loc) · 5.88 KB
/
userscheduleadherence.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
package platformclientv2
import (
"time"
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Userscheduleadherence
type Userscheduleadherence struct {
// Id - The globally unique identifier for the object.
Id *string `json:"id,omitempty"`
// Name
Name *string `json:"name,omitempty"`
// User - The user for whom this status applies
User *Userreference `json:"user,omitempty"`
// ManagementUnit - The management unit to which this user belongs
ManagementUnit *Managementunit `json:"managementUnit,omitempty"`
// Team - The team to which this user belongs
Team *Team `json:"team,omitempty"`
// ScheduledActivityCategory - Activity for which the user is scheduled
ScheduledActivityCategory *string `json:"scheduledActivityCategory,omitempty"`
// SystemPresence - Actual underlying system presence value
SystemPresence *string `json:"systemPresence,omitempty"`
// OrganizationSecondaryPresenceId - Organization Secondary Presence Id.
OrganizationSecondaryPresenceId *string `json:"organizationSecondaryPresenceId,omitempty"`
// RoutingStatus - Actual underlying routing status, used to determine whether a user is actually in adherence when OnQueue
RoutingStatus *string `json:"routingStatus,omitempty"`
// ActualActivityCategory - Activity in which the user is actually engaged
ActualActivityCategory *string `json:"actualActivityCategory,omitempty"`
// IsOutOfOffice - Whether the user is marked OutOfOffice
IsOutOfOffice *bool `json:"isOutOfOffice,omitempty"`
// AdherenceState - The user's current adherence state
AdherenceState *string `json:"adherenceState,omitempty"`
// Impact - The impact of the user's current adherenceState
Impact *string `json:"impact,omitempty"`
// TimeOfAdherenceChange - Time when the user entered the current adherenceState in ISO-8601 format
TimeOfAdherenceChange *time.Time `json:"timeOfAdherenceChange,omitempty"`
// PresenceUpdateTime - Time when presence was last updated. Used to calculate time in current status. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z
PresenceUpdateTime *time.Time `json:"presenceUpdateTime,omitempty"`
// ActiveQueues - The list of queues to which this user is joined
ActiveQueues *[]Queuereference `json:"activeQueues,omitempty"`
// ActiveQueuesModifiedTime - Time when the list of active queues for this user was last updated. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z
ActiveQueuesModifiedTime *time.Time `json:"activeQueuesModifiedTime,omitempty"`
// RemovedFromManagementUnit - For notification purposes. Used to indicate that a user was removed from the management unit
RemovedFromManagementUnit *bool `json:"removedFromManagementUnit,omitempty"`
// SelfUri - The URI for this object
SelfUri *string `json:"selfUri,omitempty"`
}
func (u *Userscheduleadherence) MarshalJSON() ([]byte, error) {
// Redundant initialization to avoid unused import errors for models with no Time values
_ = timeutil.Timedelta{}
type Alias Userscheduleadherence
TimeOfAdherenceChange := new(string)
if u.TimeOfAdherenceChange != nil {
*TimeOfAdherenceChange = timeutil.Strftime(u.TimeOfAdherenceChange, "%Y-%m-%dT%H:%M:%S.%fZ")
} else {
TimeOfAdherenceChange = nil
}
PresenceUpdateTime := new(string)
if u.PresenceUpdateTime != nil {
*PresenceUpdateTime = timeutil.Strftime(u.PresenceUpdateTime, "%Y-%m-%dT%H:%M:%S.%fZ")
} else {
PresenceUpdateTime = nil
}
ActiveQueuesModifiedTime := new(string)
if u.ActiveQueuesModifiedTime != nil {
*ActiveQueuesModifiedTime = timeutil.Strftime(u.ActiveQueuesModifiedTime, "%Y-%m-%dT%H:%M:%S.%fZ")
} else {
ActiveQueuesModifiedTime = nil
}
return json.Marshal(&struct {
Id *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
User *Userreference `json:"user,omitempty"`
ManagementUnit *Managementunit `json:"managementUnit,omitempty"`
Team *Team `json:"team,omitempty"`
ScheduledActivityCategory *string `json:"scheduledActivityCategory,omitempty"`
SystemPresence *string `json:"systemPresence,omitempty"`
OrganizationSecondaryPresenceId *string `json:"organizationSecondaryPresenceId,omitempty"`
RoutingStatus *string `json:"routingStatus,omitempty"`
ActualActivityCategory *string `json:"actualActivityCategory,omitempty"`
IsOutOfOffice *bool `json:"isOutOfOffice,omitempty"`
AdherenceState *string `json:"adherenceState,omitempty"`
Impact *string `json:"impact,omitempty"`
TimeOfAdherenceChange *string `json:"timeOfAdherenceChange,omitempty"`
PresenceUpdateTime *string `json:"presenceUpdateTime,omitempty"`
ActiveQueues *[]Queuereference `json:"activeQueues,omitempty"`
ActiveQueuesModifiedTime *string `json:"activeQueuesModifiedTime,omitempty"`
RemovedFromManagementUnit *bool `json:"removedFromManagementUnit,omitempty"`
SelfUri *string `json:"selfUri,omitempty"`
*Alias
}{
Id: u.Id,
Name: u.Name,
User: u.User,
ManagementUnit: u.ManagementUnit,
Team: u.Team,
ScheduledActivityCategory: u.ScheduledActivityCategory,
SystemPresence: u.SystemPresence,
OrganizationSecondaryPresenceId: u.OrganizationSecondaryPresenceId,
RoutingStatus: u.RoutingStatus,
ActualActivityCategory: u.ActualActivityCategory,
IsOutOfOffice: u.IsOutOfOffice,
AdherenceState: u.AdherenceState,
Impact: u.Impact,
TimeOfAdherenceChange: TimeOfAdherenceChange,
PresenceUpdateTime: PresenceUpdateTime,
ActiveQueues: u.ActiveQueues,
ActiveQueuesModifiedTime: ActiveQueuesModifiedTime,
RemovedFromManagementUnit: u.RemovedFromManagementUnit,
SelfUri: u.SelfUri,
Alias: (*Alias)(u),
})
}
// String returns a JSON representation of the model
func (o *Userscheduleadherence) String() string {
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
}