forked from isuruceanu/gohubspot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
properties.types.go
84 lines (72 loc) · 3.18 KB
/
properties.types.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
package gohubspot
type ItemDataType string
type ItemFieldType string
const (
TextAreaField ItemFieldType = "textarea"
TextField ItemFieldType = "text"
DateField ItemFieldType = "date"
FileField ItemFieldType = "file"
NumberField ItemFieldType = "number"
SelectField ItemFieldType = "select"
RadioField ItemFieldType = "radio"
CheckboxField ItemFieldType = "checkbox"
BooleanCheckboxField ItemFieldType = "booleancheckbox"
)
const (
String ItemDataType = "string"
Number ItemDataType = "number"
Date ItemDataType = "date"
DateTime ItemDataType = "datetime"
Enumeration ItemDataType = "enumeration"
)
type Property struct {
Property string `json:"property"`
Value interface{} `json:"value"`
Versions Versions `json:"versions,omitempty"`
}
type Properties struct {
Properties []Property `json:"properties"`
}
// AddProperty addes a new property to list
func (p *Properties) AddProperty(prop string, value interface{}) {
p.Properties = append(p.Properties, Property{Property: prop, Value: value})
}
// ItemPropertyOption definition
type ItemPropertyOption struct {
Description string `json:"description"`
Label string `json:"label"`
DisplayOrder int `json:"displayOrder"`
Hidden bool `json:"hidden"`
Value interface{} `json:"value"`
}
// ItemProperty definition
type ItemProperty struct {
Name string `json:"name"`
Label string `json:"label,omitempty"`
Description string `json:"description,omitempty"`
DataType ItemDataType `json:"type,omitempty"`
FieldType ItemFieldType `json:"fieldType,omitempty"`
GroupName string `json:"groupName,omitempty"`
Options []ItemPropertyOption `json:"options"`
Deleted bool `json:"deleted"`
FormField bool `json:"formField"`
DisplayOrder int `json:"displayOrder"`
ReadOnlyValue bool `json:"readOnlyValue,omitempty"`
ReadOnlyDefinition bool `json:"readOnlyDefinition,omitempty"`
Hidden bool `json:"hidden,omitempty"`
MutableDefinitionNotDeletable bool `json:"mutableDefinitionNotDeletable,omitempty"`
SearchableInGlobalSearch bool `json:"searchableInGlobalSearch,omitempty"`
Calculated bool `json:"calculated"`
ExternalOptions bool `json:"externalOptions"`
}
// ItemProperties list of ItemProperty type
type ItemProperties []ItemProperty
// ItemPropertyGroup item property group definition
type ItemPropertyGroup struct {
Name string `json:"name"`
DisplayName string `json:"displayName"`
DisplayOrder int `json:"displayOrder"`
HubspotDefined bool `json:"hubspotDefined"`
}
// ItemPropertyGroups ItemPropertyGroup list type
type ItemPropertyGroups []ItemPropertyGroup