line-bot-api 2.8.0 → 2.8.1
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 +4 -4
- data/lib/line/bot/v2/liff/api/liff_client.rb +6 -4
- data/lib/line/bot/v2/manage_audience/api/manage_audience_client.rb +12 -8
- data/lib/line/bot/v2/messaging_api/api/messaging_api_blob_client.rb +15 -10
- data/lib/line/bot/v2/messaging_api/api/messaging_api_client.rb +75 -51
- data/lib/line/bot/v2/module/api/line_module_client.rb +6 -4
- data/lib/line/bot/v2/utils.rb +25 -0
- data/lib/line/bot/version.rb +1 -1
- data/sig/line/bot/v2/utils.rbs +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6ad02a20005fee8a0e8d623b055e9e6f4990470078091977ff5fe975a859e648
|
|
4
|
+
data.tar.gz: 68f57f3c95489ed50f9b025360fb2a64405dd2007a713867a29b7d571d1e9438
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c619d6ee8fec6ce8414106ed4307efbdbb1b932a8bcb5de22a21d36e51dea1c4587ce8f9c3f31d0b0efb150896468c906b258f7b4ba594fd5399bc62e9a9c1f4
|
|
7
|
+
data.tar.gz: 1981d17b472554726c2855f8b2e89efadc015c5de854a001ca701d45b8ce5c23da0fd0d1733db59c3e16867e12bfb22afc88cbcadf6e93f077c369b9a4e9f460
|
|
@@ -115,8 +115,9 @@ module Line
|
|
|
115
115
|
def delete_liff_app_with_http_info(
|
|
116
116
|
liff_id:
|
|
117
117
|
)
|
|
118
|
-
path = "/liff/v1/apps/{liffId}"
|
|
119
|
-
|
|
118
|
+
path = Line::Bot::V2::Utils.build_path("/liff/v1/apps/{liffId}", {
|
|
119
|
+
"liffId": liff_id
|
|
120
|
+
})
|
|
120
121
|
|
|
121
122
|
response = @http_client.delete(
|
|
122
123
|
path: path,
|
|
@@ -221,8 +222,9 @@ module Line
|
|
|
221
222
|
liff_id:,
|
|
222
223
|
update_liff_app_request:
|
|
223
224
|
)
|
|
224
|
-
path = "/liff/v1/apps/{liffId}"
|
|
225
|
-
|
|
225
|
+
path = Line::Bot::V2::Utils.build_path("/liff/v1/apps/{liffId}", {
|
|
226
|
+
"liffId": liff_id
|
|
227
|
+
})
|
|
226
228
|
|
|
227
229
|
response = @http_client.put(
|
|
228
230
|
path: path,
|
|
@@ -247,8 +247,9 @@ module Line
|
|
|
247
247
|
def delete_audience_group_with_http_info(
|
|
248
248
|
audience_group_id:
|
|
249
249
|
)
|
|
250
|
-
path = "/v2/bot/audienceGroup/{audienceGroupId}"
|
|
251
|
-
|
|
250
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/audienceGroup/{audienceGroupId}", {
|
|
251
|
+
"audienceGroupId": audience_group_id
|
|
252
|
+
})
|
|
252
253
|
|
|
253
254
|
response = @http_client.delete(
|
|
254
255
|
path: path,
|
|
@@ -292,8 +293,9 @@ module Line
|
|
|
292
293
|
def get_audience_data_with_http_info(
|
|
293
294
|
audience_group_id:
|
|
294
295
|
)
|
|
295
|
-
path = "/v2/bot/audienceGroup/{audienceGroupId}"
|
|
296
|
-
|
|
296
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/audienceGroup/{audienceGroupId}", {
|
|
297
|
+
"audienceGroupId": audience_group_id
|
|
298
|
+
})
|
|
297
299
|
|
|
298
300
|
response = @http_client.get(
|
|
299
301
|
path: path,
|
|
@@ -432,8 +434,9 @@ module Line
|
|
|
432
434
|
def get_shared_audience_data_with_http_info(
|
|
433
435
|
audience_group_id:
|
|
434
436
|
)
|
|
435
|
-
path = "/v2/bot/audienceGroup/shared/{audienceGroupId}"
|
|
436
|
-
|
|
437
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/audienceGroup/shared/{audienceGroupId}", {
|
|
438
|
+
"audienceGroupId": audience_group_id
|
|
439
|
+
})
|
|
437
440
|
|
|
438
441
|
response = @http_client.get(
|
|
439
442
|
path: path,
|
|
@@ -573,8 +576,9 @@ module Line
|
|
|
573
576
|
audience_group_id:,
|
|
574
577
|
update_audience_group_description_request:
|
|
575
578
|
)
|
|
576
|
-
path = "/v2/bot/audienceGroup/{audienceGroupId}/updateDescription"
|
|
577
|
-
|
|
579
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/audienceGroup/{audienceGroupId}/updateDescription", {
|
|
580
|
+
"audienceGroupId": audience_group_id
|
|
581
|
+
})
|
|
578
582
|
|
|
579
583
|
response = @http_client.put(
|
|
580
584
|
path: path,
|
|
@@ -56,8 +56,9 @@ module Line
|
|
|
56
56
|
def get_message_content_with_http_info(
|
|
57
57
|
message_id:
|
|
58
58
|
)
|
|
59
|
-
path = "/v2/bot/message/{messageId}/content"
|
|
60
|
-
|
|
59
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/message/{messageId}/content", {
|
|
60
|
+
"messageId": message_id
|
|
61
|
+
})
|
|
61
62
|
|
|
62
63
|
response = @http_client.get(
|
|
63
64
|
path: path,
|
|
@@ -100,8 +101,9 @@ module Line
|
|
|
100
101
|
def get_message_content_preview_with_http_info(
|
|
101
102
|
message_id:
|
|
102
103
|
)
|
|
103
|
-
path = "/v2/bot/message/{messageId}/content/preview"
|
|
104
|
-
|
|
104
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/message/{messageId}/content/preview", {
|
|
105
|
+
"messageId": message_id
|
|
106
|
+
})
|
|
105
107
|
|
|
106
108
|
response = @http_client.get(
|
|
107
109
|
path: path,
|
|
@@ -144,8 +146,9 @@ module Line
|
|
|
144
146
|
def get_message_content_transcoding_by_message_id_with_http_info(
|
|
145
147
|
message_id:
|
|
146
148
|
)
|
|
147
|
-
path = "/v2/bot/message/{messageId}/content/transcoding"
|
|
148
|
-
|
|
149
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/message/{messageId}/content/transcoding", {
|
|
150
|
+
"messageId": message_id
|
|
151
|
+
})
|
|
149
152
|
|
|
150
153
|
response = @http_client.get(
|
|
151
154
|
path: path,
|
|
@@ -193,8 +196,9 @@ module Line
|
|
|
193
196
|
def get_rich_menu_image_with_http_info(
|
|
194
197
|
rich_menu_id:
|
|
195
198
|
)
|
|
196
|
-
path = "/v2/bot/richmenu/{richMenuId}/content"
|
|
197
|
-
|
|
199
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/richmenu/{richMenuId}/content", {
|
|
200
|
+
"richMenuId": rich_menu_id
|
|
201
|
+
})
|
|
198
202
|
|
|
199
203
|
response = @http_client.get(
|
|
200
204
|
path: path,
|
|
@@ -239,8 +243,9 @@ module Line
|
|
|
239
243
|
rich_menu_id:,
|
|
240
244
|
body:
|
|
241
245
|
)
|
|
242
|
-
path = "/v2/bot/richmenu/{richMenuId}/content"
|
|
243
|
-
|
|
246
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/richmenu/{richMenuId}/content", {
|
|
247
|
+
"richMenuId": rich_menu_id
|
|
248
|
+
})
|
|
244
249
|
|
|
245
250
|
response = @http_client.post(
|
|
246
251
|
path: path,
|
|
@@ -186,8 +186,9 @@ module Line
|
|
|
186
186
|
def close_coupon_with_http_info(
|
|
187
187
|
coupon_id:
|
|
188
188
|
)
|
|
189
|
-
path = "/v2/bot/coupon/{couponId}/close"
|
|
190
|
-
|
|
189
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/coupon/{couponId}/close", {
|
|
190
|
+
"couponId": coupon_id
|
|
191
|
+
})
|
|
191
192
|
|
|
192
193
|
response = @http_client.put(
|
|
193
194
|
path: path,
|
|
@@ -414,8 +415,9 @@ module Line
|
|
|
414
415
|
def delete_rich_menu_with_http_info(
|
|
415
416
|
rich_menu_id:
|
|
416
417
|
)
|
|
417
|
-
path = "/v2/bot/richmenu/{richMenuId}"
|
|
418
|
-
|
|
418
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/richmenu/{richMenuId}", {
|
|
419
|
+
"richMenuId": rich_menu_id
|
|
420
|
+
})
|
|
419
421
|
|
|
420
422
|
response = @http_client.delete(
|
|
421
423
|
path: path,
|
|
@@ -459,8 +461,9 @@ module Line
|
|
|
459
461
|
def delete_rich_menu_alias_with_http_info(
|
|
460
462
|
rich_menu_alias_id:
|
|
461
463
|
)
|
|
462
|
-
path = "/v2/bot/richmenu/alias/{richMenuAliasId}"
|
|
463
|
-
|
|
464
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/richmenu/alias/{richMenuAliasId}", {
|
|
465
|
+
"richMenuAliasId": rich_menu_alias_id
|
|
466
|
+
})
|
|
464
467
|
|
|
465
468
|
response = @http_client.delete(
|
|
466
469
|
path: path,
|
|
@@ -657,8 +660,9 @@ module Line
|
|
|
657
660
|
def get_coupon_detail_with_http_info(
|
|
658
661
|
coupon_id:
|
|
659
662
|
)
|
|
660
|
-
path = "/v2/bot/coupon/{couponId}"
|
|
661
|
-
|
|
663
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/coupon/{couponId}", {
|
|
664
|
+
"couponId": coupon_id
|
|
665
|
+
})
|
|
662
666
|
|
|
663
667
|
response = @http_client.get(
|
|
664
668
|
path: path,
|
|
@@ -823,8 +827,9 @@ module Line
|
|
|
823
827
|
def get_group_member_count_with_http_info(
|
|
824
828
|
group_id:
|
|
825
829
|
)
|
|
826
|
-
path = "/v2/bot/group/{groupId}/members/count"
|
|
827
|
-
|
|
830
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/group/{groupId}/members/count", {
|
|
831
|
+
"groupId": group_id
|
|
832
|
+
})
|
|
828
833
|
|
|
829
834
|
response = @http_client.get(
|
|
830
835
|
path: path,
|
|
@@ -874,9 +879,10 @@ module Line
|
|
|
874
879
|
group_id:,
|
|
875
880
|
user_id:
|
|
876
881
|
)
|
|
877
|
-
path = "/v2/bot/group/{groupId}/member/{userId}"
|
|
878
|
-
|
|
879
|
-
|
|
882
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/group/{groupId}/member/{userId}", {
|
|
883
|
+
"groupId": group_id,
|
|
884
|
+
"userId": user_id
|
|
885
|
+
})
|
|
880
886
|
|
|
881
887
|
response = @http_client.get(
|
|
882
888
|
path: path,
|
|
@@ -929,8 +935,9 @@ module Line
|
|
|
929
935
|
group_id:,
|
|
930
936
|
start: nil
|
|
931
937
|
)
|
|
932
|
-
path = "/v2/bot/group/{groupId}/members/ids"
|
|
933
|
-
|
|
938
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/group/{groupId}/members/ids", {
|
|
939
|
+
"groupId": group_id
|
|
940
|
+
})
|
|
934
941
|
query_params = {
|
|
935
942
|
"start": start
|
|
936
943
|
}.compact
|
|
@@ -985,8 +992,9 @@ module Line
|
|
|
985
992
|
def get_group_summary_with_http_info(
|
|
986
993
|
group_id:
|
|
987
994
|
)
|
|
988
|
-
path = "/v2/bot/group/{groupId}/summary"
|
|
989
|
-
|
|
995
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/group/{groupId}/summary", {
|
|
996
|
+
"groupId": group_id
|
|
997
|
+
})
|
|
990
998
|
|
|
991
999
|
response = @http_client.get(
|
|
992
1000
|
path: path,
|
|
@@ -1040,8 +1048,9 @@ module Line
|
|
|
1040
1048
|
start: nil,
|
|
1041
1049
|
limit: nil
|
|
1042
1050
|
)
|
|
1043
|
-
path = "/v2/bot/membership/{membershipId}/users/ids"
|
|
1044
|
-
|
|
1051
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/membership/{membershipId}/users/ids", {
|
|
1052
|
+
"membershipId": membership_id
|
|
1053
|
+
})
|
|
1045
1054
|
query_params = {
|
|
1046
1055
|
"start": start,
|
|
1047
1056
|
"limit": limit
|
|
@@ -1170,8 +1179,9 @@ module Line
|
|
|
1170
1179
|
def get_membership_subscription_with_http_info(
|
|
1171
1180
|
user_id:
|
|
1172
1181
|
)
|
|
1173
|
-
path = "/v2/bot/membership/subscription/{userId}"
|
|
1174
|
-
|
|
1182
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/membership/subscription/{userId}", {
|
|
1183
|
+
"userId": user_id
|
|
1184
|
+
})
|
|
1175
1185
|
|
|
1176
1186
|
response = @http_client.get(
|
|
1177
1187
|
path: path,
|
|
@@ -1633,8 +1643,9 @@ module Line
|
|
|
1633
1643
|
def get_profile_with_http_info(
|
|
1634
1644
|
user_id:
|
|
1635
1645
|
)
|
|
1636
|
-
path = "/v2/bot/profile/{userId}"
|
|
1637
|
-
|
|
1646
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/profile/{userId}", {
|
|
1647
|
+
"userId": user_id
|
|
1648
|
+
})
|
|
1638
1649
|
|
|
1639
1650
|
response = @http_client.get(
|
|
1640
1651
|
path: path,
|
|
@@ -1682,8 +1693,9 @@ module Line
|
|
|
1682
1693
|
def get_rich_menu_with_http_info(
|
|
1683
1694
|
rich_menu_id:
|
|
1684
1695
|
)
|
|
1685
|
-
path = "/v2/bot/richmenu/{richMenuId}"
|
|
1686
|
-
|
|
1696
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/richmenu/{richMenuId}", {
|
|
1697
|
+
"richMenuId": rich_menu_id
|
|
1698
|
+
})
|
|
1687
1699
|
|
|
1688
1700
|
response = @http_client.get(
|
|
1689
1701
|
path: path,
|
|
@@ -1731,8 +1743,9 @@ module Line
|
|
|
1731
1743
|
def get_rich_menu_alias_with_http_info(
|
|
1732
1744
|
rich_menu_alias_id:
|
|
1733
1745
|
)
|
|
1734
|
-
path = "/v2/bot/richmenu/alias/{richMenuAliasId}"
|
|
1735
|
-
|
|
1746
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/richmenu/alias/{richMenuAliasId}", {
|
|
1747
|
+
"richMenuAliasId": rich_menu_alias_id
|
|
1748
|
+
})
|
|
1736
1749
|
|
|
1737
1750
|
response = @http_client.get(
|
|
1738
1751
|
path: path,
|
|
@@ -1875,8 +1888,9 @@ module Line
|
|
|
1875
1888
|
def get_rich_menu_id_of_user_with_http_info(
|
|
1876
1889
|
user_id:
|
|
1877
1890
|
)
|
|
1878
|
-
path = "/v2/bot/user/{userId}/richmenu"
|
|
1879
|
-
|
|
1891
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/user/{userId}/richmenu", {
|
|
1892
|
+
"userId": user_id
|
|
1893
|
+
})
|
|
1880
1894
|
|
|
1881
1895
|
response = @http_client.get(
|
|
1882
1896
|
path: path,
|
|
@@ -1967,8 +1981,9 @@ module Line
|
|
|
1967
1981
|
def get_room_member_count_with_http_info(
|
|
1968
1982
|
room_id:
|
|
1969
1983
|
)
|
|
1970
|
-
path = "/v2/bot/room/{roomId}/members/count"
|
|
1971
|
-
|
|
1984
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/room/{roomId}/members/count", {
|
|
1985
|
+
"roomId": room_id
|
|
1986
|
+
})
|
|
1972
1987
|
|
|
1973
1988
|
response = @http_client.get(
|
|
1974
1989
|
path: path,
|
|
@@ -2018,9 +2033,10 @@ module Line
|
|
|
2018
2033
|
room_id:,
|
|
2019
2034
|
user_id:
|
|
2020
2035
|
)
|
|
2021
|
-
path = "/v2/bot/room/{roomId}/member/{userId}"
|
|
2022
|
-
|
|
2023
|
-
|
|
2036
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/room/{roomId}/member/{userId}", {
|
|
2037
|
+
"roomId": room_id,
|
|
2038
|
+
"userId": user_id
|
|
2039
|
+
})
|
|
2024
2040
|
|
|
2025
2041
|
response = @http_client.get(
|
|
2026
2042
|
path: path,
|
|
@@ -2073,8 +2089,9 @@ module Line
|
|
|
2073
2089
|
room_id:,
|
|
2074
2090
|
start: nil
|
|
2075
2091
|
)
|
|
2076
|
-
path = "/v2/bot/room/{roomId}/members/ids"
|
|
2077
|
-
|
|
2092
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/room/{roomId}/members/ids", {
|
|
2093
|
+
"roomId": room_id
|
|
2094
|
+
})
|
|
2078
2095
|
query_params = {
|
|
2079
2096
|
"start": start
|
|
2080
2097
|
}.compact
|
|
@@ -2172,8 +2189,9 @@ module Line
|
|
|
2172
2189
|
def issue_link_token_with_http_info(
|
|
2173
2190
|
user_id:
|
|
2174
2191
|
)
|
|
2175
|
-
path = "/v2/bot/user/{userId}/linkToken"
|
|
2176
|
-
|
|
2192
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/user/{userId}/linkToken", {
|
|
2193
|
+
"userId": user_id
|
|
2194
|
+
})
|
|
2177
2195
|
|
|
2178
2196
|
response = @http_client.post(
|
|
2179
2197
|
path: path,
|
|
@@ -2223,8 +2241,9 @@ module Line
|
|
|
2223
2241
|
def leave_group_with_http_info(
|
|
2224
2242
|
group_id:
|
|
2225
2243
|
)
|
|
2226
|
-
path = "/v2/bot/group/{groupId}/leave"
|
|
2227
|
-
|
|
2244
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/group/{groupId}/leave", {
|
|
2245
|
+
"groupId": group_id
|
|
2246
|
+
})
|
|
2228
2247
|
|
|
2229
2248
|
response = @http_client.post(
|
|
2230
2249
|
path: path,
|
|
@@ -2283,8 +2302,9 @@ module Line
|
|
|
2283
2302
|
def leave_room_with_http_info(
|
|
2284
2303
|
room_id:
|
|
2285
2304
|
)
|
|
2286
|
-
path = "/v2/bot/room/{roomId}/leave"
|
|
2287
|
-
|
|
2305
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/room/{roomId}/leave", {
|
|
2306
|
+
"roomId": room_id
|
|
2307
|
+
})
|
|
2288
2308
|
|
|
2289
2309
|
response = @http_client.post(
|
|
2290
2310
|
path: path,
|
|
@@ -2329,9 +2349,10 @@ module Line
|
|
|
2329
2349
|
user_id:,
|
|
2330
2350
|
rich_menu_id:
|
|
2331
2351
|
)
|
|
2332
|
-
path = "/v2/bot/user/{userId}/richmenu/{richMenuId}"
|
|
2333
|
-
|
|
2334
|
-
|
|
2352
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/user/{userId}/richmenu/{richMenuId}", {
|
|
2353
|
+
"userId": user_id,
|
|
2354
|
+
"richMenuId": rich_menu_id
|
|
2355
|
+
})
|
|
2335
2356
|
|
|
2336
2357
|
response = @http_client.post(
|
|
2337
2358
|
path: path,
|
|
@@ -3036,8 +3057,9 @@ module Line
|
|
|
3036
3057
|
def set_default_rich_menu_with_http_info(
|
|
3037
3058
|
rich_menu_id:
|
|
3038
3059
|
)
|
|
3039
|
-
path = "/v2/bot/user/all/richmenu/{richMenuId}"
|
|
3040
|
-
|
|
3060
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/user/all/richmenu/{richMenuId}", {
|
|
3061
|
+
"richMenuId": rich_menu_id
|
|
3062
|
+
})
|
|
3041
3063
|
|
|
3042
3064
|
response = @http_client.post(
|
|
3043
3065
|
path: path,
|
|
@@ -3226,8 +3248,9 @@ module Line
|
|
|
3226
3248
|
def unlink_rich_menu_id_from_user_with_http_info(
|
|
3227
3249
|
user_id:
|
|
3228
3250
|
)
|
|
3229
|
-
path = "/v2/bot/user/{userId}/richmenu"
|
|
3230
|
-
|
|
3251
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/user/{userId}/richmenu", {
|
|
3252
|
+
"userId": user_id
|
|
3253
|
+
})
|
|
3231
3254
|
|
|
3232
3255
|
response = @http_client.delete(
|
|
3233
3256
|
path: path,
|
|
@@ -3317,8 +3340,9 @@ module Line
|
|
|
3317
3340
|
rich_menu_alias_id:,
|
|
3318
3341
|
update_rich_menu_alias_request:
|
|
3319
3342
|
)
|
|
3320
|
-
path = "/v2/bot/richmenu/alias/{richMenuAliasId}"
|
|
3321
|
-
|
|
3343
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/richmenu/alias/{richMenuAliasId}", {
|
|
3344
|
+
"richMenuAliasId": rich_menu_alias_id
|
|
3345
|
+
})
|
|
3322
3346
|
|
|
3323
3347
|
response = @http_client.post(
|
|
3324
3348
|
path: path,
|
|
@@ -58,8 +58,9 @@ module Line
|
|
|
58
58
|
chat_id:,
|
|
59
59
|
acquire_chat_control_request: nil
|
|
60
60
|
)
|
|
61
|
-
path = "/v2/bot/chat/{chatId}/control/acquire"
|
|
62
|
-
|
|
61
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/chat/{chatId}/control/acquire", {
|
|
62
|
+
"chatId": chat_id
|
|
63
|
+
})
|
|
63
64
|
|
|
64
65
|
response = @http_client.post(
|
|
65
66
|
path: path,
|
|
@@ -208,8 +209,9 @@ module Line
|
|
|
208
209
|
def release_chat_control_with_http_info(
|
|
209
210
|
chat_id:
|
|
210
211
|
)
|
|
211
|
-
path = "/v2/bot/chat/{chatId}/control/release"
|
|
212
|
-
|
|
212
|
+
path = Line::Bot::V2::Utils.build_path("/v2/bot/chat/{chatId}/control/release", {
|
|
213
|
+
"chatId": chat_id
|
|
214
|
+
})
|
|
213
215
|
|
|
214
216
|
response = @http_client.post(
|
|
215
217
|
path: path,
|
data/lib/line/bot/v2/utils.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'uri'
|
|
2
|
+
|
|
1
3
|
module Line
|
|
2
4
|
module Bot
|
|
3
5
|
module V2
|
|
@@ -8,6 +10,29 @@ module Line
|
|
|
8
10
|
# breaking change that does not allow Hash requests will be necessary.
|
|
9
11
|
NO_CAMELIZE_PARENT_KEYS = %w(substitution).freeze
|
|
10
12
|
|
|
13
|
+
# Matches a path that contains a "." or ".." segment (literal or percent-encoded),
|
|
14
|
+
# so a path parameter cannot escape its endpoint. See square/retrofit's RequestBuilder for the same idea.
|
|
15
|
+
PATH_TRAVERSAL = %r{\A(?:.*/)?(?:\.|%2e|%2E){1,2}(?:/.*)?\z}.freeze
|
|
16
|
+
|
|
17
|
+
# NOTE: line-bot-sdk-ruby users should not use this. Breaking changes may occur, so use at your own risk.
|
|
18
|
+
#
|
|
19
|
+
# Substitutes path parameters into a path template and rejects any
|
|
20
|
+
# result that would let a parameter perform path traversal.
|
|
21
|
+
def self.build_path(path_template, params)
|
|
22
|
+
path = path_template
|
|
23
|
+
params.each do |name, value|
|
|
24
|
+
raise ArgumentError, "#{name} is required" if value.nil?
|
|
25
|
+
|
|
26
|
+
path = path.gsub("{#{name}}", URI.encode_uri_component(value.to_s))
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
if PATH_TRAVERSAL.match?(path)
|
|
30
|
+
raise ArgumentError, "Path parameters shouldn't perform path traversal ('.' or '..'): #{path}"
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
path
|
|
34
|
+
end
|
|
35
|
+
|
|
11
36
|
# NOTE: line-bot-sdk-ruby users should not use this. Breaking changes may occur, so use at your own risk.
|
|
12
37
|
def self.deep_underscore(hash)
|
|
13
38
|
hash.each_with_object({}) do |(key, value), result| # steep:ignore UnannotatedEmptyCollection
|
data/lib/line/bot/version.rb
CHANGED
data/sig/line/bot/v2/utils.rbs
CHANGED
|
@@ -4,6 +4,10 @@ module Line
|
|
|
4
4
|
module Utils
|
|
5
5
|
NO_CAMELIZE_PARENT_KEYS: Array[String]
|
|
6
6
|
|
|
7
|
+
PATH_TRAVERSAL: Regexp
|
|
8
|
+
|
|
9
|
+
def self.build_path: (String, Hash[Symbol, untyped]) -> String
|
|
10
|
+
|
|
7
11
|
def self.deep_underscore: (Hash[untyped, untyped]) -> Hash[Symbol, untyped]
|
|
8
12
|
|
|
9
13
|
def self.deep_symbolize: (untyped) -> untyped
|