-
Notifications
You must be signed in to change notification settings - Fork 12
/
createemailrequest.go
234 lines (149 loc) · 6.01 KB
/
createemailrequest.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
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
package platformclientv2
import (
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Createemailrequest
type Createemailrequest struct {
// QueueId - The ID of the queue to use for routing the email conversation. This field is mutually exclusive with flowId
QueueId *string `json:"queueId,omitempty"`
// FlowId - The ID of the flow to use for routing email conversation. This field is mutually exclusive with queueId
FlowId *string `json:"flowId,omitempty"`
// Provider - The name of the provider that is sourcing the emails. The Provider \"PureCloud Email\" is reserved for native emails.
Provider *string `json:"provider,omitempty"`
// SkillIds - The list of skill ID's to use for routing.
SkillIds *[]string `json:"skillIds,omitempty"`
// LanguageId - The ID of the language to use for routing.
LanguageId *string `json:"languageId,omitempty"`
// Priority - The priority to assign to the conversation for routing.
Priority *int `json:"priority,omitempty"`
// Attributes - The list of attributes to associate with the customer participant.
Attributes *map[string]string `json:"attributes,omitempty"`
// ToAddress - The email address of the recipient of the email.
ToAddress *string `json:"toAddress,omitempty"`
// ToName - The name of the recipient of the email.
ToName *string `json:"toName,omitempty"`
// FromAddress - The email address of the sender of the email.
FromAddress *string `json:"fromAddress,omitempty"`
// FromName - The name of the sender of the email.
FromName *string `json:"fromName,omitempty"`
// Subject - The subject of the email
Subject *string `json:"subject,omitempty"`
// Direction - Specify OUTBOUND to send an email on behalf of a queue, or INBOUND to create an external conversation. An external conversation is one where the provider is not PureCloud based.
Direction *string `json:"direction,omitempty"`
// HtmlBody - An HTML body content of the email.
HtmlBody *string `json:"htmlBody,omitempty"`
// TextBody - A text body content of the email.
TextBody *string `json:"textBody,omitempty"`
// ExternalContactId - The external contact with which the email should be associated. This field is only valid for OUTBOUND email.
ExternalContactId *string `json:"externalContactId,omitempty"`
}
func (o *Createemailrequest) MarshalJSON() ([]byte, error) {
// Redundant initialization to avoid unused import errors for models with no Time values
_ = timeutil.Timedelta{}
type Alias Createemailrequest
return json.Marshal(&struct {
QueueId *string `json:"queueId,omitempty"`
FlowId *string `json:"flowId,omitempty"`
Provider *string `json:"provider,omitempty"`
SkillIds *[]string `json:"skillIds,omitempty"`
LanguageId *string `json:"languageId,omitempty"`
Priority *int `json:"priority,omitempty"`
Attributes *map[string]string `json:"attributes,omitempty"`
ToAddress *string `json:"toAddress,omitempty"`
ToName *string `json:"toName,omitempty"`
FromAddress *string `json:"fromAddress,omitempty"`
FromName *string `json:"fromName,omitempty"`
Subject *string `json:"subject,omitempty"`
Direction *string `json:"direction,omitempty"`
HtmlBody *string `json:"htmlBody,omitempty"`
TextBody *string `json:"textBody,omitempty"`
ExternalContactId *string `json:"externalContactId,omitempty"`
*Alias
}{
QueueId: o.QueueId,
FlowId: o.FlowId,
Provider: o.Provider,
SkillIds: o.SkillIds,
LanguageId: o.LanguageId,
Priority: o.Priority,
Attributes: o.Attributes,
ToAddress: o.ToAddress,
ToName: o.ToName,
FromAddress: o.FromAddress,
FromName: o.FromName,
Subject: o.Subject,
Direction: o.Direction,
HtmlBody: o.HtmlBody,
TextBody: o.TextBody,
ExternalContactId: o.ExternalContactId,
Alias: (*Alias)(o),
})
}
func (o *Createemailrequest) UnmarshalJSON(b []byte) error {
var CreateemailrequestMap map[string]interface{}
err := json.Unmarshal(b, &CreateemailrequestMap)
if err != nil {
return err
}
if QueueId, ok := CreateemailrequestMap["queueId"].(string); ok {
o.QueueId = &QueueId
}
if FlowId, ok := CreateemailrequestMap["flowId"].(string); ok {
o.FlowId = &FlowId
}
if Provider, ok := CreateemailrequestMap["provider"].(string); ok {
o.Provider = &Provider
}
if SkillIds, ok := CreateemailrequestMap["skillIds"].([]interface{}); ok {
SkillIdsString, _ := json.Marshal(SkillIds)
json.Unmarshal(SkillIdsString, &o.SkillIds)
}
if LanguageId, ok := CreateemailrequestMap["languageId"].(string); ok {
o.LanguageId = &LanguageId
}
if Priority, ok := CreateemailrequestMap["priority"].(float64); ok {
PriorityInt := int(Priority)
o.Priority = &PriorityInt
}
if Attributes, ok := CreateemailrequestMap["attributes"].(map[string]interface{}); ok {
AttributesString, _ := json.Marshal(Attributes)
json.Unmarshal(AttributesString, &o.Attributes)
}
if ToAddress, ok := CreateemailrequestMap["toAddress"].(string); ok {
o.ToAddress = &ToAddress
}
if ToName, ok := CreateemailrequestMap["toName"].(string); ok {
o.ToName = &ToName
}
if FromAddress, ok := CreateemailrequestMap["fromAddress"].(string); ok {
o.FromAddress = &FromAddress
}
if FromName, ok := CreateemailrequestMap["fromName"].(string); ok {
o.FromName = &FromName
}
if Subject, ok := CreateemailrequestMap["subject"].(string); ok {
o.Subject = &Subject
}
if Direction, ok := CreateemailrequestMap["direction"].(string); ok {
o.Direction = &Direction
}
if HtmlBody, ok := CreateemailrequestMap["htmlBody"].(string); ok {
o.HtmlBody = &HtmlBody
}
if TextBody, ok := CreateemailrequestMap["textBody"].(string); ok {
o.TextBody = &TextBody
}
if ExternalContactId, ok := CreateemailrequestMap["externalContactId"].(string); ok {
o.ExternalContactId = &ExternalContactId
}
return nil
}
// String returns a JSON representation of the model
func (o *Createemailrequest) String() string {
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
}