-
Notifications
You must be signed in to change notification settings - Fork 12
/
analyticsproperty.go
75 lines (55 loc) · 1.91 KB
/
analyticsproperty.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
package platformclientv2
import (
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Analyticsproperty
type Analyticsproperty struct {
// Property - User-defined rather than intrinsic system-observed values. These are tagged onto segments by other components within PureCloud or by API users directly. This is the name of the user-defined property.
Property *string `json:"property,omitempty"`
// PropertyType - Indicates what the data type is (e.g. integer vs string) and therefore how to evaluate what would constitute a match
PropertyType *string `json:"propertyType,omitempty"`
// Value - What property value to match against
Value *string `json:"value,omitempty"`
}
func (o *Analyticsproperty) MarshalJSON() ([]byte, error) {
// Redundant initialization to avoid unused import errors for models with no Time values
_ = timeutil.Timedelta{}
type Alias Analyticsproperty
return json.Marshal(&struct {
Property *string `json:"property,omitempty"`
PropertyType *string `json:"propertyType,omitempty"`
Value *string `json:"value,omitempty"`
*Alias
}{
Property: o.Property,
PropertyType: o.PropertyType,
Value: o.Value,
Alias: (*Alias)(o),
})
}
func (o *Analyticsproperty) UnmarshalJSON(b []byte) error {
var AnalyticspropertyMap map[string]interface{}
err := json.Unmarshal(b, &AnalyticspropertyMap)
if err != nil {
return err
}
if Property, ok := AnalyticspropertyMap["property"].(string); ok {
o.Property = &Property
}
if PropertyType, ok := AnalyticspropertyMap["propertyType"].(string); ok {
o.PropertyType = &PropertyType
}
if Value, ok := AnalyticspropertyMap["value"].(string); ok {
o.Value = &Value
}
return nil
}
// String returns a JSON representation of the model
func (o *Analyticsproperty) String() string {
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
}