UNPKG

@line/bot-sdk

Version:
923 lines (864 loc) 171 kB
/** * This file is autogenerated. * * Generated by scripts/line-bot-client-generator/main.mjs * Do not edit this file directly. */ import type { Readable } from "node:stream"; import type * as Types from "./types.js"; import type * as insight from "./insight/api.js"; import type * as liff from "./liff/api.js"; import type * as manageAudience from "./manage-audience/api.js"; import type * as messagingApi from "./messaging-api/api.js"; import type * as moduleOperation from "./module/api.js"; import type * as moduleAttach from "./module-attach/api.js"; import type * as shop from "./shop/api.js"; export interface LineBotClientDelegates { readonly insight: insight.InsightClient; readonly liff: liff.LiffClient; readonly manageAudience: manageAudience.ManageAudienceClient; readonly manageAudienceBlob: manageAudience.ManageAudienceBlobClient; readonly messagingApi: messagingApi.MessagingApiClient; readonly messagingApiBlob: messagingApi.MessagingApiBlobClient; readonly lineModule: moduleOperation.LineModuleClient; readonly lineModuleAttach: moduleAttach.LineModuleAttachClient; readonly shop: shop.ShopClient; } export abstract class LineBotClientBase { protected abstract readonly clients: LineBotClientDelegates; /** * Retrieves the demographic attributes for a LINE Official Account's friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID). * Calls `GET https://api.line.me/v2/bot/insight/demographic`. * To inspect the HTTP status code or response headers, use {@link getFriendsDemographicsWithHttpInfo}. * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-demographic">LINE Developers documentation</a> */ public async getFriendsDemographics(): Promise<insight.GetFriendsDemographicsResponse> { return this.clients.insight.getFriendsDemographics(); } /** * Retrieves the demographic attributes for a LINE Official Account's friends.You can only retrieve information about friends for LINE Official Accounts created by users in Japan (JP), Thailand (TH), Taiwan (TW) and Indonesia (ID). * Calls `GET https://api.line.me/v2/bot/insight/demographic`. * This method returns the response body together with the underlying `httpResponse`. * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-demographic">LINE Developers documentation</a> */ public async getFriendsDemographicsWithHttpInfo(): Promise< Types.ApiResponseType<insight.GetFriendsDemographicsResponse> > { return this.clients.insight.getFriendsDemographicsWithHttpInfo(); } /** * Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. * Calls `GET https://api.line.me/v2/bot/insight/message/event`. * To inspect the HTTP status code or response headers, use {@link getMessageEventWithHttpInfo}. * @summary Get user interaction statistics * @param requestId Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-message-event">LINE Developers documentation</a> */ public async getMessageEvent( requestId: string, ): Promise<insight.GetMessageEventResponse> { return this.clients.insight.getMessageEvent(requestId); } /** * Returns statistics about how users interact with narrowcast messages or broadcast messages sent from your LINE Official Account. * Calls `GET https://api.line.me/v2/bot/insight/message/event`. * This method returns the response body together with the underlying `httpResponse`. * @summary Get user interaction statistics * @param requestId Request ID of a narrowcast message or broadcast message. Each Messaging API request has a request ID. * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-message-event">LINE Developers documentation</a> */ public async getMessageEventWithHttpInfo( requestId: string, ): Promise<Types.ApiResponseType<insight.GetMessageEventResponse>> { return this.clients.insight.getMessageEventWithHttpInfo(requestId); } /** * Returns the number of users who have added the LINE Official Account on or before a specified date. * Calls `GET https://api.line.me/v2/bot/insight/followers`. * To inspect the HTTP status code or response headers, use {@link getNumberOfFollowersWithHttpInfo}. * @summary Get number of followers * @param date Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-number-of-followers">LINE Developers documentation</a> */ public async getNumberOfFollowers( date?: string, ): Promise<insight.GetNumberOfFollowersResponse> { return this.clients.insight.getNumberOfFollowers(date); } /** * Returns the number of users who have added the LINE Official Account on or before a specified date. * Calls `GET https://api.line.me/v2/bot/insight/followers`. * This method returns the response body together with the underlying `httpResponse`. * @summary Get number of followers * @param date Date for which to retrieve the number of followers. Format: yyyyMMdd (e.g. 20191231) Timezone: UTC+9 * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-number-of-followers">LINE Developers documentation</a> */ public async getNumberOfFollowersWithHttpInfo( date?: string, ): Promise<Types.ApiResponseType<insight.GetNumberOfFollowersResponse>> { return this.clients.insight.getNumberOfFollowersWithHttpInfo(date); } /** * Returns the number of messages sent from LINE Official Account on a specified day. * Calls `GET https://api.line.me/v2/bot/insight/message/delivery`. * To inspect the HTTP status code or response headers, use {@link getNumberOfMessageDeliveriesWithHttpInfo}. * @summary Get number of message deliveries * @param date Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-number-of-delivery-messages">LINE Developers documentation</a> */ public async getNumberOfMessageDeliveries( date: string, ): Promise<insight.GetNumberOfMessageDeliveriesResponse> { return this.clients.insight.getNumberOfMessageDeliveries(date); } /** * Returns the number of messages sent from LINE Official Account on a specified day. * Calls `GET https://api.line.me/v2/bot/insight/message/delivery`. * This method returns the response body together with the underlying `httpResponse`. * @summary Get number of message deliveries * @param date Date for which to retrieve number of sent messages. - Format: yyyyMMdd (e.g. 20191231) - Timezone: UTC+9 * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-number-of-delivery-messages">LINE Developers documentation</a> */ public async getNumberOfMessageDeliveriesWithHttpInfo( date: string, ): Promise< Types.ApiResponseType<insight.GetNumberOfMessageDeliveriesResponse> > { return this.clients.insight.getNumberOfMessageDeliveriesWithHttpInfo(date); } /** * Gets rich menu statistics broken down by day for the specified period, for a rich menu created via the Messaging API. Returns the daily impression count for the whole rich menu and the daily click count for each tappable area. When the total number of unique clicks during the period is below the privacy threshold, only `richMenuId` is returned and the other fields are omitted. * Calls `GET https://api.line.me/v2/bot/insight/richmenu/{richMenuId}/daily`. * To inspect the HTTP status code or response headers, use {@link getRichMenuInsightDailyWithHttpInfo}. * @summary Get rich menu insight daily * @param richMenuId ID of the rich menu created via the Messaging API. * @param from Start date of the aggregation period (inclusive). Must be within the most recent 3 years. Format: yyyyMMdd (e.g. 20260213) Time zone: UTC+9 * @param to End date of the aggregation period (inclusive). The end date can be specified for up to 99 days after the start date. Format: yyyyMMdd (e.g. 20260215) Time zone: UTC+9 * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-insight-daily">LINE Developers documentation</a> */ public async getRichMenuInsightDaily( richMenuId: string, from: string, to: string, ): Promise<insight.GetRichMenuInsightDailyResponse> { return this.clients.insight.getRichMenuInsightDaily(richMenuId, from, to); } /** * Gets rich menu statistics broken down by day for the specified period, for a rich menu created via the Messaging API. Returns the daily impression count for the whole rich menu and the daily click count for each tappable area. When the total number of unique clicks during the period is below the privacy threshold, only `richMenuId` is returned and the other fields are omitted. * Calls `GET https://api.line.me/v2/bot/insight/richmenu/{richMenuId}/daily`. * This method returns the response body together with the underlying `httpResponse`. * @summary Get rich menu insight daily * @param richMenuId ID of the rich menu created via the Messaging API. * @param from Start date of the aggregation period (inclusive). Must be within the most recent 3 years. Format: yyyyMMdd (e.g. 20260213) Time zone: UTC+9 * @param to End date of the aggregation period (inclusive). The end date can be specified for up to 99 days after the start date. Format: yyyyMMdd (e.g. 20260215) Time zone: UTC+9 * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-insight-daily">LINE Developers documentation</a> */ public async getRichMenuInsightDailyWithHttpInfo( richMenuId: string, from: string, to: string, ): Promise<Types.ApiResponseType<insight.GetRichMenuInsightDailyResponse>> { return this.clients.insight.getRichMenuInsightDailyWithHttpInfo( richMenuId, from, to, ); } /** * Gets a summary of rich menu statistics for the specified period, for a rich menu created via the Messaging API. Returns the total impression count for the whole rich menu and the click count for each tappable area, aggregated over the entire period as a single result. When the total number of unique clicks during the period is below the privacy threshold, only `richMenuId` is returned and the other fields are omitted. * Calls `GET https://api.line.me/v2/bot/insight/richmenu/{richMenuId}/summary`. * To inspect the HTTP status code or response headers, use {@link getRichMenuInsightSummaryWithHttpInfo}. * @summary Get rich menu insight summary * @param richMenuId ID of the rich menu created via the Messaging API. * @param from Start date of the aggregation period (inclusive). Must be within the most recent 3 years. Format: yyyyMMdd (e.g. 20260213) Time zone: UTC+9 * @param to End date of the aggregation period (inclusive). The end date can be specified for up to 396 days after the start date. Format: yyyyMMdd (e.g. 20260215) Time zone: UTC+9 * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-insight-summary">LINE Developers documentation</a> */ public async getRichMenuInsightSummary( richMenuId: string, from: string, to: string, ): Promise<insight.GetRichMenuInsightSummaryResponse> { return this.clients.insight.getRichMenuInsightSummary(richMenuId, from, to); } /** * Gets a summary of rich menu statistics for the specified period, for a rich menu created via the Messaging API. Returns the total impression count for the whole rich menu and the click count for each tappable area, aggregated over the entire period as a single result. When the total number of unique clicks during the period is below the privacy threshold, only `richMenuId` is returned and the other fields are omitted. * Calls `GET https://api.line.me/v2/bot/insight/richmenu/{richMenuId}/summary`. * This method returns the response body together with the underlying `httpResponse`. * @summary Get rich menu insight summary * @param richMenuId ID of the rich menu created via the Messaging API. * @param from Start date of the aggregation period (inclusive). Must be within the most recent 3 years. Format: yyyyMMdd (e.g. 20260213) Time zone: UTC+9 * @param to End date of the aggregation period (inclusive). The end date can be specified for up to 396 days after the start date. Format: yyyyMMdd (e.g. 20260215) Time zone: UTC+9 * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-insight-summary">LINE Developers documentation</a> */ public async getRichMenuInsightSummaryWithHttpInfo( richMenuId: string, from: string, to: string, ): Promise<Types.ApiResponseType<insight.GetRichMenuInsightSummaryResponse>> { return this.clients.insight.getRichMenuInsightSummaryWithHttpInfo( richMenuId, from, to, ); } /** * You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. * Calls `GET https://api.line.me/v2/bot/insight/message/event/aggregation`. * To inspect the HTTP status code or response headers, use {@link getStatisticsPerUnitWithHttpInfo}. * @param customAggregationUnit Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. * @param from Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 * @param to End date of aggregation period. The end date can be specified for up to 30 days later. For example, if the start date is 20210301, the latest end date is 20210331. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-statistics-per-unit">LINE Developers documentation</a> */ public async getStatisticsPerUnit( customAggregationUnit: string, from: string, to: string, ): Promise<insight.GetStatisticsPerUnitResponse> { return this.clients.insight.getStatisticsPerUnit( customAggregationUnit, from, to, ); } /** * You can check the per-unit statistics of how users interact with push messages and multicast messages sent from your LINE Official Account. * Calls `GET https://api.line.me/v2/bot/insight/message/event/aggregation`. * This method returns the response body together with the underlying `httpResponse`. * @param customAggregationUnit Name of aggregation unit specified when sending the message. Case-sensitive. For example, `Promotion_a` and `Promotion_A` are regarded as different unit names. * @param from Start date of aggregation period. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 * @param to End date of aggregation period. The end date can be specified for up to 30 days later. For example, if the start date is 20210301, the latest end date is 20210331. Format: yyyyMMdd (e.g. 20210301) Time zone: UTC+9 * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-statistics-per-unit">LINE Developers documentation</a> */ public async getStatisticsPerUnitWithHttpInfo( customAggregationUnit: string, from: string, to: string, ): Promise<Types.ApiResponseType<insight.GetStatisticsPerUnitResponse>> { return this.clients.insight.getStatisticsPerUnitWithHttpInfo( customAggregationUnit, from, to, ); } /** * Adding the LIFF app to a channel * Calls `POST https://api.line.me/liff/v1/apps`. * To inspect the HTTP status code or response headers, use {@link addLIFFAppWithHttpInfo}. * @summary Create LIFF app * @param addLiffAppRequest * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/liff-server/#add-liff-app">LINE Developers documentation</a> */ public async addLIFFApp( addLiffAppRequest: liff.AddLiffAppRequest, ): Promise<liff.AddLiffAppResponse> { return this.clients.liff.addLIFFApp(addLiffAppRequest); } /** * Adding the LIFF app to a channel * Calls `POST https://api.line.me/liff/v1/apps`. * This method returns the response body together with the underlying `httpResponse`. * @summary Create LIFF app * @param addLiffAppRequest * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/liff-server/#add-liff-app">LINE Developers documentation</a> */ public async addLIFFAppWithHttpInfo( addLiffAppRequest: liff.AddLiffAppRequest, ): Promise<Types.ApiResponseType<liff.AddLiffAppResponse>> { return this.clients.liff.addLIFFAppWithHttpInfo(addLiffAppRequest); } /** * Deletes a LIFF app from a channel. * Calls `DELETE https://api.line.me/liff/v1/apps/{liffId}`. * To inspect the HTTP status code or response headers, use {@link deleteLIFFAppWithHttpInfo}. * @summary Delete LIFF app from a channel * @param liffId ID of the LIFF app to be updated * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/liff-server/#delete-liff-app">LINE Developers documentation</a> */ public async deleteLIFFApp( liffId: string, ): Promise<Types.MessageAPIResponseBase> { return this.clients.liff.deleteLIFFApp(liffId); } /** * Deletes a LIFF app from a channel. * Calls `DELETE https://api.line.me/liff/v1/apps/{liffId}`. * This method returns the response body together with the underlying `httpResponse`. * @summary Delete LIFF app from a channel * @param liffId ID of the LIFF app to be updated * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/liff-server/#delete-liff-app">LINE Developers documentation</a> */ public async deleteLIFFAppWithHttpInfo( liffId: string, ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> { return this.clients.liff.deleteLIFFAppWithHttpInfo(liffId); } /** * Gets information on all the LIFF apps added to the channel. * Calls `GET https://api.line.me/liff/v1/apps`. * To inspect the HTTP status code or response headers, use {@link getAllLIFFAppsWithHttpInfo}. * @summary Get all LIFF apps * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/liff-server/#get-all-liff-apps">LINE Developers documentation</a> */ public async getAllLIFFApps(): Promise<liff.GetAllLiffAppsResponse> { return this.clients.liff.getAllLIFFApps(); } /** * Gets information on all the LIFF apps added to the channel. * Calls `GET https://api.line.me/liff/v1/apps`. * This method returns the response body together with the underlying `httpResponse`. * @summary Get all LIFF apps * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/liff-server/#get-all-liff-apps">LINE Developers documentation</a> */ public async getAllLIFFAppsWithHttpInfo(): Promise< Types.ApiResponseType<liff.GetAllLiffAppsResponse> > { return this.clients.liff.getAllLIFFAppsWithHttpInfo(); } /** * Update LIFF app settings * Calls `PUT https://api.line.me/liff/v1/apps/{liffId}`. * To inspect the HTTP status code or response headers, use {@link updateLIFFAppWithHttpInfo}. * @summary Update LIFF app from a channel * @param liffId ID of the LIFF app to be updated * @param updateLiffAppRequest * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/liff-server/#update-liff-app">LINE Developers documentation</a> */ public async updateLIFFApp( liffId: string, updateLiffAppRequest: liff.UpdateLiffAppRequest, ): Promise<Types.MessageAPIResponseBase> { return this.clients.liff.updateLIFFApp(liffId, updateLiffAppRequest); } /** * Update LIFF app settings * Calls `PUT https://api.line.me/liff/v1/apps/{liffId}`. * This method returns the response body together with the underlying `httpResponse`. * @summary Update LIFF app from a channel * @param liffId ID of the LIFF app to be updated * @param updateLiffAppRequest * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/liff-server/#update-liff-app">LINE Developers documentation</a> */ public async updateLIFFAppWithHttpInfo( liffId: string, updateLiffAppRequest: liff.UpdateLiffAppRequest, ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> { return this.clients.liff.updateLIFFAppWithHttpInfo( liffId, updateLiffAppRequest, ); } /** * Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) * Calls `PUT https://api.line.me/v2/bot/audienceGroup/upload`. * To inspect the HTTP status code or response headers, use {@link addAudienceToAudienceGroupWithHttpInfo}. * @param addAudienceToAudienceGroupRequest * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#update-upload-audience-group">LINE Developers documentation</a> */ public async addAudienceToAudienceGroup( addAudienceToAudienceGroupRequest: manageAudience.AddAudienceToAudienceGroupRequest, ): Promise<Types.MessageAPIResponseBase> { return this.clients.manageAudience.addAudienceToAudienceGroup( addAudienceToAudienceGroupRequest, ); } /** * Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by JSON) * Calls `PUT https://api.line.me/v2/bot/audienceGroup/upload`. * This method returns the response body together with the underlying `httpResponse`. * @param addAudienceToAudienceGroupRequest * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#update-upload-audience-group">LINE Developers documentation</a> */ public async addAudienceToAudienceGroupWithHttpInfo( addAudienceToAudienceGroupRequest: manageAudience.AddAudienceToAudienceGroupRequest, ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> { return this.clients.manageAudience.addAudienceToAudienceGroupWithHttpInfo( addAudienceToAudienceGroupRequest, ); } /** * Create audience for uploading user IDs (by JSON) * Calls `POST https://api.line.me/v2/bot/audienceGroup/upload`. * To inspect the HTTP status code or response headers, use {@link createAudienceGroupWithHttpInfo}. * @param createAudienceGroupRequest * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-upload-audience-group">LINE Developers documentation</a> */ public async createAudienceGroup( createAudienceGroupRequest: manageAudience.CreateAudienceGroupRequest, ): Promise<manageAudience.CreateAudienceGroupResponse> { return this.clients.manageAudience.createAudienceGroup( createAudienceGroupRequest, ); } /** * Create audience for uploading user IDs (by JSON) * Calls `POST https://api.line.me/v2/bot/audienceGroup/upload`. * This method returns the response body together with the underlying `httpResponse`. * @param createAudienceGroupRequest * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-upload-audience-group">LINE Developers documentation</a> */ public async createAudienceGroupWithHttpInfo( createAudienceGroupRequest: manageAudience.CreateAudienceGroupRequest, ): Promise< Types.ApiResponseType<manageAudience.CreateAudienceGroupResponse> > { return this.clients.manageAudience.createAudienceGroupWithHttpInfo( createAudienceGroupRequest, ); } /** * Create audience for click-based retargeting * Calls `POST https://api.line.me/v2/bot/audienceGroup/click`. * To inspect the HTTP status code or response headers, use {@link createClickBasedAudienceGroupWithHttpInfo}. * @param createClickBasedAudienceGroupRequest * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-click-audience-group">LINE Developers documentation</a> */ public async createClickBasedAudienceGroup( createClickBasedAudienceGroupRequest: manageAudience.CreateClickBasedAudienceGroupRequest, ): Promise<manageAudience.CreateClickBasedAudienceGroupResponse> { return this.clients.manageAudience.createClickBasedAudienceGroup( createClickBasedAudienceGroupRequest, ); } /** * Create audience for click-based retargeting * Calls `POST https://api.line.me/v2/bot/audienceGroup/click`. * This method returns the response body together with the underlying `httpResponse`. * @param createClickBasedAudienceGroupRequest * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-click-audience-group">LINE Developers documentation</a> */ public async createClickBasedAudienceGroupWithHttpInfo( createClickBasedAudienceGroupRequest: manageAudience.CreateClickBasedAudienceGroupRequest, ): Promise< Types.ApiResponseType<manageAudience.CreateClickBasedAudienceGroupResponse> > { return this.clients.manageAudience.createClickBasedAudienceGroupWithHttpInfo( createClickBasedAudienceGroupRequest, ); } /** * Create audience for impression-based retargeting * Calls `POST https://api.line.me/v2/bot/audienceGroup/imp`. * To inspect the HTTP status code or response headers, use {@link createImpBasedAudienceGroupWithHttpInfo}. * @param createImpBasedAudienceGroupRequest * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-imp-audience-group">LINE Developers documentation</a> */ public async createImpBasedAudienceGroup( createImpBasedAudienceGroupRequest: manageAudience.CreateImpBasedAudienceGroupRequest, ): Promise<manageAudience.CreateImpBasedAudienceGroupResponse> { return this.clients.manageAudience.createImpBasedAudienceGroup( createImpBasedAudienceGroupRequest, ); } /** * Create audience for impression-based retargeting * Calls `POST https://api.line.me/v2/bot/audienceGroup/imp`. * This method returns the response body together with the underlying `httpResponse`. * @param createImpBasedAudienceGroupRequest * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-imp-audience-group">LINE Developers documentation</a> */ public async createImpBasedAudienceGroupWithHttpInfo( createImpBasedAudienceGroupRequest: manageAudience.CreateImpBasedAudienceGroupRequest, ): Promise< Types.ApiResponseType<manageAudience.CreateImpBasedAudienceGroupResponse> > { return this.clients.manageAudience.createImpBasedAudienceGroupWithHttpInfo( createImpBasedAudienceGroupRequest, ); } /** * Delete audience * Calls `DELETE https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}`. * To inspect the HTTP status code or response headers, use {@link deleteAudienceGroupWithHttpInfo}. * @param audienceGroupId The audience ID. * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#delete-audience-group">LINE Developers documentation</a> */ public async deleteAudienceGroup( audienceGroupId: number, ): Promise<Types.MessageAPIResponseBase> { return this.clients.manageAudience.deleteAudienceGroup(audienceGroupId); } /** * Delete audience * Calls `DELETE https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}`. * This method returns the response body together with the underlying `httpResponse`. * @param audienceGroupId The audience ID. * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#delete-audience-group">LINE Developers documentation</a> */ public async deleteAudienceGroupWithHttpInfo( audienceGroupId: number, ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> { return this.clients.manageAudience.deleteAudienceGroupWithHttpInfo( audienceGroupId, ); } /** * Gets audience data. * Calls `GET https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}`. * To inspect the HTTP status code or response headers, use {@link getAudienceDataWithHttpInfo}. * @param audienceGroupId The audience ID. * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-group">LINE Developers documentation</a> */ public async getAudienceData( audienceGroupId: number, ): Promise<manageAudience.GetAudienceDataResponse> { return this.clients.manageAudience.getAudienceData(audienceGroupId); } /** * Gets audience data. * Calls `GET https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}`. * This method returns the response body together with the underlying `httpResponse`. * @param audienceGroupId The audience ID. * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-group">LINE Developers documentation</a> */ public async getAudienceDataWithHttpInfo( audienceGroupId: number, ): Promise<Types.ApiResponseType<manageAudience.GetAudienceDataResponse>> { return this.clients.manageAudience.getAudienceDataWithHttpInfo( audienceGroupId, ); } /** * Gets data for more than one audience. * Calls `GET https://api.line.me/v2/bot/audienceGroup/list`. * To inspect the HTTP status code or response headers, use {@link getAudienceGroupsWithHttpInfo}. * @param page The page to return when getting (paginated) results. Must be 1 or higher. * @param description The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. * @param status The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. * @param size The number of audiences per page. Default: 20 Max: 40 * @param includesExternalPublicGroups true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. * @param createRoute How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-groups">LINE Developers documentation</a> */ public async getAudienceGroups( page: number, description?: string, status?: manageAudience.AudienceGroupStatus, size?: number, includesExternalPublicGroups?: boolean, createRoute?: manageAudience.AudienceGroupCreateRoute, ): Promise<manageAudience.GetAudienceGroupsResponse> { return this.clients.manageAudience.getAudienceGroups( page, description, status, size, includesExternalPublicGroups, createRoute, ); } /** * Gets data for more than one audience. * Calls `GET https://api.line.me/v2/bot/audienceGroup/list`. * This method returns the response body together with the underlying `httpResponse`. * @param page The page to return when getting (paginated) results. Must be 1 or higher. * @param description The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. * @param status The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. * @param size The number of audiences per page. Default: 20 Max: 40 * @param includesExternalPublicGroups true (default): Get public audiences created in all channels linked to the same bot. false: Get audiences created in the same channel. * @param createRoute How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-audience-groups">LINE Developers documentation</a> */ public async getAudienceGroupsWithHttpInfo( page: number, description?: string, status?: manageAudience.AudienceGroupStatus, size?: number, includesExternalPublicGroups?: boolean, createRoute?: manageAudience.AudienceGroupCreateRoute, ): Promise<Types.ApiResponseType<manageAudience.GetAudienceGroupsResponse>> { return this.clients.manageAudience.getAudienceGroupsWithHttpInfo( page, description, status, size, includesExternalPublicGroups, createRoute, ); } /** * Gets audience data. * Calls `GET https://api.line.me/v2/bot/audienceGroup/shared/{audienceGroupId}`. * To inspect the HTTP status code or response headers, use {@link getSharedAudienceDataWithHttpInfo}. * @param audienceGroupId The audience ID. * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience">LINE Developers documentation</a> */ public async getSharedAudienceData( audienceGroupId: number, ): Promise<manageAudience.GetSharedAudienceDataResponse> { return this.clients.manageAudience.getSharedAudienceData(audienceGroupId); } /** * Gets audience data. * Calls `GET https://api.line.me/v2/bot/audienceGroup/shared/{audienceGroupId}`. * This method returns the response body together with the underlying `httpResponse`. * @param audienceGroupId The audience ID. * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience">LINE Developers documentation</a> */ public async getSharedAudienceDataWithHttpInfo( audienceGroupId: number, ): Promise< Types.ApiResponseType<manageAudience.GetSharedAudienceDataResponse> > { return this.clients.manageAudience.getSharedAudienceDataWithHttpInfo( audienceGroupId, ); } /** * Gets data for more than one audience, including those shared by the Business Manager. * Calls `GET https://api.line.me/v2/bot/audienceGroup/shared/list`. * To inspect the HTTP status code or response headers, use {@link getSharedAudienceGroupsWithHttpInfo}. * @param page The page to return when getting (paginated) results. Must be 1 or higher. * @param description The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. * @param status The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. * @param size The number of audiences per page. Default: 20 Max: 40 * @param createRoute How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. * @param includesOwnedAudienceGroups true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list">LINE Developers documentation</a> */ public async getSharedAudienceGroups( page: number, description?: string, status?: manageAudience.AudienceGroupStatus, size?: number, createRoute?: manageAudience.AudienceGroupCreateRoute, includesOwnedAudienceGroups?: boolean, ): Promise<manageAudience.GetSharedAudienceGroupsResponse> { return this.clients.manageAudience.getSharedAudienceGroups( page, description, status, size, createRoute, includesOwnedAudienceGroups, ); } /** * Gets data for more than one audience, including those shared by the Business Manager. * Calls `GET https://api.line.me/v2/bot/audienceGroup/shared/list`. * This method returns the response body together with the underlying `httpResponse`. * @param page The page to return when getting (paginated) results. Must be 1 or higher. * @param description The name of the audience(s) to return. You can search for partial matches. This is case-insensitive, meaning AUDIENCE and audience are considered identical. If omitted, the name of the audience(s) will not be used as a search criterion. * @param status The status of the audience(s) to return. If omitted, the status of the audience(s) will not be used as a search criterion. * @param size The number of audiences per page. Default: 20 Max: 40 * @param createRoute How the audience was created. If omitted, all audiences are included. `OA_MANAGER`: Return only audiences created with LINE Official Account Manager (opens new window). `MESSAGING_API`: Return only audiences created with Messaging API. * @param includesOwnedAudienceGroups true: Include audienceGroups owned by LINE Official Account Manager false: Respond only audienceGroups shared by Business Manager * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-shared-audience-list">LINE Developers documentation</a> */ public async getSharedAudienceGroupsWithHttpInfo( page: number, description?: string, status?: manageAudience.AudienceGroupStatus, size?: number, createRoute?: manageAudience.AudienceGroupCreateRoute, includesOwnedAudienceGroups?: boolean, ): Promise< Types.ApiResponseType<manageAudience.GetSharedAudienceGroupsResponse> > { return this.clients.manageAudience.getSharedAudienceGroupsWithHttpInfo( page, description, status, size, createRoute, includesOwnedAudienceGroups, ); } /** * Renames an existing audience. * Calls `PUT https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}/updateDescription`. * To inspect the HTTP status code or response headers, use {@link updateAudienceGroupDescriptionWithHttpInfo}. * @param audienceGroupId The audience ID. * @param updateAudienceGroupDescriptionRequest * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#set-description-audience-group">LINE Developers documentation</a> */ public async updateAudienceGroupDescription( audienceGroupId: number, updateAudienceGroupDescriptionRequest: manageAudience.UpdateAudienceGroupDescriptionRequest, ): Promise<Types.MessageAPIResponseBase> { return this.clients.manageAudience.updateAudienceGroupDescription( audienceGroupId, updateAudienceGroupDescriptionRequest, ); } /** * Renames an existing audience. * Calls `PUT https://api.line.me/v2/bot/audienceGroup/{audienceGroupId}/updateDescription`. * This method returns the response body together with the underlying `httpResponse`. * @param audienceGroupId The audience ID. * @param updateAudienceGroupDescriptionRequest * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#set-description-audience-group">LINE Developers documentation</a> */ public async updateAudienceGroupDescriptionWithHttpInfo( audienceGroupId: number, updateAudienceGroupDescriptionRequest: manageAudience.UpdateAudienceGroupDescriptionRequest, ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> { return this.clients.manageAudience.updateAudienceGroupDescriptionWithHttpInfo( audienceGroupId, updateAudienceGroupDescriptionRequest, ); } /** * Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file). * Calls `PUT https://api-data.line.me/v2/bot/audienceGroup/upload/byFile`. * To inspect the HTTP status code or response headers, use {@link addUserIdsToAudienceWithHttpInfo}. * @param file A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 * @param audienceGroupId The audience ID. * @param uploadDescription The description to register with the job * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#update-upload-audience-group-by-file">LINE Developers documentation</a> */ public async addUserIdsToAudience( file: Blob, audienceGroupId?: number, uploadDescription?: string, ): Promise<Types.MessageAPIResponseBase> { return this.clients.manageAudienceBlob.addUserIdsToAudience( file, audienceGroupId, uploadDescription, ); } /** * Add user IDs or Identifiers for Advertisers (IFAs) to an audience for uploading user IDs (by file). * Calls `PUT https://api-data.line.me/v2/bot/audienceGroup/upload/byFile`. * This method returns the response body together with the underlying `httpResponse`. * @param file A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 * @param audienceGroupId The audience ID. * @param uploadDescription The description to register with the job * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#update-upload-audience-group-by-file">LINE Developers documentation</a> */ public async addUserIdsToAudienceWithHttpInfo( file: Blob, audienceGroupId?: number, uploadDescription?: string, ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> { return this.clients.manageAudienceBlob.addUserIdsToAudienceWithHttpInfo( file, audienceGroupId, uploadDescription, ); } /** * Create audience for uploading user IDs (by file). * Calls `POST https://api-data.line.me/v2/bot/audienceGroup/upload/byFile`. * To inspect the HTTP status code or response headers, use {@link createAudienceForUploadingUserIdsWithHttpInfo}. * @param file A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 * @param description The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 * @param isIfaAudience To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. * @param uploadDescription The description to register for the job (in `jobs[].description`). * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-upload-audience-group-by-file">LINE Developers documentation</a> */ public async createAudienceForUploadingUserIds( file: Blob, description?: string, isIfaAudience?: boolean, uploadDescription?: string, ): Promise<manageAudience.CreateAudienceGroupResponse> { return this.clients.manageAudienceBlob.createAudienceForUploadingUserIds( file, description, isIfaAudience, uploadDescription, ); } /** * Create audience for uploading user IDs (by file). * Calls `POST https://api-data.line.me/v2/bot/audienceGroup/upload/byFile`. * This method returns the response body together with the underlying `httpResponse`. * @param file A text file with one user ID or IFA entered per line. Specify text/plain as Content-Type. Max file number: 1 Max number: 1,500,000 * @param description The audience's name. This is case-insensitive, meaning AUDIENCE and audience are considered identical. Max character limit: 120 * @param isIfaAudience To specify recipients by IFAs: set `true`. To specify recipients by user IDs: set `false` or omit isIfaAudience property. * @param uploadDescription The description to register for the job (in `jobs[].description`). * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-upload-audience-group-by-file">LINE Developers documentation</a> */ public async createAudienceForUploadingUserIdsWithHttpInfo( file: Blob, description?: string, isIfaAudience?: boolean, uploadDescription?: string, ): Promise< Types.ApiResponseType<manageAudience.CreateAudienceGroupResponse> > { return this.clients.manageAudienceBlob.createAudienceForUploadingUserIdsWithHttpInfo( file, description, isIfaAudience, uploadDescription, ); } /** * Sends a message to multiple users at any time. * Calls `POST https://api.line.me/v2/bot/message/broadcast`. * To inspect the HTTP status code or response headers, use {@link broadcastWithHttpInfo}. * @param broadcastRequest * @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. * @returns A promise resolving to the response body. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#send-broadcast-message">LINE Developers documentation</a> */ public async broadcast( broadcastRequest: messagingApi.BroadcastRequest, xLineRetryKey?: string, ): Promise<object> { return this.clients.messagingApi.broadcast(broadcastRequest, xLineRetryKey); } /** * Sends a message to multiple users at any time. * Calls `POST https://api.line.me/v2/bot/message/broadcast`. * This method returns the response body together with the underlying `httpResponse`. * @param broadcastRequest * @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. * @returns A promise resolving to the response body together with the underlying `httpResponse`. * @see <a href="https://developers.line.biz/en/reference/messaging-api/#send-broadcast-message">LINE Developers documentation</a> */ public async broadcastWithHttpInfo( broadcastRequest: messagingApi.BroadcastRequest, xLineRetryKey?: string, ): Promise<Types.ApiResponseType<object>> { return this.clients.messagingApi.broadcastWithHtt