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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e0107481c67d6f6f360101945ea31fa81311d557abb6553141a14a06144f747
4
- data.tar.gz: 39c27282633be8b12ba7c7e3b8b4888246042b5a4c3506b9ab0c4a03ebfea683
3
+ metadata.gz: 27601340df6db4d70b171347203e9f89a3de4d2b47435dc114d6ee3a9dda7a48
4
+ data.tar.gz: 585c5e7f9a6a314f35764b3da2999841f8df0bce1cd17057682cba6dd7dc4547
5
5
  SHA512:
6
- metadata.gz: 16e420b314676e467056e598f2aff9073ddd20e1f1498d260d2ba661e7e1f24394b13bb18cf2da8543633b316e51920e76577b5dc16bc3c90ca914d09f3e2d39
7
- data.tar.gz: c357c754cd5d06c7c1af231360030bd955305bc830cb9ce2694f21e99f963dc3eb051bc926329f7004a92d95557639f1eba434f89b82bffe6bf40a336841f1ba
6
+ metadata.gz: 566dabb5840c873d12d6e1bb7652ca8491c1efeb6488d54649a9ebb60d7ea871a5cc1d6195d14bd9540cbe6ed2293c97d373d1a3267fd75c1f5611d5d0ea770c
7
+ data.tar.gz: 7388c6263391816f4f0712db155f062a2331e35f62d9702c91eea1b7ccc7b808fba39f56af327e1f0d582887bb814b564daff9ee957c5b4e98005042c99795f7
@@ -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
- If 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://feedback.line.me/enquete/public/919-h9Yqmr1u). Please
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).
@@ -15,7 +15,7 @@
15
15
  module Line
16
16
  module Bot
17
17
  module API
18
- VERSION = "1.3.0"
18
+ VERSION = "1.4.0"
19
19
  end
20
20
  end
21
21
  end
@@ -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.3.0
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: 2018-10-09 00:00:00.000000000 Z
11
+ date: 2019-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable