samanage 2.1.15 → 2.1.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b3edf616c02a5a68065d36aa9cf44c2bb7eddec
4
- data.tar.gz: 36489fd9004eb8c220fc8a7eaf55dd6f1919ee46
3
+ metadata.gz: 3ba9d49fb26927fd2cf98b118da982990a5ffb64
4
+ data.tar.gz: 976b9b27dd7174d1b8e7d820d46c522122ad7aa3
5
5
  SHA512:
6
- metadata.gz: 06d6187866bf910eee253f3fa485f5b88239f8b700f2b0df0467c6de1436e6d4e8c191d3e0c884e357d59c86abc717926dd9d423a11bb6f194862592381913ac
7
- data.tar.gz: e0378296ebae937e9f6dd9b6e030341020f9ff2218e52841e9da330f585251ce7e44c6d9532aed11fee25ca663423bc5fbcad98a5af77036e7ef55c950db1467
6
+ metadata.gz: 9f99a5ba09aa8f979df8211a43449588ce94429abda7df8ecfe6f2126e7493c6ece8d8a965ee67be9e33ddd3cbd859bfc9935d63bfecb7173372204e3a214e9a
7
+ data.tar.gz: 64c92b5d364400c5ce6ded2c2d7b5c0f9056193aa0369daa40b5d35377500d6e33e7f4177f4ad4828fc4135180205a6a08b6d78d20cd545ccfab4cfb873c41bf
data/changelog.md CHANGED
@@ -1,3 +1,6 @@
1
+ ### 2.1.16
2
+ - Use options where callbacks could be sent
3
+
1
4
  ### 2.1.15
2
5
  - Use options in find methods
3
6
 
@@ -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
 
@@ -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
@@ -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
- self.execute(http_method: 'put', path: "users/#{user_id}.json?send_activation_email=1&add_callbacks=1")
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
@@ -1,3 +1,3 @@
1
1
  module Samanage
2
- VERSION = '2.1.15'
2
+ VERSION = '2.1.16'
3
3
  end
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.15
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-09 00:00:00.000000000 Z
11
+ date: 2019-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty