halo_msp_api 0.1.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.
@@ -0,0 +1,86 @@
1
+ # frozen_string_literal: true
2
+
3
+ module HaloMspApi
4
+ module Resources
5
+ class Actions < Base
6
+ # GET /Actions - List of Actions
7
+ # Parameters based on swagger.json specification
8
+ def list(options = {})
9
+ params = build_list_params(options)
10
+ get("/Actions", params)
11
+ end
12
+
13
+ # GET /Actions/{id} - Get a specific Action
14
+ def get(id, params = {})
15
+ get_resource("Actions", id, params)
16
+ end
17
+
18
+ # POST /Actions - Create a new Action
19
+ def create(data)
20
+ create_resource("Actions", data)
21
+ end
22
+
23
+ # PUT /Actions/{id} - Update an Action
24
+ def update(id, data)
25
+ update_resource("Actions", id, data)
26
+ end
27
+
28
+ # DELETE /Actions/{id} - Delete an Action
29
+ def delete(id)
30
+ delete_resource("Actions", id)
31
+ end
32
+
33
+ # Action Reactions methods
34
+ # GET /ActionReaction - List action reactions
35
+ def reactions(params = {})
36
+ get("/ActionReaction", params)
37
+ end
38
+
39
+ # GET /ActionReaction/{id} - Get specific action reaction
40
+ def reaction(id, params = {})
41
+ get("/ActionReaction/#{id}", params)
42
+ end
43
+
44
+ # POST /ActionReaction - Create action reaction
45
+ def create_reaction(data)
46
+ post("/ActionReaction", data)
47
+ end
48
+
49
+ # PUT /ActionReaction/{id} - Update action reaction
50
+ def update_reaction(id, data)
51
+ put("/ActionReaction/#{id}", data)
52
+ end
53
+
54
+ # DELETE /ActionReaction/{id} - Delete action reaction
55
+ def delete_reaction(id)
56
+ delete("/ActionReaction/#{id}")
57
+ end
58
+
59
+ # Action Review methods
60
+ # GET /ActionReview - List action reviews
61
+ def reviews(params = {})
62
+ get("/ActionReview", params)
63
+ end
64
+
65
+ # GET /ActionReview/{id} - Get specific action review
66
+ def review(id, params = {})
67
+ get("/ActionReview/#{id}", params)
68
+ end
69
+
70
+ # POST /ActionReview - Create action review
71
+ def create_review(data)
72
+ post("/ActionReview", data)
73
+ end
74
+
75
+ # PUT /ActionReview/{id} - Update action review
76
+ def update_review(id, data)
77
+ put("/ActionReview/#{id}", data)
78
+ end
79
+
80
+ # DELETE /ActionReview/{id} - Delete action review
81
+ def delete_review(id)
82
+ delete("/ActionReview/#{id}")
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,100 @@
1
+ # frozen_string_literal: true
2
+
3
+ module HaloMspApi
4
+ module Resources
5
+ class Agents < Base
6
+ # GET /Agent - List of Agents
7
+ def list(params = {})
8
+ list_resource("Agent", params)
9
+ end
10
+
11
+ # GET /Agent/{id} - Get a specific Agent
12
+ def get(id, params = {})
13
+ get_resource("Agent", id, params)
14
+ end
15
+
16
+ # POST /Agent - Create a new Agent
17
+ def create(data)
18
+ create_resource("Agent", data)
19
+ end
20
+
21
+ # PUT /Agent/{id} - Update an Agent
22
+ def update(id, data)
23
+ update_resource("Agent", id, data)
24
+ end
25
+
26
+ # DELETE /Agent/{id} - Delete an Agent
27
+ def delete(id)
28
+ delete_resource("Agent", id)
29
+ end
30
+
31
+ # GET /Agent/me - Get current Agent information
32
+ def me(params = {})
33
+ get(resource_path("Agent", nil, "me"), params)
34
+ end
35
+
36
+ # POST /Agent/ClearCache - Clear Agent cache
37
+ def clear_cache
38
+ post(resource_path("Agent", nil, "ClearCache"))
39
+ end
40
+
41
+ # GET /AgentImage/{id} - Get Agent image
42
+ def image(id)
43
+ get(resource_path("AgentImage", id))
44
+ end
45
+
46
+ # Agent Check-in related methods
47
+ # GET /AgentCheckIn - List Agent check-ins
48
+ def check_ins(params = {})
49
+ get("/AgentCheckIn", params)
50
+ end
51
+
52
+ # GET /AgentCheckIn/{id} - Get specific Agent check-in
53
+ def check_in(id, params = {})
54
+ get("/AgentCheckIn/#{id}", params)
55
+ end
56
+
57
+ # POST /AgentCheckIn - Create Agent check-in
58
+ def create_check_in(data)
59
+ post("/AgentCheckIn", data)
60
+ end
61
+
62
+ # Agent Event Subscription methods
63
+ # GET /AgentEventSubscription - List Agent event subscriptions
64
+ def event_subscriptions(params = {})
65
+ get("/AgentEventSubscription", params)
66
+ end
67
+
68
+ # GET /AgentEventSubscription/{id} - Get specific Agent event subscription
69
+ def event_subscription(id, params = {})
70
+ get("/AgentEventSubscription/#{id}", params)
71
+ end
72
+
73
+ # POST /AgentEventSubscription - Create Agent event subscription
74
+ def create_event_subscription(data)
75
+ post("/AgentEventSubscription", data)
76
+ end
77
+
78
+ # Agent Presence related methods
79
+ # GET /AgentPresenceRule - List Agent presence rules
80
+ def presence_rules(params = {})
81
+ get("/AgentPresenceRule", params)
82
+ end
83
+
84
+ # GET /AgentPresenceSubscription - List Agent presence subscriptions
85
+ def presence_subscriptions(params = {})
86
+ get("/AgentPresenceSubscription", params)
87
+ end
88
+
89
+ # GET /AgentPresenceSubscription/{id} - Get specific Agent presence subscription
90
+ def presence_subscription(id, params = {})
91
+ get("/AgentPresenceSubscription/#{id}", params)
92
+ end
93
+
94
+ # POST /AgentPresenceSubscription - Create Agent presence subscription
95
+ def create_presence_subscription(data)
96
+ post("/AgentPresenceSubscription", data)
97
+ end
98
+ end
99
+ end
100
+ end
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ module HaloMspApi
4
+ module Resources
5
+ class Appointments < Base
6
+ # GET /Appointment - List of Appointments
7
+ def list(params = {})
8
+ list_resource("Appointment", params)
9
+ end
10
+
11
+ # GET /Appointment/{id} - Get a specific Appointment
12
+ def get(id, params = {})
13
+ get_resource("Appointment", id, params)
14
+ end
15
+
16
+ # POST /Appointment - Create a new Appointment
17
+ def create(data)
18
+ create_resource("Appointment", data)
19
+ end
20
+
21
+ # PUT /Appointment/{id} - Update an Appointment
22
+ def update(id, data)
23
+ update_resource("Appointment", id, data)
24
+ end
25
+
26
+ # DELETE /Appointment/{id} - Delete an Appointment
27
+ def delete(id)
28
+ delete_resource("Appointment", id)
29
+ end
30
+
31
+ # GET /Appointment/Availability - Get Appointment availability
32
+ def availability(params = {})
33
+ get(resource_path("Appointment", nil, "Availability"), params)
34
+ end
35
+
36
+ # GET /Appointment/Calendar - Get Appointment calendar
37
+ def calendar(params = {})
38
+ get(resource_path("Appointment", nil, "Calendar"), params)
39
+ end
40
+
41
+ # POST /Appointment/CheckAvailability - Check Appointment availability
42
+ def check_availability(data)
43
+ post(resource_path("Appointment", nil, "CheckAvailability"), data)
44
+ end
45
+
46
+ # GET /Appointment/Slots - Get Appointment slots
47
+ def slots(params = {})
48
+ get(resource_path("Appointment", nil, "Slots"), params)
49
+ end
50
+
51
+ # POST /Appointment/Slots - Create Appointment slots
52
+ def create_slots(data)
53
+ post(resource_path("Appointment", nil, "Slots"), data)
54
+ end
55
+
56
+ # GET /Appointment/Types - Get Appointment types
57
+ def types(params = {})
58
+ get(resource_path("Appointment", nil, "Types"), params)
59
+ end
60
+
61
+ # POST /Appointment/Types - Create Appointment type
62
+ def create_type(data)
63
+ post(resource_path("Appointment", nil, "Types"), data)
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,147 @@
1
+ # frozen_string_literal: true
2
+
3
+ module HaloMspApi
4
+ module Resources
5
+ class Assets < Base
6
+ # GET /Asset - List of Assets
7
+ def list(params = {})
8
+ list_resource("Asset", params)
9
+ end
10
+
11
+ # GET /Asset/{id} - Get a specific Asset
12
+ def get(id, params = {})
13
+ get_resource("Asset", id, params)
14
+ end
15
+
16
+ # POST /Asset - Create a new Asset
17
+ def create(data)
18
+ create_resource("Asset", data)
19
+ end
20
+
21
+ # PUT /Asset/{id} - Update an Asset
22
+ def update(id, data)
23
+ update_resource("Asset", id, data)
24
+ end
25
+
26
+ # DELETE /Asset/{id} - Delete an Asset
27
+ def delete(id)
28
+ delete_resource("Asset", id)
29
+ end
30
+
31
+ # GET /Asset/GetAllSoftwareVersions - Get all software versions
32
+ def software_versions(params = {})
33
+ get(resource_path("Asset", nil, "GetAllSoftwareVersions"), params)
34
+ end
35
+
36
+ # GET /Asset/NextTag - Get next asset tag
37
+ def next_tag(params = {})
38
+ get(resource_path("Asset", nil, "NextTag"), params)
39
+ end
40
+
41
+ # Asset Change related methods
42
+ # GET /AssetChange - List Asset changes
43
+ def changes(params = {})
44
+ get("/AssetChange", params)
45
+ end
46
+
47
+ # POST /AssetChange - Create Asset change
48
+ def create_change(data)
49
+ post("/AssetChange", data)
50
+ end
51
+
52
+ # Asset Group methods
53
+ # GET /AssetGroup - List Asset groups
54
+ def groups(params = {})
55
+ get("/AssetGroup", params)
56
+ end
57
+
58
+ # GET /AssetGroup/{id} - Get specific Asset group
59
+ def group(id, params = {})
60
+ get("/AssetGroup/#{id}", params)
61
+ end
62
+
63
+ # POST /AssetGroup - Create Asset group
64
+ def create_group(data)
65
+ post("/AssetGroup", data)
66
+ end
67
+
68
+ # PUT /AssetGroup/{id} - Update Asset group
69
+ def update_group(id, data)
70
+ put("/AssetGroup/#{id}", data)
71
+ end
72
+
73
+ # DELETE /AssetGroup/{id} - Delete Asset group
74
+ def delete_group(id)
75
+ delete("/AssetGroup/#{id}")
76
+ end
77
+
78
+ # Asset Software methods
79
+ # GET /AssetSoftware - List Asset software
80
+ def software(params = {})
81
+ get("/AssetSoftware", params)
82
+ end
83
+
84
+ # POST /AssetSoftware - Create Asset software
85
+ def create_software(data)
86
+ post("/AssetSoftware", data)
87
+ end
88
+
89
+ # Asset Type methods
90
+ # GET /AssetType - List Asset types
91
+ def types(params = {})
92
+ get("/AssetType", params)
93
+ end
94
+
95
+ # GET /AssetType/{id} - Get specific Asset type
96
+ def type(id, params = {})
97
+ get("/AssetType/#{id}", params)
98
+ end
99
+
100
+ # POST /AssetType - Create Asset type
101
+ def create_type(data)
102
+ post("/AssetType", data)
103
+ end
104
+
105
+ # PUT /AssetType/{id} - Update Asset type
106
+ def update_type(id, data)
107
+ put("/AssetType/#{id}", data)
108
+ end
109
+
110
+ # DELETE /AssetType/{id} - Delete Asset type
111
+ def delete_type(id)
112
+ delete("/AssetType/#{id}")
113
+ end
114
+
115
+ # GET /AssetTypeInfo - Get Asset type info
116
+ def type_info(params = {})
117
+ get("/AssetTypeInfo", params)
118
+ end
119
+
120
+ # Asset Type Mappings methods
121
+ # GET /AssetTypeMappings - List Asset type mappings
122
+ def type_mappings(params = {})
123
+ get("/AssetTypeMappings", params)
124
+ end
125
+
126
+ # GET /AssetTypeMappings/{id} - Get specific Asset type mapping
127
+ def type_mapping(id, params = {})
128
+ get("/AssetTypeMappings/#{id}", params)
129
+ end
130
+
131
+ # POST /AssetTypeMappings - Create Asset type mapping
132
+ def create_type_mapping(data)
133
+ post("/AssetTypeMappings", data)
134
+ end
135
+
136
+ # PUT /AssetTypeMappings/{id} - Update Asset type mapping
137
+ def update_type_mapping(id, data)
138
+ put("/AssetTypeMappings/#{id}", data)
139
+ end
140
+
141
+ # DELETE /AssetTypeMappings/{id} - Delete Asset type mapping
142
+ def delete_type_mapping(id)
143
+ delete("/AssetTypeMappings/#{id}")
144
+ end
145
+ end
146
+ end
147
+ end
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ module HaloMspApi
4
+ module Resources
5
+ class Base
6
+ attr_reader :client
7
+
8
+ def initialize(client)
9
+ @client = client
10
+ end
11
+
12
+ protected
13
+
14
+ def get(path, params = {})
15
+ client.get(path, params)
16
+ end
17
+
18
+ def post(path, body = {})
19
+ client.post(path, body)
20
+ end
21
+
22
+ def put(path, body = {})
23
+ client.put(path, body)
24
+ end
25
+
26
+ def patch(path, body = {})
27
+ client.patch(path, body)
28
+ end
29
+
30
+ def delete(path)
31
+ client.delete(path)
32
+ end
33
+
34
+ # Helper method to build resource path
35
+ def resource_path(resource_name, id = nil, action = nil)
36
+ path = "/#{resource_name}"
37
+ path += "/#{id}" if id
38
+ path += "/#{action}" if action
39
+ path
40
+ end
41
+
42
+ # Helper method for list operations with common parameters
43
+ def list_resource(resource_name, params = {})
44
+ get(resource_path(resource_name), params)
45
+ end
46
+
47
+ # Helper method for get operations
48
+ def get_resource(resource_name, id, params = {})
49
+ get(resource_path(resource_name, id), params)
50
+ end
51
+
52
+ # Helper method for create operations
53
+ def create_resource(resource_name, data)
54
+ post(resource_path(resource_name), data)
55
+ end
56
+
57
+ # Helper method for update operations
58
+ def update_resource(resource_name, id, data)
59
+ put(resource_path(resource_name, id), data)
60
+ end
61
+
62
+ # Helper method for delete operations
63
+ def delete_resource(resource_name, id)
64
+ delete(resource_path(resource_name, id))
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,115 @@
1
+ # frozen_string_literal: true
2
+
3
+ module HaloMspApi
4
+ module Resources
5
+ class Clients < Base
6
+ # GET /Client - List of Clients
7
+ def list(params = {})
8
+ list_resource("Client", params)
9
+ end
10
+
11
+ # GET /Client/{id} - Get a specific Client
12
+ def get(id, params = {})
13
+ get_resource("Client", id, params)
14
+ end
15
+
16
+ # POST /Client - Create a new Client
17
+ def create(data)
18
+ create_resource("Client", data)
19
+ end
20
+
21
+ # PUT /Client/{id} - Update a Client
22
+ def update(id, data)
23
+ update_resource("Client", id, data)
24
+ end
25
+
26
+ # 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)
34
+ end
35
+
36
+ # GET /Client/NewAccountsId - Get new accounts ID
37
+ def new_accounts_id(params = {})
38
+ get(resource_path("Client", nil, "NewAccountsId"), params)
39
+ end
40
+
41
+ # POST /Client/PaymentMethodUpdate - Update payment method
42
+ def update_payment_method(data)
43
+ post(resource_path("Client", nil, "PaymentMethodUpdate"), data)
44
+ end
45
+
46
+ # Client Cache methods
47
+ # GET /ClientCache - Get Client cache
48
+ def cache(params = {})
49
+ get("/ClientCache", params)
50
+ end
51
+
52
+ # Client Contract methods
53
+ # GET /ClientContract - List Client contracts
54
+ def contracts(params = {})
55
+ get("/ClientContract", params)
56
+ end
57
+
58
+ # GET /ClientContract/{id} - Get specific Client contract
59
+ def contract(id, params = {})
60
+ get("/ClientContract/#{id}", params)
61
+ end
62
+
63
+ # POST /ClientContract - Create Client contract
64
+ def create_contract(data)
65
+ post("/ClientContract", data)
66
+ end
67
+
68
+ # PUT /ClientContract/{id} - Update Client contract
69
+ def update_contract(id, data)
70
+ put("/ClientContract/#{id}", data)
71
+ end
72
+
73
+ # DELETE /ClientContract/{id} - Delete Client contract
74
+ def delete_contract(id)
75
+ delete("/ClientContract/#{id}")
76
+ end
77
+
78
+ # POST /ClientContract/Approval - Client contract approval
79
+ def contract_approval(data)
80
+ post("/ClientContract/Approval", data)
81
+ end
82
+
83
+ # GET /ClientContract/NextRef - Get next contract reference
84
+ def next_contract_ref(params = {})
85
+ get("/ClientContract/NextRef", params)
86
+ end
87
+
88
+ # Client Prepay methods
89
+ # GET /ClientPrepay - List Client prepayments
90
+ def prepayments(params = {})
91
+ get("/ClientPrepay", params)
92
+ end
93
+
94
+ # GET /ClientPrepay/{id} - Get specific Client prepayment
95
+ def prepayment(id, params = {})
96
+ get("/ClientPrepay/#{id}", params)
97
+ end
98
+
99
+ # POST /ClientPrepay - Create Client prepayment
100
+ def create_prepayment(data)
101
+ post("/ClientPrepay", data)
102
+ end
103
+
104
+ # PUT /ClientPrepay/{id} - Update Client prepayment
105
+ def update_prepayment(id, data)
106
+ put("/ClientPrepay/#{id}", data)
107
+ end
108
+
109
+ # DELETE /ClientPrepay/{id} - Delete Client prepayment
110
+ def delete_prepayment(id)
111
+ delete("/ClientPrepay/#{id}")
112
+ end
113
+ end
114
+ end
115
+ end