forked from MyPureCloud/platform-client-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
createcallrequest.go
199 lines (129 loc) · 5.13 KB
/
createcallrequest.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
package platformclientv2
import (
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Createcallrequest
type Createcallrequest struct {
// PhoneNumber - The phone number to dial.
PhoneNumber *string `json:"phoneNumber"`
// CallerId - The caller id phone number for this outbound call.
CallerId *string `json:"callerId"`
// CallerIdName - The caller id name for this outbound call.
CallerIdName *string `json:"callerIdName"`
// CallFromQueueId - The queue ID to call on behalf of.
CallFromQueueId *string `json:"callFromQueueId"`
// CallQueueId - The queue ID to call.
CallQueueId *string `json:"callQueueId"`
// CallUserId - The user ID to call.
CallUserId *string `json:"callUserId"`
// Priority - The priority to assign to this call (if calling a queue).
Priority *int `json:"priority"`
// LanguageId - The language skill ID to use for routing this call (if calling a queue).
LanguageId *string `json:"languageId"`
// RoutingSkillsIds - The skill ID's to use for routing this call (if calling a queue).
RoutingSkillsIds *[]string `json:"routingSkillsIds"`
// ConversationIds - The list of existing call conversations to merge into a new ad-hoc conference.
ConversationIds *[]string `json:"conversationIds"`
// Participants - The list of participants to call to create a new ad-hoc conference.
Participants *[]Destination `json:"participants"`
// UuiData - User to User Information (UUI) data managed by SIP session application.
UuiData *string `json:"uuiData"`
// ExternalContactId - The external contact with which to associate the call.
ExternalContactId *string `json:"externalContactId"`
}
func (o *Createcallrequest) MarshalJSON() ([]byte, error) {
// Redundant initialization to avoid unused import errors for models with no Time values
_ = timeutil.Timedelta{}
type Alias Createcallrequest
return json.Marshal(&struct {
PhoneNumber *string `json:"phoneNumber"`
CallerId *string `json:"callerId"`
CallerIdName *string `json:"callerIdName"`
CallFromQueueId *string `json:"callFromQueueId"`
CallQueueId *string `json:"callQueueId"`
CallUserId *string `json:"callUserId"`
Priority *int `json:"priority"`
LanguageId *string `json:"languageId"`
RoutingSkillsIds *[]string `json:"routingSkillsIds"`
ConversationIds *[]string `json:"conversationIds"`
Participants *[]Destination `json:"participants"`
UuiData *string `json:"uuiData"`
ExternalContactId *string `json:"externalContactId"`
*Alias
}{
PhoneNumber: o.PhoneNumber,
CallerId: o.CallerId,
CallerIdName: o.CallerIdName,
CallFromQueueId: o.CallFromQueueId,
CallQueueId: o.CallQueueId,
CallUserId: o.CallUserId,
Priority: o.Priority,
LanguageId: o.LanguageId,
RoutingSkillsIds: o.RoutingSkillsIds,
ConversationIds: o.ConversationIds,
Participants: o.Participants,
UuiData: o.UuiData,
ExternalContactId: o.ExternalContactId,
Alias: (*Alias)(o),
})
}
func (o *Createcallrequest) UnmarshalJSON(b []byte) error {
var CreatecallrequestMap map[string]interface{}
err := json.Unmarshal(b, &CreatecallrequestMap)
if err != nil {
return err
}
if PhoneNumber, ok := CreatecallrequestMap["phoneNumber"].(string); ok {
o.PhoneNumber = &PhoneNumber
}
if CallerId, ok := CreatecallrequestMap["callerId"].(string); ok {
o.CallerId = &CallerId
}
if CallerIdName, ok := CreatecallrequestMap["callerIdName"].(string); ok {
o.CallerIdName = &CallerIdName
}
if CallFromQueueId, ok := CreatecallrequestMap["callFromQueueId"].(string); ok {
o.CallFromQueueId = &CallFromQueueId
}
if CallQueueId, ok := CreatecallrequestMap["callQueueId"].(string); ok {
o.CallQueueId = &CallQueueId
}
if CallUserId, ok := CreatecallrequestMap["callUserId"].(string); ok {
o.CallUserId = &CallUserId
}
if Priority, ok := CreatecallrequestMap["priority"].(float64); ok {
PriorityInt := int(Priority)
o.Priority = &PriorityInt
}
if LanguageId, ok := CreatecallrequestMap["languageId"].(string); ok {
o.LanguageId = &LanguageId
}
if RoutingSkillsIds, ok := CreatecallrequestMap["routingSkillsIds"].([]interface{}); ok {
RoutingSkillsIdsString, _ := json.Marshal(RoutingSkillsIds)
json.Unmarshal(RoutingSkillsIdsString, &o.RoutingSkillsIds)
}
if ConversationIds, ok := CreatecallrequestMap["conversationIds"].([]interface{}); ok {
ConversationIdsString, _ := json.Marshal(ConversationIds)
json.Unmarshal(ConversationIdsString, &o.ConversationIds)
}
if Participants, ok := CreatecallrequestMap["participants"].([]interface{}); ok {
ParticipantsString, _ := json.Marshal(Participants)
json.Unmarshal(ParticipantsString, &o.Participants)
}
if UuiData, ok := CreatecallrequestMap["uuiData"].(string); ok {
o.UuiData = &UuiData
}
if ExternalContactId, ok := CreatecallrequestMap["externalContactId"].(string); ok {
o.ExternalContactId = &ExternalContactId
}
return nil
}
// String returns a JSON representation of the model
func (o *Createcallrequest) String() string {
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
}