samanage 2.1.15 → 2.1.16
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 +3 -0
- data/lib/samanage/api/category.rb +3 -3
- data/lib/samanage/api/incidents.rb +3 -3
- data/lib/samanage/api/users.rb +1 -1
- data/lib/samanage/api/utils.rb +6 -2
- data/lib/samanage/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3ba9d49fb26927fd2cf98b118da982990a5ffb64
|
|
4
|
+
data.tar.gz: 976b9b27dd7174d1b8e7d820d46c522122ad7aa3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9f99a5ba09aa8f979df8211a43449588ce94429abda7df8ecfe6f2126e7493c6ece8d8a965ee67be9e33ddd3cbd859bfc9935d63bfecb7173372204e3a214e9a
|
|
7
|
+
data.tar.gz: 64c92b5d364400c5ce6ded2c2d7b5c0f9056193aa0369daa40b5d35377500d6e33e7f4177f4ad4828fc4135180205a6a08b6d78d20cd545ccfab4cfb873c41bf
|
data/changelog.md
CHANGED
|
@@ -9,16 +9,16 @@ module Samanage
|
|
|
9
9
|
# Samanage categories are not paginated
|
|
10
10
|
# - to break into subcategories, add
|
|
11
11
|
def collect_categories(options: {})
|
|
12
|
-
request = self.execute(http_method: 'get', path: "categories.json")
|
|
12
|
+
request = self.execute(http_method: 'get', path: "categories.json", options: options)
|
|
13
13
|
request[:data]
|
|
14
14
|
end
|
|
15
15
|
|
|
16
16
|
def create_category(payload: nil, options: {})
|
|
17
|
-
self.execute(path: PATHS[:category], http_method: 'post', payload: payload)
|
|
17
|
+
self.execute(path: PATHS[:category], http_method: 'post', payload: payload, options: options)
|
|
18
18
|
end
|
|
19
19
|
|
|
20
20
|
def delete_category(id: )
|
|
21
|
-
self.execute(path: "categories/#{id}", http_method: 'delete')
|
|
21
|
+
self.execute(path: "categories/#{id}", http_method: 'delete', options: options)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
alias_method :categories, :collect_categories
|
|
@@ -51,7 +51,7 @@ module Samanage
|
|
|
51
51
|
|
|
52
52
|
# Create an incident given json
|
|
53
53
|
def create_incident(payload: nil, options: {})
|
|
54
|
-
self.execute(path: PATHS[:incident], http_method: 'post', payload: payload)
|
|
54
|
+
self.execute(path: PATHS[:incident], http_method: 'post', payload: payload, options: options)
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
# Find incident by ID
|
|
@@ -69,8 +69,8 @@ module Samanage
|
|
|
69
69
|
self.execute(path: path, http_method: 'put', payload: payload, options: options)
|
|
70
70
|
end
|
|
71
71
|
|
|
72
|
-
def delete_incident(id: )
|
|
73
|
-
self.execute(path: "incidents/#{id}.json", http_method: 'delete')
|
|
72
|
+
def delete_incident(id: , options: {})
|
|
73
|
+
self.execute(path: "incidents/#{id}.json", http_method: 'delete', options: options)
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
|
data/lib/samanage/api/users.rb
CHANGED
|
@@ -30,7 +30,7 @@ module Samanage
|
|
|
30
30
|
|
|
31
31
|
# Create user given JSON
|
|
32
32
|
def create_user(payload: , options: {})
|
|
33
|
-
self.execute(path: PATHS[:user], http_method: 'post', payload: payload)
|
|
33
|
+
self.execute(path: PATHS[:user], http_method: 'post', payload: payload, options: options)
|
|
34
34
|
end
|
|
35
35
|
|
|
36
36
|
# Return user by ID
|
data/lib/samanage/api/utils.rb
CHANGED
|
@@ -7,7 +7,11 @@ module Samanage
|
|
|
7
7
|
def send_activation_email(email: )
|
|
8
8
|
user_id = self.find_user_id_by_email(email: email)
|
|
9
9
|
raise Samanage::Error.new(error: 'Invalid Email', response: {}) unless user_id
|
|
10
|
-
|
|
10
|
+
options = {
|
|
11
|
+
send_activation_email: 1,
|
|
12
|
+
add_callbacks: 1
|
|
13
|
+
}
|
|
14
|
+
self.execute(http_method: 'put', path: "users/#{user_id}.json", options: options)
|
|
11
15
|
end
|
|
12
16
|
|
|
13
17
|
def find_name_from_group_id(group_id: )
|
|
@@ -15,7 +19,7 @@ module Samanage
|
|
|
15
19
|
begin
|
|
16
20
|
self.find_group(id: group_id).to_h.dig(:data,'name')
|
|
17
21
|
rescue => e
|
|
18
|
-
return "Unable to find user for group id #{group_id}"
|
|
22
|
+
return "[#{e.class}]: #{e.inspect} Unable to find user for group id #{group_id}"
|
|
19
23
|
end
|
|
20
24
|
end
|
|
21
25
|
end
|
data/lib/samanage/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: samanage
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.
|
|
4
|
+
version: 2.1.16
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Walls
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-05-
|
|
11
|
+
date: 2019-05-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: httparty
|