glip_sdk 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/README.md +19 -1
- data/lib/glip_sdk/rest/groups.rb +2 -2
- data/lib/glip_sdk.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39fe36f20b9679fe0be808b0bdcc0956539fe1c1
|
4
|
+
data.tar.gz: 7e520d28b9a5cee605acbed7aa436e343c3b4543
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfc192286f79c525fe39938df701a66e6207252326c6fda855acb4fcc2a985bea5ef569ff3437fa8fb1f0bd15a5cbc18d278c945d7405d2ef8172e4352ef7c31
|
7
|
+
data.tar.gz: 90bc5d7bf529b8d015fab991994f110cd91b828aed91bf8a5219ba83d27884e81f5dfc6a32ea50f5481e94ed0e7e911bfe9e4e137acc649416b0bd32906227c3
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -20,7 +20,25 @@ More documentation will be added soon. For now see the example and SDK code.
|
|
20
20
|
```ruby
|
21
21
|
rc_sdk = RingCentralSdk::REST::Client.new [...]
|
22
22
|
glip = GlipSdk::REST::Client.new rc_sdk
|
23
|
-
|
23
|
+
|
24
|
+
# For HTTP calls, params are the same as REST API, e.g. camelCase
|
25
|
+
res = glip.posts.post groupId: '12345', text: 'Hi there!'
|
26
|
+
|
27
|
+
# Get all groups will successfully call `prevPageToken` as provided
|
28
|
+
# All params can be provided:
|
29
|
+
groups = glip.groups.all_groups
|
30
|
+
groups = glip.groups.all_groups type: 'Group'
|
31
|
+
groups = glip.groups.all_groups type: 'Team'
|
32
|
+
|
33
|
+
# Subscribe for updates
|
34
|
+
class MyObserver
|
35
|
+
def update(message)
|
36
|
+
puts 'received message'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
glip.groups.observer MyObserver.new
|
41
|
+
glip.posts.observer MyObserver.new
|
24
42
|
```
|
25
43
|
|
26
44
|
## Example Scripts
|
data/lib/glip_sdk/rest/groups.rb
CHANGED
@@ -24,7 +24,7 @@ module GlipSdk
|
|
24
24
|
def all_groups(params = {})
|
25
25
|
groups = []
|
26
26
|
get_next = true
|
27
|
-
while get_next
|
27
|
+
while get_next
|
28
28
|
res = get params
|
29
29
|
groups.concat(res.body['records']) if res.body['records'].length > 0
|
30
30
|
|
@@ -35,7 +35,7 @@ module GlipSdk
|
|
35
35
|
get_next = false
|
36
36
|
end
|
37
37
|
end
|
38
|
-
|
38
|
+
groups
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
data/lib/glip_sdk.rb
CHANGED