Class: HipcallSdk::ContactResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/hipcall/resources/contacts.rb

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from HipcallSdk::Resource

Instance Method Details

#create_comment(contact_id:, **attributes) ⇒ Object



12
13
14
15
# File 'lib/hipcall/resources/contacts.rb', line 12

def create_comment(contact_id:, **attributes)
  response = post_request("contacts/#{company_id}/comments", body: attributes)
  Comment.new response.body.dig("data")
end

#create_tags(contact_id:, **attributes) ⇒ Object



3
4
5
6
# File 'lib/hipcall/resources/contacts.rb', line 3

def create_tags(contact_id:, **attributes)
  response = post_request("contacts/#{contact_id}/tags", body: attributes)
			Collection.from_response(response, key: "data", type: Tag)
end

#delete_tags(contact_id:, tag_id:) ⇒ Object



8
9
10
# File 'lib/hipcall/resources/contacts.rb', line 8

def delete_tags(contact_id:, tag_id:)
  delete_request("contacts/#{contact_id}/tags/#{tag_id}")
end