panoptes-client 0.2.4 → 0.2.5

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: 06b43114723894cc1ec09a791758625db2e642a9
4
- data.tar.gz: e166ca0779531c6bbb1935cea63c2231259c331a
3
+ metadata.gz: c9093577357d957e9de91f8cf05a4bc4a545ae13
4
+ data.tar.gz: f9be472c1e3558ef8d8f2d380f715b22a968fd0b
5
5
  SHA512:
6
- metadata.gz: 196a96b8cf3bb082aaf1f3b6caba894a4438061d1c9d7159a75f72757ceb47bf6164fa79e3d6ad6db597aaabca2eed740e2a430681ba5b985f3f92a0e722656d
7
- data.tar.gz: 193a6c461059bf56473ec15d6b276c39d63e9992c7c31f4a5503394da387e0db21b33c34413191828c0f06b4d290023551c491a5838adaf2cfef200edb2ef8fb
6
+ metadata.gz: 0adbd891e129ceacbc55b061e65cc5c63d532e0647d0fc6250c76d52a2a635c5aa7431ca5994bf34b1220417f530288306ccc3f25dcbedb92d3ed0dee522eec8
7
+ data.tar.gz: 70b9a45e53f6788fcfb47948800cd4861cd0996935036012a031bb8fda2cb90c3d44f64e76a801f0de0973b910fe89e2d9cae8be558e84d20ab121be0b966d9d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.2.5
2
+
3
+ * Add `client.remove_user_from_user_group` that can be used by group admins to remove some other user from a group.
4
+ * Add `client.delete_user_group` to remove a user group.
5
+
1
6
  # 0.2.4
2
7
 
3
8
  * Add support for the new retirement reason field
@@ -63,8 +63,11 @@ module Panoptes
63
63
  handle_response(response)
64
64
  end
65
65
 
66
- def delete(path, query = {})
67
- response = conn.delete("/api" + path, query)
66
+ def delete(path, query = {}, etag: nil)
67
+ headers = {}
68
+ headers["If-Match"] = etag if etag
69
+
70
+ response = conn.delete("/api" + path, query, headers)
68
71
  handle_response(response)
69
72
  end
70
73
 
@@ -22,6 +22,17 @@ module Panoptes
22
22
  links: {user: user_id, user_group: user_group_id}
23
23
  })["memberships"][0]
24
24
  end
25
+
26
+ def remove_user_from_user_group(user_group_id, user_id)
27
+ delete("/user_groups/#{user_group_id}/links/users/#{user_id}")
28
+ end
29
+
30
+ def delete_user_group(user_group_id)
31
+ response = conn.get("/api/user_groups/#{user_group_id}")
32
+ etag = response.headers["ETag"]
33
+
34
+ delete("/user_groups/#{user_group_id}", {}, etag: etag)
35
+ end
25
36
  end
26
37
  end
27
38
  end
@@ -1,5 +1,5 @@
1
1
  module Panoptes
2
2
  class Client
3
- VERSION = "0.2.4"
3
+ VERSION = "0.2.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: panoptes-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Veldthuis
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-11 00:00:00.000000000 Z
11
+ date: 2016-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday