Class: Hubspot::EngagementCall
Constant Summary
Constants inherited
from Engagement
Hubspot::Engagement::ALL_ENGAGEMENTS_PATH, Hubspot::Engagement::ASSOCIATE_ENGAGEMENT_PATH, Hubspot::Engagement::CREATE_ENGAGMEMENT_PATH, Hubspot::Engagement::ENGAGEMENT_PATH, Hubspot::Engagement::GET_ASSOCIATED_ENGAGEMENTS, Hubspot::Engagement::RECENT_ENGAGEMENT_PATH
Instance Attribute Summary
Attributes inherited from Engagement
#associations, #attachments, #engagement, #id, #metadata
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Engagement
#[], all, associate!, #destroy!, #destroyed?, find, find_by_association, find_by_company, find_by_contact, #initialize, recent, #update!
Class Method Details
.create!(contact_vid, body, duration, owner_id = nil, deal_id = nil, status = 'COMPLETED', time = nil) ⇒ Object
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
|
# File 'lib/hubspot/engagement.rb', line 197
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
180
181
182
|
# File 'lib/hubspot/engagement.rb', line 180
def body
metadata['body']
end
|
#company_ids ⇒ Object
188
189
190
|
# File 'lib/hubspot/engagement.rb', line 188
def company_ids
associations['companyIds']
end
|
184
185
186
|
# File 'lib/hubspot/engagement.rb', line 184
def contact_ids
associations['contactIds']
end
|
#deal_ids ⇒ Object
192
193
194
|
# File 'lib/hubspot/engagement.rb', line 192
def deal_ids
associations['dealIds']
end
|