UNPKG

67.4 kBJavaScriptView Raw
1"use strict";
2/**
3 * LINE Messaging API
4 * This document describes LINE Messaging API.
5 *
6 * The version of the OpenAPI document: 0.0.1
7 *
8 *
9 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
10 * https://openapi-generator.tech
11 * Do not edit the class manually.
12 */
13Object.defineProperty(exports, "__esModule", { value: true });
14exports.MessagingApiClient = void 0;
15const Types = require("../../types");
16const http_fetch_1 = require("../../http-fetch");
17class MessagingApiClient {
18 constructor(config) {
19 if (!config.baseURL) {
20 config.baseURL = "https://api.line.me";
21 }
22 this.httpClient = new http_fetch_1.default({
23 defaultHeaders: {
24 Authorization: "Bearer " + config.channelAccessToken,
25 },
26 baseURL: config.baseURL,
27 });
28 }
29 async parseHTTPResponse(response) {
30 const { LINE_REQUEST_ID_HTTP_HEADER_NAME } = Types;
31 let resBody = Object.assign({}, (await response.json()));
32 if (response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME)) {
33 resBody[LINE_REQUEST_ID_HTTP_HEADER_NAME] = response.headers.get(LINE_REQUEST_ID_HTTP_HEADER_NAME);
34 }
35 return resBody;
36 }
37 /**
38 * Send a message using phone number
39 * @param audienceMatchMessagesRequest
40 *
41 * @see <a href="https://developers.line.biz/en/reference/partner-docs/#phone-audience-match"> Documentation</a>
42 */
43 async audienceMatch(audienceMatchMessagesRequest) {
44 return (await this.audienceMatchWithHttpInfo(audienceMatchMessagesRequest))
45 .body;
46 }
47 /**
48 * Send a message using phone number.
49 * This method includes HttpInfo object to return additional information.
50 * @param audienceMatchMessagesRequest
51 *
52 * @see <a href="https://developers.line.biz/en/reference/partner-docs/#phone-audience-match"> Documentation</a>
53 */
54 async audienceMatchWithHttpInfo(audienceMatchMessagesRequest) {
55 const params = audienceMatchMessagesRequest;
56 const res = await this.httpClient.post("/bot/ad/multicast/phone", params);
57 return { httpResponse: res, body: await res.json() };
58 }
59 /**
60 * Sends a message to multiple users at any time.
61 * @param broadcastRequest
62 * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key.
63 *
64 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#send-broadcast-message"> Documentation</a>
65 */
66 async broadcast(broadcastRequest, xLineRetryKey) {
67 return (await this.broadcastWithHttpInfo(broadcastRequest, xLineRetryKey))
68 .body;
69 }
70 /**
71 * Sends a message to multiple users at any time..
72 * This method includes HttpInfo object to return additional information.
73 * @param broadcastRequest
74 * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key.
75 *
76 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#send-broadcast-message"> Documentation</a>
77 */
78 async broadcastWithHttpInfo(broadcastRequest, xLineRetryKey) {
79 const params = broadcastRequest;
80 const headerParams = Object.assign({}, (xLineRetryKey != null ? { "X-Line-Retry-Key": xLineRetryKey } : {}));
81 const res = await this.httpClient.post("/v2/bot/message/broadcast", params, { headers: headerParams });
82 return { httpResponse: res, body: await res.json() };
83 }
84 /**
85 * Cancel default rich menu
86 *
87 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#cancel-default-rich-menu"> Documentation</a>
88 */
89 async cancelDefaultRichMenu() {
90 return (await this.cancelDefaultRichMenuWithHttpInfo()).body;
91 }
92 /**
93 * Cancel default rich menu.
94 * This method includes HttpInfo object to return additional information.
95 *
96 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#cancel-default-rich-menu"> Documentation</a>
97 */
98 async cancelDefaultRichMenuWithHttpInfo() {
99 const res = await this.httpClient.delete("/v2/bot/user/all/richmenu");
100 return { httpResponse: res, body: await res.json() };
101 }
102 /**
103 * Create rich menu
104 * @param richMenuRequest
105 *
106 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-rich-menu"> Documentation</a>
107 */
108 async createRichMenu(richMenuRequest) {
109 return (await this.createRichMenuWithHttpInfo(richMenuRequest)).body;
110 }
111 /**
112 * Create rich menu.
113 * This method includes HttpInfo object to return additional information.
114 * @param richMenuRequest
115 *
116 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-rich-menu"> Documentation</a>
117 */
118 async createRichMenuWithHttpInfo(richMenuRequest) {
119 const params = richMenuRequest;
120 const res = await this.httpClient.post("/v2/bot/richmenu", params);
121 return { httpResponse: res, body: await res.json() };
122 }
123 /**
124 * Create rich menu alias
125 * @param createRichMenuAliasRequest
126 *
127 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-rich-menu-alias"> Documentation</a>
128 */
129 async createRichMenuAlias(createRichMenuAliasRequest) {
130 return (await this.createRichMenuAliasWithHttpInfo(createRichMenuAliasRequest)).body;
131 }
132 /**
133 * Create rich menu alias.
134 * This method includes HttpInfo object to return additional information.
135 * @param createRichMenuAliasRequest
136 *
137 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-rich-menu-alias"> Documentation</a>
138 */
139 async createRichMenuAliasWithHttpInfo(createRichMenuAliasRequest) {
140 const params = createRichMenuAliasRequest;
141 const res = await this.httpClient.post("/v2/bot/richmenu/alias", params);
142 return { httpResponse: res, body: await res.json() };
143 }
144 /**
145 * Deletes a rich menu.
146 * @param richMenuId ID of a rich menu
147 *
148 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#delete-rich-menu"> Documentation</a>
149 */
150 async deleteRichMenu(richMenuId) {
151 return (await this.deleteRichMenuWithHttpInfo(richMenuId)).body;
152 }
153 /**
154 * Deletes a rich menu..
155 * This method includes HttpInfo object to return additional information.
156 * @param richMenuId ID of a rich menu
157 *
158 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#delete-rich-menu"> Documentation</a>
159 */
160 async deleteRichMenuWithHttpInfo(richMenuId) {
161 const res = await this.httpClient.delete("/v2/bot/richmenu/{richMenuId}".replace("{richMenuId}", String(richMenuId)));
162 return { httpResponse: res, body: await res.json() };
163 }
164 /**
165 * Delete rich menu alias
166 * @param richMenuAliasId Rich menu alias ID that you want to delete.
167 *
168 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#delete-rich-menu-alias"> Documentation</a>
169 */
170 async deleteRichMenuAlias(richMenuAliasId) {
171 return (await this.deleteRichMenuAliasWithHttpInfo(richMenuAliasId)).body;
172 }
173 /**
174 * Delete rich menu alias.
175 * This method includes HttpInfo object to return additional information.
176 * @param richMenuAliasId Rich menu alias ID that you want to delete.
177 *
178 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#delete-rich-menu-alias"> Documentation</a>
179 */
180 async deleteRichMenuAliasWithHttpInfo(richMenuAliasId) {
181 const res = await this.httpClient.delete("/v2/bot/richmenu/alias/{richMenuAliasId}".replace("{richMenuAliasId}", String(richMenuAliasId)));
182 return { httpResponse: res, body: await res.json() };
183 }
184 /**
185 * Get result of message delivery using phone number
186 * @param date Date the message was sent Format: `yyyyMMdd` (e.g. `20190831`) Time Zone: UTC+9
187 *
188 * @see <a href="https://developers.line.biz/en/reference/partner-docs/#get-phone-audience-match"> Documentation</a>
189 */
190 async getAdPhoneMessageStatistics(date) {
191 return (await this.getAdPhoneMessageStatisticsWithHttpInfo(date)).body;
192 }
193 /**
194 * Get result of message delivery using phone number.
195 * This method includes HttpInfo object to return additional information.
196 * @param date Date the message was sent Format: `yyyyMMdd` (e.g. `20190831`) Time Zone: UTC+9
197 *
198 * @see <a href="https://developers.line.biz/en/reference/partner-docs/#get-phone-audience-match"> Documentation</a>
199 */
200 async getAdPhoneMessageStatisticsWithHttpInfo(date) {
201 const queryParams = {
202 date: date,
203 };
204 Object.keys(queryParams).forEach((key) => {
205 if (queryParams[key] === undefined) {
206 delete queryParams[key];
207 }
208 });
209 const res = await this.httpClient.get("/v2/bot/message/delivery/ad_phone", queryParams);
210 return { httpResponse: res, body: await res.json() };
211 }
212 /**
213 * Get name list of units used this month
214 * @param limit The maximum number of aggregation units you can get per request.
215 * @param start Value of the continuation token found in the next property of the JSON object returned in the response. If you can\'t get all the aggregation units in one request, include this parameter to get the remaining array.
216 *
217 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-name-list-of-units-used-this-month"> Documentation</a>
218 */
219 async getAggregationUnitNameList(limit, start) {
220 return (await this.getAggregationUnitNameListWithHttpInfo(limit, start))
221 .body;
222 }
223 /**
224 * Get name list of units used this month.
225 * This method includes HttpInfo object to return additional information.
226 * @param limit The maximum number of aggregation units you can get per request.
227 * @param start Value of the continuation token found in the next property of the JSON object returned in the response. If you can\'t get all the aggregation units in one request, include this parameter to get the remaining array.
228 *
229 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-name-list-of-units-used-this-month"> Documentation</a>
230 */
231 async getAggregationUnitNameListWithHttpInfo(limit, start) {
232 const queryParams = {
233 limit: limit,
234 start: start,
235 };
236 Object.keys(queryParams).forEach((key) => {
237 if (queryParams[key] === undefined) {
238 delete queryParams[key];
239 }
240 });
241 const res = await this.httpClient.get("/v2/bot/message/aggregation/list", queryParams);
242 return { httpResponse: res, body: await res.json() };
243 }
244 /**
245 * Get number of units used this month
246 *
247 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-number-of-units-used-this-month"> Documentation</a>
248 */
249 async getAggregationUnitUsage() {
250 return (await this.getAggregationUnitUsageWithHttpInfo()).body;
251 }
252 /**
253 * Get number of units used this month.
254 * This method includes HttpInfo object to return additional information.
255 *
256 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-number-of-units-used-this-month"> Documentation</a>
257 */
258 async getAggregationUnitUsageWithHttpInfo() {
259 const res = await this.httpClient.get("/v2/bot/message/aggregation/info");
260 return { httpResponse: res, body: await res.json() };
261 }
262 /**
263 * Get bot info
264 *
265 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-bot-info"> Documentation</a>
266 */
267 async getBotInfo() {
268 return (await this.getBotInfoWithHttpInfo()).body;
269 }
270 /**
271 * Get bot info.
272 * This method includes HttpInfo object to return additional information.
273 *
274 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-bot-info"> Documentation</a>
275 */
276 async getBotInfoWithHttpInfo() {
277 const res = await this.httpClient.get("/v2/bot/info");
278 return { httpResponse: res, body: await res.json() };
279 }
280 /**
281 * Gets the ID of the default rich menu set with the Messaging API.
282 *
283 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-default-rich-menu-id"> Documentation</a>
284 */
285 async getDefaultRichMenuId() {
286 return (await this.getDefaultRichMenuIdWithHttpInfo()).body;
287 }
288 /**
289 * Gets the ID of the default rich menu set with the Messaging API..
290 * This method includes HttpInfo object to return additional information.
291 *
292 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-default-rich-menu-id"> Documentation</a>
293 */
294 async getDefaultRichMenuIdWithHttpInfo() {
295 const res = await this.httpClient.get("/v2/bot/user/all/richmenu");
296 return { httpResponse: res, body: await res.json() };
297 }
298 /**
299 * Get a list of users who added your LINE Official Account as a friend
300 * @param start Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs.
301 * @param limit The maximum number of user IDs to retrieve in a single request.
302 *
303 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-follower-ids"> Documentation</a>
304 */
305 async getFollowers(start, limit) {
306 return (await this.getFollowersWithHttpInfo(start, limit)).body;
307 }
308 /**
309 * Get a list of users who added your LINE Official Account as a friend.
310 * This method includes HttpInfo object to return additional information.
311 * @param start Value of the continuation token found in the next property of the JSON object returned in the response. Include this parameter to get the next array of user IDs.
312 * @param limit The maximum number of user IDs to retrieve in a single request.
313 *
314 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-follower-ids"> Documentation</a>
315 */
316 async getFollowersWithHttpInfo(start, limit) {
317 const queryParams = {
318 start: start,
319 limit: limit,
320 };
321 Object.keys(queryParams).forEach((key) => {
322 if (queryParams[key] === undefined) {
323 delete queryParams[key];
324 }
325 });
326 const res = await this.httpClient.get("/v2/bot/followers/ids", queryParams);
327 return { httpResponse: res, body: await res.json() };
328 }
329 /**
330 * Get number of users in a group chat
331 * @param groupId Group ID
332 *
333 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-members-group-count"> Documentation</a>
334 */
335 async getGroupMemberCount(groupId) {
336 return (await this.getGroupMemberCountWithHttpInfo(groupId)).body;
337 }
338 /**
339 * Get number of users in a group chat.
340 * This method includes HttpInfo object to return additional information.
341 * @param groupId Group ID
342 *
343 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-members-group-count"> Documentation</a>
344 */
345 async getGroupMemberCountWithHttpInfo(groupId) {
346 const res = await this.httpClient.get("/v2/bot/group/{groupId}/members/count".replace("{groupId}", String(groupId)));
347 return { httpResponse: res, body: await res.json() };
348 }
349 /**
350 * Get group chat member profile
351 * @param groupId Group ID
352 * @param userId User ID
353 *
354 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-group-member-profile"> Documentation</a>
355 */
356 async getGroupMemberProfile(groupId, userId) {
357 return (await this.getGroupMemberProfileWithHttpInfo(groupId, userId)).body;
358 }
359 /**
360 * Get group chat member profile.
361 * This method includes HttpInfo object to return additional information.
362 * @param groupId Group ID
363 * @param userId User ID
364 *
365 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-group-member-profile"> Documentation</a>
366 */
367 async getGroupMemberProfileWithHttpInfo(groupId, userId) {
368 const res = await this.httpClient.get("/v2/bot/group/{groupId}/member/{userId}"
369 .replace("{groupId}", String(groupId))
370 .replace("{userId}", String(userId)));
371 return { httpResponse: res, body: await res.json() };
372 }
373 /**
374 * Get group chat member user IDs
375 * @param groupId Group ID
376 * @param start Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group.
377 *
378 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-group-member-user-ids"> Documentation</a>
379 */
380 async getGroupMembersIds(groupId, start) {
381 return (await this.getGroupMembersIdsWithHttpInfo(groupId, start)).body;
382 }
383 /**
384 * Get group chat member user IDs.
385 * This method includes HttpInfo object to return additional information.
386 * @param groupId Group ID
387 * @param start Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group.
388 *
389 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-group-member-user-ids"> Documentation</a>
390 */
391 async getGroupMembersIdsWithHttpInfo(groupId, start) {
392 const queryParams = {
393 start: start,
394 };
395 Object.keys(queryParams).forEach((key) => {
396 if (queryParams[key] === undefined) {
397 delete queryParams[key];
398 }
399 });
400 const res = await this.httpClient.get("/v2/bot/group/{groupId}/members/ids".replace("{groupId}", String(groupId)), queryParams);
401 return { httpResponse: res, body: await res.json() };
402 }
403 /**
404 * Get group chat summary
405 * @param groupId Group ID
406 *
407 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-group-summary"> Documentation</a>
408 */
409 async getGroupSummary(groupId) {
410 return (await this.getGroupSummaryWithHttpInfo(groupId)).body;
411 }
412 /**
413 * Get group chat summary.
414 * This method includes HttpInfo object to return additional information.
415 * @param groupId Group ID
416 *
417 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-group-summary"> Documentation</a>
418 */
419 async getGroupSummaryWithHttpInfo(groupId) {
420 const res = await this.httpClient.get("/v2/bot/group/{groupId}/summary".replace("{groupId}", String(groupId)));
421 return { httpResponse: res, body: await res.json() };
422 }
423 /**
424 * Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned.
425 *
426 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-quota"> Documentation</a>
427 */
428 async getMessageQuota() {
429 return (await this.getMessageQuotaWithHttpInfo()).body;
430 }
431 /**
432 * Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned..
433 * This method includes HttpInfo object to return additional information.
434 *
435 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-quota"> Documentation</a>
436 */
437 async getMessageQuotaWithHttpInfo() {
438 const res = await this.httpClient.get("/v2/bot/message/quota");
439 return { httpResponse: res, body: await res.json() };
440 }
441 /**
442 * Gets the number of messages sent in the current month.
443 *
444 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-consumption"> Documentation</a>
445 */
446 async getMessageQuotaConsumption() {
447 return (await this.getMessageQuotaConsumptionWithHttpInfo()).body;
448 }
449 /**
450 * Gets the number of messages sent in the current month..
451 * This method includes HttpInfo object to return additional information.
452 *
453 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-consumption"> Documentation</a>
454 */
455 async getMessageQuotaConsumptionWithHttpInfo() {
456 const res = await this.httpClient.get("/v2/bot/message/quota/consumption");
457 return { httpResponse: res, body: await res.json() };
458 }
459 /**
460 * Gets the status of a narrowcast message.
461 * @param requestId The narrowcast message\'s request ID. Each Messaging API request has a request ID.
462 *
463 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-narrowcast-progress-status"> Documentation</a>
464 */
465 async getNarrowcastProgress(requestId) {
466 return (await this.getNarrowcastProgressWithHttpInfo(requestId)).body;
467 }
468 /**
469 * Gets the status of a narrowcast message..
470 * This method includes HttpInfo object to return additional information.
471 * @param requestId The narrowcast message\'s request ID. Each Messaging API request has a request ID.
472 *
473 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-narrowcast-progress-status"> Documentation</a>
474 */
475 async getNarrowcastProgressWithHttpInfo(requestId) {
476 const queryParams = {
477 requestId: requestId,
478 };
479 Object.keys(queryParams).forEach((key) => {
480 if (queryParams[key] === undefined) {
481 delete queryParams[key];
482 }
483 });
484 const res = await this.httpClient.get("/v2/bot/message/progress/narrowcast", queryParams);
485 return { httpResponse: res, body: await res.json() };
486 }
487 /**
488 * Get number of sent broadcast messages
489 * @param date Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9
490 *
491 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-number-of-broadcast-messages"> Documentation</a>
492 */
493 async getNumberOfSentBroadcastMessages(date) {
494 return (await this.getNumberOfSentBroadcastMessagesWithHttpInfo(date)).body;
495 }
496 /**
497 * Get number of sent broadcast messages.
498 * This method includes HttpInfo object to return additional information.
499 * @param date Date the messages were sent Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9
500 *
501 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-number-of-broadcast-messages"> Documentation</a>
502 */
503 async getNumberOfSentBroadcastMessagesWithHttpInfo(date) {
504 const queryParams = {
505 date: date,
506 };
507 Object.keys(queryParams).forEach((key) => {
508 if (queryParams[key] === undefined) {
509 delete queryParams[key];
510 }
511 });
512 const res = await this.httpClient.get("/v2/bot/message/delivery/broadcast", queryParams);
513 return { httpResponse: res, body: await res.json() };
514 }
515 /**
516 * Get number of sent multicast messages
517 * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9
518 *
519 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-number-of-multicast-messages"> Documentation</a>
520 */
521 async getNumberOfSentMulticastMessages(date) {
522 return (await this.getNumberOfSentMulticastMessagesWithHttpInfo(date)).body;
523 }
524 /**
525 * Get number of sent multicast messages.
526 * This method includes HttpInfo object to return additional information.
527 * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9
528 *
529 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-number-of-multicast-messages"> Documentation</a>
530 */
531 async getNumberOfSentMulticastMessagesWithHttpInfo(date) {
532 const queryParams = {
533 date: date,
534 };
535 Object.keys(queryParams).forEach((key) => {
536 if (queryParams[key] === undefined) {
537 delete queryParams[key];
538 }
539 });
540 const res = await this.httpClient.get("/v2/bot/message/delivery/multicast", queryParams);
541 return { httpResponse: res, body: await res.json() };
542 }
543 /**
544 * Get number of sent push messages
545 * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9
546 *
547 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-number-of-push-messages"> Documentation</a>
548 */
549 async getNumberOfSentPushMessages(date) {
550 return (await this.getNumberOfSentPushMessagesWithHttpInfo(date)).body;
551 }
552 /**
553 * Get number of sent push messages.
554 * This method includes HttpInfo object to return additional information.
555 * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9
556 *
557 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-number-of-push-messages"> Documentation</a>
558 */
559 async getNumberOfSentPushMessagesWithHttpInfo(date) {
560 const queryParams = {
561 date: date,
562 };
563 Object.keys(queryParams).forEach((key) => {
564 if (queryParams[key] === undefined) {
565 delete queryParams[key];
566 }
567 });
568 const res = await this.httpClient.get("/v2/bot/message/delivery/push", queryParams);
569 return { httpResponse: res, body: await res.json() };
570 }
571 /**
572 * Get number of sent reply messages
573 * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9
574 *
575 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-number-of-reply-messages"> Documentation</a>
576 */
577 async getNumberOfSentReplyMessages(date) {
578 return (await this.getNumberOfSentReplyMessagesWithHttpInfo(date)).body;
579 }
580 /**
581 * Get number of sent reply messages.
582 * This method includes HttpInfo object to return additional information.
583 * @param date Date the messages were sent Format: `yyyyMMdd` (e.g. `20191231`) Timezone: UTC+9
584 *
585 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-number-of-reply-messages"> Documentation</a>
586 */
587 async getNumberOfSentReplyMessagesWithHttpInfo(date) {
588 const queryParams = {
589 date: date,
590 };
591 Object.keys(queryParams).forEach((key) => {
592 if (queryParams[key] === undefined) {
593 delete queryParams[key];
594 }
595 });
596 const res = await this.httpClient.get("/v2/bot/message/delivery/reply", queryParams);
597 return { httpResponse: res, body: await res.json() };
598 }
599 /**
600 * Get number of sent LINE notification messages
601 * @param date Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9
602 *
603 * @see <a href="https://developers.line.biz/en/reference/partner-docs/#get-number-of-sent-line-notification-messages"> Documentation</a>
604 */
605 async getPNPMessageStatistics(date) {
606 return (await this.getPNPMessageStatisticsWithHttpInfo(date)).body;
607 }
608 /**
609 * Get number of sent LINE notification messages .
610 * This method includes HttpInfo object to return additional information.
611 * @param date Date the message was sent Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9
612 *
613 * @see <a href="https://developers.line.biz/en/reference/partner-docs/#get-number-of-sent-line-notification-messages"> Documentation</a>
614 */
615 async getPNPMessageStatisticsWithHttpInfo(date) {
616 const queryParams = {
617 date: date,
618 };
619 Object.keys(queryParams).forEach((key) => {
620 if (queryParams[key] === undefined) {
621 delete queryParams[key];
622 }
623 });
624 const res = await this.httpClient.get("/v2/bot/message/delivery/pnp", queryParams);
625 return { httpResponse: res, body: await res.json() };
626 }
627 /**
628 * Get profile
629 * @param userId User ID
630 *
631 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-profile"> Documentation</a>
632 */
633 async getProfile(userId) {
634 return (await this.getProfileWithHttpInfo(userId)).body;
635 }
636 /**
637 * Get profile.
638 * This method includes HttpInfo object to return additional information.
639 * @param userId User ID
640 *
641 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-profile"> Documentation</a>
642 */
643 async getProfileWithHttpInfo(userId) {
644 const res = await this.httpClient.get("/v2/bot/profile/{userId}".replace("{userId}", String(userId)));
645 return { httpResponse: res, body: await res.json() };
646 }
647 /**
648 * Gets a rich menu via a rich menu ID.
649 * @param richMenuId ID of a rich menu
650 *
651 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu"> Documentation</a>
652 */
653 async getRichMenu(richMenuId) {
654 return (await this.getRichMenuWithHttpInfo(richMenuId)).body;
655 }
656 /**
657 * Gets a rich menu via a rich menu ID..
658 * This method includes HttpInfo object to return additional information.
659 * @param richMenuId ID of a rich menu
660 *
661 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu"> Documentation</a>
662 */
663 async getRichMenuWithHttpInfo(richMenuId) {
664 const res = await this.httpClient.get("/v2/bot/richmenu/{richMenuId}".replace("{richMenuId}", String(richMenuId)));
665 return { httpResponse: res, body: await res.json() };
666 }
667 /**
668 * Get rich menu alias information
669 * @param richMenuAliasId The rich menu alias ID whose information you want to obtain.
670 *
671 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-alias-by-id"> Documentation</a>
672 */
673 async getRichMenuAlias(richMenuAliasId) {
674 return (await this.getRichMenuAliasWithHttpInfo(richMenuAliasId)).body;
675 }
676 /**
677 * Get rich menu alias information.
678 * This method includes HttpInfo object to return additional information.
679 * @param richMenuAliasId The rich menu alias ID whose information you want to obtain.
680 *
681 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-alias-by-id"> Documentation</a>
682 */
683 async getRichMenuAliasWithHttpInfo(richMenuAliasId) {
684 const res = await this.httpClient.get("/v2/bot/richmenu/alias/{richMenuAliasId}".replace("{richMenuAliasId}", String(richMenuAliasId)));
685 return { httpResponse: res, body: await res.json() };
686 }
687 /**
688 * Get list of rich menu alias
689 *
690 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-alias-list"> Documentation</a>
691 */
692 async getRichMenuAliasList() {
693 return (await this.getRichMenuAliasListWithHttpInfo()).body;
694 }
695 /**
696 * Get list of rich menu alias.
697 * This method includes HttpInfo object to return additional information.
698 *
699 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-alias-list"> Documentation</a>
700 */
701 async getRichMenuAliasListWithHttpInfo() {
702 const res = await this.httpClient.get("/v2/bot/richmenu/alias/list");
703 return { httpResponse: res, body: await res.json() };
704 }
705 /**
706 * Get the status of Replace or unlink a linked rich menus in batches.
707 * @param requestId A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID.
708 *
709 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-batch-control-rich-menus-progress-status"> Documentation</a>
710 */
711 async getRichMenuBatchProgress(requestId) {
712 return (await this.getRichMenuBatchProgressWithHttpInfo(requestId)).body;
713 }
714 /**
715 * Get the status of Replace or unlink a linked rich menus in batches..
716 * This method includes HttpInfo object to return additional information.
717 * @param requestId A request ID used to batch control the rich menu linked to the user. Each Messaging API request has a request ID.
718 *
719 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-batch-control-rich-menus-progress-status"> Documentation</a>
720 */
721 async getRichMenuBatchProgressWithHttpInfo(requestId) {
722 const queryParams = {
723 requestId: requestId,
724 };
725 Object.keys(queryParams).forEach((key) => {
726 if (queryParams[key] === undefined) {
727 delete queryParams[key];
728 }
729 });
730 const res = await this.httpClient.get("/v2/bot/richmenu/progress/batch", queryParams);
731 return { httpResponse: res, body: await res.json() };
732 }
733 /**
734 * Get rich menu ID of user
735 * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
736 *
737 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-id-of-user"> Documentation</a>
738 */
739 async getRichMenuIdOfUser(userId) {
740 return (await this.getRichMenuIdOfUserWithHttpInfo(userId)).body;
741 }
742 /**
743 * Get rich menu ID of user.
744 * This method includes HttpInfo object to return additional information.
745 * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
746 *
747 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-id-of-user"> Documentation</a>
748 */
749 async getRichMenuIdOfUserWithHttpInfo(userId) {
750 const res = await this.httpClient.get("/v2/bot/user/{userId}/richmenu".replace("{userId}", String(userId)));
751 return { httpResponse: res, body: await res.json() };
752 }
753 /**
754 * Get rich menu list
755 *
756 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-list"> Documentation</a>
757 */
758 async getRichMenuList() {
759 return (await this.getRichMenuListWithHttpInfo()).body;
760 }
761 /**
762 * Get rich menu list.
763 * This method includes HttpInfo object to return additional information.
764 *
765 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-list"> Documentation</a>
766 */
767 async getRichMenuListWithHttpInfo() {
768 const res = await this.httpClient.get("/v2/bot/richmenu/list");
769 return { httpResponse: res, body: await res.json() };
770 }
771 /**
772 * Get number of users in a multi-person chat
773 * @param roomId Room ID
774 *
775 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-members-room-count"> Documentation</a>
776 */
777 async getRoomMemberCount(roomId) {
778 return (await this.getRoomMemberCountWithHttpInfo(roomId)).body;
779 }
780 /**
781 * Get number of users in a multi-person chat.
782 * This method includes HttpInfo object to return additional information.
783 * @param roomId Room ID
784 *
785 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-members-room-count"> Documentation</a>
786 */
787 async getRoomMemberCountWithHttpInfo(roomId) {
788 const res = await this.httpClient.get("/v2/bot/room/{roomId}/members/count".replace("{roomId}", String(roomId)));
789 return { httpResponse: res, body: await res.json() };
790 }
791 /**
792 * Get multi-person chat member profile
793 * @param roomId Room ID
794 * @param userId User ID
795 *
796 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-room-member-profile"> Documentation</a>
797 */
798 async getRoomMemberProfile(roomId, userId) {
799 return (await this.getRoomMemberProfileWithHttpInfo(roomId, userId)).body;
800 }
801 /**
802 * Get multi-person chat member profile.
803 * This method includes HttpInfo object to return additional information.
804 * @param roomId Room ID
805 * @param userId User ID
806 *
807 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-room-member-profile"> Documentation</a>
808 */
809 async getRoomMemberProfileWithHttpInfo(roomId, userId) {
810 const res = await this.httpClient.get("/v2/bot/room/{roomId}/member/{userId}"
811 .replace("{roomId}", String(roomId))
812 .replace("{userId}", String(userId)));
813 return { httpResponse: res, body: await res.json() };
814 }
815 /**
816 * Get multi-person chat member user IDs
817 * @param roomId Room ID
818 * @param start Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group.
819 *
820 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-room-member-user-ids"> Documentation</a>
821 */
822 async getRoomMembersIds(roomId, start) {
823 return (await this.getRoomMembersIdsWithHttpInfo(roomId, start)).body;
824 }
825 /**
826 * Get multi-person chat member user IDs.
827 * This method includes HttpInfo object to return additional information.
828 * @param roomId Room ID
829 * @param start Value of the continuation token found in the `next` property of the JSON object returned in the response. Include this parameter to get the next array of user IDs for the members of the group.
830 *
831 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-room-member-user-ids"> Documentation</a>
832 */
833 async getRoomMembersIdsWithHttpInfo(roomId, start) {
834 const queryParams = {
835 start: start,
836 };
837 Object.keys(queryParams).forEach((key) => {
838 if (queryParams[key] === undefined) {
839 delete queryParams[key];
840 }
841 });
842 const res = await this.httpClient.get("/v2/bot/room/{roomId}/members/ids".replace("{roomId}", String(roomId)), queryParams);
843 return { httpResponse: res, body: await res.json() };
844 }
845 /**
846 * Get webhook endpoint information
847 *
848 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-webhook-endpoint-information"> Documentation</a>
849 */
850 async getWebhookEndpoint() {
851 return (await this.getWebhookEndpointWithHttpInfo()).body;
852 }
853 /**
854 * Get webhook endpoint information.
855 * This method includes HttpInfo object to return additional information.
856 *
857 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-webhook-endpoint-information"> Documentation</a>
858 */
859 async getWebhookEndpointWithHttpInfo() {
860 const res = await this.httpClient.get("/v2/bot/channel/webhook/endpoint");
861 return { httpResponse: res, body: await res.json() };
862 }
863 /**
864 * Issue link token
865 * @param userId User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE.
866 *
867 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-link-token"> Documentation</a>
868 */
869 async issueLinkToken(userId) {
870 return (await this.issueLinkTokenWithHttpInfo(userId)).body;
871 }
872 /**
873 * Issue link token.
874 * This method includes HttpInfo object to return additional information.
875 * @param userId User ID for the LINE account to be linked. Found in the `source` object of account link event objects. Do not use the LINE ID used in LINE.
876 *
877 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-link-token"> Documentation</a>
878 */
879 async issueLinkTokenWithHttpInfo(userId) {
880 const res = await this.httpClient.post("/v2/bot/user/{userId}/linkToken".replace("{userId}", String(userId)));
881 return { httpResponse: res, body: await res.json() };
882 }
883 /**
884 * Leave group chat
885 * @param groupId Group ID
886 *
887 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#leave-group"> Documentation</a>
888 */
889 async leaveGroup(groupId) {
890 return (await this.leaveGroupWithHttpInfo(groupId)).body;
891 }
892 /**
893 * Leave group chat.
894 * This method includes HttpInfo object to return additional information.
895 * @param groupId Group ID
896 *
897 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#leave-group"> Documentation</a>
898 */
899 async leaveGroupWithHttpInfo(groupId) {
900 const res = await this.httpClient.post("/v2/bot/group/{groupId}/leave".replace("{groupId}", String(groupId)));
901 return { httpResponse: res, body: await res.json() };
902 }
903 /**
904 * Leave multi-person chat
905 * @param roomId Room ID
906 *
907 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#leave-room"> Documentation</a>
908 */
909 async leaveRoom(roomId) {
910 return (await this.leaveRoomWithHttpInfo(roomId)).body;
911 }
912 /**
913 * Leave multi-person chat.
914 * This method includes HttpInfo object to return additional information.
915 * @param roomId Room ID
916 *
917 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#leave-room"> Documentation</a>
918 */
919 async leaveRoomWithHttpInfo(roomId) {
920 const res = await this.httpClient.post("/v2/bot/room/{roomId}/leave".replace("{roomId}", String(roomId)));
921 return { httpResponse: res, body: await res.json() };
922 }
923 /**
924 * Link rich menu to user.
925 * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
926 * @param richMenuId ID of a rich menu
927 *
928 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-user"> Documentation</a>
929 */
930 async linkRichMenuIdToUser(userId, richMenuId) {
931 return (await this.linkRichMenuIdToUserWithHttpInfo(userId, richMenuId))
932 .body;
933 }
934 /**
935 * Link rich menu to user..
936 * This method includes HttpInfo object to return additional information.
937 * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
938 * @param richMenuId ID of a rich menu
939 *
940 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-user"> Documentation</a>
941 */
942 async linkRichMenuIdToUserWithHttpInfo(userId, richMenuId) {
943 const res = await this.httpClient.post("/v2/bot/user/{userId}/richmenu/{richMenuId}"
944 .replace("{userId}", String(userId))
945 .replace("{richMenuId}", String(richMenuId)));
946 return { httpResponse: res, body: await res.json() };
947 }
948 /**
949 * Link rich menu to multiple users
950 * @param richMenuBulkLinkRequest
951 *
952 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-users"> Documentation</a>
953 */
954 async linkRichMenuIdToUsers(richMenuBulkLinkRequest) {
955 return (await this.linkRichMenuIdToUsersWithHttpInfo(richMenuBulkLinkRequest)).body;
956 }
957 /**
958 * Link rich menu to multiple users.
959 * This method includes HttpInfo object to return additional information.
960 * @param richMenuBulkLinkRequest
961 *
962 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-users"> Documentation</a>
963 */
964 async linkRichMenuIdToUsersWithHttpInfo(richMenuBulkLinkRequest) {
965 const params = richMenuBulkLinkRequest;
966 const res = await this.httpClient.post("/v2/bot/richmenu/bulk/link", params);
967 return { httpResponse: res, body: await res.json() };
968 }
969 /**
970 * Mark messages from users as read
971 * @param markMessagesAsReadRequest
972 *
973 * @see <a href="https://developers.line.biz/en/reference/partner-docs/#mark-messages-from-users-as-read"> Documentation</a>
974 */
975 async markMessagesAsRead(markMessagesAsReadRequest) {
976 return (await this.markMessagesAsReadWithHttpInfo(markMessagesAsReadRequest)).body;
977 }
978 /**
979 * Mark messages from users as read.
980 * This method includes HttpInfo object to return additional information.
981 * @param markMessagesAsReadRequest
982 *
983 * @see <a href="https://developers.line.biz/en/reference/partner-docs/#mark-messages-from-users-as-read"> Documentation</a>
984 */
985 async markMessagesAsReadWithHttpInfo(markMessagesAsReadRequest) {
986 const params = markMessagesAsReadRequest;
987 const res = await this.httpClient.post("/v2/bot/message/markAsRead", params);
988 return { httpResponse: res, body: await res.json() };
989 }
990 /**
991 * An API that efficiently sends the same message to multiple user IDs. You can\'t send messages to group chats or multi-person chats.
992 * @param multicastRequest
993 * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key.
994 *
995 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#send-multicast-message"> Documentation</a>
996 */
997 async multicast(multicastRequest, xLineRetryKey) {
998 return (await this.multicastWithHttpInfo(multicastRequest, xLineRetryKey))
999 .body;
1000 }
1001 /**
1002 * An API that efficiently sends the same message to multiple user IDs. You can\'t send messages to group chats or multi-person chats..
1003 * This method includes HttpInfo object to return additional information.
1004 * @param multicastRequest
1005 * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key.
1006 *
1007 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#send-multicast-message"> Documentation</a>
1008 */
1009 async multicastWithHttpInfo(multicastRequest, xLineRetryKey) {
1010 const params = multicastRequest;
1011 const headerParams = Object.assign({}, (xLineRetryKey != null ? { "X-Line-Retry-Key": xLineRetryKey } : {}));
1012 const res = await this.httpClient.post("/v2/bot/message/multicast", params, { headers: headerParams });
1013 return { httpResponse: res, body: await res.json() };
1014 }
1015 /**
1016 * Send narrowcast message
1017 * @param narrowcastRequest
1018 * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key.
1019 *
1020 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#send-narrowcast-message"> Documentation</a>
1021 */
1022 async narrowcast(narrowcastRequest, xLineRetryKey) {
1023 return (await this.narrowcastWithHttpInfo(narrowcastRequest, xLineRetryKey))
1024 .body;
1025 }
1026 /**
1027 * Send narrowcast message.
1028 * This method includes HttpInfo object to return additional information.
1029 * @param narrowcastRequest
1030 * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key.
1031 *
1032 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#send-narrowcast-message"> Documentation</a>
1033 */
1034 async narrowcastWithHttpInfo(narrowcastRequest, xLineRetryKey) {
1035 const params = narrowcastRequest;
1036 const headerParams = Object.assign({}, (xLineRetryKey != null ? { "X-Line-Retry-Key": xLineRetryKey } : {}));
1037 const res = await this.httpClient.post("/v2/bot/message/narrowcast", params, { headers: headerParams });
1038 return { httpResponse: res, body: await res.json() };
1039 }
1040 /**
1041 * Sends a message to a user, group chat, or multi-person chat at any time.
1042 * @param pushMessageRequest
1043 * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key.
1044 *
1045 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#send-push-message"> Documentation</a>
1046 */
1047 async pushMessage(pushMessageRequest, xLineRetryKey) {
1048 return (await this.pushMessageWithHttpInfo(pushMessageRequest, xLineRetryKey)).body;
1049 }
1050 /**
1051 * Sends a message to a user, group chat, or multi-person chat at any time..
1052 * This method includes HttpInfo object to return additional information.
1053 * @param pushMessageRequest
1054 * @param xLineRetryKey Retry key. Specifies the UUID in hexadecimal format (e.g., `123e4567-e89b-12d3-a456-426614174000`) generated by any method. The retry key isn\'t generated by LINE. Each developer must generate their own retry key.
1055 *
1056 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#send-push-message"> Documentation</a>
1057 */
1058 async pushMessageWithHttpInfo(pushMessageRequest, xLineRetryKey) {
1059 const params = pushMessageRequest;
1060 const headerParams = Object.assign({}, (xLineRetryKey != null ? { "X-Line-Retry-Key": xLineRetryKey } : {}));
1061 const res = await this.httpClient.post("/v2/bot/message/push", params, { headers: headerParams });
1062 return { httpResponse: res, body: await res.json() };
1063 }
1064 /**
1065 * Send LINE notification message
1066 * @param pnpMessagesRequest
1067 * @param xLineDeliveryTag String returned in the delivery.data property of the delivery completion event via Webhook.
1068 *
1069 * @see <a href="https://developers.line.biz/en/reference/partner-docs/#send-line-notification-message"> Documentation</a>
1070 */
1071 async pushMessagesByPhone(pnpMessagesRequest, xLineDeliveryTag) {
1072 return (await this.pushMessagesByPhoneWithHttpInfo(pnpMessagesRequest, xLineDeliveryTag)).body;
1073 }
1074 /**
1075 * Send LINE notification message.
1076 * This method includes HttpInfo object to return additional information.
1077 * @param pnpMessagesRequest
1078 * @param xLineDeliveryTag String returned in the delivery.data property of the delivery completion event via Webhook.
1079 *
1080 * @see <a href="https://developers.line.biz/en/reference/partner-docs/#send-line-notification-message"> Documentation</a>
1081 */
1082 async pushMessagesByPhoneWithHttpInfo(pnpMessagesRequest, xLineDeliveryTag) {
1083 const params = pnpMessagesRequest;
1084 const headerParams = Object.assign({}, (xLineDeliveryTag != null
1085 ? { "X-Line-Delivery-Tag": xLineDeliveryTag }
1086 : {}));
1087 const res = await this.httpClient.post("/bot/pnp/push", params, { headers: headerParams });
1088 return { httpResponse: res, body: await res.json() };
1089 }
1090 /**
1091 * Send reply message
1092 * @param replyMessageRequest
1093 *
1094 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#send-reply-message"> Documentation</a>
1095 */
1096 async replyMessage(replyMessageRequest) {
1097 return (await this.replyMessageWithHttpInfo(replyMessageRequest)).body;
1098 }
1099 /**
1100 * Send reply message.
1101 * This method includes HttpInfo object to return additional information.
1102 * @param replyMessageRequest
1103 *
1104 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#send-reply-message"> Documentation</a>
1105 */
1106 async replyMessageWithHttpInfo(replyMessageRequest) {
1107 const params = replyMessageRequest;
1108 const res = await this.httpClient.post("/v2/bot/message/reply", params);
1109 return { httpResponse: res, body: await res.json() };
1110 }
1111 /**
1112 * You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu
1113 * @param richMenuBatchRequest
1114 *
1115 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#batch-control-rich-menus-of-users"> Documentation</a>
1116 */
1117 async richMenuBatch(richMenuBatchRequest) {
1118 return (await this.richMenuBatchWithHttpInfo(richMenuBatchRequest)).body;
1119 }
1120 /**
1121 * You can use this endpoint to batch control the rich menu linked to the users using the endpoint such as Link rich menu to user. The following operations are available: 1. Replace a rich menu with another rich menu for all users linked to a specific rich menu 2. Unlink a rich menu for all users linked to a specific rich menu 3. Unlink a rich menu for all users linked the rich menu .
1122 * This method includes HttpInfo object to return additional information.
1123 * @param richMenuBatchRequest
1124 *
1125 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#batch-control-rich-menus-of-users"> Documentation</a>
1126 */
1127 async richMenuBatchWithHttpInfo(richMenuBatchRequest) {
1128 const params = richMenuBatchRequest;
1129 const res = await this.httpClient.post("/v2/bot/richmenu/batch", params);
1130 return { httpResponse: res, body: await res.json() };
1131 }
1132 /**
1133 * Set default rich menu
1134 * @param richMenuId ID of a rich menu
1135 *
1136 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#set-default-rich-menu"> Documentation</a>
1137 */
1138 async setDefaultRichMenu(richMenuId) {
1139 return (await this.setDefaultRichMenuWithHttpInfo(richMenuId)).body;
1140 }
1141 /**
1142 * Set default rich menu.
1143 * This method includes HttpInfo object to return additional information.
1144 * @param richMenuId ID of a rich menu
1145 *
1146 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#set-default-rich-menu"> Documentation</a>
1147 */
1148 async setDefaultRichMenuWithHttpInfo(richMenuId) {
1149 const res = await this.httpClient.post("/v2/bot/user/all/richmenu/{richMenuId}".replace("{richMenuId}", String(richMenuId)));
1150 return { httpResponse: res, body: await res.json() };
1151 }
1152 /**
1153 * Set webhook endpoint URL
1154 * @param setWebhookEndpointRequest
1155 *
1156 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#set-webhook-endpoint-url"> Documentation</a>
1157 */
1158 async setWebhookEndpoint(setWebhookEndpointRequest) {
1159 return (await this.setWebhookEndpointWithHttpInfo(setWebhookEndpointRequest)).body;
1160 }
1161 /**
1162 * Set webhook endpoint URL.
1163 * This method includes HttpInfo object to return additional information.
1164 * @param setWebhookEndpointRequest
1165 *
1166 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#set-webhook-endpoint-url"> Documentation</a>
1167 */
1168 async setWebhookEndpointWithHttpInfo(setWebhookEndpointRequest) {
1169 const params = setWebhookEndpointRequest;
1170 const res = await this.httpClient.put("/v2/bot/channel/webhook/endpoint", params);
1171 return { httpResponse: res, body: await res.json() };
1172 }
1173 /**
1174 * Test webhook endpoint
1175 * @param testWebhookEndpointRequest
1176 *
1177 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#test-webhook-endpoint"> Documentation</a>
1178 */
1179 async testWebhookEndpoint(testWebhookEndpointRequest) {
1180 return (await this.testWebhookEndpointWithHttpInfo(testWebhookEndpointRequest)).body;
1181 }
1182 /**
1183 * Test webhook endpoint.
1184 * This method includes HttpInfo object to return additional information.
1185 * @param testWebhookEndpointRequest
1186 *
1187 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#test-webhook-endpoint"> Documentation</a>
1188 */
1189 async testWebhookEndpointWithHttpInfo(testWebhookEndpointRequest) {
1190 const params = testWebhookEndpointRequest;
1191 const res = await this.httpClient.post("/v2/bot/channel/webhook/test", params);
1192 return { httpResponse: res, body: await res.json() };
1193 }
1194 /**
1195 * Unlink rich menu from user
1196 * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
1197 *
1198 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-user"> Documentation</a>
1199 */
1200 async unlinkRichMenuIdFromUser(userId) {
1201 return (await this.unlinkRichMenuIdFromUserWithHttpInfo(userId)).body;
1202 }
1203 /**
1204 * Unlink rich menu from user.
1205 * This method includes HttpInfo object to return additional information.
1206 * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
1207 *
1208 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-user"> Documentation</a>
1209 */
1210 async unlinkRichMenuIdFromUserWithHttpInfo(userId) {
1211 const res = await this.httpClient.delete("/v2/bot/user/{userId}/richmenu".replace("{userId}", String(userId)));
1212 return { httpResponse: res, body: await res.json() };
1213 }
1214 /**
1215 * Unlink rich menus from multiple users
1216 * @param richMenuBulkUnlinkRequest
1217 *
1218 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-users"> Documentation</a>
1219 */
1220 async unlinkRichMenuIdFromUsers(richMenuBulkUnlinkRequest) {
1221 return (await this.unlinkRichMenuIdFromUsersWithHttpInfo(richMenuBulkUnlinkRequest)).body;
1222 }
1223 /**
1224 * Unlink rich menus from multiple users.
1225 * This method includes HttpInfo object to return additional information.
1226 * @param richMenuBulkUnlinkRequest
1227 *
1228 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-users"> Documentation</a>
1229 */
1230 async unlinkRichMenuIdFromUsersWithHttpInfo(richMenuBulkUnlinkRequest) {
1231 const params = richMenuBulkUnlinkRequest;
1232 const res = await this.httpClient.post("/v2/bot/richmenu/bulk/unlink", params);
1233 return { httpResponse: res, body: await res.json() };
1234 }
1235 /**
1236 * Update rich menu alias
1237 * @param richMenuAliasId The rich menu alias ID you want to update.
1238 * @param updateRichMenuAliasRequest
1239 *
1240 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#update-rich-menu-alias"> Documentation</a>
1241 */
1242 async updateRichMenuAlias(richMenuAliasId, updateRichMenuAliasRequest) {
1243 return (await this.updateRichMenuAliasWithHttpInfo(richMenuAliasId, updateRichMenuAliasRequest)).body;
1244 }
1245 /**
1246 * Update rich menu alias.
1247 * This method includes HttpInfo object to return additional information.
1248 * @param richMenuAliasId The rich menu alias ID you want to update.
1249 * @param updateRichMenuAliasRequest
1250 *
1251 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#update-rich-menu-alias"> Documentation</a>
1252 */
1253 async updateRichMenuAliasWithHttpInfo(richMenuAliasId, updateRichMenuAliasRequest) {
1254 const params = updateRichMenuAliasRequest;
1255 const res = await this.httpClient.post("/v2/bot/richmenu/alias/{richMenuAliasId}".replace("{richMenuAliasId}", String(richMenuAliasId)), params);
1256 return { httpResponse: res, body: await res.json() };
1257 }
1258 /**
1259 * Validate message objects of a broadcast message
1260 * @param validateMessageRequest
1261 *
1262 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-broadcast-message"> Documentation</a>
1263 */
1264 async validateBroadcast(validateMessageRequest) {
1265 return (await this.validateBroadcastWithHttpInfo(validateMessageRequest))
1266 .body;
1267 }
1268 /**
1269 * Validate message objects of a broadcast message.
1270 * This method includes HttpInfo object to return additional information.
1271 * @param validateMessageRequest
1272 *
1273 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-broadcast-message"> Documentation</a>
1274 */
1275 async validateBroadcastWithHttpInfo(validateMessageRequest) {
1276 const params = validateMessageRequest;
1277 const res = await this.httpClient.post("/v2/bot/message/validate/broadcast", params);
1278 return { httpResponse: res, body: await res.json() };
1279 }
1280 /**
1281 * Validate message objects of a multicast message
1282 * @param validateMessageRequest
1283 *
1284 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-multicast-message"> Documentation</a>
1285 */
1286 async validateMulticast(validateMessageRequest) {
1287 return (await this.validateMulticastWithHttpInfo(validateMessageRequest))
1288 .body;
1289 }
1290 /**
1291 * Validate message objects of a multicast message.
1292 * This method includes HttpInfo object to return additional information.
1293 * @param validateMessageRequest
1294 *
1295 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-multicast-message"> Documentation</a>
1296 */
1297 async validateMulticastWithHttpInfo(validateMessageRequest) {
1298 const params = validateMessageRequest;
1299 const res = await this.httpClient.post("/v2/bot/message/validate/multicast", params);
1300 return { httpResponse: res, body: await res.json() };
1301 }
1302 /**
1303 * Validate message objects of a narrowcast message
1304 * @param validateMessageRequest
1305 *
1306 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-narrowcast-message"> Documentation</a>
1307 */
1308 async validateNarrowcast(validateMessageRequest) {
1309 return (await this.validateNarrowcastWithHttpInfo(validateMessageRequest))
1310 .body;
1311 }
1312 /**
1313 * Validate message objects of a narrowcast message.
1314 * This method includes HttpInfo object to return additional information.
1315 * @param validateMessageRequest
1316 *
1317 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-narrowcast-message"> Documentation</a>
1318 */
1319 async validateNarrowcastWithHttpInfo(validateMessageRequest) {
1320 const params = validateMessageRequest;
1321 const res = await this.httpClient.post("/v2/bot/message/validate/narrowcast", params);
1322 return { httpResponse: res, body: await res.json() };
1323 }
1324 /**
1325 * Validate message objects of a push message
1326 * @param validateMessageRequest
1327 *
1328 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-push-message"> Documentation</a>
1329 */
1330 async validatePush(validateMessageRequest) {
1331 return (await this.validatePushWithHttpInfo(validateMessageRequest)).body;
1332 }
1333 /**
1334 * Validate message objects of a push message.
1335 * This method includes HttpInfo object to return additional information.
1336 * @param validateMessageRequest
1337 *
1338 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-push-message"> Documentation</a>
1339 */
1340 async validatePushWithHttpInfo(validateMessageRequest) {
1341 const params = validateMessageRequest;
1342 const res = await this.httpClient.post("/v2/bot/message/validate/push", params);
1343 return { httpResponse: res, body: await res.json() };
1344 }
1345 /**
1346 * Validate message objects of a reply message
1347 * @param validateMessageRequest
1348 *
1349 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-reply-message"> Documentation</a>
1350 */
1351 async validateReply(validateMessageRequest) {
1352 return (await this.validateReplyWithHttpInfo(validateMessageRequest)).body;
1353 }
1354 /**
1355 * Validate message objects of a reply message.
1356 * This method includes HttpInfo object to return additional information.
1357 * @param validateMessageRequest
1358 *
1359 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-reply-message"> Documentation</a>
1360 */
1361 async validateReplyWithHttpInfo(validateMessageRequest) {
1362 const params = validateMessageRequest;
1363 const res = await this.httpClient.post("/v2/bot/message/validate/reply", params);
1364 return { httpResponse: res, body: await res.json() };
1365 }
1366 /**
1367 * Validate a request body of the Replace or unlink the linked rich menus in batches endpoint.
1368 * @param richMenuBatchRequest
1369 *
1370 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-batch-control-rich-menus-request"> Documentation</a>
1371 */
1372 async validateRichMenuBatchRequest(richMenuBatchRequest) {
1373 return (await this.validateRichMenuBatchRequestWithHttpInfo(richMenuBatchRequest)).body;
1374 }
1375 /**
1376 * Validate a request body of the Replace or unlink the linked rich menus in batches endpoint..
1377 * This method includes HttpInfo object to return additional information.
1378 * @param richMenuBatchRequest
1379 *
1380 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-batch-control-rich-menus-request"> Documentation</a>
1381 */
1382 async validateRichMenuBatchRequestWithHttpInfo(richMenuBatchRequest) {
1383 const params = richMenuBatchRequest;
1384 const res = await this.httpClient.post("/v2/bot/richmenu/validate/batch", params);
1385 return { httpResponse: res, body: await res.json() };
1386 }
1387 /**
1388 * Validate rich menu object
1389 * @param richMenuRequest
1390 *
1391 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-rich-menu-object"> Documentation</a>
1392 */
1393 async validateRichMenuObject(richMenuRequest) {
1394 return (await this.validateRichMenuObjectWithHttpInfo(richMenuRequest))
1395 .body;
1396 }
1397 /**
1398 * Validate rich menu object.
1399 * This method includes HttpInfo object to return additional information.
1400 * @param richMenuRequest
1401 *
1402 * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-rich-menu-object"> Documentation</a>
1403 */
1404 async validateRichMenuObjectWithHttpInfo(richMenuRequest) {
1405 const params = richMenuRequest;
1406 const res = await this.httpClient.post("/v2/bot/richmenu/validate", params);
1407 return { httpResponse: res, body: await res.json() };
1408 }
1409}
1410exports.MessagingApiClient = MessagingApiClient;