Class: Tazworks::Client
Overview
Tazworks Clients Model
Instance Attribute Summary
Attributes inherited from Model
#attributes, #attributes_loaded, #ids
Class Method Summary collapse
-
.all(params = {}) ⇒ Object
docs.developer.tazworks.com/#e008c159-b8d7-4843-a08f-ff483315a067 tazapi defaults to params { page: 0, size: 30 }.
- .ancestors(_clientGuid) ⇒ Object
- .descendents(_clientGuid) ⇒ Object
-
.get(ids) ⇒ Object
docs.developer.tazworks.com/#3a09caba-349b-4969-a55a-1cbcaea0136c TODO: WARNING - UNTESTED - maintainer doesn’t have a proper token for this endpoint!.
Instance Method Summary collapse
- #ancestors ⇒ Object
-
#applicants(params = {}) ⇒ Object
Orders/Applicants.
- #client_products(params = {}) ⇒ Object
- #create_applicant(params) ⇒ Object
- #descendents(clientGuid) ⇒ Object
- #find_applicant(applicantGuid) ⇒ Object
- #orders(params = {}) ⇒ Object
- #submit_order(params) ⇒ Object
Methods inherited from Model
#attributes_loaded?, #clientGuid, find, #initialize, initialize_from_response, #load_attributes, #loaded_attributes, #reload
Constructor Details
This class inherits a constructor from Tazworks::Model
Class Method Details
.all(params = {}) ⇒ Object
docs.developer.tazworks.com/#e008c159-b8d7-4843-a08f-ff483315a067 tazapi defaults to params { page: 0, size: 30 }
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
docs.developer.tazworks.com/#3a09caba-349b-4969-a55a-1cbcaea0136c TODO: WARNING - UNTESTED - maintainer doesn’t have a proper token for this endpoint!
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
Orders/Applicants
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 |