Class: Fastbound::Resources::Contacts
- Inherits:
-
Object
- Object
- Fastbound::Resources::Contacts
- Defined in:
- lib/fastbound/resources/contacts.rb
Instance Method Summary collapse
- #create(params = {}) ⇒ Object
- #create_license(id, params = {}) ⇒ Object
- #delete_license(id, license_id) ⇒ Object
- #destroy(id) ⇒ Object
- #find(id) ⇒ Object
- #find_by_external_id(external_id) ⇒ Object
-
#get_license(id, license_id) ⇒ Object
License operations.
-
#initialize(client) ⇒ Contacts
constructor
A new instance of Contacts.
- #list(license_name: nil, trade_name: nil, ffl_number: nil, organization_name: nil, first_name: nil, middle_name: nil, last_name: nil, suffix: nil, take: nil, skip: nil) ⇒ Object
- #merge(winning_contact_id:, losing_contact_id:) ⇒ Object
- #update(id, params = {}) ⇒ Object
- #update_license(id, license_id, params = {}) ⇒ Object
Constructor Details
#initialize(client) ⇒ Contacts
Returns a new instance of Contacts.
4 5 6 |
# File 'lib/fastbound/resources/contacts.rb', line 4 def initialize(client) @client = client end |
Instance Method Details
#create(params = {}) ⇒ Object
27 28 29 |
# File 'lib/fastbound/resources/contacts.rb', line 27 def create(params = {}) @client.post("#{base}/Contacts", params) end |
#create_license(id, params = {}) ⇒ Object
52 53 54 |
# File 'lib/fastbound/resources/contacts.rb', line 52 def create_license(id, params = {}) @client.post("#{base}/Contacts/#{id}/Licenses", params) end |
#delete_license(id, license_id) ⇒ Object
60 61 62 |
# File 'lib/fastbound/resources/contacts.rb', line 60 def delete_license(id, license_id) @client.delete("#{base}/Contacts/#{id}/Licenses/#{license_id}") end |
#destroy(id) ⇒ Object
35 36 37 |
# File 'lib/fastbound/resources/contacts.rb', line 35 def destroy(id) @client.delete("#{base}/Contacts/#{id}") end |
#find(id) ⇒ Object
19 20 21 |
# File 'lib/fastbound/resources/contacts.rb', line 19 def find(id) @client.get("#{base}/Contacts/#{id}") end |
#find_by_external_id(external_id) ⇒ Object
23 24 25 |
# File 'lib/fastbound/resources/contacts.rb', line 23 def find_by_external_id(external_id) @client.get("#{base}/Contacts/GetByExternalId/#{external_id}") end |
#get_license(id, license_id) ⇒ Object
License operations
48 49 50 |
# File 'lib/fastbound/resources/contacts.rb', line 48 def get_license(id, license_id) @client.get("#{base}/Contacts/#{id}/Licenses/#{license_id}") end |
#list(license_name: nil, trade_name: nil, ffl_number: nil, organization_name: nil, first_name: nil, middle_name: nil, last_name: nil, suffix: nil, take: nil, skip: nil) ⇒ Object
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/fastbound/resources/contacts.rb', line 8 def list(license_name: nil, trade_name: nil, ffl_number: nil, organization_name: nil, first_name: nil, middle_name: nil, last_name: nil, suffix: nil, take: nil, skip: nil) @client.get("#{base}/Contacts", { licenseName: license_name, tradeName: trade_name, fflNumber: ffl_number, organizationName: organization_name, firstName: first_name, middleName: middle_name, lastName: last_name, suffix: suffix, take: take, skip: skip }) end |
#merge(winning_contact_id:, losing_contact_id:) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/fastbound/resources/contacts.rb', line 39 def merge(winning_contact_id:, losing_contact_id:) @client.post("#{base}/Contacts/Merge", { winningContactId: winning_contact_id, losingContactId: losing_contact_id }) end |
#update(id, params = {}) ⇒ Object
31 32 33 |
# File 'lib/fastbound/resources/contacts.rb', line 31 def update(id, params = {}) @client.put("#{base}/Contacts/#{id}", params) end |
#update_license(id, license_id, params = {}) ⇒ Object
56 57 58 |
# File 'lib/fastbound/resources/contacts.rb', line 56 def update_license(id, license_id, params = {}) @client.put("#{base}/Contacts/#{id}/Licenses/#{license_id}", params) end |