forked from MyPureCloud/platform-client-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
textbotexitaction.go
114 lines (79 loc) · 3.13 KB
/
textbotexitaction.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
package platformclientv2
import (
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Textbotexitaction - Settings for a next-action of exiting the bot flow. Any output variables are available in the details.
type Textbotexitaction struct {
// Reason - The reason for the exit.
Reason *string `json:"reason,omitempty"`
// ReasonExtendedInfo - Extended information related to the reason, if available.
ReasonExtendedInfo *string `json:"reasonExtendedInfo"`
// ActiveIntent - The active intent at the time of the exit.
ActiveIntent *string `json:"activeIntent"`
// FlowLocation - Describes where in the Bot Flow the user was when the exit occurred.
FlowLocation *Textbotflowlocation `json:"flowLocation"`
// OutputData - The output data for the bot flow.
OutputData *Textbotinputoutputdata `json:"outputData"`
// FlowOutcomes - The list of Flow Outcomes for the bot flow and their details.
FlowOutcomes *[]Textbotflowoutcome `json:"flowOutcomes"`
}
func (o *Textbotexitaction) MarshalJSON() ([]byte, error) {
// Redundant initialization to avoid unused import errors for models with no Time values
_ = timeutil.Timedelta{}
type Alias Textbotexitaction
return json.Marshal(&struct {
Reason *string `json:"reason,omitempty"`
ReasonExtendedInfo *string `json:"reasonExtendedInfo"`
ActiveIntent *string `json:"activeIntent"`
FlowLocation *Textbotflowlocation `json:"flowLocation"`
OutputData *Textbotinputoutputdata `json:"outputData"`
FlowOutcomes *[]Textbotflowoutcome `json:"flowOutcomes"`
*Alias
}{
Reason: o.Reason,
ReasonExtendedInfo: o.ReasonExtendedInfo,
ActiveIntent: o.ActiveIntent,
FlowLocation: o.FlowLocation,
OutputData: o.OutputData,
FlowOutcomes: o.FlowOutcomes,
Alias: (*Alias)(o),
})
}
func (o *Textbotexitaction) UnmarshalJSON(b []byte) error {
var TextbotexitactionMap map[string]interface{}
err := json.Unmarshal(b, &TextbotexitactionMap)
if err != nil {
return err
}
if Reason, ok := TextbotexitactionMap["reason"].(string); ok {
o.Reason = &Reason
}
if ReasonExtendedInfo, ok := TextbotexitactionMap["reasonExtendedInfo"].(string); ok {
o.ReasonExtendedInfo = &ReasonExtendedInfo
}
if ActiveIntent, ok := TextbotexitactionMap["activeIntent"].(string); ok {
o.ActiveIntent = &ActiveIntent
}
if FlowLocation, ok := TextbotexitactionMap["flowLocation"].(map[string]interface{}); ok {
FlowLocationString, _ := json.Marshal(FlowLocation)
json.Unmarshal(FlowLocationString, &o.FlowLocation)
}
if OutputData, ok := TextbotexitactionMap["outputData"].(map[string]interface{}); ok {
OutputDataString, _ := json.Marshal(OutputData)
json.Unmarshal(OutputDataString, &o.OutputData)
}
if FlowOutcomes, ok := TextbotexitactionMap["flowOutcomes"].([]interface{}); ok {
FlowOutcomesString, _ := json.Marshal(FlowOutcomes)
json.Unmarshal(FlowOutcomesString, &o.FlowOutcomes)
}
return nil
}
// String returns a JSON representation of the model
func (o *Textbotexitaction) String() string {
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
}