Class: Tazworks::Client
Overview
Instance Attribute Summary
Attributes inherited from Model
#attributes, #attributes_loaded, #ids
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Model
#attributes_loaded?, #clientGuid, find, #initialize, initialize_from_response, #load_attributes, #loaded_attributes, #reload
Class Method Details
.all(params = {}) ⇒ Object
14
15
16
17
|
# File 'lib/tazworks/client.rb', line 14
def self.all(params = {})
raw_response = RestClient.get('/v1/clients', { params: })
ClientPagedResponse.new(raw_response, {})
end
|
.ancestors(_clientGuid) ⇒ Object
25
26
27
|
# File 'lib/tazworks/client.rb', line 25
def self.ancestors(_clientGuid)
raise 'Unimplemented'
end
|
.descendents(_clientGuid) ⇒ Object
20
21
22
|
# File 'lib/tazworks/client.rb', line 20
def self.descendents(_clientGuid)
raise 'Unimplemented'
end
|
.get(ids) ⇒ Object
8
9
10
|
# File 'lib/tazworks/client.rb', line 8
def self.get(ids)
RestClient.get("/v1/clients/#{ids[:clientGuid]}")
end
|
Instance Method Details
#ancestors ⇒ Object
58
59
60
|
# File 'lib/tazworks/client.rb', line 58
def ancestors
Client.ancestors(clientGuid)
end
|
#applicants(params = {}) ⇒ Object
33
34
35
|
# File 'lib/tazworks/client.rb', line 33
def applicants(params = {})
Applicant.all(clientGuid, params)
end
|
#client_products(params = {}) ⇒ Object
41
42
43
|
# File 'lib/tazworks/client.rb', line 41
def client_products(params = {})
ClientProduct.all(clientGuid, params)
end
|
#create_applicant(params) ⇒ Object
45
46
47
|
# File 'lib/tazworks/client.rb', line 45
def create_applicant(params)
Tazworks::Applicant.create(clientGuid, params)
end
|
#descendents(clientGuid) ⇒ Object
62
63
64
|
# File 'lib/tazworks/client.rb', line 62
def descendents(clientGuid)
Client.descendents(clientGuid)
end
|
#find_applicant(applicantGuid) ⇒ Object
50
51
52
|
# File 'lib/tazworks/client.rb', line 50
def find_applicant(applicantGuid)
Tazworks::Applicant.find(ids: { clientGuid:, applicantGuid: })
end
|
#orders(params = {}) ⇒ Object
37
38
39
|
# File 'lib/tazworks/client.rb', line 37
def orders(params = {})
Order.all(clientGuid, params)
end
|
#submit_order(params) ⇒ Object
54
55
56
|
# File 'lib/tazworks/client.rb', line 54
def submit_order(params)
Order.create(clientGuid, params)
end
|