halo_msp_api 0.1.0 → 0.3.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/Gemfile +3 -8
- data/README.md +32 -32
- data/Rakefile +3 -3
- data/examples/basic_usage.rb +95 -31
- data/lib/halo_msp_api/client.rb +49 -28
- data/lib/halo_msp_api/configuration.rb +1 -0
- data/lib/halo_msp_api/error.rb +1 -0
- data/lib/halo_msp_api/resources/actions.rb +21 -20
- data/lib/halo_msp_api/resources/agents.rb +24 -23
- data/lib/halo_msp_api/resources/appointments.rb +18 -17
- data/lib/halo_msp_api/resources/assets.rb +33 -32
- data/lib/halo_msp_api/resources/base.rb +12 -10
- data/lib/halo_msp_api/resources/clients.rb +26 -30
- data/lib/halo_msp_api/resources/integrations.rb +109 -106
- data/lib/halo_msp_api/resources/invoices.rb +32 -31
- data/lib/halo_msp_api/resources/knowledge_base.rb +17 -16
- data/lib/halo_msp_api/resources/organisations.rb +11 -10
- data/lib/halo_msp_api/resources/products.rb +33 -0
- data/lib/halo_msp_api/resources/purchase_orders.rb +16 -15
- data/lib/halo_msp_api/resources/quotations.rb +14 -13
- data/lib/halo_msp_api/resources/reports.rb +23 -22
- data/lib/halo_msp_api/resources/sales_orders.rb +16 -15
- data/lib/halo_msp_api/resources/services.rb +39 -38
- data/lib/halo_msp_api/resources/slas.rb +21 -20
- data/lib/halo_msp_api/resources/suppliers.rb +16 -15
- data/lib/halo_msp_api/resources/tickets.rb +63 -45
- data/lib/halo_msp_api/resources/users.rb +20 -24
- data/lib/halo_msp_api/resources/webhooks.rb +22 -21
- data/lib/halo_msp_api/version.rb +1 -1
- data/lib/halo_msp_api.rb +26 -24
- metadata +12 -14
|
@@ -2,84 +2,85 @@
|
|
|
2
2
|
|
|
3
3
|
module HaloMspApi
|
|
4
4
|
module Resources
|
|
5
|
+
# Resource class for Actions
|
|
5
6
|
class Actions < Base
|
|
6
7
|
# GET /Actions - List of Actions
|
|
7
8
|
# Parameters based on swagger.json specification
|
|
8
|
-
def
|
|
9
|
+
def actions(options = {})
|
|
9
10
|
params = build_list_params(options)
|
|
10
|
-
get(
|
|
11
|
+
get('/Actions', params)
|
|
11
12
|
end
|
|
12
13
|
|
|
13
14
|
# GET /Actions/{id} - Get a specific Action
|
|
14
|
-
def
|
|
15
|
-
get_resource(
|
|
15
|
+
def action(id, params = {})
|
|
16
|
+
get_resource('Actions', id, params)
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
# POST /Actions - Create a new Action
|
|
19
|
-
def
|
|
20
|
-
create_resource(
|
|
20
|
+
def create_action(data)
|
|
21
|
+
create_resource('Actions', data)
|
|
21
22
|
end
|
|
22
23
|
|
|
23
24
|
# PUT /Actions/{id} - Update an Action
|
|
24
|
-
def
|
|
25
|
-
update_resource(
|
|
25
|
+
def update_action(id, data)
|
|
26
|
+
update_resource('Actions', id, data)
|
|
26
27
|
end
|
|
27
28
|
|
|
28
29
|
# DELETE /Actions/{id} - Delete an Action
|
|
29
|
-
def
|
|
30
|
-
delete_resource(
|
|
30
|
+
def delete_action(id)
|
|
31
|
+
delete_resource('Actions', id)
|
|
31
32
|
end
|
|
32
33
|
|
|
33
34
|
# Action Reactions methods
|
|
34
35
|
# GET /ActionReaction - List action reactions
|
|
35
36
|
def reactions(params = {})
|
|
36
|
-
|
|
37
|
+
list_resource('ActionReaction', params)
|
|
37
38
|
end
|
|
38
39
|
|
|
39
40
|
# GET /ActionReaction/{id} - Get specific action reaction
|
|
40
41
|
def reaction(id, params = {})
|
|
41
|
-
|
|
42
|
+
get_resource('ActionReaction', id, params)
|
|
42
43
|
end
|
|
43
44
|
|
|
44
45
|
# POST /ActionReaction - Create action reaction
|
|
45
46
|
def create_reaction(data)
|
|
46
|
-
|
|
47
|
+
create_resource('ActionReaction', data)
|
|
47
48
|
end
|
|
48
49
|
|
|
49
50
|
# PUT /ActionReaction/{id} - Update action reaction
|
|
50
51
|
def update_reaction(id, data)
|
|
51
|
-
|
|
52
|
+
update_resource('ActionReaction', id, data)
|
|
52
53
|
end
|
|
53
54
|
|
|
54
55
|
# DELETE /ActionReaction/{id} - Delete action reaction
|
|
55
56
|
def delete_reaction(id)
|
|
56
|
-
|
|
57
|
+
delete_resource('ActionReaction', id)
|
|
57
58
|
end
|
|
58
59
|
|
|
59
60
|
# Action Review methods
|
|
60
61
|
# GET /ActionReview - List action reviews
|
|
61
62
|
def reviews(params = {})
|
|
62
|
-
|
|
63
|
+
list_resource('ActionReview', params)
|
|
63
64
|
end
|
|
64
65
|
|
|
65
66
|
# GET /ActionReview/{id} - Get specific action review
|
|
66
67
|
def review(id, params = {})
|
|
67
|
-
|
|
68
|
+
get_resource('ActionReview', id, params)
|
|
68
69
|
end
|
|
69
70
|
|
|
70
71
|
# POST /ActionReview - Create action review
|
|
71
72
|
def create_review(data)
|
|
72
|
-
|
|
73
|
+
create_resource('ActionReview', data)
|
|
73
74
|
end
|
|
74
75
|
|
|
75
76
|
# PUT /ActionReview/{id} - Update action review
|
|
76
77
|
def update_review(id, data)
|
|
77
|
-
|
|
78
|
+
update_resource('ActionReview', id, data)
|
|
78
79
|
end
|
|
79
80
|
|
|
80
81
|
# DELETE /ActionReview/{id} - Delete action review
|
|
81
82
|
def delete_review(id)
|
|
82
|
-
|
|
83
|
+
delete_resource('ActionReview', id)
|
|
83
84
|
end
|
|
84
85
|
end
|
|
85
86
|
end
|
|
@@ -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
|
|
8
|
-
list_resource(
|
|
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
|
|
13
|
-
get_resource(
|
|
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
|
|
18
|
-
create_resource(
|
|
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
|
|
23
|
-
update_resource(
|
|
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
|
|
28
|
-
delete_resource(
|
|
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
|
-
|
|
34
|
+
get_resource('Agent', 'me', params)
|
|
34
35
|
end
|
|
35
36
|
|
|
36
37
|
# POST /Agent/ClearCache - Clear Agent cache
|
|
37
38
|
def clear_cache
|
|
38
|
-
post(resource_path(
|
|
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
|
-
|
|
44
|
+
get_resource('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
|
-
|
|
50
|
+
list_resource('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
|
-
|
|
55
|
+
get_resource('AgentCheckIn', id, params)
|
|
55
56
|
end
|
|
56
57
|
|
|
57
58
|
# POST /AgentCheckIn - Create Agent check-in
|
|
58
59
|
def create_check_in(data)
|
|
59
|
-
|
|
60
|
+
create_resource('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
|
-
|
|
66
|
+
list_resource('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
|
-
|
|
71
|
+
get_resource('AgentEventSubscription', id, params)
|
|
71
72
|
end
|
|
72
73
|
|
|
73
74
|
# POST /AgentEventSubscription - Create Agent event subscription
|
|
74
75
|
def create_event_subscription(data)
|
|
75
|
-
|
|
76
|
+
create_resource('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
|
-
|
|
82
|
+
list_resource('AgentPresenceRule', params)
|
|
82
83
|
end
|
|
83
84
|
|
|
84
85
|
# GET /AgentPresenceSubscription - List Agent presence subscriptions
|
|
85
86
|
def presence_subscriptions(params = {})
|
|
86
|
-
|
|
87
|
+
list_resource('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
|
-
|
|
92
|
+
get_resource('AgentPresenceSubscription', id, params)
|
|
92
93
|
end
|
|
93
94
|
|
|
94
95
|
# POST /AgentPresenceSubscription - Create Agent presence subscription
|
|
95
96
|
def create_presence_subscription(data)
|
|
96
|
-
|
|
97
|
+
create_resource('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
|
|
8
|
-
list_resource(
|
|
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
|
|
13
|
-
get_resource(
|
|
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
|
|
18
|
-
create_resource(
|
|
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
|
|
23
|
-
update_resource(
|
|
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
|
|
28
|
-
delete_resource(
|
|
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
|
-
|
|
34
|
+
get_resource('Appointment', 'Availability', params)
|
|
34
35
|
end
|
|
35
36
|
|
|
36
37
|
# GET /Appointment/Calendar - Get Appointment calendar
|
|
37
38
|
def calendar(params = {})
|
|
38
|
-
|
|
39
|
+
get_resource('Appointment', '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(
|
|
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
|
-
|
|
49
|
+
list_resource('Appointment', 'Slots', params)
|
|
49
50
|
end
|
|
50
51
|
|
|
51
52
|
# POST /Appointment/Slots - Create Appointment slots
|
|
52
53
|
def create_slots(data)
|
|
53
|
-
|
|
54
|
+
create_resource('Appointment', 'Slots', data)
|
|
54
55
|
end
|
|
55
56
|
|
|
56
57
|
# GET /Appointment/Types - Get Appointment types
|
|
57
58
|
def types(params = {})
|
|
58
|
-
|
|
59
|
+
list_resource('Appointment', 'Types', params)
|
|
59
60
|
end
|
|
60
61
|
|
|
61
62
|
# POST /Appointment/Types - Create Appointment type
|
|
62
63
|
def create_type(data)
|
|
63
|
-
|
|
64
|
+
create_resource('Appointment', '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
|
|
8
|
-
list_resource(
|
|
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
|
|
13
|
-
get_resource(
|
|
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
|
|
18
|
-
create_resource(
|
|
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
|
|
23
|
-
update_resource(
|
|
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
|
|
28
|
-
delete_resource(
|
|
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
|
-
|
|
34
|
+
list_resource('Asset', params, 'GetAllSoftwareVersions')
|
|
34
35
|
end
|
|
35
36
|
|
|
36
37
|
# GET /Asset/NextTag - Get next asset tag
|
|
37
38
|
def next_tag(params = {})
|
|
38
|
-
|
|
39
|
+
get_resource('Asset', '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
|
-
|
|
45
|
+
list_resource('AssetChange', params)
|
|
45
46
|
end
|
|
46
47
|
|
|
47
48
|
# POST /AssetChange - Create Asset change
|
|
48
49
|
def create_change(data)
|
|
49
|
-
|
|
50
|
+
create_resource('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
|
-
|
|
56
|
+
list_resource('AssetGroup', params)
|
|
56
57
|
end
|
|
57
58
|
|
|
58
59
|
# GET /AssetGroup/{id} - Get specific Asset group
|
|
59
60
|
def group(id, params = {})
|
|
60
|
-
|
|
61
|
+
get_resource('AssetGroup', id, params)
|
|
61
62
|
end
|
|
62
63
|
|
|
63
64
|
# POST /AssetGroup - Create Asset group
|
|
64
65
|
def create_group(data)
|
|
65
|
-
|
|
66
|
+
create_resource('AssetGroup', data)
|
|
66
67
|
end
|
|
67
68
|
|
|
68
69
|
# PUT /AssetGroup/{id} - Update Asset group
|
|
69
70
|
def update_group(id, data)
|
|
70
|
-
|
|
71
|
+
update_resource('AssetGroup', id, data)
|
|
71
72
|
end
|
|
72
73
|
|
|
73
74
|
# DELETE /AssetGroup/{id} - Delete Asset group
|
|
74
75
|
def delete_group(id)
|
|
75
|
-
|
|
76
|
+
delete_resource('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
|
-
|
|
82
|
+
list_resource('AssetSoftware', params)
|
|
82
83
|
end
|
|
83
84
|
|
|
84
85
|
# POST /AssetSoftware - Create Asset software
|
|
85
86
|
def create_software(data)
|
|
86
|
-
|
|
87
|
+
create_resource('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
|
-
|
|
93
|
+
list_resource('AssetType', params)
|
|
93
94
|
end
|
|
94
95
|
|
|
95
96
|
# GET /AssetType/{id} - Get specific Asset type
|
|
96
97
|
def type(id, params = {})
|
|
97
|
-
|
|
98
|
+
get_resource('AssetType', id, params)
|
|
98
99
|
end
|
|
99
100
|
|
|
100
101
|
# POST /AssetType - Create Asset type
|
|
101
102
|
def create_type(data)
|
|
102
|
-
|
|
103
|
+
create_resource('AssetType', data)
|
|
103
104
|
end
|
|
104
105
|
|
|
105
106
|
# PUT /AssetType/{id} - Update Asset type
|
|
106
107
|
def update_type(id, data)
|
|
107
|
-
|
|
108
|
+
update_resource('AssetType', id, data)
|
|
108
109
|
end
|
|
109
110
|
|
|
110
111
|
# DELETE /AssetType/{id} - Delete Asset type
|
|
111
112
|
def delete_type(id)
|
|
112
|
-
|
|
113
|
+
delete_resource('AssetType', id)
|
|
113
114
|
end
|
|
114
115
|
|
|
115
116
|
# GET /AssetTypeInfo - Get Asset type info
|
|
116
117
|
def type_info(params = {})
|
|
117
|
-
get(
|
|
118
|
+
get(resource_path('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
|
-
|
|
124
|
+
list_resource('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
|
-
|
|
129
|
+
get_resource('AssetTypeMappings', id, params)
|
|
129
130
|
end
|
|
130
131
|
|
|
131
132
|
# POST /AssetTypeMappings - Create Asset type mapping
|
|
132
133
|
def create_type_mapping(data)
|
|
133
|
-
|
|
134
|
+
create_resource('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
|
-
|
|
139
|
+
update_resource('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
|
-
|
|
144
|
+
delete_resource('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 :
|
|
7
|
+
attr_reader :client_instance
|
|
7
8
|
|
|
8
|
-
def initialize(
|
|
9
|
-
@
|
|
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
|
-
|
|
16
|
+
client_instance.get(path, params)
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
def post(path, body = {})
|
|
19
|
-
|
|
20
|
+
client_instance.post(path, body)
|
|
20
21
|
end
|
|
21
22
|
|
|
22
23
|
def put(path, body = {})
|
|
23
|
-
|
|
24
|
+
client_instance.put(path, body)
|
|
24
25
|
end
|
|
25
26
|
|
|
26
27
|
def patch(path, body = {})
|
|
27
|
-
|
|
28
|
+
client_instance.patch(path, body)
|
|
28
29
|
end
|
|
29
30
|
|
|
30
31
|
def delete(path)
|
|
31
|
-
|
|
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
|
|
@@ -56,7 +57,8 @@ module HaloMspApi
|
|
|
56
57
|
|
|
57
58
|
# Helper method for update operations
|
|
58
59
|
def update_resource(resource_name, id, data)
|
|
59
|
-
|
|
60
|
+
data_with_id = data.merge(id: id)
|
|
61
|
+
post(resource_path(resource_name), data_with_id)
|
|
60
62
|
end
|
|
61
63
|
|
|
62
64
|
# Helper method for delete operations
|