forked from MyPureCloud/platform-client-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
voicemailgrouppolicy.go
162 lines (107 loc) · 4.66 KB
/
voicemailgrouppolicy.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
package platformclientv2
import (
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Voicemailgrouppolicy
type Voicemailgrouppolicy struct {
// Name
Name *string `json:"name"`
// Group - The group associated with the policy
Group *Group `json:"group"`
// Enabled - Whether voicemail is enabled for the group
Enabled *bool `json:"enabled"`
// SendEmailNotifications - Whether email notifications are sent to group members when a new voicemail is received
SendEmailNotifications *bool `json:"sendEmailNotifications"`
// DisableEmailPii - Removes any PII from group emails. This is overridden by the analogous organization configuration value. This is always true if HIPAA is enabled or unknown for an organization.
DisableEmailPii *bool `json:"disableEmailPii"`
// RotateCallsSecs - How many seconds to ring before rotating to the next member in the group
RotateCallsSecs *int `json:"rotateCallsSecs"`
// StopRingingAfterRotations - How many rotations to go through
StopRingingAfterRotations *int `json:"stopRingingAfterRotations"`
// OverflowGroupId - A fallback group to contact when all of the members in this group did not answer the call.
OverflowGroupId *string `json:"overflowGroupId"`
// GroupAlertType - Specifies if the members in this group should be contacted randomly, in a specific order, or by round-robin.
GroupAlertType *string `json:"groupAlertType"`
// InteractiveResponsePromptId - The prompt to use when connecting a user to a Group Ring call
InteractiveResponsePromptId *string `json:"interactiveResponsePromptId"`
}
func (o *Voicemailgrouppolicy) MarshalJSON() ([]byte, error) {
// Redundant initialization to avoid unused import errors for models with no Time values
_ = timeutil.Timedelta{}
type Alias Voicemailgrouppolicy
return json.Marshal(&struct {
Name *string `json:"name"`
Group *Group `json:"group"`
Enabled *bool `json:"enabled"`
SendEmailNotifications *bool `json:"sendEmailNotifications"`
DisableEmailPii *bool `json:"disableEmailPii"`
RotateCallsSecs *int `json:"rotateCallsSecs"`
StopRingingAfterRotations *int `json:"stopRingingAfterRotations"`
OverflowGroupId *string `json:"overflowGroupId"`
GroupAlertType *string `json:"groupAlertType"`
InteractiveResponsePromptId *string `json:"interactiveResponsePromptId"`
*Alias
}{
Name: o.Name,
Group: o.Group,
Enabled: o.Enabled,
SendEmailNotifications: o.SendEmailNotifications,
DisableEmailPii: o.DisableEmailPii,
RotateCallsSecs: o.RotateCallsSecs,
StopRingingAfterRotations: o.StopRingingAfterRotations,
OverflowGroupId: o.OverflowGroupId,
GroupAlertType: o.GroupAlertType,
InteractiveResponsePromptId: o.InteractiveResponsePromptId,
Alias: (*Alias)(o),
})
}
func (o *Voicemailgrouppolicy) UnmarshalJSON(b []byte) error {
var VoicemailgrouppolicyMap map[string]interface{}
err := json.Unmarshal(b, &VoicemailgrouppolicyMap)
if err != nil {
return err
}
if Name, ok := VoicemailgrouppolicyMap["name"].(string); ok {
o.Name = &Name
}
if Group, ok := VoicemailgrouppolicyMap["group"].(map[string]interface{}); ok {
GroupString, _ := json.Marshal(Group)
json.Unmarshal(GroupString, &o.Group)
}
if Enabled, ok := VoicemailgrouppolicyMap["enabled"].(bool); ok {
o.Enabled = &Enabled
}
if SendEmailNotifications, ok := VoicemailgrouppolicyMap["sendEmailNotifications"].(bool); ok {
o.SendEmailNotifications = &SendEmailNotifications
}
if DisableEmailPii, ok := VoicemailgrouppolicyMap["disableEmailPii"].(bool); ok {
o.DisableEmailPii = &DisableEmailPii
}
if RotateCallsSecs, ok := VoicemailgrouppolicyMap["rotateCallsSecs"].(float64); ok {
RotateCallsSecsInt := int(RotateCallsSecs)
o.RotateCallsSecs = &RotateCallsSecsInt
}
if StopRingingAfterRotations, ok := VoicemailgrouppolicyMap["stopRingingAfterRotations"].(float64); ok {
StopRingingAfterRotationsInt := int(StopRingingAfterRotations)
o.StopRingingAfterRotations = &StopRingingAfterRotationsInt
}
if OverflowGroupId, ok := VoicemailgrouppolicyMap["overflowGroupId"].(string); ok {
o.OverflowGroupId = &OverflowGroupId
}
if GroupAlertType, ok := VoicemailgrouppolicyMap["groupAlertType"].(string); ok {
o.GroupAlertType = &GroupAlertType
}
if InteractiveResponsePromptId, ok := VoicemailgrouppolicyMap["interactiveResponsePromptId"].(string); ok {
o.InteractiveResponsePromptId = &InteractiveResponsePromptId
}
return nil
}
// String returns a JSON representation of the model
func (o *Voicemailgrouppolicy) String() string {
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
}