line-bot-api 1.14.1 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d265a003f523763063653537df89119ee79f3fc1c987640fbd78090d081045ca
4
- data.tar.gz: a5fd82fa00d302b4b804432b87fde84034492e7245a9665d4ab9f480a0fd12df
3
+ metadata.gz: a1352650b47d2d00a2d08061982b02c3489594f710c064bc06aebea8fc1bc4da
4
+ data.tar.gz: 3f74b50c38d6765d66800cfcf4558146bbb0dbce9225b4ecf5c4a81a686bd6d3
5
5
  SHA512:
6
- metadata.gz: 6d89224a7a2eae22ff20ff38e08d472d595500356b54c6836cdf0af9e7345edeb42c6a6fcfb3c4500402c76635cd8e4d3e932526a0718e403fc5fa2d858b2d48
7
- data.tar.gz: f2de6de836fa6f95a93f98acb88021a1206506dfebabd7f734c38747b6bbb141c59d3bebd6b7c2cc3743564dc498b929f700bdf33dada17d65a1953972dbe9eb
6
+ metadata.gz: 3de07c49edb984b2d362369c2e900b2c9d4dfd5b6399e9367cf6e14d46b4b343f07ef775aa785cc71d57db4af26eb22b27fcb0fe43c1ad160384011a9cd12c37
7
+ data.tar.gz: 31f1423914851cfbb501d24bb9f2ae6d6112880f1de5106649dc5eb1a6591a178afbc88a7c6a2cb5639594e2e954bad1a798fbb3fb957144e5fa6272a18d912a
@@ -15,7 +15,7 @@
15
15
  module Line
16
16
  module Bot
17
17
  module API
18
- VERSION = "1.14.1"
18
+ VERSION = "1.15.0"
19
19
  end
20
20
  end
21
21
  end
@@ -106,15 +106,16 @@ module Line
106
106
  #
107
107
  # @param user_id [String] User Id
108
108
  # @param messages [Hash or Array] Message Objects
109
+ # @param headers [Hash] HTTP Headers
109
110
  # @return [Net::HTTPResponse]
110
- def push_message(user_id, messages)
111
+ def push_message(user_id, messages, headers: {})
111
112
  channel_token_required
112
113
 
113
114
  messages = [messages] if messages.is_a?(Hash)
114
115
 
115
116
  endpoint_path = '/bot/message/push'
116
117
  payload = { to: user_id, messages: messages }.to_json
117
- post(endpoint, endpoint_path, payload, credentials)
118
+ post(endpoint, endpoint_path, payload, credentials.merge(headers))
118
119
  end
119
120
 
120
121
  # Reply messages to a user using replyToken.
@@ -151,8 +152,9 @@ module Line
151
152
  #
152
153
  # @param to [Array or String] Array of userIds
153
154
  # @param messages [Hash or Array] Message Objects
155
+ # @param headers [Hash] HTTP Headers
154
156
  # @return [Net::HTTPResponse]
155
- def multicast(to, messages)
157
+ def multicast(to, messages, headers: {})
156
158
  channel_token_required
157
159
 
158
160
  to = [to] if to.is_a?(String)
@@ -160,21 +162,23 @@ module Line
160
162
 
161
163
  endpoint_path = '/bot/message/multicast'
162
164
  payload = { to: to, messages: messages }.to_json
163
- post(endpoint, endpoint_path, payload, credentials)
165
+ post(endpoint, endpoint_path, payload, credentials.merge(headers))
164
166
  end
165
167
 
166
168
  # Send messages to all friends.
167
169
  #
168
170
  # @param messages [Hash or Array] Message Objects
171
+ # @param headers [Hash] HTTP Headers
172
+ #
169
173
  # @return [Net::HTTPResponse]
170
- def broadcast(messages)
174
+ def broadcast(messages, headers: {})
171
175
  channel_token_required
172
176
 
173
177
  messages = [messages] if messages.is_a?(Hash)
174
178
 
175
179
  endpoint_path = '/bot/message/broadcast'
176
180
  payload = { messages: messages }.to_json
177
- post(endpoint, endpoint_path, payload, credentials)
181
+ post(endpoint, endpoint_path, payload, credentials.merge(headers))
178
182
  end
179
183
 
180
184
  # Narrowcast messages to users
@@ -186,9 +190,10 @@ module Line
186
190
  # @param recipient [Hash]
187
191
  # @param filter [Hash]
188
192
  # @param limit [Hash]
193
+ # @param headers [Hash] HTTP Headers
189
194
  #
190
195
  # @return [Net::HTTPResponse]
191
- def narrowcast(messages, recipient: nil, filter: nil, limit: nil)
196
+ def narrowcast(messages, recipient: nil, filter: nil, limit: nil, headers: {})
192
197
  channel_token_required
193
198
 
194
199
  messages = [messages] if messages.is_a?(Hash)
@@ -200,7 +205,7 @@ module Line
200
205
  filter: filter,
201
206
  limit: limit
202
207
  }.to_json
203
- post(endpoint, endpoint_path, payload, credentials)
208
+ post(endpoint, endpoint_path, payload, credentials.merge(headers))
204
209
  end
205
210
 
206
211
  def leave_group(group_id)
@@ -295,6 +300,42 @@ module Line
295
300
  get(endpoint, endpoint_path, credentials)
296
301
  end
297
302
 
303
+ # Gets the group ID, group name, and group icon URL of a group where the LINE Official Account is a member.
304
+ #
305
+ # @param group_id [String] Group's identifier
306
+ #
307
+ # @return [Net::HTTPResponse]
308
+ def get_group_summary(group_id)
309
+ channel_token_required
310
+
311
+ endpoint_path = "/bot/group/#{group_id}/summary"
312
+ get(endpoint, endpoint_path, credentials)
313
+ end
314
+
315
+ # Gets the user IDs of the members of a group that the bot is in.
316
+ #
317
+ # @param group_id [String] Group's identifier
318
+ #
319
+ # @return [Net::HTTPResponse]
320
+ def get_group_members_count(group_id)
321
+ channel_token_required
322
+
323
+ endpoint_path = "/bot/group/#{group_id}/members/count"
324
+ get(endpoint, endpoint_path, credentials)
325
+ end
326
+
327
+ # Gets the count of members in a room.
328
+ #
329
+ # @param room_id [String] Room's identifier
330
+ #
331
+ # @return [Net::HTTPResponse]
332
+ def get_room_members_count(room_id)
333
+ channel_token_required
334
+
335
+ endpoint_path = "/bot/room/#{room_id}/members/count"
336
+ get(endpoint, endpoint_path, credentials)
337
+ end
338
+
298
339
  # Get a list of all uploaded rich menus
299
340
  #
300
341
  # @return [Net::HTTPResponse]
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.14.1
4
+ version: 1.15.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: 2020-04-06 00:00:00.000000000 Z
11
+ date: 2020-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable