halo_msp_api 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,98 +2,99 @@
2
2
 
3
3
  module HaloMspApi
4
4
  module Resources
5
+ # Resource class for Agents
5
6
  class Agents < Base
6
7
  # GET /Agent - List of Agents
7
- def list(params = {})
8
- list_resource("Agent", params)
8
+ def agents(params = {})
9
+ list_resource('Agent', params)
9
10
  end
10
11
 
11
12
  # GET /Agent/{id} - Get a specific Agent
12
- def get(id, params = {})
13
- get_resource("Agent", id, params)
13
+ def agent(id, params = {})
14
+ get_resource('Agent', id, params)
14
15
  end
15
16
 
16
17
  # POST /Agent - Create a new Agent
17
- def create(data)
18
- create_resource("Agent", data)
18
+ def create_agent(data)
19
+ create_resource('Agent', data)
19
20
  end
20
21
 
21
22
  # PUT /Agent/{id} - Update an Agent
22
- def update(id, data)
23
- update_resource("Agent", id, data)
23
+ def update_agent(id, data)
24
+ update_resource('Agent', id, data)
24
25
  end
25
26
 
26
27
  # DELETE /Agent/{id} - Delete an Agent
27
- def delete(id)
28
- delete_resource("Agent", id)
28
+ def delete_agent(id)
29
+ delete_resource('Agent', id)
29
30
  end
30
31
 
31
32
  # GET /Agent/me - Get current Agent information
32
33
  def me(params = {})
33
- get(resource_path("Agent", nil, "me"), params)
34
+ get(resource_path('Agent', nil, 'me'), params)
34
35
  end
35
36
 
36
37
  # POST /Agent/ClearCache - Clear Agent cache
37
38
  def clear_cache
38
- post(resource_path("Agent", nil, "ClearCache"))
39
+ post(resource_path('Agent', nil, 'ClearCache'))
39
40
  end
40
41
 
41
42
  # GET /AgentImage/{id} - Get Agent image
42
43
  def image(id)
43
- get(resource_path("AgentImage", id))
44
+ get(resource_path('AgentImage', id))
44
45
  end
45
46
 
46
47
  # Agent Check-in related methods
47
48
  # GET /AgentCheckIn - List Agent check-ins
48
49
  def check_ins(params = {})
49
- get("/AgentCheckIn", params)
50
+ get('AgentCheckIn', params)
50
51
  end
51
52
 
52
53
  # GET /AgentCheckIn/{id} - Get specific Agent check-in
53
54
  def check_in(id, params = {})
54
- get("/AgentCheckIn/#{id}", params)
55
+ get("AgentCheckIn/#{id}", params)
55
56
  end
56
57
 
57
58
  # POST /AgentCheckIn - Create Agent check-in
58
59
  def create_check_in(data)
59
- post("/AgentCheckIn", data)
60
+ post('AgentCheckIn', data)
60
61
  end
61
62
 
62
63
  # Agent Event Subscription methods
63
64
  # GET /AgentEventSubscription - List Agent event subscriptions
64
65
  def event_subscriptions(params = {})
65
- get("/AgentEventSubscription", params)
66
+ get('AgentEventSubscription', params)
66
67
  end
67
68
 
68
69
  # GET /AgentEventSubscription/{id} - Get specific Agent event subscription
69
70
  def event_subscription(id, params = {})
70
- get("/AgentEventSubscription/#{id}", params)
71
+ get("AgentEventSubscription/#{id}", params)
71
72
  end
72
73
 
73
74
  # POST /AgentEventSubscription - Create Agent event subscription
74
75
  def create_event_subscription(data)
75
- post("/AgentEventSubscription", data)
76
+ post('AgentEventSubscription', data)
76
77
  end
77
78
 
78
79
  # Agent Presence related methods
79
80
  # GET /AgentPresenceRule - List Agent presence rules
80
81
  def presence_rules(params = {})
81
- get("/AgentPresenceRule", params)
82
+ get('AgentPresenceRule', params)
82
83
  end
83
84
 
84
85
  # GET /AgentPresenceSubscription - List Agent presence subscriptions
85
86
  def presence_subscriptions(params = {})
86
- get("/AgentPresenceSubscription", params)
87
+ get('AgentPresenceSubscription', params)
87
88
  end
88
89
 
89
90
  # GET /AgentPresenceSubscription/{id} - Get specific Agent presence subscription
90
91
  def presence_subscription(id, params = {})
91
- get("/AgentPresenceSubscription/#{id}", params)
92
+ get("AgentPresenceSubscription/#{id}", params)
92
93
  end
93
94
 
94
95
  # POST /AgentPresenceSubscription - Create Agent presence subscription
95
96
  def create_presence_subscription(data)
96
- post("/AgentPresenceSubscription", data)
97
+ post('AgentPresenceSubscription', data)
97
98
  end
98
99
  end
99
100
  end
@@ -2,65 +2,66 @@
2
2
 
3
3
  module HaloMspApi
4
4
  module Resources
5
+ # Resource class for Appointments
5
6
  class Appointments < Base
6
7
  # GET /Appointment - List of Appointments
7
- def list(params = {})
8
- list_resource("Appointment", params)
8
+ def appointments(params = {})
9
+ list_resource('Appointment', params)
9
10
  end
10
11
 
11
12
  # GET /Appointment/{id} - Get a specific Appointment
12
- def get(id, params = {})
13
- get_resource("Appointment", id, params)
13
+ def appointment(id, params = {})
14
+ get_resource('Appointment', id, params)
14
15
  end
15
16
 
16
17
  # POST /Appointment - Create a new Appointment
17
- def create(data)
18
- create_resource("Appointment", data)
18
+ def create_appointment(data)
19
+ create_resource('Appointment', data)
19
20
  end
20
21
 
21
22
  # PUT /Appointment/{id} - Update an Appointment
22
- def update(id, data)
23
- update_resource("Appointment", id, data)
23
+ def update_appointment(id, data)
24
+ update_resource('Appointment', id, data)
24
25
  end
25
26
 
26
27
  # DELETE /Appointment/{id} - Delete an Appointment
27
- def delete(id)
28
- delete_resource("Appointment", id)
28
+ def delete_appointment(id)
29
+ delete_resource('Appointment', id)
29
30
  end
30
31
 
31
32
  # GET /Appointment/Availability - Get Appointment availability
32
33
  def availability(params = {})
33
- get(resource_path("Appointment", nil, "Availability"), params)
34
+ get(resource_path('Appointment', nil, 'Availability'), params)
34
35
  end
35
36
 
36
37
  # GET /Appointment/Calendar - Get Appointment calendar
37
38
  def calendar(params = {})
38
- get(resource_path("Appointment", nil, "Calendar"), params)
39
+ get(resource_path('Appointment', nil, 'Calendar'), params)
39
40
  end
40
41
 
41
42
  # POST /Appointment/CheckAvailability - Check Appointment availability
42
43
  def check_availability(data)
43
- post(resource_path("Appointment", nil, "CheckAvailability"), data)
44
+ post(resource_path('Appointment', nil, 'CheckAvailability'), data)
44
45
  end
45
46
 
46
47
  # GET /Appointment/Slots - Get Appointment slots
47
48
  def slots(params = {})
48
- get(resource_path("Appointment", nil, "Slots"), params)
49
+ get(resource_path('Appointment', nil, 'Slots'), params)
49
50
  end
50
51
 
51
52
  # POST /Appointment/Slots - Create Appointment slots
52
53
  def create_slots(data)
53
- post(resource_path("Appointment", nil, "Slots"), data)
54
+ post(resource_path('Appointment', nil, 'Slots'), data)
54
55
  end
55
56
 
56
57
  # GET /Appointment/Types - Get Appointment types
57
58
  def types(params = {})
58
- get(resource_path("Appointment", nil, "Types"), params)
59
+ get(resource_path('Appointment', nil, 'Types'), params)
59
60
  end
60
61
 
61
62
  # POST /Appointment/Types - Create Appointment type
62
63
  def create_type(data)
63
- post(resource_path("Appointment", nil, "Types"), data)
64
+ post(resource_path('Appointment', nil, 'Types'), data)
64
65
  end
65
66
  end
66
67
  end
@@ -2,145 +2,146 @@
2
2
 
3
3
  module HaloMspApi
4
4
  module Resources
5
+ # Resource class for Assets
5
6
  class Assets < Base
6
7
  # GET /Asset - List of Assets
7
- def list(params = {})
8
- list_resource("Asset", params)
8
+ def assets(params = {})
9
+ list_resource('Asset', params)
9
10
  end
10
11
 
11
12
  # GET /Asset/{id} - Get a specific Asset
12
- def get(id, params = {})
13
- get_resource("Asset", id, params)
13
+ def asset(id, params = {})
14
+ get_resource('Asset', id, params)
14
15
  end
15
16
 
16
17
  # POST /Asset - Create a new Asset
17
- def create(data)
18
- create_resource("Asset", data)
18
+ def create_asset(data)
19
+ create_resource('Asset', data)
19
20
  end
20
21
 
21
22
  # PUT /Asset/{id} - Update an Asset
22
- def update(id, data)
23
- update_resource("Asset", id, data)
23
+ def update_asset(id, data)
24
+ update_resource('Asset', id, data)
24
25
  end
25
26
 
26
27
  # DELETE /Asset/{id} - Delete an Asset
27
- def delete(id)
28
- delete_resource("Asset", id)
28
+ def delete_asset(id)
29
+ delete_resource('Asset', id)
29
30
  end
30
31
 
31
32
  # GET /Asset/GetAllSoftwareVersions - Get all software versions
32
33
  def software_versions(params = {})
33
- get(resource_path("Asset", nil, "GetAllSoftwareVersions"), params)
34
+ get(resource_path('Asset', nil, 'GetAllSoftwareVersions'), params)
34
35
  end
35
36
 
36
37
  # GET /Asset/NextTag - Get next asset tag
37
38
  def next_tag(params = {})
38
- get(resource_path("Asset", nil, "NextTag"), params)
39
+ get(resource_path('Asset', nil, 'NextTag'), params)
39
40
  end
40
41
 
41
42
  # Asset Change related methods
42
43
  # GET /AssetChange - List Asset changes
43
44
  def changes(params = {})
44
- get("/AssetChange", params)
45
+ get('AssetChange', params)
45
46
  end
46
47
 
47
48
  # POST /AssetChange - Create Asset change
48
49
  def create_change(data)
49
- post("/AssetChange", data)
50
+ post('AssetChange', data)
50
51
  end
51
52
 
52
53
  # Asset Group methods
53
54
  # GET /AssetGroup - List Asset groups
54
55
  def groups(params = {})
55
- get("/AssetGroup", params)
56
+ get('AssetGroup', params)
56
57
  end
57
58
 
58
59
  # GET /AssetGroup/{id} - Get specific Asset group
59
60
  def group(id, params = {})
60
- get("/AssetGroup/#{id}", params)
61
+ get("AssetGroup/#{id}", params)
61
62
  end
62
63
 
63
64
  # POST /AssetGroup - Create Asset group
64
65
  def create_group(data)
65
- post("/AssetGroup", data)
66
+ post('AssetGroup', data)
66
67
  end
67
68
 
68
69
  # PUT /AssetGroup/{id} - Update Asset group
69
70
  def update_group(id, data)
70
- put("/AssetGroup/#{id}", data)
71
+ put("AssetGroup/#{id}", data)
71
72
  end
72
73
 
73
74
  # DELETE /AssetGroup/{id} - Delete Asset group
74
75
  def delete_group(id)
75
- delete("/AssetGroup/#{id}")
76
+ delete("AssetGroup/#{id}")
76
77
  end
77
78
 
78
79
  # Asset Software methods
79
80
  # GET /AssetSoftware - List Asset software
80
81
  def software(params = {})
81
- get("/AssetSoftware", params)
82
+ get('AssetSoftware', params)
82
83
  end
83
84
 
84
85
  # POST /AssetSoftware - Create Asset software
85
86
  def create_software(data)
86
- post("/AssetSoftware", data)
87
+ post('AssetSoftware', data)
87
88
  end
88
89
 
89
90
  # Asset Type methods
90
91
  # GET /AssetType - List Asset types
91
92
  def types(params = {})
92
- get("/AssetType", params)
93
+ get('AssetType', params)
93
94
  end
94
95
 
95
96
  # GET /AssetType/{id} - Get specific Asset type
96
97
  def type(id, params = {})
97
- get("/AssetType/#{id}", params)
98
+ get("AssetType/#{id}", params)
98
99
  end
99
100
 
100
101
  # POST /AssetType - Create Asset type
101
102
  def create_type(data)
102
- post("/AssetType", data)
103
+ post('AssetType', data)
103
104
  end
104
105
 
105
106
  # PUT /AssetType/{id} - Update Asset type
106
107
  def update_type(id, data)
