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,139 +2,140 @@
|
|
|
2
2
|
|
|
3
3
|
module HaloMspApi
|
|
4
4
|
module Resources
|
|
5
|
+
# Resource class for Invoices
|
|
5
6
|
class Invoices < Base
|
|
6
7
|
# GET /Invoice - List of Invoices
|
|
7
|
-
def
|
|
8
|
-
list_resource(
|
|
8
|
+
def invoices(params = {})
|
|
9
|
+
list_resource('Invoice', params)
|
|
9
10
|
end
|
|
10
11
|
|
|
11
12
|
# GET /Invoice/{id} - Get a specific Invoice
|
|
12
|
-
def
|
|
13
|
-
get_resource(
|
|
13
|
+
def invoice(id, params = {})
|
|
14
|
+
get_resource('Invoice', id, params)
|
|
14
15
|
end
|
|
15
16
|
|
|
16
17
|
# POST /Invoice - Create a new Invoice
|
|
17
|
-
def
|
|
18
|
-
create_resource(
|
|
18
|
+
def create_invoice(data)
|
|
19
|
+
create_resource('Invoice', data)
|
|
19
20
|
end
|
|
20
21
|
|
|
21
22
|
# PUT /Invoice/{id} - Update an Invoice
|
|
22
|
-
def
|
|
23
|
-
update_resource(
|
|
23
|
+
def update_invoice(id, data)
|
|
24
|
+
update_resource('Invoice', id, data)
|
|
24
25
|
end
|
|
25
26
|
|
|
26
27
|
# DELETE /Invoice/{id} - Delete an Invoice
|
|
27
|
-
def
|
|
28
|
-
delete_resource(
|
|
28
|
+
def delete_invoice(id)
|
|
29
|
+
delete_resource('Invoice', id)
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
# POST /Invoice/{id}/void - Void an Invoice
|
|
32
33
|
def void(id, data = {})
|
|
33
|
-
post(resource_path(
|
|
34
|
+
post(resource_path('Invoice', "#{id}/void"), data)
|
|
34
35
|
end
|
|
35
36
|
|
|
36
37
|
# GET /Invoice/PDF/{id} - Get Invoice PDF
|
|
37
38
|
def pdf(id, params = {})
|
|
38
|
-
|
|
39
|
+
get_resource('Invoice', "#{id}/PDF", params)
|
|
39
40
|
end
|
|
40
41
|
|
|
41
42
|
# POST /Invoice/updatelines - Update Invoice lines
|
|
42
43
|
def update_lines(data)
|
|
43
|
-
post(resource_path(
|
|
44
|
+
post(resource_path('Invoice', nil, 'updatelines'), data)
|
|
44
45
|
end
|
|
45
46
|
|
|
46
47
|
# GET /Invoice/View - Get Invoice view
|
|
47
48
|
def view(params = {})
|
|
48
|
-
|
|
49
|
+
get_resource('Invoice', 'View', params)
|
|
49
50
|
end
|
|
50
51
|
|
|
51
52
|
# Invoice Change methods
|
|
52
53
|
# GET /InvoiceChange - List Invoice changes
|
|
53
54
|
def changes(params = {})
|
|
54
|
-
|
|
55
|
+
list_resource('InvoiceChange', params)
|
|
55
56
|
end
|
|
56
57
|
|
|
57
58
|
# POST /InvoiceChange - Create Invoice change
|
|
58
59
|
def create_change(data)
|
|
59
|
-
|
|
60
|
+
create_resource('InvoiceChange', data)
|
|
60
61
|
end
|
|
61
62
|
|
|
62
63
|
# Invoice Detail Pro Rata methods
|
|
63
64
|
# GET /InvoiceDetailProRata - List Invoice detail pro rata
|
|
64
65
|
def detail_pro_rata(params = {})
|
|
65
|
-
|
|
66
|
+
list_resource('InvoiceDetailProRata', params)
|
|
66
67
|
end
|
|
67
68
|
|
|
68
69
|
# POST /InvoiceDetailProRata - Create Invoice detail pro rata
|
|
69
70
|
def create_detail_pro_rata(data)
|
|
70
|
-
|
|
71
|
+
create_resource('InvoiceDetailProRata', data)
|
|
71
72
|
end
|
|
72
73
|
|
|
73
74
|
# Invoice Payment methods
|
|
74
75
|
# GET /InvoicePayment - List Invoice payments
|
|
75
76
|
def payments(params = {})
|
|
76
|
-
|
|
77
|
+
list_resource('InvoicePayment', params)
|
|
77
78
|
end
|
|
78
79
|
|
|
79
80
|
# GET /InvoicePayment/{id} - Get specific Invoice payment
|
|
80
81
|
def payment(id, params = {})
|
|
81
|
-
|
|
82
|
+
get_resource('InvoicePayment', id, params)
|
|
82
83
|
end
|
|
83
84
|
|
|
84
85
|
# POST /InvoicePayment - Create Invoice payment
|
|
85
86
|
def create_payment(data)
|
|
86
|
-
|
|
87
|
+
create_resource('InvoicePayment', data)
|
|
87
88
|
end
|
|
88
89
|
|
|
89
90
|
# PUT /InvoicePayment/{id} - Update Invoice payment
|
|
90
91
|
def update_payment(id, data)
|
|
91
|
-
|
|
92
|
+
update_resource('InvoicePayment', id, data)
|
|
92
93
|
end
|
|
93
94
|
|
|
94
95
|
# DELETE /InvoicePayment/{id} - Delete Invoice payment
|
|
95
96
|
def delete_payment(id)
|
|
96
|
-
|
|
97
|
+
delete_resource('InvoicePayment', id)
|
|
97
98
|
end
|
|
98
99
|
|
|
99
100
|
# Recurring Invoice methods
|
|
100
101
|
# GET /RecurringInvoice - List Recurring invoices
|
|
101
102
|
def recurring_invoices(params = {})
|
|
102
|
-
|
|
103
|
+
list_resource('RecurringInvoice', params)
|
|
103
104
|
end
|
|
104
105
|
|
|
105
106
|
# GET /RecurringInvoice/{id} - Get specific Recurring invoice
|
|
106
107
|
def recurring_invoice(id, params = {})
|
|
107
|
-
|
|
108
|
+
get_resource('RecurringInvoice', id, params)
|
|
108
109
|
end
|
|
109
110
|
|
|
110
111
|
# POST /RecurringInvoice - Create Recurring invoice
|
|
111
112
|
def create_recurring_invoice(data)
|
|
112
|
-
|
|
113
|
+
create_resource('RecurringInvoice', data)
|
|
113
114
|
end
|
|
114
115
|
|
|
115
116
|
# PUT /RecurringInvoice/{id} - Update Recurring invoice
|
|
116
117
|
def update_recurring_invoice(id, data)
|
|
117
|
-
|
|
118
|
+
update_resource('RecurringInvoice', id, data)
|
|
118
119
|
end
|
|
119
120
|
|
|
120
121
|
# DELETE /RecurringInvoice/{id} - Delete Recurring invoice
|
|
121
122
|
def delete_recurring_invoice(id)
|
|
122
|
-
|
|
123
|
+
delete_resource('RecurringInvoice', id)
|
|
123
124
|
end
|
|
124
125
|
|
|
125
126
|
# GET /RecurringInvoice/Lines - Get Recurring invoice lines
|
|
126
127
|
def recurring_invoice_lines(params = {})
|
|
127
|
-
|
|
128
|
+
get_resource('RecurringInvoice', 'Lines', params)
|
|
128
129
|
end
|
|
129
130
|
|
|
130
131
|
# POST /RecurringInvoice/process - Process Recurring invoices
|
|
131
132
|
def process_recurring_invoices(data)
|
|
132
|
-
post(
|
|
133
|
+
post('RecurringInvoice/process', data)
|
|
133
134
|
end
|
|
134
135
|
|
|
135
136
|
# POST /RecurringInvoice/updatelines - Update Recurring invoice lines
|
|
136
137
|
def update_recurring_invoice_lines(data)
|
|
137
|
-
post(
|
|
138
|
+
post('RecurringInvoice/updatelines', data)
|
|
138
139
|
end
|
|
139
140
|
end
|
|
140
141
|
end
|
|
@@ -2,87 +2,88 @@
|
|
|
2
2
|
|
|
3
3
|
module HaloMspApi
|
|
4
4
|
module Resources
|
|
5
|
+
# Resource class for Knowledge Base
|
|
5
6
|
class KnowledgeBase < Base
|
|
6
7
|
# GET /KBArticle - List of Knowledge Base Articles
|
|
7
8
|
def articles(params = {})
|
|
8
|
-
|
|
9
|
+
list_resource('KBArticle', params)
|
|
9
10
|
end
|
|
10
11
|
|
|
11
12
|
# GET /KBArticle/{id} - Get a specific Knowledge Base Article
|
|
12
13
|
def article(id, params = {})
|
|
13
|
-
|
|
14
|
+
get_resource('KBArticle', id, params)
|
|
14
15
|
end
|
|
15
16
|
|
|
16
17
|
# POST /KBArticle - Create a new Knowledge Base Article
|
|
17
18
|
def create_article(data)
|
|
18
|
-
|
|
19
|
+
create_resource('KBArticle', data)
|
|
19
20
|
end
|
|
20
21
|
|
|
21
22
|
# PUT /KBArticle/{id} - Update a Knowledge Base Article
|
|
22
23
|
def update_article(id, data)
|
|
23
|
-
|
|
24
|
+
update_resource('KBArticle', id, data)
|
|
24
25
|
end
|
|
25
26
|
|
|
26
27
|
# DELETE /KBArticle/{id} - Delete a Knowledge Base Article
|
|
27
28
|
def delete_article(id)
|
|
28
|
-
|
|
29
|
+
delete_resource('KBArticle', id)
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
# GET /KBArticle/Search - Search Knowledge Base Articles
|
|
32
33
|
def search_articles(params = {})
|
|
33
|
-
get(
|
|
34
|
+
get('KBArticle/Search', params)
|
|
34
35
|
end
|
|
35
36
|
|
|
36
37
|
# Knowledge Base Category methods
|
|
37
38
|
# GET /KBCategory - List Knowledge Base Categories
|
|
38
39
|
def categories(params = {})
|
|
39
|
-
|
|
40
|
+
list_resource('KBCategory', params)
|
|
40
41
|
end
|
|
41
42
|
|
|
42
43
|
# GET /KBCategory/{id} - Get specific Knowledge Base Category
|
|
43
44
|
def category(id, params = {})
|
|
44
|
-
|
|
45
|
+
get_resource('KBCategory', id, params)
|
|
45
46
|
end
|
|
46
47
|
|
|
47
48
|
# POST /KBCategory - Create Knowledge Base Category
|
|
48
49
|
def create_category(data)
|
|
49
|
-
|
|
50
|
+
create_resource('KBCategory', data)
|
|
50
51
|
end
|
|
51
52
|
|
|
52
53
|
# PUT /KBCategory/{id} - Update Knowledge Base Category
|
|
53
54
|
def update_category(id, data)
|
|
54
|
-
|
|
55
|
+
update_resource('KBCategory', id, data)
|
|
55
56
|
end
|
|
56
57
|
|
|
57
58
|
# DELETE /KBCategory/{id} - Delete Knowledge Base Category
|
|
58
59
|
def delete_category(id)
|
|
59
|
-
|
|
60
|
+
delete_resource('KBCategory', id)
|
|
60
61
|
end
|
|
61
62
|
|
|
62
63
|
# Knowledge Base Keywords methods
|
|
63
64
|
# GET /KBKeywords - List Knowledge Base Keywords
|
|
64
65
|
def keywords(params = {})
|
|
65
|
-
|
|
66
|
+
list_resource('KBKeywords', params)
|
|
66
67
|
end
|
|
67
68
|
|
|
68
69
|
# GET /KBKeywords/{id} - Get specific Knowledge Base Keywords
|
|
69
70
|
def keyword(id, params = {})
|
|
70
|
-
|
|
71
|
+
get_resource('KBKeywords', id, params)
|
|
71
72
|
end
|
|
72
73
|
|
|
73
74
|
# POST /KBKeywords - Create Knowledge Base Keywords
|
|
74
75
|
def create_keyword(data)
|
|
75
|
-
|
|
76
|
+
create_resource('KBKeywords', data)
|
|
76
77
|
end
|
|
77
78
|
|
|
78
79
|
# PUT /KBKeywords/{id} - Update Knowledge Base Keywords
|
|
79
80
|
def update_keyword(id, data)
|
|
80
|
-
|
|
81
|
+
update_resource('KBKeywords', id, data)
|
|
81
82
|
end
|
|
82
83
|
|
|
83
84
|
# DELETE /KBKeywords/{id} - Delete Knowledge Base Keywords
|
|
84
85
|
def delete_keyword(id)
|
|
85
|
-
|
|
86
|
+
delete_resource('KBKeywords', id)
|
|
86
87
|
end
|
|
87
88
|
end
|
|
88
89
|
end
|
|
@@ -2,30 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
module HaloMspApi
|
|
4
4
|
module Resources
|
|
5
|
+
# Resource class for Organisations
|
|
5
6
|
class Organisations < Base
|
|
6
7
|
# GET /Organisation - List of Organisations
|
|
7
|
-
def
|
|
8
|
-
list_resource(
|
|
8
|
+
def organisations(params = {})
|
|
9
|
+
list_resource('Organisation', params)
|
|
9
10
|
end
|
|
10
11
|
|
|
11
12
|
# GET /Organisation/{id} - Get a specific Organisation
|
|
12
|
-
def
|
|
13
|
-
get_resource(
|
|
13
|
+
def organisation(id, params = {})
|
|
14
|
+
get_resource('Organisation', id, params)
|
|
14
15
|
end
|
|
15
16
|
|
|
16
17
|
# POST /Organisation - Create a new Organisation
|
|
17
|
-
def
|
|
18
|
-
create_resource(
|
|
18
|
+
def create_organisation(data)
|
|
19
|
+
create_resource('Organisation', data)
|
|
19
20
|
end
|
|
20
21
|
|
|
21
22
|
# PUT /Organisation/{id} - Update an Organisation
|
|
22
|
-
def
|
|
23
|
-
update_resource(
|
|
23
|
+
def update_organisation(id, data)
|
|
24
|
+
update_resource('Organisation', id, data)
|
|
24
25
|
end
|
|
25
26
|
|
|
26
27
|
# DELETE /Organisation/{id} - Delete an Organisation
|
|
27
|
-
def
|
|
28
|
-
delete_resource(
|
|
28
|
+
def delete_organisation(id)
|
|
29
|
+
delete_resource('Organisation', id)
|
|
29
30
|
end
|
|
30
31
|
end
|
|
31
32
|
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module HaloMspApi
|
|
4
|
+
module Resources
|
|
5
|
+
# Resource class for Products
|
|
6
|
+
class Products < Base
|
|
7
|
+
# GET /Item - List of Products
|
|
8
|
+
def products(params = {})
|
|
9
|
+
list_resource('Item', params)
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# GET /Item/{id} - Get a specific Product
|
|
13
|
+
def product(id, params = {})
|
|
14
|
+
get_resource('Item', id, params)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# POST /Item - Create a new Product
|
|
18
|
+
def create_product(data)
|
|
19
|
+
create_resource('Item', data)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
# PUT /Item/{id} - Update a Product
|
|
23
|
+
def update_product(id, data)
|
|
24
|
+
update_resource('Item', id, data)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# DELETE /Item/{id} - Delete a Product
|
|
28
|
+
def delete_product(id)
|
|
29
|
+
delete_resource('Item', id)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -2,55 +2,56 @@
|
|
|
2
2
|
|
|
3
3
|
module HaloMspApi
|
|
4
4
|
module Resources
|
|
5
|
+
# Resource class for Purchase Orders
|
|
5
6
|
class PurchaseOrders < Base
|
|
6
7
|
# GET /PurchaseOrder - List of Purchase Orders
|
|
7
|
-
def
|
|
8
|
-
list_resource(
|
|
8
|
+
def purchase_orders(params = {})
|
|
9
|
+
list_resource('PurchaseOrder', params)
|
|
9
10
|
end
|
|
10
11
|
|
|
11
12
|
# GET /PurchaseOrder/{id} - Get a specific Purchase Order
|
|
12
|
-
def
|
|
13
|
-
get_resource(
|
|
13
|
+
def purchase_order(id, params = {})
|
|
14
|
+
get_resource('PurchaseOrder', id, params)
|
|
14
15
|
end
|
|
15
16
|
|
|
16
17
|
# POST /PurchaseOrder - Create a new Purchase Order
|
|
17
|
-
def
|
|
18
|
-
create_resource(
|
|
18
|
+
def create_purchase_order(data)
|
|
19
|
+
create_resource('PurchaseOrder', data)
|
|
19
20
|
end
|
|
20
21
|
|
|
21
22
|
# PUT /PurchaseOrder/{id} - Update a Purchase Order
|
|
22
|
-
def
|
|
23
|
-
update_resource(
|
|
23
|
+
def update_purchase_order(id, data)
|
|
24
|
+
update_resource('PurchaseOrder', id, data)
|
|
24
25
|
end
|
|
25
26
|
|
|
26
27
|
# DELETE /PurchaseOrder/{id} - Delete a Purchase Order
|
|
27
|
-
def
|
|
28
|
-
delete_resource(
|
|
28
|
+
def delete_purchase_order(id)
|
|
29
|
+
delete_resource('PurchaseOrder', id)
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
# POST /PurchaseOrder/Approval - Purchase Order approval
|
|
32
33
|
def approval(data)
|
|
33
|
-
post(resource_path(
|
|
34
|
+
post(resource_path('PurchaseOrder', nil, 'Approval'), data)
|
|
34
35
|
end
|
|
35
36
|
|
|
36
37
|
# GET /PurchaseOrder/Lines - Get Purchase Order lines
|
|
37
38
|
def lines(params = {})
|
|
38
|
-
get(resource_path(
|
|
39
|
+
get(resource_path('PurchaseOrder', nil, 'Lines'), params)
|
|
39
40
|
end
|
|
40
41
|
|
|
41
42
|
# GET /PurchaseOrder/NextRef - Get next Purchase Order reference
|
|
42
43
|
def next_ref(params = {})
|
|
43
|
-
get(resource_path(
|
|
44
|
+
get(resource_path('PurchaseOrder', nil, 'NextRef'), params)
|
|
44
45
|
end
|
|
45
46
|
|
|
46
47
|
# POST /PurchaseOrder/updatelines - Update Purchase Order lines
|
|
47
48
|
def update_lines(data)
|
|
48
|
-
post(resource_path(
|
|
49
|
+
post(resource_path('PurchaseOrder', nil, 'updatelines'), data)
|
|
49
50
|
end
|
|
50
51
|
|
|
51
52
|
# GET /PurchaseOrder/View - Get Purchase Order view
|
|
52
53
|
def view(params = {})
|
|
53
|
-
get(resource_path(
|
|
54
|
+
get(resource_path('PurchaseOrder', nil, 'View'), params)
|
|
54
55
|
end
|
|
55
56
|
end
|
|
56
57
|
end
|
|
@@ -2,45 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
module HaloMspApi
|
|
4
4
|
module Resources
|
|
5
|
+
# Resource class for Quotations
|
|
5
6
|
class Quotations < Base
|
|
6
7
|
# GET /Quotation - List of Quotations
|
|
7
|
-
def
|
|
8
|
-
list_resource(
|
|
8
|
+
def quotations(params = {})
|
|
9
|
+
list_resource('Quotation', params)
|
|
9
10
|
end
|
|
10
11
|
|
|
11
12
|
# GET /Quotation/{id} - Get a specific Quotation
|
|
12
|
-
def
|
|
13
|
-
get_resource(
|
|
13
|
+
def quotation(id, params = {})
|
|
14
|
+
get_resource('Quotation', id, params)
|
|
14
15
|
end
|
|
15
16
|
|
|
16
17
|
# POST /Quotation - Create a new Quotation
|
|
17
|
-
def
|
|
18
|
-
create_resource(
|
|
18
|
+
def create_quotation(data)
|
|
19
|
+
create_resource('Quotation', data)
|
|
19
20
|
end
|
|
20
21
|
|
|
21
22
|
# PUT /Quotation/{id} - Update a Quotation
|
|
22
|
-
def
|
|
23
|
-
update_resource(
|
|
23
|
+
def update_quotation(id, data)
|
|
24
|
+
update_resource('Quotation', id, data)
|
|
24
25
|
end
|
|
25
26
|
|
|
26
27
|
# DELETE /Quotation/{id} - Delete a Quotation
|
|
27
|
-
def
|
|
28
|
-
delete_resource(
|
|
28
|
+
def delete_quotation(id)
|
|
29
|
+
delete_resource('Quotation', id)
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
# POST /Quotation/Approval - Quotation approval
|
|
32
33
|
def approval(data)
|
|
33
|
-
post(resource_path(
|
|
34
|
+
post(resource_path('Quotation', nil, 'Approval'), data)
|
|
34
35
|
end
|
|
35
36
|
|
|
36
37
|
# GET /Quotation/Lines - Get Quotation lines
|
|
37
38
|
def lines(params = {})
|
|
38
|
-
get(resource_path(
|
|
39
|
+
get(resource_path('Quotation', nil, 'Lines'), params)
|
|
39
40
|
end
|
|
40
41
|
|
|
41
42
|
# GET /Quotation/View - Get Quotation view
|
|
42
43
|
def view(params = {})
|
|
43
|
-
get(resource_path(
|
|
44
|
+
get(resource_path('Quotation', nil, 'View'), params)
|
|
44
45
|
end
|
|
45
46
|
end
|
|
46
47
|
end
|
|
@@ -2,86 +2,87 @@
|
|
|
2
2
|
|
|
3
3
|
module HaloMspApi
|
|
4
4
|
module Resources
|
|
5
|
+
# Resource class for Reports
|
|
5
6
|
class Reports < Base
|
|
6
7
|
# GET /Report - List of Reports
|
|
7
|
-
def
|
|
8
|
-
list_resource(
|
|
8
|
+
def reports(params = {})
|
|
9
|
+
list_resource('Report', params)
|
|
9
10
|
end
|
|
10
11
|
|
|
11
12
|
# GET /Report/{id} - Get a specific Report
|
|
12
|
-
def
|
|
13
|
-
get_resource(
|
|
13
|
+
def report(id, params = {})
|
|
14
|
+
get_resource('Report', id, params)
|
|
14
15
|
end
|
|
15
16
|
|
|
16
17
|
# POST /Report - Create a new Report
|
|
17
|
-
def
|
|
18
|
-
create_resource(
|
|
18
|
+
def create_report(data)
|
|
19
|
+
create_resource('Report', data)
|
|
19
20
|
end
|
|
20
21
|
|
|
21
22
|
# PUT /Report/{id} - Update a Report
|
|
22
|
-
def
|
|
23
|
-
update_resource(
|
|
23
|
+
def update_report(id, data)
|
|
24
|
+
update_resource('Report', id, data)
|
|
24
25
|
end
|
|
25
26
|
|
|
26
27
|
# DELETE /Report/{id} - Delete a Report
|
|
27
|
-
def
|
|
28
|
-
delete_resource(
|
|
28
|
+
def delete_report(id)
|
|
29
|
+
delete_resource('Report', id)
|
|
29
30
|
end
|
|
30
31
|
|
|
31
32
|
# GET /Report/Bookmark - Get Report bookmarks
|
|
32
33
|
def bookmarks(params = {})
|
|
33
|
-
get(resource_path(
|
|
34
|
+
get(resource_path('Report', nil, 'Bookmark'), params)
|
|
34
35
|
end
|
|
35
36
|
|
|
36
37
|
# POST /Report/Bookmark - Create Report bookmark
|
|
37
38
|
def create_bookmark(data)
|
|
38
|
-
post(resource_path(
|
|
39
|
+
post(resource_path('Report', nil, 'Bookmark'), data)
|
|
39
40
|
end
|
|
40
41
|
|
|
41
42
|
# POST /Report/createpdf - Create Report PDF
|
|
42
43
|
def create_pdf(data)
|
|
43
|
-
post(resource_path(
|
|
44
|
+
post(resource_path('Report', nil, 'createpdf'), data)
|
|
44
45
|
end
|
|
45
46
|
|
|
46
47
|
# POST /Report/print - Print Report
|
|
47
|
-
def
|
|
48
|
-
post(resource_path(
|
|
48
|
+
def print_report(data)
|
|
49
|
+
post(resource_path('Report', nil, 'print'), data)
|
|
49
50
|
end
|
|
50
51
|
|
|
51
52
|
# GET /ReportData/{publishedid} - Get Report data
|
|
52
53
|
def data(published_id, params = {})
|
|
53
|
-
get("
|
|
54
|
+
get("ReportData/#{published_id}", params)
|
|
54
55
|
end
|
|
55
56
|
|
|
56
57
|
# Report Repository methods
|
|
57
58
|
# GET /ReportRepository - List Report repositories
|
|
58
59
|
def repositories(params = {})
|
|
59
|
-
|
|
60
|
+
list_resource('ReportRepository', params)
|
|
60
61
|
end
|
|
61
62
|
|
|
62
63
|
# GET /ReportRepository/{id} - Get specific Report repository
|
|
63
64
|
def repository(id, params = {})
|
|
64
|
-
|
|
65
|
+
get_resource('ReportRepository', id, params)
|
|
65
66
|
end
|
|
66
67
|
|
|
67
68
|
# POST /ReportRepository - Create Report repository
|
|
68
69
|
def create_repository(data)
|
|
69
|
-
|
|
70
|
+
create_resource('ReportRepository', data)
|
|
70
71
|
end
|
|
71
72
|
|
|
72
73
|
# PUT /ReportRepository/{id} - Update Report repository
|
|
73
74
|
def update_repository(id, data)
|
|
74
|
-
|
|
75
|
+
update_resource('ReportRepository', id, data)
|
|
75
76
|
end
|
|
76
77
|
|
|
77
78
|
# DELETE /ReportRepository/{id} - Delete Report repository
|
|
78
79
|
def delete_repository(id)
|
|
79
|
-
|
|
80
|
+
delete_resource('ReportRepository', id)
|
|
80
81
|
end
|
|
81
82
|
|
|
82
83
|
# GET /ReportRepository/ReportCategories - Get Report categories
|
|
83
84
|
def categories(params = {})
|
|
84
|
-
get(
|
|
85
|
+
get('ReportRepository/ReportCategories', params)
|
|
85
86
|
end
|
|
86
87
|
end
|
|
87
88
|
end
|