-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathmodel_journey_stats.go
More file actions
331 lines (274 loc) · 8.78 KB
/
Copy pathmodel_journey_stats.go
File metadata and controls
331 lines (274 loc) · 8.78 KB
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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
/*
OneSignal
A powerful way to send personalized messages at scale and build effective customer engagement strategies. Learn more at onesignal.com
Contact: devrel@onesignal.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package onesignal
import (
"encoding/json"
)
// JourneyStats Journey-level counts plus flat, id-keyed maps of node and branch stats. Contains no definition detail; join it by id against the journey from View journey.
type JourneyStats struct {
// UUID of the journey these stats belong to.
Id *string `json:"id,omitempty"`
// Users who entered the journey.
Started *int32 `json:"started,omitempty"`
// Users who reached the end of the journey normally.
Completed *int32 `json:"completed,omitempty"`
// Users who left the journey through an early exit rule.
ExitedEarly *int32 `json:"exited_early,omitempty"`
// Node stats keyed by node id. Includes every node in the graph, at any nesting depth.
Nodes *map[string]JourneyNodeStats `json:"nodes,omitempty"`
// Branch stats keyed by branch id. Empty for a journey with no branching nodes.
Branches *map[string]JourneyBranchStats `json:"branches,omitempty"`
AdditionalProperties map[string]interface{}
}
type _JourneyStats JourneyStats
// NewJourneyStats instantiates a new JourneyStats object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewJourneyStats() *JourneyStats {
this := JourneyStats{}
return &this
}
// NewJourneyStatsWithDefaults instantiates a new JourneyStats object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewJourneyStatsWithDefaults() *JourneyStats {
this := JourneyStats{}
return &this
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *JourneyStats) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *JourneyStats) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *JourneyStats) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *JourneyStats) SetId(v string) {
o.Id = &v
}
// GetStarted returns the Started field value if set, zero value otherwise.
func (o *JourneyStats) GetStarted() int32 {
if o == nil || o.Started == nil {
var ret int32
return ret
}
return *o.Started
}
// GetStartedOk returns a tuple with the Started field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *JourneyStats) GetStartedOk() (*int32, bool) {
if o == nil || o.Started == nil {
return nil, false
}
return o.Started, true
}
// HasStarted returns a boolean if a field has been set.
func (o *JourneyStats) HasStarted() bool {
if o != nil && o.Started != nil {
return true
}
return false
}
// SetStarted gets a reference to the given int32 and assigns it to the Started field.
func (o *JourneyStats) SetStarted(v int32) {
o.Started = &v
}
// GetCompleted returns the Completed field value if set, zero value otherwise.
func (o *JourneyStats) GetCompleted() int32 {
if o == nil || o.Completed == nil {
var ret int32
return ret
}
return *o.Completed
}
// GetCompletedOk returns a tuple with the Completed field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *JourneyStats) GetCompletedOk() (*int32, bool) {
if o == nil || o.Completed == nil {
return nil, false
}
return o.Completed, true
}
// HasCompleted returns a boolean if a field has been set.
func (o *JourneyStats) HasCompleted() bool {
if o != nil && o.Completed != nil {
return true
}
return false
}
// SetCompleted gets a reference to the given int32 and assigns it to the Completed field.
func (o *JourneyStats) SetCompleted(v int32) {
o.Completed = &v
}
// GetExitedEarly returns the ExitedEarly field value if set, zero value otherwise.
func (o *JourneyStats) GetExitedEarly() int32 {
if o == nil || o.ExitedEarly == nil {
var ret int32
return ret
}
return *o.ExitedEarly
}
// GetExitedEarlyOk returns a tuple with the ExitedEarly field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *JourneyStats) GetExitedEarlyOk() (*int32, bool) {
if o == nil || o.ExitedEarly == nil {
return nil, false
}
return o.ExitedEarly, true
}
// HasExitedEarly returns a boolean if a field has been set.
func (o *JourneyStats) HasExitedEarly() bool {
if o != nil && o.ExitedEarly != nil {
return true
}
return false
}
// SetExitedEarly gets a reference to the given int32 and assigns it to the ExitedEarly field.
func (o *JourneyStats) SetExitedEarly(v int32) {
o.ExitedEarly = &v
}
// GetNodes returns the Nodes field value if set, zero value otherwise.
func (o *JourneyStats) GetNodes() map[string]JourneyNodeStats {
if o == nil || o.Nodes == nil {
var ret map[string]JourneyNodeStats
return ret
}
return *o.Nodes
}
// GetNodesOk returns a tuple with the Nodes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *JourneyStats) GetNodesOk() (*map[string]JourneyNodeStats, bool) {
if o == nil || o.Nodes == nil {
return nil, false
}
return o.Nodes, true
}
// HasNodes returns a boolean if a field has been set.
func (o *JourneyStats) HasNodes() bool {
if o != nil && o.Nodes != nil {
return true
}
return false
}
// SetNodes gets a reference to the given map[string]JourneyNodeStats and assigns it to the Nodes field.
func (o *JourneyStats) SetNodes(v map[string]JourneyNodeStats) {
o.Nodes = &v
}
// GetBranches returns the Branches field value if set, zero value otherwise.
func (o *JourneyStats) GetBranches() map[string]JourneyBranchStats {
if o == nil || o.Branches == nil {
var ret map[string]JourneyBranchStats
return ret
}
return *o.Branches
}
// GetBranchesOk returns a tuple with the Branches field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *JourneyStats) GetBranchesOk() (*map[string]JourneyBranchStats, bool) {
if o == nil || o.Branches == nil {
return nil, false
}
return o.Branches, true
}
// HasBranches returns a boolean if a field has been set.
func (o *JourneyStats) HasBranches() bool {
if o != nil && o.Branches != nil {
return true
}
return false
}
// SetBranches gets a reference to the given map[string]JourneyBranchStats and assigns it to the Branches field.
func (o *JourneyStats) SetBranches(v map[string]JourneyBranchStats) {
o.Branches = &v
}
func (o JourneyStats) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.Started != nil {
toSerialize["started"] = o.Started
}
if o.Completed != nil {
toSerialize["completed"] = o.Completed
}
if o.ExitedEarly != nil {
toSerialize["exited_early"] = o.ExitedEarly
}
if o.Nodes != nil {
toSerialize["nodes"] = o.Nodes
}
if o.Branches != nil {
toSerialize["branches"] = o.Branches
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return json.Marshal(toSerialize)
}
func (o *JourneyStats) UnmarshalJSON(bytes []byte) (err error) {
varJourneyStats := _JourneyStats{}
if err = json.Unmarshal(bytes, &varJourneyStats); err == nil {
*o = JourneyStats(varJourneyStats)
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
delete(additionalProperties, "id")
delete(additionalProperties, "started")
delete(additionalProperties, "completed")
delete(additionalProperties, "exited_early")
delete(additionalProperties, "nodes")
delete(additionalProperties, "branches")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableJourneyStats struct {
value *JourneyStats
isSet bool
}
func (v NullableJourneyStats) Get() *JourneyStats {
return v.value
}
func (v *NullableJourneyStats) Set(val *JourneyStats) {
v.value = val
v.isSet = true
}
func (v NullableJourneyStats) IsSet() bool {
return v.isSet
}
func (v *NullableJourneyStats) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableJourneyStats(val *JourneyStats) *NullableJourneyStats {
return &NullableJourneyStats{value: val, isSet: true}
}
func (v NullableJourneyStats) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableJourneyStats) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}