-
Notifications
You must be signed in to change notification settings - Fork 12
/
shifttradesettings.go
134 lines (78 loc) · 4.26 KB
/
shifttradesettings.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
package platformclientv2
import (
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Shifttradesettings
type Shifttradesettings struct {
// Enabled - Whether shift trading is enabled for this management unit
Enabled *bool `json:"enabled,omitempty"`
// AutoReview - Whether automatic shift trade review is enabled according to the rules defined in for this management unit
AutoReview *bool `json:"autoReview,omitempty"`
// AllowDirectTrades - Whether direct shift trades between agents are allowed
AllowDirectTrades *bool `json:"allowDirectTrades,omitempty"`
// MinHoursInFuture - The minimum number of hours in the future shift trades are allowed
MinHoursInFuture *int `json:"minHoursInFuture,omitempty"`
// UnequalPaid - How to handle shift trades which involve unequal paid times
UnequalPaid *string `json:"unequalPaid,omitempty"`
// OneSided - How to handle one-sided shift trades
OneSided *string `json:"oneSided,omitempty"`
// WeeklyMinPaidViolations - How to handle shift trades which result in violations of weekly minimum paid time constraint
WeeklyMinPaidViolations *string `json:"weeklyMinPaidViolations,omitempty"`
// WeeklyMaxPaidViolations - How to handle shift trades which result in violations of weekly maximum paid time constraint
WeeklyMaxPaidViolations *string `json:"weeklyMaxPaidViolations,omitempty"`
// RequiresMatchingQueues - Whether to constrain shift trades to agents with matching queues
RequiresMatchingQueues *bool `json:"requiresMatchingQueues,omitempty"`
// RequiresMatchingLanguages - Whether to constrain shift trades to agents with matching languages
RequiresMatchingLanguages *bool `json:"requiresMatchingLanguages,omitempty"`
// RequiresMatchingSkills - Whether to constrain shift trades to agents with matching skills
RequiresMatchingSkills *bool `json:"requiresMatchingSkills,omitempty"`
// RequiresMatchingPlanningGroups - Whether to constrain shift trades to agents with matching planning groups
RequiresMatchingPlanningGroups *bool `json:"requiresMatchingPlanningGroups,omitempty"`
// ActivityCategoryRules - Rules that specify what to do with activity categories that are part of a shift defined in a trade
ActivityCategoryRules *[]Shifttradeactivityrule `json:"activityCategoryRules,omitempty"`
}
func (u *Shifttradesettings) MarshalJSON() ([]byte, error) {
// Redundant initialization to avoid unused import errors for models with no Time values
_ = timeutil.Timedelta{}
type Alias Shifttradesettings
return json.Marshal(&struct {
Enabled *bool `json:"enabled,omitempty"`
AutoReview *bool `json:"autoReview,omitempty"`
AllowDirectTrades *bool `json:"allowDirectTrades,omitempty"`
MinHoursInFuture *int `json:"minHoursInFuture,omitempty"`
UnequalPaid *string `json:"unequalPaid,omitempty"`
OneSided *string `json:"oneSided,omitempty"`
WeeklyMinPaidViolations *string `json:"weeklyMinPaidViolations,omitempty"`
WeeklyMaxPaidViolations *string `json:"weeklyMaxPaidViolations,omitempty"`
RequiresMatchingQueues *bool `json:"requiresMatchingQueues,omitempty"`
RequiresMatchingLanguages *bool `json:"requiresMatchingLanguages,omitempty"`
RequiresMatchingSkills *bool `json:"requiresMatchingSkills,omitempty"`
RequiresMatchingPlanningGroups *bool `json:"requiresMatchingPlanningGroups,omitempty"`
ActivityCategoryRules *[]Shifttradeactivityrule `json:"activityCategoryRules,omitempty"`
*Alias
}{
Enabled: u.Enabled,
AutoReview: u.AutoReview,
AllowDirectTrades: u.AllowDirectTrades,
MinHoursInFuture: u.MinHoursInFuture,
UnequalPaid: u.UnequalPaid,
OneSided: u.OneSided,
WeeklyMinPaidViolations: u.WeeklyMinPaidViolations,
WeeklyMaxPaidViolations: u.WeeklyMaxPaidViolations,
RequiresMatchingQueues: u.RequiresMatchingQueues,
RequiresMatchingLanguages: u.RequiresMatchingLanguages,
RequiresMatchingSkills: u.RequiresMatchingSkills,
RequiresMatchingPlanningGroups: u.RequiresMatchingPlanningGroups,
ActivityCategoryRules: u.ActivityCategoryRules,
Alias: (*Alias)(u),
})
}
// String returns a JSON representation of the model
func (o *Shifttradesettings) String() string {
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
}