107
- put("/AssetType/#{id}", data)
108
+ put("AssetType/#{id}", data)
108
109
  end
109
110
 
110
111
  # DELETE /AssetType/{id} - Delete Asset type
111
112
  def delete_type(id)
112
- delete("/AssetType/#{id}")
113
+ delete("AssetType/#{id}")
113
114
  end
114
115
 
115
116
  # GET /AssetTypeInfo - Get Asset type info
116
117
  def type_info(params = {})
117
- get("/AssetTypeInfo", params)
118
+ get('AssetTypeInfo', params)
118
119
  end
119
120
 
120
121
  # Asset Type Mappings methods
121
122
  # GET /AssetTypeMappings - List Asset type mappings
122
123
  def type_mappings(params = {})
123
- get("/AssetTypeMappings", params)
124
+ get('AssetTypeMappings', params)
124
125
  end
125
126
 
126
127
  # GET /AssetTypeMappings/{id} - Get specific Asset type mapping
127
128
  def type_mapping(id, params = {})
128
- get("/AssetTypeMappings/#{id}", params)
129
+ get("AssetTypeMappings/#{id}", params)
129
130
  end
130
131
 
131
132
  # POST /AssetTypeMappings - Create Asset type mapping
132
133
  def create_type_mapping(data)
133
- post("/AssetTypeMappings", data)
134
+ post('AssetTypeMappings', data)
134
135
  end
135
136
 
136
137
  # PUT /AssetTypeMappings/{id} - Update Asset type mapping
137
138
  def update_type_mapping(id, data)
138
- put("/AssetTypeMappings/#{id}", data)
139
+ put("AssetTypeMappings/#{id}", data)
139
140
  end
140
141
 
141
142
  # DELETE /AssetTypeMappings/{id} - Delete Asset type mapping
142
143
  def delete_type_mapping(id)
143
- delete("/AssetTypeMappings/#{id}")
144
+ delete("AssetTypeMappings/#{id}")
144
145
  end
145
146
  end
146
147
  end
@@ -2,38 +2,39 @@
2
2
 
3
3
  module HaloMspApi
4
4
  module Resources
5
+ # Base class for all resources
5
6
  class Base
6
- attr_reader :client
7
+ attr_reader :client_instance
7
8
 
8
- def initialize(client)
9
- @client = client
9
+ def initialize(client_instance)
10
+ @client_instance = client_instance
10
11
  end
11
12
 
12
13
  protected
13
14
 
14
15
  def get(path, params = {})
15
- client.get(path, params)
16
+ client_instance.get(path, params)
16
17
  end
17
18
 
18
19
  def post(path, body = {})
19
- client.post(path, body)
20
+ client_instance.post(path, body)
20
21
  end
21
22
 
22
23
  def put(path, body = {})
23
- client.put(path, body)
24
+ client_instance.put(path, body)
24
25
  end
25
26
 
26
27
  def patch(path, body = {})
27
- client.patch(path, body)
28
+ client_instance.patch(path, body)
28
29
  end
29
30
 
30
31
  def delete(path)
31
- client.delete(path)
32
+ client_instance.delete(path)
32
33
  end
33
34
 
34
35
  # Helper method to build resource path
35
36
  def resource_path(resource_name, id = nil, action = nil)
36
- path = "/#{resource_name}"
37
+ path = "/api/#{resource_name}"
37
38
  path += "/#{id}" if id
38
39
  path += "/#{action}" if action
39
40
  path
@@ -2,113 +2,109 @@
2
2
 
3
3
  module HaloMspApi
4
4
  module Resources
5
+ # Resource class for Clients
5
6
  class Clients < Base
6
7
  # GET /Client - List of Clients
7
- def list(params = {})
8
- list_resource("Client", params)
8
+ def clients(params = {})
9
+ list_resource('Client', params)
9
10
  end
10
11
 
11
12
  # GET /Client/{id} - Get a specific Client
12
- def get(id, params = {})
13
- get_resource("Client", id, params)
13
+ def client(id, params = {})
14
+ get_resource('Client', id, params)
14
15
  end
15
16
 
16
17
  # POST /Client - Create a new Client
17
- def create(data)
18
- create_resource("Client", data)
18
+ def create_client(data)
19
+ create_resource('Client', data)
19
20
  end
20
21
 
21
22
  # PUT /Client/{id} - Update a Client
