Class: Hubspot::EngagementCall
Constant Summary
Constants inherited
from Engagement
Hubspot::Engagement::ASSOCIATE_ENGAGEMENT_PATH, Hubspot::Engagement::CREATE_ENGAGMEMENT_PATH, Hubspot::Engagement::ENGAGEMENT_PATH, Hubspot::Engagement::GET_ASSOCIATED_ENGAGEMENTS
Instance Attribute Summary
Attributes inherited from Engagement
#associations, #attachments, #engagement, #id, #metadata
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Engagement
#[], associate!, #destroy!, #destroyed?, find, find_by_association, find_by_company, find_by_contact, #initialize, #update!
Class Method Details
.create!(contact_vid, body, duration, owner_id = nil, deal_id = nil, status = 'COMPLETED', time = nil) ⇒ Object
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
|
# File 'lib/hubspot/engagement.rb', line 172
def create!(contact_vid, body, duration, owner_id = nil, deal_id = nil, status = 'COMPLETED', time = nil)
data = {
engagement: {
type: 'CALL'
},
associations: {
contactIds: [contact_vid],
dealIds: [deal_id],
ownerIds: [owner_id]
},
metadata: {
body: body,
status: status,
durationMilliseconds: duration
}
}
data[:engagement][:timestamp] = (time.to_i) * 1000 if time
data[:engagement][:owner_id] = owner_id if owner_id
super(data)
end
|
Instance Method Details
#body ⇒ Object
155
156
157
|
# File 'lib/hubspot/engagement.rb', line 155
def body
metadata['body']
end
|
#company_ids ⇒ Object
163
164
165
|
# File 'lib/hubspot/engagement.rb', line 163
def company_ids
associations['companyIds']
end
|
159
160
161
|
# File 'lib/hubspot/engagement.rb', line 159
def contact_ids
associations['contactIds']
end
|
#deal_ids ⇒ Object
167
168
169
|
# File 'lib/hubspot/engagement.rb', line 167
def deal_ids
associations['dealIds']
end
|