2020-07-04 06:12:47 +00:00
|
|
|
json.additional_attributes resource.additional_attributes
|
|
|
|
json.availability_status resource.availability_status
|
|
|
|
json.email resource.email
|
|
|
|
json.id resource.id
|
|
|
|
json.name resource.name
|
|
|
|
json.phone_number resource.phone_number
|
2021-06-07 06:16:47 +00:00
|
|
|
json.identifier resource.identifier
|
2020-07-04 06:12:47 +00:00
|
|
|
json.thumbnail resource.avatar_url
|
2020-08-21 14:00:27 +00:00
|
|
|
json.custom_attributes resource.custom_attributes
|
2020-11-10 09:55:26 +00:00
|
|
|
json.conversations_count resource.conversations_count if resource[:conversations_count].present?
|
2021-05-13 08:02:19 +00:00
|
|
|
json.last_activity_at resource.last_activity_at.to_i if resource[:last_activity_at].present?
|
2020-08-19 17:55:55 +00:00
|
|
|
|
|
|
|
# we only want to output contact inbox when its /contacts endpoints
|
|
|
|
if defined?(with_contact_inboxes) && with_contact_inboxes.present?
|
|
|
|
json.contact_inboxes do
|
|
|
|
json.array! resource.contact_inboxes do |contact_inbox|
|
|
|
|
json.partial! 'api/v1/models/contact_inbox.json.jbuilder', resource: contact_inbox
|
|
|
|
end
|
2020-08-10 06:45:29 +00:00
|
|
|
end
|
|
|
|
end
|