line-bot-api 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +3 -3
- data/lib/line/bot/api/version.rb +1 -1
- data/lib/line/bot/client.rb +47 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 27601340df6db4d70b171347203e9f89a3de4d2b47435dc114d6ee3a9dda7a48
|
4
|
+
data.tar.gz: 585c5e7f9a6a314f35764b3da2999841f8df0bce1cd17057682cba6dd7dc4547
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 566dabb5840c873d12d6e1bb7652ca8491c1efeb6488d54649a9ebb60d7ea871a5cc1d6195d14bd9540cbe6ed2293c97d373d1a3267fd75c1f5611d5d0ea770c
|
7
|
+
data.tar.gz: 7388c6263391816f4f0712db155f062a2331e35f62d9702c91eea1b7ccc7b808fba39f56af327e1f0d582887bb814b564daff9ee957c5b4e98005042c99795f7
|
data/CONTRIBUTING.md
CHANGED
@@ -10,6 +10,6 @@ source projects you are aware of. It will be amazing if you could help us by doi
|
|
10
10
|
|
11
11
|
### Contributor license agreement
|
12
12
|
|
13
|
-
|
14
|
-
[the ICLA (individual contributor license agreement)](https://
|
15
|
-
contact us if you need the CCLA (corporate contributor license agreement).
|
13
|
+
When you are sending a pull request and it's a non-trivial change beyond fixing typos, please make sure to sign
|
14
|
+
[the ICLA (individual contributor license agreement)](https://cla-assistant.io/line/line-bot-sdk-ruby). Please
|
15
|
+
[contact us](mailto:dl_oss_dev@linecorp.com) if you need the CCLA (corporate contributor license agreement).
|
data/lib/line/bot/api/version.rb
CHANGED
data/lib/line/bot/client.rb
CHANGED
@@ -280,6 +280,24 @@ module Line
|
|
280
280
|
get(endpoint_path)
|
281
281
|
end
|
282
282
|
|
283
|
+
# Set default rich menu (Link a rich menu to all user)
|
284
|
+
#
|
285
|
+
# @param rich_menu_id [String] ID of an uploaded rich menu
|
286
|
+
#
|
287
|
+
# @return [Net::HTTPResponse]
|
288
|
+
def set_default_rich_menu(rich_menu_id)
|
289
|
+
endpoint_path = "/bot/user/all/richmenu/#{rich_menu_id}"
|
290
|
+
post(endpoint_path)
|
291
|
+
end
|
292
|
+
|
293
|
+
# Unset default rich menu (Unlink a rich menu from all user)
|
294
|
+
#
|
295
|
+
# @return [Net::HTTPResponse]
|
296
|
+
def unset_default_rich_menu
|
297
|
+
endpoint_path = "/bot/user/all/richmenu"
|
298
|
+
delete(endpoint_path)
|
299
|
+
end
|
300
|
+
|
283
301
|
# Link a rich menu to a user
|
284
302
|
#
|
285
303
|
# @param user_id [String] ID of the user
|
@@ -335,6 +353,16 @@ module Line
|
|
335
353
|
request.post
|
336
354
|
end
|
337
355
|
|
356
|
+
# Issue a link token to a user
|
357
|
+
#
|
358
|
+
# @param user_id [String] ID of the user
|
359
|
+
#
|
360
|
+
# @return [Net::HTTPResponse]
|
361
|
+
def create_link_token(user_id)
|
362
|
+
endpoint_path = "/bot/user/#{user_id}/linkToken"
|
363
|
+
post(endpoint_path)
|
364
|
+
end
|
365
|
+
|
338
366
|
# Fetch data, get content of specified URL.
|
339
367
|
#
|
340
368
|
# @param endpoint_path [String]
|
@@ -353,6 +381,25 @@ module Line
|
|
353
381
|
request.get
|
354
382
|
end
|
355
383
|
|
384
|
+
# Post data, get content of specified URL.
|
385
|
+
#
|
386
|
+
# @param endpoint_path [String]
|
387
|
+
#
|
388
|
+
# @return [Net::HTTPResponse]
|
389
|
+
def post(endpoint_path, payload = nil)
|
390
|
+
raise Line::Bot::API::InvalidCredentialsError, 'Invalidates credentials' unless credentials?
|
391
|
+
|
392
|
+
request = Request.new do |config|
|
393
|
+
config.httpclient = httpclient
|
394
|
+
config.endpoint = endpoint
|
395
|
+
config.endpoint_path = endpoint_path
|
396
|
+
config.credentials = credentials
|
397
|
+
config.payload = payload if payload
|
398
|
+
end
|
399
|
+
|
400
|
+
request.post
|
401
|
+
end
|
402
|
+
|
356
403
|
# Delete content of specified URL.
|
357
404
|
#
|
358
405
|
# @param endpoint_path [String]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: line-bot-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LINE Corporation
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|