Module: NgpVan::Client::People

Included in:
NgpVan::Client
Defined in:
lib/ngp_van/client/people.rb

Instance Method Summary collapse

Instance Method Details

#apply_code_to_person(id:, body: {}) ⇒ Object



34
35
36
37
# File 'lib/ngp_van/client/people.rb', line 34

def apply_code_to_person(id:, body: {})
  verify_id(id)
  post(path: "people/#{id}/codes", body: body)
end

#create_canvass_responses_for_person(id:, body: {}) ⇒ Object



24
25
26
27
# File 'lib/ngp_van/client/people.rb', line 24

def create_canvass_responses_for_person(id:, body: {})
  verify_id(id)
  post(path: "people/#{id}/canvassResponses", body: body)
end

#create_canvass_responses_for_person_by_type(id:, type:, body: {}) ⇒ Object



29
30
31
32
# File 'lib/ngp_van/client/people.rb', line 29

def create_canvass_responses_for_person_by_type(id:, type:, body: {})
  verify_ids(id, type)
  post(path: "people/#{type}:#{id}/canvassResponses", body: body)
end

#create_notes_for_person(id:, body: {}) ⇒ Object



54
55
56
57
# File 'lib/ngp_van/client/people.rb', line 54

def create_notes_for_person(id:, body: {})
  verify_id(id)
  post(path: "people/#{id}/notes", body: body)
end

#create_notes_for_person_by_type(id:, type:, body: {}) ⇒ Object



59
60
61
62
# File 'lib/ngp_van/client/people.rb', line 59

def create_notes_for_person_by_type(id:, type:, body: {})
  verify_ids(id, type)
  post(path: "people/#{type}:#{id}/notes", body: body)
end

#delete_code_from_person(id:, codeId:) ⇒ Object



39
40
41
42
# File 'lib/ngp_van/client/people.rb', line 39

def delete_code_from_person(id:, codeId:)
  verify_ids(id, codeId)
  delete(path: "people/#{id}/codes/#{codeId}")
end

#find_or_create_person(body: {}) ⇒ Object



10
11
12
# File 'lib/ngp_van/client/people.rb', line 10

def find_or_create_person(body: {})
  post(path: 'people/findOrCreate', body: body)
end

#find_person(body: {}) ⇒ Object



6
7
8
# File 'lib/ngp_van/client/people.rb', line 6

def find_person(body: {})
  post(path: 'people/find', body: body)
end

#get_person_by_van_id(id:, params: {}) ⇒ Object



49
50
51
52
# File 'lib/ngp_van/client/people.rb', line 49

def get_person_by_van_id(id:, params: {})
  verify_id(id)
  get(path: "people/#{id}", params: params)
end

#person(id:, params: {}) ⇒ Object



14
15
16
17
# File 'lib/ngp_van/client/people.rb', line 14

def person(id:, params: {})
  verify_id(id)
  get(path: "people/#{id}", params: params)
end

#person_by_type(id:, type:, params: {}) ⇒ Object



19
20
21
22
# File 'lib/ngp_van/client/people.rb', line 19

def person_by_type(id:, type:, params: {})
  verify_ids(id, type)
  get(path: "people/#{type}:#{id}", params: params)
end

#update_person_by_van_id(id:, body: {}) ⇒ Object



44
45
46
47
# File 'lib/ngp_van/client/people.rb', line 44

def update_person_by_van_id(id:, body: {})
  verify_id(id)
  post(path: "people/#{id}", body: body)
end