-
Notifications
You must be signed in to change notification settings - Fork 0
/
object.go
90 lines (78 loc) · 2.55 KB
/
object.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
package hubspot
const (
ObjectTypeContact = "contact"
ObjectTypeCompany = "company"
ObjectTypeDeal = "deal"
ObjectTypeFeedbackSubmission = "feedback_submission"
ObjectTypeLineItem = "line_item"
ObjectTypeProduct = "product"
ObjectTypeQuote = "quote"
ObjectTypeDiscount = "discount"
ObjectTypeFee = "fee"
ObjectTypeTax = "tax"
ObjectTypeTicket = "ticket"
ObjectTypeGoal = "goal_target"
ObjectTypeIDContact = "0-1"
ObjectTypeIDCompany = "0-2"
ObjectTypeIDDeal = "0-3"
ObjectTypeIDTicket = "0-5"
ObjectTypeIDProduct = "0-7"
ObjectTypeIDLineItem = "0-8"
ObjectTypeIDQuote = "0-14"
ObjectTypeIDFeedbackSubmission = "0-19"
ObjectTypeIDCall = "0-48"
ObjectTypeIDEmail = "0-49"
ObjectTypeIDMeeting = "0-47"
ObjectTypeIDNote = "0-4"
ObjectTypeIDTask = "0-27"
ObjectTypeIDCommunication = "0-18"
ObjectTypeIDPostalMail = "0-116"
ObjectTypeIDMarketingEvent = "0-54"
)
type PublicObject[
P ObjectPropertiesEmbedder,
PWH PropertyWithHistory | Results[PropertyWithHistory] | PaginatedResults[PropertyWithHistory],
AE AssociationEdge | Results[AssociationEdge] | PaginatedResults[AssociationEdge],
] struct {
// ID is the HubSpot object ID.
ID string `json:"id,omitempty"`
// Properties is the object's properties.
Properties *P `json:"properties,omitempty"`
// PropertiesWithHistory is the object's properties with history.
//
// The map key is the property name.
//
// Example:
// {
// "firstname": [
// {
// "value": "John",
// "timestamp": "2024-02-25T15:52:36.931Z",
// "sourceType": "CRM_UI",
// "sourceId": "userId:51446676",
// "updatedByUserId": 51446676
// }
// ]
// }
PropertiesWithHistory map[string][]*PWH `json:"propertiesWithHistory,omitempty"`
// Associations is the object's associations.
//
// The map key is the association type name.
//
// Example:
// {
// "companies": [
// {
// "id": "10259467251",
// "type": "contact_to_company"
// }
// ]
// }
Associations map[string][]*AE `json:"associations,omitempty"`
CreatedAt *DateTime `json:"createdAt,omitempty"`
UpdatedAt *DateTime `json:"updatedAt,omitempty"`
Archived bool `json:"archived,omitempty"`
ArchivedAt *DateTime `json:"archivedAt,omitempty"`
}
type CustomObject struct{}
func (CustomObject) embedProperties() {}