22
- def update(id, data)
23
- update_resource("Client", id, data)
23
+ def update_client(id, data)
24
+ update_resource('Client', id, data)
24
25
  end
25
26
 
26
27
  # DELETE /Client/{id} - Delete a Client
27
- def delete(id)
28
- delete_resource("Client", id)
29
- end
30
-
31
- # GET /Client/me - Get current Client information
32
- def me(params = {})
33
- get(resource_path("Client", nil, "me"), params)
28
+ def delete_client(id)
29
+ delete_resource('Client', id)
34
30
  end
35
31
 
36
32
  # GET /Client/NewAccountsId - Get new accounts ID
37
33
  def new_accounts_id(params = {})
38
- get(resource_path("Client", nil, "NewAccountsId"), params)
34
+ get(resource_path('Client', nil, 'NewAccountsId'), params)
39
35
  end
40
36
 
41
37
  # POST /Client/PaymentMethodUpdate - Update payment method
42
38
  def update_payment_method(data)
43
- post(resource_path("Client", nil, "PaymentMethodUpdate"), data)
39
+ post(resource_path('Client', nil, 'PaymentMethodUpdate'), data)
44
40
  end
45
41
 
46
42
  # Client Cache methods
47
43
  # GET /ClientCache - Get Client cache
48
44
  def cache(params = {})
49
- get("/ClientCache", params)
45
+ get('ClientCache', params)
50
46
  end
51
47
 
52
48
  # Client Contract methods
53
49
  # GET /ClientContract - List Client contracts
54
50
  def contracts(params = {})
55
- get("/ClientContract", params)
51
+ get('ClientContract', params)
56
52
  end
57
53
 
58
54
  # GET /ClientContract/{id} - Get specific Client contract
59
55
  def contract(id, params = {})
60
- get("/ClientContract/#{id}", params)
56
+ get("ClientContract/#{id}", params)
61
57
  end
62
58
 
63
59
  # POST /ClientContract - Create Client contract
64
60
  def create_contract(data)
65
- post("/ClientContract", data)
61
+ post('ClientContract', data)
66
62
  end
67
63
 
68
64
  # PUT /ClientContract/{id} - Update Client contract
69
65
  def update_contract(id, data)
70
- put("/ClientContract/#{id}", data)
66
+ put("ClientContract/#{id}", data)
71
67
  end
72
68
 
73
69
  # DELETE /ClientContract/{id} - Delete Client contract
74
70
  def delete_contract(id)
75
- delete("/ClientContract/#{id}")
71
+ delete("ClientContract/#{id}")
76
72
  end
77
73
 
78
74
  # POST /ClientContract/Approval - Client contract approval
79
75
  def contract_approval(data)
80
- post("/ClientContract/Approval", data)
76
+ post('ClientContract/Approval', data)
81
77
  end
82
78
 
83
79
  # GET /ClientContract/NextRef - Get next contract reference
84
80
  def next_contract_ref(params = {})
85
- get("/ClientContract/NextRef", params)
81
+ get('ClientContract/NextRef', params)
86
82
  end
87
83
 
88
84
  # Client Prepay methods
89
85
  # GET /ClientPrepay - List Client prepayments
90
86
  def prepayments(params = {})
91
- get("/ClientPrepay", params)
87
+ get('ClientPrepay', params)
92
88
  end
93
89
 
94
90
  # GET /ClientPrepay/{id} - Get specific Client prepayment
95
91
  def prepayment(id, params = {})
96
- get("/ClientPrepay/#{id}", params)
92
+ get("ClientPrepay/#{id}", params)
97
93
  end
98
94
 
99
95
  # POST /ClientPrepay - Create Client prepayment
100
96
  def create_prepayment(data)
101
- post("/ClientPrepay", data)
97
+ post('ClientPrepay', data)
102
98
  end
103
99
 
104
100
  # PUT /ClientPrepay/{id} - Update Client prepayment
105
101
  def update_prepayment(id, data)
106
- put("/ClientPrepay/#{id}", data)
102
+ put("ClientPrepay/#{id}", data)
107
103
  end
108
104
 
109
105
  # DELETE /ClientPrepay/{id} - Delete Client prepayment
110
106
  def delete_prepayment(id)
111
- delete("/ClientPrepay/#{id}")
107
+ delete("ClientPrepay/#{id}")
112
108
  end
113
109
  end
114
110
  end