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,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ module HaloMspApi
4
+ module Resources
5
+ class Users < Base
6
+ # GET /Users - List of Users
7
+ def list(params = {})
8
+ list_resource("Users", params)
9
+ end
10
+
11
+ # GET /Users/{id} - Get a specific User
12
+ def get(id, params = {})
13
+ get_resource("Users", id, params)
14
+ end
15
+
16
+ # POST /Users - Create a new User
17
+ def create(data)
18
+ create_resource("Users", data)
19
+ end
20
+
21
+ # PUT /Users/{id} - Update a User
22
+ def update(id, data)
23
+ update_resource("Users", id, data)
24
+ end
25
+
26
+ # DELETE /Users/{id} - Delete a User
27
+ def delete(id)
28
+ delete_resource("Users", id)
29
+ end
30
+
31
+ # GET /Users/me - Get current User information
32
+ def me(params = {})
33
+ get(resource_path("Users", nil, "me"), params)
34
+ end
35
+
36
+ # GET /Users/prefs - Get User preferences
37
+ def preferences(params = {})
38
+ get(resource_path("Users", nil, "prefs"), params)
39
+ end
40
+
41
+ # POST /Users/prefs - Update User preferences
42
+ def update_preferences(data)
43
+ post(resource_path("Users", nil, "prefs"), data)
44
+ end
45
+
46
+ # User Change methods
47
+ # GET /UserChange - List User changes
48
+ def changes(params = {})
49
+ get("/UserChange", params)
50
+ end
51
+
52
+ # POST /UserChange - Create User change
53
+ def create_change(data)
54
+ post("/UserChange", data)
55
+ end
56
+
57
+ # User Roles methods
58
+ # GET /UserRoles - List User roles
59
+ def roles(params = {})
60
+ get("/UserRoles", params)
61
+ end
62
+
63
+ # GET /UserRoles/{id} - Get specific User role
64
+ def role(id, params = {})
65
+ get("/UserRoles/#{id}", params)
66
+ end
67
+
68
+ # POST /UserRoles - Create User role
69
+ def create_role(data)
70
+ post("/UserRoles", data)
71
+ end
72
+
73
+ # PUT /UserRoles/{id} - Update User role
74
+ def update_role(id, data)
75
+ put("/UserRoles/#{id}", data)
76
+ end
77
+
78
+ # DELETE /UserRoles/{id} - Delete User role
79
+ def delete_role(id)
80
+ delete("/UserRoles/#{id}")
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,89 @@
1
+ # frozen_string_literal: true
2
+
3
+ module HaloMspApi
4
+ module Resources
5
+ class Webhooks < Base
6
+ # GET /Webhook - List of Webhooks
7
+ def list(params = {})
8
+ list_resource("Webhook", params)
9
+ end
10
+
11
+ # GET /Webhook/{id} - Get a specific Webhook
12
+ def get(id, params = {})
13
+ get_resource("Webhook", id, params)
14
+ end
15
+
16
+ # POST /Webhook - Create a new Webhook
17
+ def create(data)
18
+ create_resource("Webhook", data)
19
+ end
20
+
21
+ # PUT /Webhook/{id} - Update a Webhook
22
+ def update(id, data)
23
+ update_resource("Webhook", id, data)
24
+ end
25
+
26
+ # DELETE /Webhook/{id} - Delete a Webhook
27
+ def delete(id)
28
+ delete_resource("Webhook", id)
29
+ end
30
+
31
+ # POST /Webhook/test - Test a Webhook
32
+ def test(data)
33
+ post(resource_path("Webhook", nil, "test"), data)
34
+ end
35
+
36
+ # Webhook Event methods
37
+ # GET /WebhookEvent - List Webhook events
38
+ def events(params = {})
39
+ get("/WebhookEvent", params)
40
+ end
41
+
42
+ # GET /WebhookEvent/{id} - Get specific Webhook event
43
+ def event(id, params = {})
44
+ get("/WebhookEvent/#{id}", params)
45
+ end
46
+
47
+ # POST /WebhookEvent - Create Webhook event
48
+ def create_event(data)
49
+ post("/WebhookEvent", data)
50
+ end
51
+
52
+ # PUT /WebhookEvent/{id} - Update Webhook event
53
+ def update_event(id, data)
54
+ put("/WebhookEvent/#{id}", data)
55
+ end
56
+
57
+ # DELETE /WebhookEvent/{id} - Delete Webhook event
58
+ def delete_event(id)
59
+ delete("/WebhookEvent/#{id}")
60
+ end
61
+
62
+ # Webhook Subscription methods
63
+ # GET /WebhookSubscription - List Webhook subscriptions
64
+ def subscriptions(params = {})
65
+ get("/WebhookSubscription", params)
66
+ end
67
+
68
+ # GET /WebhookSubscription/{id} - Get specific Webhook subscription
69
+ def subscription(id, params = {})
70
+ get("/WebhookSubscription/#{id}", params)
71
+ end
72
+
73
+ # POST /WebhookSubscription - Create Webhook subscription
74
+ def create_subscription(data)
75
+ post("/WebhookSubscription", data)
76
+ end
77
+
78
+ # PUT /WebhookSubscription/{id} - Update Webhook subscription
79
+ def update_subscription(id, data)
80
+ put("/WebhookSubscription/#{id}", data)
81
+ end
82
+
83
+ # DELETE /WebhookSubscription/{id} - Delete Webhook subscription
84
+ def delete_subscription(id)
85
+ delete("/WebhookSubscription/#{id}")
86
+ end
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module HaloMspApi
4
+ VERSION = "0.1.0"
5
+ end
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "halo_msp_api/version"
4
+ require_relative "halo_msp_api/client"
5
+ require_relative "halo_msp_api/configuration"
6
+ require_relative "halo_msp_api/error"
7
+
8
+ # Core resource modules
9
+ require_relative "halo_msp_api/resources/base"
10
+ require_relative "halo_msp_api/resources/actions"
11
+ require_relative "halo_msp_api/resources/agents"
12
+ require_relative "halo_msp_api/resources/appointments"
13
+ require_relative "halo_msp_api/resources/assets"
14
+ require_relative "halo_msp_api/resources/clients"
15
+ require_relative "halo_msp_api/resources/integrations"
16
+ require_relative "halo_msp_api/resources/invoices"
17
+ require_relative "halo_msp_api/resources/knowledge_base"
18
+ require_relative "halo_msp_api/resources/organisations"
19
+ require_relative "halo_msp_api/resources/purchase_orders"
20
+ require_relative "halo_msp_api/resources/quotations"
21
+ require_relative "halo_msp_api/resources/reports"
22
+ require_relative "halo_msp_api/resources/sales_orders"
23
+ require_relative "halo_msp_api/resources/services"
24
+ require_relative "halo_msp_api/resources/slas"
25
+ require_relative "halo_msp_api/resources/suppliers"
26
+ require_relative "halo_msp_api/resources/tickets"
27
+ require_relative "halo_msp_api/resources/users"
28
+ require_relative "halo_msp_api/resources/webhooks"
29
+
30
+ module HaloMspApi
31
+ class << self
32
+ attr_accessor :configuration
33
+ end
34
+
35
+ def self.configure
36
+ self.configuration ||= Configuration.new
37
+ yield(configuration)
38
+ end
39
+
40
+ def self.client
41
+ @client ||= Client.new(configuration)
42
+ end
43
+ end