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

#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

#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