Class: HaloMspApi::Resources::Clients

Inherits:
Base
  • Object
show all
Defined in:
lib/halo_msp_api/resources/clients.rb

Overview

Resource class for Clients

Instance Attribute Summary

Attributes inherited from Base

#client_instance

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from HaloMspApi::Resources::Base

Instance Method Details

#cache(params = {}) ⇒ Object

Client Cache methods GET /ClientCache - Get Client cache



44
45
46
# File 'lib/halo_msp_api/resources/clients.rb', line 44

def cache(params = {})
  get('ClientCache', params)
end

#client(id, params = {}) ⇒ Object

GET /Client/id - Get a specific Client



13
14
15
# File 'lib/halo_msp_api/resources/clients.rb', line 13

def client(id, params = {})
  get_resource('Client', id, params)
end

#clients(params = {}) ⇒ Object

GET /Client - List of Clients



8
9
10
# File 'lib/halo_msp_api/resources/clients.rb', line 8

def clients(params = {})
  list_resource('Client', params)
end

#contract(id, params = {}) ⇒ Object

GET /ClientContract/id - Get specific Client contract



55
56
57
# File 'lib/halo_msp_api/resources/clients.rb', line 55

def contract(id, params = {})
  get_resource('ClientContract', id, params)
end

#contract_approval(data) ⇒ Object

POST /ClientContract/Approval - Client contract approval



75
76
77
# File 'lib/halo_msp_api/resources/clients.rb', line 75

def contract_approval(data)
  post('ClientContract/Approval', data)
end

#contracts(params = {}) ⇒ Object

Client Contract methods GET /ClientContract - List Client contracts



50
51
52
# File 'lib/halo_msp_api/resources/clients.rb', line 50

def contracts(params = {})
  list_resource('ClientContract', params)
end

#create_client(data) ⇒ Object

POST /Client - Create a new Client



18
19
20
# File 'lib/halo_msp_api/resources/clients.rb', line 18

def create_client(data)
  create_resource('Client', data)
end

#create_contract(data) ⇒ Object

POST /ClientContract - Create Client contract



60
61
62
# File 'lib/halo_msp_api/resources/clients.rb', line 60

def create_contract(data)
  create_resource('ClientContract', data)
end

#create_prepayment(data) ⇒ Object

POST /ClientPrepay - Create Client prepayment



96
97
98
# File 'lib/halo_msp_api/resources/clients.rb', line 96

def create_prepayment(data)
  create_resource('ClientPrepay', data)
end

#delete_client(id) ⇒ Object

DELETE /Client/id - Delete a Client



28
29
30
# File 'lib/halo_msp_api/resources/clients.rb', line 28

def delete_client(id)
  delete_resource('Client', id)
end

#delete_contract(id) ⇒ Object

DELETE /ClientContract/id - Delete Client contract



70
71
72
# File 'lib/halo_msp_api/resources/clients.rb', line 70

def delete_contract(id)
  delete_resource('ClientContract', id)
end

#delete_prepayment(id) ⇒ Object

DELETE /ClientPrepay/id - Delete Client prepayment



106
107
108
# File 'lib/halo_msp_api/resources/clients.rb', line 106

def delete_prepayment(id)
  delete_resource('ClientPrepay', id)
end

#new_accounts_id(params = {}) ⇒ Object

GET /Client/NewAccountsId - Get new accounts ID



33
34
35
# File 'lib/halo_msp_api/resources/clients.rb', line 33

def new_accounts_id(params = {})
  get(resource_path('Client', nil, 'NewAccountsId'), params)
end

#next_contract_ref(params = {}) ⇒ Object

GET /ClientContract/NextRef - Get next contract reference



80
81
82
# File 'lib/halo_msp_api/resources/clients.rb', line 80

def next_contract_ref(params = {})
  get('ClientContract/NextRef', params)
end

#prepayment(id, params = {}) ⇒ Object

GET /ClientPrepay/id - Get specific Client prepayment



91
92
93
# File 'lib/halo_msp_api/resources/clients.rb', line 91

def prepayment(id, params = {})
  get_resource('ClientPrepay', id, params)
end

#prepayments(params = {}) ⇒ Object

Client Prepay methods GET /ClientPrepay - List Client prepayments



86
87
88
# File 'lib/halo_msp_api/resources/clients.rb', line 86

def prepayments(params = {})
  list_resource('ClientPrepay', params)
end

#update_client(id, data) ⇒ Object

PUT /Client/id - Update a Client



23
24
25
# File 'lib/halo_msp_api/resources/clients.rb', line 23

def update_client(id, data)
  update_resource('Client', id, data)
end

#update_contract(id, data) ⇒ Object

PUT /ClientContract/id - Update Client contract



65
66
67
# File 'lib/halo_msp_api/resources/clients.rb', line 65

def update_contract(id, data)
  update_resource('ClientContract', id, data)
end

#update_payment_method(data) ⇒ Object

POST /Client/PaymentMethodUpdate - Update payment method



38
39
40
# File 'lib/halo_msp_api/resources/clients.rb', line 38

def update_payment_method(data)
  post(resource_path('Client', nil, 'PaymentMethodUpdate'), data)
end

#update_prepayment(id, data) ⇒ Object

PUT /ClientPrepay/id - Update Client prepayment



101
102
103
# File 'lib/halo_msp_api/resources/clients.rb', line 101

def update_prepayment(id, data)
  update_resource('ClientPrepay', id, data)
end