/**
 * LINE Messaging API
 * This document describes LINE Messaging API.
 *
 * The version of the OpenAPI document: 0.0.1
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

/* tslint:disable:no-unused-locals */
import { BotInfoResponse } from "../model/botInfoResponse.js";
import { BroadcastRequest } from "../model/broadcastRequest.js";
import { CouponCreateRequest } from "../model/couponCreateRequest.js";
import { CouponCreateResponse } from "../model/couponCreateResponse.js";
import { CouponResponse } from "../model/couponResponse.js";
import { CreateRichMenuAliasRequest } from "../model/createRichMenuAliasRequest.js";
import { ErrorResponse } from "../model/errorResponse.js";
import { GetAggregationUnitNameListResponse } from "../model/getAggregationUnitNameListResponse.js";
import { GetAggregationUnitUsageResponse } from "../model/getAggregationUnitUsageResponse.js";
import { GetFollowersResponse } from "../model/getFollowersResponse.js";
import { GetJoinedMembershipUsersResponse } from "../model/getJoinedMembershipUsersResponse.js";
import { GetMembershipSubscriptionResponse } from "../model/getMembershipSubscriptionResponse.js";
import { GetWebhookEndpointResponse } from "../model/getWebhookEndpointResponse.js";
import { GroupMemberCountResponse } from "../model/groupMemberCountResponse.js";
import { GroupSummaryResponse } from "../model/groupSummaryResponse.js";
import { GroupUserProfileResponse } from "../model/groupUserProfileResponse.js";
import { IssueLinkTokenResponse } from "../model/issueLinkTokenResponse.js";
import { MarkMessagesAsReadByTokenRequest } from "../model/markMessagesAsReadByTokenRequest.js";
import { MarkMessagesAsReadRequest } from "../model/markMessagesAsReadRequest.js";
import { MembersIdsResponse } from "../model/membersIdsResponse.js";
import { MembershipListResponse } from "../model/membershipListResponse.js";
import { MessageQuotaResponse } from "../model/messageQuotaResponse.js";
import { MessagingApiPagerCouponListResponse } from "../model/messagingApiPagerCouponListResponse.js";
import { MulticastRequest } from "../model/multicastRequest.js";
import { NarrowcastProgressResponse } from "../model/narrowcastProgressResponse.js";
import { NarrowcastRequest } from "../model/narrowcastRequest.js";
import { NumberOfMessagesResponse } from "../model/numberOfMessagesResponse.js";
import { PnpMessagesRequest } from "../model/pnpMessagesRequest.js";
import { PushMessageRequest } from "../model/pushMessageRequest.js";
import { PushMessageResponse } from "../model/pushMessageResponse.js";
import { QuotaConsumptionResponse } from "../model/quotaConsumptionResponse.js";
import { ReplyMessageRequest } from "../model/replyMessageRequest.js";
import { ReplyMessageResponse } from "../model/replyMessageResponse.js";
import { RichMenuAliasListResponse } from "../model/richMenuAliasListResponse.js";
import { RichMenuAliasResponse } from "../model/richMenuAliasResponse.js";
import { RichMenuBatchProgressResponse } from "../model/richMenuBatchProgressResponse.js";
import { RichMenuBatchRequest } from "../model/richMenuBatchRequest.js";
import { RichMenuBulkLinkRequest } from "../model/richMenuBulkLinkRequest.js";
import { RichMenuBulkUnlinkRequest } from "../model/richMenuBulkUnlinkRequest.js";
import { RichMenuIdResponse } from "../model/richMenuIdResponse.js";
import { RichMenuListResponse } from "../model/richMenuListResponse.js";
import { RichMenuRequest } from "../model/richMenuRequest.js";
import { RichMenuResponse } from "../model/richMenuResponse.js";
import { RoomMemberCountResponse } from "../model/roomMemberCountResponse.js";
import { RoomUserProfileResponse } from "../model/roomUserProfileResponse.js";
import { SetWebhookEndpointRequest } from "../model/setWebhookEndpointRequest.js";
import { ShowLoadingAnimationRequest } from "../model/showLoadingAnimationRequest.js";
import { TestWebhookEndpointRequest } from "../model/testWebhookEndpointRequest.js";
import { TestWebhookEndpointResponse } from "../model/testWebhookEndpointResponse.js";
import { UpdateRichMenuAliasRequest } from "../model/updateRichMenuAliasRequest.js";
import { UserProfileResponse } from "../model/userProfileResponse.js";
import { ValidateMessageRequest } from "../model/validateMessageRequest.js";

import * as Types from "../../types.js";
import { ensureJSON, buildPath } from "../../utils.js";
import { Readable } from "node:stream";

import HTTPFetchClient, {
  convertResponseToReadable,
  mergeHeaders,
} from "../../http-fetch.js";

// ===============================================
// This file is autogenerated - Please do not edit
// ===============================================

interface httpClientConfig {
  /**
   * Base URL for requests.
   * Defaults to 'https://api.line.me'.
   * You can override this for testing or to use a mock server.
   */
  baseURL?: string;
  /**
   * Channel access token used for authorization.
   */
  channelAccessToken: string;
  /**
   * Extra headers merged into every request.
   */
  defaultHeaders?: Record<string, string>;
}

/**
 * @see {@link LineBotClient} for a unified interface that wraps this client.
 */

export class MessagingApiClient {
  private httpClient: HTTPFetchClient;

  /**
   * Initializes a new `MessagingApiClient`.
   *
   * @param config Configuration for this API client.
   * @param config.baseURL The base URL for requests. Defaults to `https://api.line.me`.
   * @param config.channelAccessToken The channel access token used for authorization.
   * @param config.defaultHeaders Extra headers merged into every request.
   *
   * @example
   * const client = new MessagingApiClient({
   *   channelAccessToken: process.env.LINE_CHANNEL_ACCESS_TOKEN!,
   * });
   */
  constructor(config: httpClientConfig) {
    const baseURL = config.baseURL || "https://api.line.me";
    const defaultHeaders = mergeHeaders(config.defaultHeaders, {
      Authorization: "Bearer " + config.channelAccessToken,
    });
    this.httpClient = new HTTPFetchClient({
      defaultHeaders: defaultHeaders,
      baseURL: baseURL,
    });
  }

  /**
   * 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: BroadcastRequest,
    xLineRetryKey?: string,
  ): Promise<object> {
    return (await this.broadcastWithHttpInfo(broadcastRequest, xLineRetryKey))
      .body;
  }

  /**
   * 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: BroadcastRequest,
    xLineRetryKey?: string,
  ): Promise<Types.ApiResponseType<object>> {
    const params = broadcastRequest;

    const headerParams = {
      ...(xLineRetryKey != null ? { "X-Line-Retry-Key": xLineRetryKey } : {}),
    };

    const res = await this.httpClient.post(
      "/v2/bot/message/broadcast",
      params,
      { headers: headerParams },
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Cancel default rich menu
   * Calls `DELETE https://api.line.me/v2/bot/user/all/richmenu`.
   * To inspect the HTTP status code or response headers, use {@link cancelDefaultRichMenuWithHttpInfo}.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#cancel-default-rich-menu">LINE Developers documentation</a>
   */
  public async cancelDefaultRichMenu(): Promise<Types.MessageAPIResponseBase> {
    return (await this.cancelDefaultRichMenuWithHttpInfo()).body;
  }

  /**
   * Cancel default rich menu
   * Calls `DELETE https://api.line.me/v2/bot/user/all/richmenu`.
   * 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/#cancel-default-rich-menu">LINE Developers documentation</a>
   */
  public async cancelDefaultRichMenuWithHttpInfo(): Promise<
    Types.ApiResponseType<Types.MessageAPIResponseBase>
  > {
    const res = await this.httpClient.delete("/v2/bot/user/all/richmenu");
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Close coupon
   * Calls `PUT https://api.line.me/v2/bot/coupon/{couponId}/close`.
   * To inspect the HTTP status code or response headers, use {@link closeCouponWithHttpInfo}.
   * @param couponId
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#discontinue-coupon">LINE Developers documentation</a>
   */
  public async closeCoupon(
    couponId: string,
  ): Promise<Types.MessageAPIResponseBase> {
    return (await this.closeCouponWithHttpInfo(couponId)).body;
  }

  /**
   * Close coupon
   * Calls `PUT https://api.line.me/v2/bot/coupon/{couponId}/close`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param couponId
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#discontinue-coupon">LINE Developers documentation</a>
   */
  public async closeCouponWithHttpInfo(
    couponId: string,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const requestPath = buildPath("/v2/bot/coupon/{couponId}/close", {
      couponId: couponId,
    });

    const res = await this.httpClient.put(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Create a new coupon. Define coupon details such as type, title, and validity period.
   * Calls `POST https://api.line.me/v2/bot/coupon`.
   * To inspect the HTTP status code or response headers, use {@link createCouponWithHttpInfo}.
   * @param couponCreateRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-coupon">LINE Developers documentation</a>
   */
  public async createCoupon(
    couponCreateRequest?: CouponCreateRequest,
  ): Promise<CouponCreateResponse> {
    return (await this.createCouponWithHttpInfo(couponCreateRequest)).body;
  }

  /**
   * Create a new coupon. Define coupon details such as type, title, and validity period.
   * Calls `POST https://api.line.me/v2/bot/coupon`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param couponCreateRequest
   * @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-coupon">LINE Developers documentation</a>
   */
  public async createCouponWithHttpInfo(
    couponCreateRequest?: CouponCreateRequest,
  ): Promise<Types.ApiResponseType<CouponCreateResponse>> {
    const params = couponCreateRequest;

    const res = await this.httpClient.post("/v2/bot/coupon", params);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Create rich menu
   * Calls `POST https://api.line.me/v2/bot/richmenu`.
   * To inspect the HTTP status code or response headers, use {@link createRichMenuWithHttpInfo}.
   * @param richMenuRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-rich-menu">LINE Developers documentation</a>
   */
  public async createRichMenu(
    richMenuRequest: RichMenuRequest,
  ): Promise<RichMenuIdResponse> {
    return (await this.createRichMenuWithHttpInfo(richMenuRequest)).body;
  }

  /**
   * Create rich menu
   * Calls `POST https://api.line.me/v2/bot/richmenu`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param richMenuRequest
   * @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-rich-menu">LINE Developers documentation</a>
   */
  public async createRichMenuWithHttpInfo(
    richMenuRequest: RichMenuRequest,
  ): Promise<Types.ApiResponseType<RichMenuIdResponse>> {
    const params = richMenuRequest;

    const res = await this.httpClient.post("/v2/bot/richmenu", params);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Create rich menu alias
   * Calls `POST https://api.line.me/v2/bot/richmenu/alias`.
   * To inspect the HTTP status code or response headers, use {@link createRichMenuAliasWithHttpInfo}.
   * @param createRichMenuAliasRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#create-rich-menu-alias">LINE Developers documentation</a>
   */
  public async createRichMenuAlias(
    createRichMenuAliasRequest: CreateRichMenuAliasRequest,
  ): Promise<Types.MessageAPIResponseBase> {
    return (
      await this.createRichMenuAliasWithHttpInfo(createRichMenuAliasRequest)
    ).body;
  }

  /**
   * Create rich menu alias
   * Calls `POST https://api.line.me/v2/bot/richmenu/alias`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param createRichMenuAliasRequest
   * @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-rich-menu-alias">LINE Developers documentation</a>
   */
  public async createRichMenuAliasWithHttpInfo(
    createRichMenuAliasRequest: CreateRichMenuAliasRequest,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const params = createRichMenuAliasRequest;

    const res = await this.httpClient.post("/v2/bot/richmenu/alias", params);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Deletes a rich menu.
   * Calls `DELETE https://api.line.me/v2/bot/richmenu/{richMenuId}`.
   * To inspect the HTTP status code or response headers, use {@link deleteRichMenuWithHttpInfo}.
   * @param richMenuId ID of a rich menu
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#delete-rich-menu">LINE Developers documentation</a>
   */
  public async deleteRichMenu(
    richMenuId: string,
  ): Promise<Types.MessageAPIResponseBase> {
    return (await this.deleteRichMenuWithHttpInfo(richMenuId)).body;
  }

  /**
   * Deletes a rich menu.
   * Calls `DELETE https://api.line.me/v2/bot/richmenu/{richMenuId}`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param richMenuId ID of a rich menu
   * @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-rich-menu">LINE Developers documentation</a>
   */
  public async deleteRichMenuWithHttpInfo(
    richMenuId: string,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const requestPath = buildPath("/v2/bot/richmenu/{richMenuId}", {
      richMenuId: richMenuId,
    });

    const res = await this.httpClient.delete(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Delete rich menu alias
   * Calls `DELETE https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId}`.
   * To inspect the HTTP status code or response headers, use {@link deleteRichMenuAliasWithHttpInfo}.
   * @param richMenuAliasId Rich menu alias ID that you want to delete.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#delete-rich-menu-alias">LINE Developers documentation</a>
   */
  public async deleteRichMenuAlias(
    richMenuAliasId: string,
  ): Promise<Types.MessageAPIResponseBase> {
    return (await this.deleteRichMenuAliasWithHttpInfo(richMenuAliasId)).body;
  }

  /**
   * Delete rich menu alias
   * Calls `DELETE https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId}`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param richMenuAliasId Rich menu alias ID that you want to delete.
   * @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-rich-menu-alias">LINE Developers documentation</a>
   */
  public async deleteRichMenuAliasWithHttpInfo(
    richMenuAliasId: string,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const requestPath = buildPath("/v2/bot/richmenu/alias/{richMenuAliasId}", {
      richMenuAliasId: richMenuAliasId,
    });

    const res = await this.httpClient.delete(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get name list of units used this month
   * Calls `GET https://api.line.me/v2/bot/message/aggregation/list`.
   * To inspect the HTTP status code or response headers, use {@link getAggregationUnitNameListWithHttpInfo}.
   * @param limit The maximum number of aggregation units you can get per request.
   * @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.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-name-list-of-units-used-this-month">LINE Developers documentation</a>
   */
  public async getAggregationUnitNameList(
    limit?: string,
    start?: string,
  ): Promise<GetAggregationUnitNameListResponse> {
    return (await this.getAggregationUnitNameListWithHttpInfo(limit, start))
      .body;
  }

  /**
   * Get name list of units used this month
   * Calls `GET https://api.line.me/v2/bot/message/aggregation/list`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param limit The maximum number of aggregation units you can get per request.
   * @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.
   * @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-name-list-of-units-used-this-month">LINE Developers documentation</a>
   */
  public async getAggregationUnitNameListWithHttpInfo(
    limit?: string,
    start?: string,
  ): Promise<Types.ApiResponseType<GetAggregationUnitNameListResponse>> {
    const queryParams = {
      limit: limit,
      start: start,
    };

    if (queryParams["limit"] === undefined) {
      delete queryParams["limit"];
    }

    if (queryParams["start"] === undefined) {
      delete queryParams["start"];
    }

    const res = await this.httpClient.get(
      "/v2/bot/message/aggregation/list",
      queryParams,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get number of units used this month
   * Calls `GET https://api.line.me/v2/bot/message/aggregation/info`.
   * To inspect the HTTP status code or response headers, use {@link getAggregationUnitUsageWithHttpInfo}.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-number-of-units-used-this-month">LINE Developers documentation</a>
   */
  public async getAggregationUnitUsage(): Promise<GetAggregationUnitUsageResponse> {
    return (await this.getAggregationUnitUsageWithHttpInfo()).body;
  }

  /**
   * Get number of units used this month
   * Calls `GET https://api.line.me/v2/bot/message/aggregation/info`.
   * 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-number-of-units-used-this-month">LINE Developers documentation</a>
   */
  public async getAggregationUnitUsageWithHttpInfo(): Promise<
    Types.ApiResponseType<GetAggregationUnitUsageResponse>
  > {
    const res = await this.httpClient.get("/v2/bot/message/aggregation/info");
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get bot info
   * Calls `GET https://api.line.me/v2/bot/info`.
   * To inspect the HTTP status code or response headers, use {@link getBotInfoWithHttpInfo}.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-bot-info">LINE Developers documentation</a>
   */
  public async getBotInfo(): Promise<BotInfoResponse> {
    return (await this.getBotInfoWithHttpInfo()).body;
  }

  /**
   * Get bot info
   * Calls `GET https://api.line.me/v2/bot/info`.
   * 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-bot-info">LINE Developers documentation</a>
   */
  public async getBotInfoWithHttpInfo(): Promise<
    Types.ApiResponseType<BotInfoResponse>
  > {
    const res = await this.httpClient.get("/v2/bot/info");
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get coupon detail
   * Calls `GET https://api.line.me/v2/bot/coupon/{couponId}`.
   * To inspect the HTTP status code or response headers, use {@link getCouponDetailWithHttpInfo}.
   * @param couponId
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-coupon">LINE Developers documentation</a>
   */
  public async getCouponDetail(couponId: string): Promise<CouponResponse> {
    return (await this.getCouponDetailWithHttpInfo(couponId)).body;
  }

  /**
   * Get coupon detail
   * Calls `GET https://api.line.me/v2/bot/coupon/{couponId}`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param couponId
   * @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-coupon">LINE Developers documentation</a>
   */
  public async getCouponDetailWithHttpInfo(
    couponId: string,
  ): Promise<Types.ApiResponseType<CouponResponse>> {
    const requestPath = buildPath("/v2/bot/coupon/{couponId}", {
      couponId: couponId,
    });

    const res = await this.httpClient.get(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Gets the ID of the default rich menu set with the Messaging API.
   * Calls `GET https://api.line.me/v2/bot/user/all/richmenu`.
   * To inspect the HTTP status code or response headers, use {@link getDefaultRichMenuIdWithHttpInfo}.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-default-rich-menu-id">LINE Developers documentation</a>
   */
  public async getDefaultRichMenuId(): Promise<RichMenuIdResponse> {
    return (await this.getDefaultRichMenuIdWithHttpInfo()).body;
  }

  /**
   * Gets the ID of the default rich menu set with the Messaging API.
   * Calls `GET https://api.line.me/v2/bot/user/all/richmenu`.
   * 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-default-rich-menu-id">LINE Developers documentation</a>
   */
  public async getDefaultRichMenuIdWithHttpInfo(): Promise<
    Types.ApiResponseType<RichMenuIdResponse>
  > {
    const res = await this.httpClient.get("/v2/bot/user/all/richmenu");
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get a list of users who added your LINE Official Account as a friend
   * Calls `GET https://api.line.me/v2/bot/followers/ids`.
   * To inspect the HTTP status code or response headers, use {@link getFollowersWithHttpInfo}.
   * @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.
   * @param limit The maximum number of user IDs to retrieve in a single request.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-follower-ids">LINE Developers documentation</a>
   */
  public async getFollowers(
    start?: string,
    limit?: number,
  ): Promise<GetFollowersResponse> {
    return (await this.getFollowersWithHttpInfo(start, limit)).body;
  }

  /**
   * Get a list of users who added your LINE Official Account as a friend
   * Calls `GET https://api.line.me/v2/bot/followers/ids`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @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.
   * @param limit The maximum number of user IDs to retrieve in a single request.
   * @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-follower-ids">LINE Developers documentation</a>
   */
  public async getFollowersWithHttpInfo(
    start?: string,
    limit?: number,
  ): Promise<Types.ApiResponseType<GetFollowersResponse>> {
    const queryParams = {
      start: start,
      limit: limit,
    };

    if (queryParams["start"] === undefined) {
      delete queryParams["start"];
    }

    if (queryParams["limit"] === undefined) {
      delete queryParams["limit"];
    }

    const res = await this.httpClient.get("/v2/bot/followers/ids", queryParams);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get number of users in a group chat
   * Calls `GET https://api.line.me/v2/bot/group/{groupId}/members/count`.
   * To inspect the HTTP status code or response headers, use {@link getGroupMemberCountWithHttpInfo}.
   * @param groupId Group ID
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-members-group-count">LINE Developers documentation</a>
   */
  public async getGroupMemberCount(
    groupId: string,
  ): Promise<GroupMemberCountResponse> {
    return (await this.getGroupMemberCountWithHttpInfo(groupId)).body;
  }

  /**
   * Get number of users in a group chat
   * Calls `GET https://api.line.me/v2/bot/group/{groupId}/members/count`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param groupId Group 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-members-group-count">LINE Developers documentation</a>
   */
  public async getGroupMemberCountWithHttpInfo(
    groupId: string,
  ): Promise<Types.ApiResponseType<GroupMemberCountResponse>> {
    const requestPath = buildPath("/v2/bot/group/{groupId}/members/count", {
      groupId: groupId,
    });

    const res = await this.httpClient.get(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get group chat member profile
   * Calls `GET https://api.line.me/v2/bot/group/{groupId}/member/{userId}`.
   * To inspect the HTTP status code or response headers, use {@link getGroupMemberProfileWithHttpInfo}.
   * @param groupId Group ID
   * @param userId User ID
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-group-member-profile">LINE Developers documentation</a>
   */
  public async getGroupMemberProfile(
    groupId: string,
    userId: string,
  ): Promise<GroupUserProfileResponse> {
    return (await this.getGroupMemberProfileWithHttpInfo(groupId, userId)).body;
  }

  /**
   * Get group chat member profile
   * Calls `GET https://api.line.me/v2/bot/group/{groupId}/member/{userId}`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param groupId Group ID
   * @param userId User 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-group-member-profile">LINE Developers documentation</a>
   */
  public async getGroupMemberProfileWithHttpInfo(
    groupId: string,
    userId: string,
  ): Promise<Types.ApiResponseType<GroupUserProfileResponse>> {
    const requestPath = buildPath("/v2/bot/group/{groupId}/member/{userId}", {
      groupId: groupId,
      userId: userId,
    });

    const res = await this.httpClient.get(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get group chat member user IDs
   * Calls `GET https://api.line.me/v2/bot/group/{groupId}/members/ids`.
   * To inspect the HTTP status code or response headers, use {@link getGroupMembersIdsWithHttpInfo}.
   * @param groupId Group ID
   * @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.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-group-member-user-ids">LINE Developers documentation</a>
   */
  public async getGroupMembersIds(
    groupId: string,
    start?: string,
  ): Promise<MembersIdsResponse> {
    return (await this.getGroupMembersIdsWithHttpInfo(groupId, start)).body;
  }

  /**
   * Get group chat member user IDs
   * Calls `GET https://api.line.me/v2/bot/group/{groupId}/members/ids`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param groupId Group ID
   * @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.
   * @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-group-member-user-ids">LINE Developers documentation</a>
   */
  public async getGroupMembersIdsWithHttpInfo(
    groupId: string,
    start?: string,
  ): Promise<Types.ApiResponseType<MembersIdsResponse>> {
    const requestPath = buildPath("/v2/bot/group/{groupId}/members/ids", {
      groupId: groupId,
    });

    const queryParams = {
      start: start,
    };

    if (queryParams["start"] === undefined) {
      delete queryParams["start"];
    }

    const res = await this.httpClient.get(requestPath, queryParams);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get group chat summary
   * Calls `GET https://api.line.me/v2/bot/group/{groupId}/summary`.
   * To inspect the HTTP status code or response headers, use {@link getGroupSummaryWithHttpInfo}.
   * @param groupId Group ID
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-group-summary">LINE Developers documentation</a>
   */
  public async getGroupSummary(groupId: string): Promise<GroupSummaryResponse> {
    return (await this.getGroupSummaryWithHttpInfo(groupId)).body;
  }

  /**
   * Get group chat summary
   * Calls `GET https://api.line.me/v2/bot/group/{groupId}/summary`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param groupId Group 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-group-summary">LINE Developers documentation</a>
   */
  public async getGroupSummaryWithHttpInfo(
    groupId: string,
  ): Promise<Types.ApiResponseType<GroupSummaryResponse>> {
    const requestPath = buildPath("/v2/bot/group/{groupId}/summary", {
      groupId: groupId,
    });

    const res = await this.httpClient.get(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get a list of user IDs who joined the membership.
   * Calls `GET https://api.line.me/v2/bot/membership/{membershipId}/users/ids`.
   * To inspect the HTTP status code or response headers, use {@link getJoinedMembershipUsersWithHttpInfo}.
   * @param membershipId Membership plan ID.
   * @param start A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds).
   * @param limit The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-membership-user-ids">LINE Developers documentation</a>
   */
  public async getJoinedMembershipUsers(
    membershipId: number,
    start?: string,
    limit?: number,
  ): Promise<GetJoinedMembershipUsersResponse> {
    return (
      await this.getJoinedMembershipUsersWithHttpInfo(
        membershipId,
        start,
        limit,
      )
    ).body;
  }

  /**
   * Get a list of user IDs who joined the membership.
   * Calls `GET https://api.line.me/v2/bot/membership/{membershipId}/users/ids`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param membershipId Membership plan ID.
   * @param start A continuation token to get next remaining membership user IDs. Returned only when there are remaining user IDs that weren't returned in the userIds property in the previous request. The continuation token expires in 24 hours (86,400 seconds).
   * @param limit The max number of items to return for this API call. The value is set to 300 by default, but the max acceptable value is 1000.
   * @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-membership-user-ids">LINE Developers documentation</a>
   */
  public async getJoinedMembershipUsersWithHttpInfo(
    membershipId: number,
    start?: string,
    limit?: number,
  ): Promise<Types.ApiResponseType<GetJoinedMembershipUsersResponse>> {
    const requestPath = buildPath(
      "/v2/bot/membership/{membershipId}/users/ids",
      {
        membershipId: membershipId,
      },
    );

    const queryParams = {
      start: start,
      limit: limit,
    };

    if (queryParams["start"] === undefined) {
      delete queryParams["start"];
    }

    if (queryParams["limit"] === undefined) {
      delete queryParams["limit"];
    }

    const res = await this.httpClient.get(requestPath, queryParams);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get a list of memberships.
   * Calls `GET https://api.line.me/v2/bot/membership/list`.
   * To inspect the HTTP status code or response headers, use {@link getMembershipListWithHttpInfo}.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-membership-plans">LINE Developers documentation</a>
   */
  public async getMembershipList(): Promise<MembershipListResponse> {
    return (await this.getMembershipListWithHttpInfo()).body;
  }

  /**
   * Get a list of memberships.
   * Calls `GET https://api.line.me/v2/bot/membership/list`.
   * 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-membership-plans">LINE Developers documentation</a>
   */
  public async getMembershipListWithHttpInfo(): Promise<
    Types.ApiResponseType<MembershipListResponse>
  > {
    const res = await this.httpClient.get("/v2/bot/membership/list");
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get a user's membership subscription.
   * Calls `GET https://api.line.me/v2/bot/membership/subscription/{userId}`.
   * To inspect the HTTP status code or response headers, use {@link getMembershipSubscriptionWithHttpInfo}.
   * @param userId User ID
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-a-users-membership-subscription-status">LINE Developers documentation</a>
   */
  public async getMembershipSubscription(
    userId: string,
  ): Promise<GetMembershipSubscriptionResponse> {
    return (await this.getMembershipSubscriptionWithHttpInfo(userId)).body;
  }

  /**
   * Get a user's membership subscription.
   * Calls `GET https://api.line.me/v2/bot/membership/subscription/{userId}`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param userId User 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-a-users-membership-subscription-status">LINE Developers documentation</a>
   */
  public async getMembershipSubscriptionWithHttpInfo(
    userId: string,
  ): Promise<Types.ApiResponseType<GetMembershipSubscriptionResponse>> {
    const requestPath = buildPath("/v2/bot/membership/subscription/{userId}", {
      userId: userId,
    });

    const res = await this.httpClient.get(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned.
   * Calls `GET https://api.line.me/v2/bot/message/quota`.
   * To inspect the HTTP status code or response headers, use {@link getMessageQuotaWithHttpInfo}.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-quota">LINE Developers documentation</a>
   */
  public async getMessageQuota(): Promise<MessageQuotaResponse> {
    return (await this.getMessageQuotaWithHttpInfo()).body;
  }

  /**
   * Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned.
   * Calls `GET https://api.line.me/v2/bot/message/quota`.
   * 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-quota">LINE Developers documentation</a>
   */
  public async getMessageQuotaWithHttpInfo(): Promise<
    Types.ApiResponseType<MessageQuotaResponse>
  > {
    const res = await this.httpClient.get("/v2/bot/message/quota");
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Gets the number of messages sent in the current month.
   * Calls `GET https://api.line.me/v2/bot/message/quota/consumption`.
   * To inspect the HTTP status code or response headers, use {@link getMessageQuotaConsumptionWithHttpInfo}.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-consumption">LINE Developers documentation</a>
   */
  public async getMessageQuotaConsumption(): Promise<QuotaConsumptionResponse> {
    return (await this.getMessageQuotaConsumptionWithHttpInfo()).body;
  }

  /**
   * Gets the number of messages sent in the current month.
   * Calls `GET https://api.line.me/v2/bot/message/quota/consumption`.
   * 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-consumption">LINE Developers documentation</a>
   */
  public async getMessageQuotaConsumptionWithHttpInfo(): Promise<
    Types.ApiResponseType<QuotaConsumptionResponse>
  > {
    const res = await this.httpClient.get("/v2/bot/message/quota/consumption");
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Gets the status of a narrowcast message.
   * Calls `GET https://api.line.me/v2/bot/message/progress/narrowcast`.
   * To inspect the HTTP status code or response headers, use {@link getNarrowcastProgressWithHttpInfo}.
   * @param requestId The narrowcast message's request ID. 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-narrowcast-progress-status">LINE Developers documentation</a>
   */
  public async getNarrowcastProgress(
    requestId: string,
  ): Promise<NarrowcastProgressResponse> {
    return (await this.getNarrowcastProgressWithHttpInfo(requestId)).body;
  }

  /**
   * Gets the status of a narrowcast message.
   * Calls `GET https://api.line.me/v2/bot/message/progress/narrowcast`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param requestId The narrowcast message's request ID. 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-narrowcast-progress-status">LINE Developers documentation</a>
   */
  public async getNarrowcastProgressWithHttpInfo(
    requestId: string,
  ): Promise<Types.ApiResponseType<NarrowcastProgressResponse>> {
    const queryParams = {
      requestId: requestId,
    };

    const res = await this.httpClient.get(
      "/v2/bot/message/progress/narrowcast",
      queryParams,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get number of sent broadcast messages
   * Calls `GET https://api.line.me/v2/bot/message/delivery/broadcast`.
   * To inspect the HTTP status code or response headers, use {@link getNumberOfSentBroadcastMessagesWithHttpInfo}.
   * @param date Date the messages were sent  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-broadcast-messages">LINE Developers documentation</a>
   */
  public async getNumberOfSentBroadcastMessages(
    date: string,
  ): Promise<NumberOfMessagesResponse> {
    return (await this.getNumberOfSentBroadcastMessagesWithHttpInfo(date)).body;
  }

  /**
   * Get number of sent broadcast messages
   * Calls `GET https://api.line.me/v2/bot/message/delivery/broadcast`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param date Date the messages were sent  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-broadcast-messages">LINE Developers documentation</a>
   */
  public async getNumberOfSentBroadcastMessagesWithHttpInfo(
    date: string,
  ): Promise<Types.ApiResponseType<NumberOfMessagesResponse>> {
    const queryParams = {
      date: date,
    };

    const res = await this.httpClient.get(
      "/v2/bot/message/delivery/broadcast",
      queryParams,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get number of sent multicast messages
   * Calls `GET https://api.line.me/v2/bot/message/delivery/multicast`.
   * To inspect the HTTP status code or response headers, use {@link getNumberOfSentMulticastMessagesWithHttpInfo}.
   * @param date Date the messages were sent  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-multicast-messages">LINE Developers documentation</a>
   */
  public async getNumberOfSentMulticastMessages(
    date: string,
  ): Promise<NumberOfMessagesResponse> {
    return (await this.getNumberOfSentMulticastMessagesWithHttpInfo(date)).body;
  }

  /**
   * Get number of sent multicast messages
   * Calls `GET https://api.line.me/v2/bot/message/delivery/multicast`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param date Date the messages were sent  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-multicast-messages">LINE Developers documentation</a>
   */
  public async getNumberOfSentMulticastMessagesWithHttpInfo(
    date: string,
  ): Promise<Types.ApiResponseType<NumberOfMessagesResponse>> {
    const queryParams = {
      date: date,
    };

    const res = await this.httpClient.get(
      "/v2/bot/message/delivery/multicast",
      queryParams,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get number of sent push messages
   * Calls `GET https://api.line.me/v2/bot/message/delivery/push`.
   * To inspect the HTTP status code or response headers, use {@link getNumberOfSentPushMessagesWithHttpInfo}.
   * @param date Date the messages were sent  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-push-messages">LINE Developers documentation</a>
   */
  public async getNumberOfSentPushMessages(
    date: string,
  ): Promise<NumberOfMessagesResponse> {
    return (await this.getNumberOfSentPushMessagesWithHttpInfo(date)).body;
  }

  /**
   * Get number of sent push messages
   * Calls `GET https://api.line.me/v2/bot/message/delivery/push`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param date Date the messages were sent  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-push-messages">LINE Developers documentation</a>
   */
  public async getNumberOfSentPushMessagesWithHttpInfo(
    date: string,
  ): Promise<Types.ApiResponseType<NumberOfMessagesResponse>> {
    const queryParams = {
      date: date,
    };

    const res = await this.httpClient.get(
      "/v2/bot/message/delivery/push",
      queryParams,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get number of sent reply messages
   * Calls `GET https://api.line.me/v2/bot/message/delivery/reply`.
   * To inspect the HTTP status code or response headers, use {@link getNumberOfSentReplyMessagesWithHttpInfo}.
   * @param date Date the messages were sent  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-reply-messages">LINE Developers documentation</a>
   */
  public async getNumberOfSentReplyMessages(
    date: string,
  ): Promise<NumberOfMessagesResponse> {
    return (await this.getNumberOfSentReplyMessagesWithHttpInfo(date)).body;
  }

  /**
   * Get number of sent reply messages
   * Calls `GET https://api.line.me/v2/bot/message/delivery/reply`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param date Date the messages were sent  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-reply-messages">LINE Developers documentation</a>
   */
  public async getNumberOfSentReplyMessagesWithHttpInfo(
    date: string,
  ): Promise<Types.ApiResponseType<NumberOfMessagesResponse>> {
    const queryParams = {
      date: date,
    };

    const res = await this.httpClient.get(
      "/v2/bot/message/delivery/reply",
      queryParams,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get number of sent LINE notification messages
   * Calls `GET https://api.line.me/v2/bot/message/delivery/pnp`.
   * To inspect the HTTP status code or response headers, use {@link getPNPMessageStatisticsWithHttpInfo}.
   * @param date Date the message was sent  Format: `yyyyMMdd` (Example:`20211231`) Time zone: UTC+9
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/partner-docs/#get-number-of-sent-line-notification-messages">LINE Developers documentation</a>
   */
  public async getPNPMessageStatistics(
    date: string,
  ): Promise<NumberOfMessagesResponse> {
    return (await this.getPNPMessageStatisticsWithHttpInfo(date)).body;
  }

  /**
   * Get number of sent LINE notification messages
   * Calls `GET https://api.line.me/v2/bot/message/delivery/pnp`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param date Date the message was sent  Format: `yyyyMMdd` (Example:`20211231`) 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/partner-docs/#get-number-of-sent-line-notification-messages">LINE Developers documentation</a>
   */
  public async getPNPMessageStatisticsWithHttpInfo(
    date: string,
  ): Promise<Types.ApiResponseType<NumberOfMessagesResponse>> {
    const queryParams = {
      date: date,
    };

    const res = await this.httpClient.get(
      "/v2/bot/message/delivery/pnp",
      queryParams,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get profile
   * Calls `GET https://api.line.me/v2/bot/profile/{userId}`.
   * To inspect the HTTP status code or response headers, use {@link getProfileWithHttpInfo}.
   * @param userId User ID
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-profile">LINE Developers documentation</a>
   */
  public async getProfile(userId: string): Promise<UserProfileResponse> {
    return (await this.getProfileWithHttpInfo(userId)).body;
  }

  /**
   * Get profile
   * Calls `GET https://api.line.me/v2/bot/profile/{userId}`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param userId User 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-profile">LINE Developers documentation</a>
   */
  public async getProfileWithHttpInfo(
    userId: string,
  ): Promise<Types.ApiResponseType<UserProfileResponse>> {
    const requestPath = buildPath("/v2/bot/profile/{userId}", {
      userId: userId,
    });

    const res = await this.httpClient.get(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Gets a rich menu via a rich menu ID.
   * Calls `GET https://api.line.me/v2/bot/richmenu/{richMenuId}`.
   * To inspect the HTTP status code or response headers, use {@link getRichMenuWithHttpInfo}.
   * @param richMenuId ID of a rich menu
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu">LINE Developers documentation</a>
   */
  public async getRichMenu(richMenuId: string): Promise<RichMenuResponse> {
    return (await this.getRichMenuWithHttpInfo(richMenuId)).body;
  }

  /**
   * Gets a rich menu via a rich menu ID.
   * Calls `GET https://api.line.me/v2/bot/richmenu/{richMenuId}`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param richMenuId ID of a rich menu
   * @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">LINE Developers documentation</a>
   */
  public async getRichMenuWithHttpInfo(
    richMenuId: string,
  ): Promise<Types.ApiResponseType<RichMenuResponse>> {
    const requestPath = buildPath("/v2/bot/richmenu/{richMenuId}", {
      richMenuId: richMenuId,
    });

    const res = await this.httpClient.get(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get rich menu alias information
   * Calls `GET https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId}`.
   * To inspect the HTTP status code or response headers, use {@link getRichMenuAliasWithHttpInfo}.
   * @param richMenuAliasId The rich menu alias ID whose information you want to obtain.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-alias-by-id">LINE Developers documentation</a>
   */
  public async getRichMenuAlias(
    richMenuAliasId: string,
  ): Promise<RichMenuAliasResponse> {
    return (await this.getRichMenuAliasWithHttpInfo(richMenuAliasId)).body;
  }

  /**
   * Get rich menu alias information
   * Calls `GET https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId}`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param richMenuAliasId The rich menu alias ID whose information you want to obtain.
   * @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-alias-by-id">LINE Developers documentation</a>
   */
  public async getRichMenuAliasWithHttpInfo(
    richMenuAliasId: string,
  ): Promise<Types.ApiResponseType<RichMenuAliasResponse>> {
    const requestPath = buildPath("/v2/bot/richmenu/alias/{richMenuAliasId}", {
      richMenuAliasId: richMenuAliasId,
    });

    const res = await this.httpClient.get(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get list of rich menu alias
   * Calls `GET https://api.line.me/v2/bot/richmenu/alias/list`.
   * To inspect the HTTP status code or response headers, use {@link getRichMenuAliasListWithHttpInfo}.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-alias-list">LINE Developers documentation</a>
   */
  public async getRichMenuAliasList(): Promise<RichMenuAliasListResponse> {
    return (await this.getRichMenuAliasListWithHttpInfo()).body;
  }

  /**
   * Get list of rich menu alias
   * Calls `GET https://api.line.me/v2/bot/richmenu/alias/list`.
   * 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-rich-menu-alias-list">LINE Developers documentation</a>
   */
  public async getRichMenuAliasListWithHttpInfo(): Promise<
    Types.ApiResponseType<RichMenuAliasListResponse>
  > {
    const res = await this.httpClient.get("/v2/bot/richmenu/alias/list");
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get the status of Replace or unlink a linked rich menus in batches.
   * Calls `GET https://api.line.me/v2/bot/richmenu/progress/batch`.
   * To inspect the HTTP status code or response headers, use {@link getRichMenuBatchProgressWithHttpInfo}.
   * @param requestId A request ID used to batch control the rich menu linked to the user. 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-batch-control-rich-menus-progress-status">LINE Developers documentation</a>
   */
  public async getRichMenuBatchProgress(
    requestId: string,
  ): Promise<RichMenuBatchProgressResponse> {
    return (await this.getRichMenuBatchProgressWithHttpInfo(requestId)).body;
  }

  /**
   * Get the status of Replace or unlink a linked rich menus in batches.
   * Calls `GET https://api.line.me/v2/bot/richmenu/progress/batch`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param requestId A request ID used to batch control the rich menu linked to the user. 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-batch-control-rich-menus-progress-status">LINE Developers documentation</a>
   */
  public async getRichMenuBatchProgressWithHttpInfo(
    requestId: string,
  ): Promise<Types.ApiResponseType<RichMenuBatchProgressResponse>> {
    const queryParams = {
      requestId: requestId,
    };

    const res = await this.httpClient.get(
      "/v2/bot/richmenu/progress/batch",
      queryParams,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get rich menu ID of user
   * Calls `GET https://api.line.me/v2/bot/user/{userId}/richmenu`.
   * To inspect the HTTP status code or response headers, use {@link getRichMenuIdOfUserWithHttpInfo}.
   * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-id-of-user">LINE Developers documentation</a>
   */
  public async getRichMenuIdOfUser(
    userId: string,
  ): Promise<RichMenuIdResponse> {
    return (await this.getRichMenuIdOfUserWithHttpInfo(userId)).body;
  }

  /**
   * Get rich menu ID of user
   * Calls `GET https://api.line.me/v2/bot/user/{userId}/richmenu`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
   * @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-id-of-user">LINE Developers documentation</a>
   */
  public async getRichMenuIdOfUserWithHttpInfo(
    userId: string,
  ): Promise<Types.ApiResponseType<RichMenuIdResponse>> {
    const requestPath = buildPath("/v2/bot/user/{userId}/richmenu", {
      userId: userId,
    });

    const res = await this.httpClient.get(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get rich menu list
   * Calls `GET https://api.line.me/v2/bot/richmenu/list`.
   * To inspect the HTTP status code or response headers, use {@link getRichMenuListWithHttpInfo}.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-rich-menu-list">LINE Developers documentation</a>
   */
  public async getRichMenuList(): Promise<RichMenuListResponse> {
    return (await this.getRichMenuListWithHttpInfo()).body;
  }

  /**
   * Get rich menu list
   * Calls `GET https://api.line.me/v2/bot/richmenu/list`.
   * 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-rich-menu-list">LINE Developers documentation</a>
   */
  public async getRichMenuListWithHttpInfo(): Promise<
    Types.ApiResponseType<RichMenuListResponse>
  > {
    const res = await this.httpClient.get("/v2/bot/richmenu/list");
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get number of users in a multi-person chat
   * Calls `GET https://api.line.me/v2/bot/room/{roomId}/members/count`.
   * To inspect the HTTP status code or response headers, use {@link getRoomMemberCountWithHttpInfo}.
   * @param roomId Room ID
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-members-room-count">LINE Developers documentation</a>
   */
  public async getRoomMemberCount(
    roomId: string,
  ): Promise<RoomMemberCountResponse> {
    return (await this.getRoomMemberCountWithHttpInfo(roomId)).body;
  }

  /**
   * Get number of users in a multi-person chat
   * Calls `GET https://api.line.me/v2/bot/room/{roomId}/members/count`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param roomId Room 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-members-room-count">LINE Developers documentation</a>
   */
  public async getRoomMemberCountWithHttpInfo(
    roomId: string,
  ): Promise<Types.ApiResponseType<RoomMemberCountResponse>> {
    const requestPath = buildPath("/v2/bot/room/{roomId}/members/count", {
      roomId: roomId,
    });

    const res = await this.httpClient.get(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get multi-person chat member profile
   * Calls `GET https://api.line.me/v2/bot/room/{roomId}/member/{userId}`.
   * To inspect the HTTP status code or response headers, use {@link getRoomMemberProfileWithHttpInfo}.
   * @param roomId Room ID
   * @param userId User ID
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-room-member-profile">LINE Developers documentation</a>
   */
  public async getRoomMemberProfile(
    roomId: string,
    userId: string,
  ): Promise<RoomUserProfileResponse> {
    return (await this.getRoomMemberProfileWithHttpInfo(roomId, userId)).body;
  }

  /**
   * Get multi-person chat member profile
   * Calls `GET https://api.line.me/v2/bot/room/{roomId}/member/{userId}`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param roomId Room ID
   * @param userId User 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-room-member-profile">LINE Developers documentation</a>
   */
  public async getRoomMemberProfileWithHttpInfo(
    roomId: string,
    userId: string,
  ): Promise<Types.ApiResponseType<RoomUserProfileResponse>> {
    const requestPath = buildPath("/v2/bot/room/{roomId}/member/{userId}", {
      roomId: roomId,
      userId: userId,
    });

    const res = await this.httpClient.get(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get multi-person chat member user IDs
   * Calls `GET https://api.line.me/v2/bot/room/{roomId}/members/ids`.
   * To inspect the HTTP status code or response headers, use {@link getRoomMembersIdsWithHttpInfo}.
   * @param roomId Room ID
   * @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.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-room-member-user-ids">LINE Developers documentation</a>
   */
  public async getRoomMembersIds(
    roomId: string,
    start?: string,
  ): Promise<MembersIdsResponse> {
    return (await this.getRoomMembersIdsWithHttpInfo(roomId, start)).body;
  }

  /**
   * Get multi-person chat member user IDs
   * Calls `GET https://api.line.me/v2/bot/room/{roomId}/members/ids`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param roomId Room ID
   * @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.
   * @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-room-member-user-ids">LINE Developers documentation</a>
   */
  public async getRoomMembersIdsWithHttpInfo(
    roomId: string,
    start?: string,
  ): Promise<Types.ApiResponseType<MembersIdsResponse>> {
    const requestPath = buildPath("/v2/bot/room/{roomId}/members/ids", {
      roomId: roomId,
    });

    const queryParams = {
      start: start,
    };

    if (queryParams["start"] === undefined) {
      delete queryParams["start"];
    }

    const res = await this.httpClient.get(requestPath, queryParams);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get webhook endpoint information
   * Calls `GET https://api.line.me/v2/bot/channel/webhook/endpoint`.
   * To inspect the HTTP status code or response headers, use {@link getWebhookEndpointWithHttpInfo}.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-webhook-endpoint-information">LINE Developers documentation</a>
   */
  public async getWebhookEndpoint(): Promise<GetWebhookEndpointResponse> {
    return (await this.getWebhookEndpointWithHttpInfo()).body;
  }

  /**
   * Get webhook endpoint information
   * Calls `GET https://api.line.me/v2/bot/channel/webhook/endpoint`.
   * 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-webhook-endpoint-information">LINE Developers documentation</a>
   */
  public async getWebhookEndpointWithHttpInfo(): Promise<
    Types.ApiResponseType<GetWebhookEndpointResponse>
  > {
    const res = await this.httpClient.get("/v2/bot/channel/webhook/endpoint");
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Issue link token
   * Calls `POST https://api.line.me/v2/bot/user/{userId}/linkToken`.
   * To inspect the HTTP status code or response headers, use {@link issueLinkTokenWithHttpInfo}.
   * @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.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-link-token">LINE Developers documentation</a>
   */
  public async issueLinkToken(userId: string): Promise<IssueLinkTokenResponse> {
    return (await this.issueLinkTokenWithHttpInfo(userId)).body;
  }

  /**
   * Issue link token
   * Calls `POST https://api.line.me/v2/bot/user/{userId}/linkToken`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @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.
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#issue-link-token">LINE Developers documentation</a>
   */
  public async issueLinkTokenWithHttpInfo(
    userId: string,
  ): Promise<Types.ApiResponseType<IssueLinkTokenResponse>> {
    const requestPath = buildPath("/v2/bot/user/{userId}/linkToken", {
      userId: userId,
    });

    const res = await this.httpClient.post(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Leave group chat
   * Calls `POST https://api.line.me/v2/bot/group/{groupId}/leave`.
   * To inspect the HTTP status code or response headers, use {@link leaveGroupWithHttpInfo}.
   * @param groupId Group ID
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#leave-group">LINE Developers documentation</a>
   */
  public async leaveGroup(
    groupId: string,
  ): Promise<Types.MessageAPIResponseBase> {
    return (await this.leaveGroupWithHttpInfo(groupId)).body;
  }

  /**
   * Leave group chat
   * Calls `POST https://api.line.me/v2/bot/group/{groupId}/leave`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param groupId Group 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/#leave-group">LINE Developers documentation</a>
   */
  public async leaveGroupWithHttpInfo(
    groupId: string,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const requestPath = buildPath("/v2/bot/group/{groupId}/leave", {
      groupId: groupId,
    });

    const res = await this.httpClient.post(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Leave multi-person chat
   * Calls `POST https://api.line.me/v2/bot/room/{roomId}/leave`.
   * To inspect the HTTP status code or response headers, use {@link leaveRoomWithHttpInfo}.
   * @param roomId Room ID
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#leave-room">LINE Developers documentation</a>
   */
  public async leaveRoom(
    roomId: string,
  ): Promise<Types.MessageAPIResponseBase> {
    return (await this.leaveRoomWithHttpInfo(roomId)).body;
  }

  /**
   * Leave multi-person chat
   * Calls `POST https://api.line.me/v2/bot/room/{roomId}/leave`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param roomId Room 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/#leave-room">LINE Developers documentation</a>
   */
  public async leaveRoomWithHttpInfo(
    roomId: string,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const requestPath = buildPath("/v2/bot/room/{roomId}/leave", {
      roomId: roomId,
    });

    const res = await this.httpClient.post(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Link rich menu to user.
   * Calls `POST https://api.line.me/v2/bot/user/{userId}/richmenu/{richMenuId}`.
   * To inspect the HTTP status code or response headers, use {@link linkRichMenuIdToUserWithHttpInfo}.
   * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
   * @param richMenuId ID of a rich menu
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-user">LINE Developers documentation</a>
   */
  public async linkRichMenuIdToUser(
    userId: string,
    richMenuId: string,
  ): Promise<Types.MessageAPIResponseBase> {
    return (await this.linkRichMenuIdToUserWithHttpInfo(userId, richMenuId))
      .body;
  }

  /**
   * Link rich menu to user.
   * Calls `POST https://api.line.me/v2/bot/user/{userId}/richmenu/{richMenuId}`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
   * @param richMenuId ID of a rich menu
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-user">LINE Developers documentation</a>
   */
  public async linkRichMenuIdToUserWithHttpInfo(
    userId: string,
    richMenuId: string,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const requestPath = buildPath(
      "/v2/bot/user/{userId}/richmenu/{richMenuId}",
      {
        userId: userId,
        richMenuId: richMenuId,
      },
    );

    const res = await this.httpClient.post(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Link rich menu to multiple users
   * Calls `POST https://api.line.me/v2/bot/richmenu/bulk/link`.
   * To inspect the HTTP status code or response headers, use {@link linkRichMenuIdToUsersWithHttpInfo}.
   * @param richMenuBulkLinkRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-users">LINE Developers documentation</a>
   */
  public async linkRichMenuIdToUsers(
    richMenuBulkLinkRequest: RichMenuBulkLinkRequest,
  ): Promise<Types.MessageAPIResponseBase> {
    return (
      await this.linkRichMenuIdToUsersWithHttpInfo(richMenuBulkLinkRequest)
    ).body;
  }

  /**
   * Link rich menu to multiple users
   * Calls `POST https://api.line.me/v2/bot/richmenu/bulk/link`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param richMenuBulkLinkRequest
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#link-rich-menu-to-users">LINE Developers documentation</a>
   */
  public async linkRichMenuIdToUsersWithHttpInfo(
    richMenuBulkLinkRequest: RichMenuBulkLinkRequest,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const params = richMenuBulkLinkRequest;

    const res = await this.httpClient.post(
      "/v2/bot/richmenu/bulk/link",
      params,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Get a paginated list of coupons.
   * Calls `GET https://api.line.me/v2/bot/coupon`.
   * To inspect the HTTP status code or response headers, use {@link listCouponWithHttpInfo}.
   * @param status Filter coupons by their status.
   * @param start Pagination token to retrieve the next page of results.
   * @param limit Maximum number of coupons to return per request.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-coupons-list">LINE Developers documentation</a>
   */
  public async listCoupon(
    status?: Set<"DRAFT" | "RUNNING" | "CLOSED">,
    start?: string,
    limit?: number,
  ): Promise<MessagingApiPagerCouponListResponse> {
    return (await this.listCouponWithHttpInfo(status, start, limit)).body;
  }

  /**
   * Get a paginated list of coupons.
   * Calls `GET https://api.line.me/v2/bot/coupon`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param status Filter coupons by their status.
   * @param start Pagination token to retrieve the next page of results.
   * @param limit Maximum number of coupons to return per request.
   * @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-coupons-list">LINE Developers documentation</a>
   */
  public async listCouponWithHttpInfo(
    status?: Set<"DRAFT" | "RUNNING" | "CLOSED">,
    start?: string,
    limit?: number,
  ): Promise<Types.ApiResponseType<MessagingApiPagerCouponListResponse>> {
    const queryParams = {
      status: status != null ? [...status].join(",") : undefined,
      start: start,
      limit: limit,
    };

    if (queryParams["status"] === undefined) {
      delete queryParams["status"];
    }

    if (queryParams["start"] === undefined) {
      delete queryParams["start"];
    }

    if (queryParams["limit"] === undefined) {
      delete queryParams["limit"];
    }

    const res = await this.httpClient.get("/v2/bot/coupon", queryParams);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Mark messages from users as read
   * Calls `POST https://api.line.me/v2/bot/message/markAsRead`.
   * To inspect the HTTP status code or response headers, use {@link markMessagesAsReadWithHttpInfo}.
   * @param markMessagesAsReadRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/partner-docs/#mark-messages-from-users-as-read">LINE Developers documentation</a>
   */
  public async markMessagesAsRead(
    markMessagesAsReadRequest: MarkMessagesAsReadRequest,
  ): Promise<Types.MessageAPIResponseBase> {
    return (
      await this.markMessagesAsReadWithHttpInfo(markMessagesAsReadRequest)
    ).body;
  }

  /**
   * Mark messages from users as read
   * Calls `POST https://api.line.me/v2/bot/message/markAsRead`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param markMessagesAsReadRequest
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/partner-docs/#mark-messages-from-users-as-read">LINE Developers documentation</a>
   */
  public async markMessagesAsReadWithHttpInfo(
    markMessagesAsReadRequest: MarkMessagesAsReadRequest,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const params = markMessagesAsReadRequest;

    const res = await this.httpClient.post(
      "/v2/bot/message/markAsRead",
      params,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Mark messages from users as read by token
   * Calls `POST https://api.line.me/v2/bot/chat/markAsRead`.
   * To inspect the HTTP status code or response headers, use {@link markMessagesAsReadByTokenWithHttpInfo}.
   * @param markMessagesAsReadByTokenRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#mark-as-read">LINE Developers documentation</a>
   */
  public async markMessagesAsReadByToken(
    markMessagesAsReadByTokenRequest: MarkMessagesAsReadByTokenRequest,
  ): Promise<Types.MessageAPIResponseBase> {
    return (
      await this.markMessagesAsReadByTokenWithHttpInfo(
        markMessagesAsReadByTokenRequest,
      )
    ).body;
  }

  /**
   * Mark messages from users as read by token
   * Calls `POST https://api.line.me/v2/bot/chat/markAsRead`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param markMessagesAsReadByTokenRequest
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#mark-as-read">LINE Developers documentation</a>
   */
  public async markMessagesAsReadByTokenWithHttpInfo(
    markMessagesAsReadByTokenRequest: MarkMessagesAsReadByTokenRequest,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const params = markMessagesAsReadByTokenRequest;

    const res = await this.httpClient.post("/v2/bot/chat/markAsRead", params);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * An API that efficiently sends the same message to multiple user IDs. You can't send messages to group chats or multi-person chats.
   * Calls `POST https://api.line.me/v2/bot/message/multicast`.
   * To inspect the HTTP status code or response headers, use {@link multicastWithHttpInfo}.
   * @param multicastRequest
   * @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-multicast-message">LINE Developers documentation</a>
   */
  public async multicast(
    multicastRequest: MulticastRequest,
    xLineRetryKey?: string,
  ): Promise<object> {
    return (await this.multicastWithHttpInfo(multicastRequest, xLineRetryKey))
      .body;
  }

  /**
   * An API that efficiently sends the same message to multiple user IDs. You can't send messages to group chats or multi-person chats.
   * Calls `POST https://api.line.me/v2/bot/message/multicast`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param multicastRequest
   * @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-multicast-message">LINE Developers documentation</a>
   */
  public async multicastWithHttpInfo(
    multicastRequest: MulticastRequest,
    xLineRetryKey?: string,
  ): Promise<Types.ApiResponseType<object>> {
    const params = multicastRequest;

    const headerParams = {
      ...(xLineRetryKey != null ? { "X-Line-Retry-Key": xLineRetryKey } : {}),
    };

    const res = await this.httpClient.post(
      "/v2/bot/message/multicast",
      params,
      { headers: headerParams },
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Send narrowcast message
   * Calls `POST https://api.line.me/v2/bot/message/narrowcast`.
   * To inspect the HTTP status code or response headers, use {@link narrowcastWithHttpInfo}.
   * @param narrowcastRequest
   * @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-narrowcast-message">LINE Developers documentation</a>
   */
  public async narrowcast(
    narrowcastRequest: NarrowcastRequest,
    xLineRetryKey?: string,
  ): Promise<object> {
    return (await this.narrowcastWithHttpInfo(narrowcastRequest, xLineRetryKey))
      .body;
  }

  /**
   * Send narrowcast message
   * Calls `POST https://api.line.me/v2/bot/message/narrowcast`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param narrowcastRequest
   * @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-narrowcast-message">LINE Developers documentation</a>
   */
  public async narrowcastWithHttpInfo(
    narrowcastRequest: NarrowcastRequest,
    xLineRetryKey?: string,
  ): Promise<Types.ApiResponseType<object>> {
    const params = narrowcastRequest;

    const headerParams = {
      ...(xLineRetryKey != null ? { "X-Line-Retry-Key": xLineRetryKey } : {}),
    };

    const res = await this.httpClient.post(
      "/v2/bot/message/narrowcast",
      params,
      { headers: headerParams },
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Sends a message to a user, group chat, or multi-person chat at any time.
   * Calls `POST https://api.line.me/v2/bot/message/push`.
   * To inspect the HTTP status code or response headers, use {@link pushMessageWithHttpInfo}.
   * @param pushMessageRequest
   * @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-push-message">LINE Developers documentation</a>
   */
  public async pushMessage(
    pushMessageRequest: PushMessageRequest,
    xLineRetryKey?: string,
  ): Promise<PushMessageResponse> {
    return (
      await this.pushMessageWithHttpInfo(pushMessageRequest, xLineRetryKey)
    ).body;
  }

  /**
   * Sends a message to a user, group chat, or multi-person chat at any time.
   * Calls `POST https://api.line.me/v2/bot/message/push`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param pushMessageRequest
   * @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-push-message">LINE Developers documentation</a>
   */
  public async pushMessageWithHttpInfo(
    pushMessageRequest: PushMessageRequest,
    xLineRetryKey?: string,
  ): Promise<Types.ApiResponseType<PushMessageResponse>> {
    const params = pushMessageRequest;

    const headerParams = {
      ...(xLineRetryKey != null ? { "X-Line-Retry-Key": xLineRetryKey } : {}),
    };

    const res = await this.httpClient.post("/v2/bot/message/push", params, {
      headers: headerParams,
    });
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Send LINE notification message
   * Calls `POST https://api.line.me/bot/pnp/push`.
   * To inspect the HTTP status code or response headers, use {@link pushMessagesByPhoneWithHttpInfo}.
   * @param pnpMessagesRequest
   * @param xLineDeliveryTag String returned in the delivery.data property of the delivery completion event via Webhook.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/partner-docs/#send-line-notification-message">LINE Developers documentation</a>
   */
  public async pushMessagesByPhone(
    pnpMessagesRequest: PnpMessagesRequest,
    xLineDeliveryTag?: string,
  ): Promise<Types.MessageAPIResponseBase> {
    return (
      await this.pushMessagesByPhoneWithHttpInfo(
        pnpMessagesRequest,
        xLineDeliveryTag,
      )
    ).body;
  }

  /**
   * Send LINE notification message
   * Calls `POST https://api.line.me/bot/pnp/push`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param pnpMessagesRequest
   * @param xLineDeliveryTag String returned in the delivery.data property of the delivery completion event via Webhook.
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/partner-docs/#send-line-notification-message">LINE Developers documentation</a>
   */
  public async pushMessagesByPhoneWithHttpInfo(
    pnpMessagesRequest: PnpMessagesRequest,
    xLineDeliveryTag?: string,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const params = pnpMessagesRequest;

    const headerParams = {
      ...(xLineDeliveryTag != null
        ? { "X-Line-Delivery-Tag": xLineDeliveryTag }
        : {}),
    };

    const res = await this.httpClient.post("/bot/pnp/push", params, {
      headers: headerParams,
    });
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Send reply message
   * Calls `POST https://api.line.me/v2/bot/message/reply`.
   * To inspect the HTTP status code or response headers, use {@link replyMessageWithHttpInfo}.
   * @param replyMessageRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#send-reply-message">LINE Developers documentation</a>
   */
  public async replyMessage(
    replyMessageRequest: ReplyMessageRequest,
  ): Promise<ReplyMessageResponse> {
    return (await this.replyMessageWithHttpInfo(replyMessageRequest)).body;
  }

  /**
   * Send reply message
   * Calls `POST https://api.line.me/v2/bot/message/reply`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param replyMessageRequest
   * @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-reply-message">LINE Developers documentation</a>
   */
  public async replyMessageWithHttpInfo(
    replyMessageRequest: ReplyMessageRequest,
  ): Promise<Types.ApiResponseType<ReplyMessageResponse>> {
    const params = replyMessageRequest;

    const res = await this.httpClient.post("/v2/bot/message/reply", params);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * 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
   * Calls `POST https://api.line.me/v2/bot/richmenu/batch`.
   * To inspect the HTTP status code or response headers, use {@link richMenuBatchWithHttpInfo}.
   * @param richMenuBatchRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#batch-control-rich-menus-of-users">LINE Developers documentation</a>
   */
  public async richMenuBatch(
    richMenuBatchRequest: RichMenuBatchRequest,
  ): Promise<Types.MessageAPIResponseBase> {
    return (await this.richMenuBatchWithHttpInfo(richMenuBatchRequest)).body;
  }

  /**
   * 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
   * Calls `POST https://api.line.me/v2/bot/richmenu/batch`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param richMenuBatchRequest
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#batch-control-rich-menus-of-users">LINE Developers documentation</a>
   */
  public async richMenuBatchWithHttpInfo(
    richMenuBatchRequest: RichMenuBatchRequest,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const params = richMenuBatchRequest;

    const res = await this.httpClient.post("/v2/bot/richmenu/batch", params);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Set default rich menu
   * Calls `POST https://api.line.me/v2/bot/user/all/richmenu/{richMenuId}`.
   * To inspect the HTTP status code or response headers, use {@link setDefaultRichMenuWithHttpInfo}.
   * @param richMenuId ID of a rich menu
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#set-default-rich-menu">LINE Developers documentation</a>
   */
  public async setDefaultRichMenu(
    richMenuId: string,
  ): Promise<Types.MessageAPIResponseBase> {
    return (await this.setDefaultRichMenuWithHttpInfo(richMenuId)).body;
  }

  /**
   * Set default rich menu
   * Calls `POST https://api.line.me/v2/bot/user/all/richmenu/{richMenuId}`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param richMenuId ID of a rich menu
   * @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-default-rich-menu">LINE Developers documentation</a>
   */
  public async setDefaultRichMenuWithHttpInfo(
    richMenuId: string,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const requestPath = buildPath("/v2/bot/user/all/richmenu/{richMenuId}", {
      richMenuId: richMenuId,
    });

    const res = await this.httpClient.post(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Set webhook endpoint URL
   * Calls `PUT https://api.line.me/v2/bot/channel/webhook/endpoint`.
   * To inspect the HTTP status code or response headers, use {@link setWebhookEndpointWithHttpInfo}.
   * @param setWebhookEndpointRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#set-webhook-endpoint-url">LINE Developers documentation</a>
   */
  public async setWebhookEndpoint(
    setWebhookEndpointRequest: SetWebhookEndpointRequest,
  ): Promise<Types.MessageAPIResponseBase> {
    return (
      await this.setWebhookEndpointWithHttpInfo(setWebhookEndpointRequest)
    ).body;
  }

  /**
   * Set webhook endpoint URL
   * Calls `PUT https://api.line.me/v2/bot/channel/webhook/endpoint`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param setWebhookEndpointRequest
   * @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-webhook-endpoint-url">LINE Developers documentation</a>
   */
  public async setWebhookEndpointWithHttpInfo(
    setWebhookEndpointRequest: SetWebhookEndpointRequest,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const params = setWebhookEndpointRequest;

    const res = await this.httpClient.put(
      "/v2/bot/channel/webhook/endpoint",
      params,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Display a loading animation in one-on-one chats between users and LINE Official Accounts.
   * Calls `POST https://api.line.me/v2/bot/chat/loading/start`.
   * To inspect the HTTP status code or response headers, use {@link showLoadingAnimationWithHttpInfo}.
   * @param showLoadingAnimationRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#display-a-loading-indicator">LINE Developers documentation</a>
   */
  public async showLoadingAnimation(
    showLoadingAnimationRequest: ShowLoadingAnimationRequest,
  ): Promise<object> {
    return (
      await this.showLoadingAnimationWithHttpInfo(showLoadingAnimationRequest)
    ).body;
  }

  /**
   * Display a loading animation in one-on-one chats between users and LINE Official Accounts.
   * Calls `POST https://api.line.me/v2/bot/chat/loading/start`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param showLoadingAnimationRequest
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#display-a-loading-indicator">LINE Developers documentation</a>
   */
  public async showLoadingAnimationWithHttpInfo(
    showLoadingAnimationRequest: ShowLoadingAnimationRequest,
  ): Promise<Types.ApiResponseType<object>> {
    const params = showLoadingAnimationRequest;

    const res = await this.httpClient.post(
      "/v2/bot/chat/loading/start",
      params,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Test webhook endpoint
   * Calls `POST https://api.line.me/v2/bot/channel/webhook/test`.
   * To inspect the HTTP status code or response headers, use {@link testWebhookEndpointWithHttpInfo}.
   * @param testWebhookEndpointRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#test-webhook-endpoint">LINE Developers documentation</a>
   */
  public async testWebhookEndpoint(
    testWebhookEndpointRequest?: TestWebhookEndpointRequest,
  ): Promise<TestWebhookEndpointResponse> {
    return (
      await this.testWebhookEndpointWithHttpInfo(testWebhookEndpointRequest)
    ).body;
  }

  /**
   * Test webhook endpoint
   * Calls `POST https://api.line.me/v2/bot/channel/webhook/test`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param testWebhookEndpointRequest
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#test-webhook-endpoint">LINE Developers documentation</a>
   */
  public async testWebhookEndpointWithHttpInfo(
    testWebhookEndpointRequest?: TestWebhookEndpointRequest,
  ): Promise<Types.ApiResponseType<TestWebhookEndpointResponse>> {
    const params = testWebhookEndpointRequest;

    const res = await this.httpClient.post(
      "/v2/bot/channel/webhook/test",
      params,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Unlink rich menu from user
   * Calls `DELETE https://api.line.me/v2/bot/user/{userId}/richmenu`.
   * To inspect the HTTP status code or response headers, use {@link unlinkRichMenuIdFromUserWithHttpInfo}.
   * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-user">LINE Developers documentation</a>
   */
  public async unlinkRichMenuIdFromUser(
    userId: string,
  ): Promise<Types.MessageAPIResponseBase> {
    return (await this.unlinkRichMenuIdFromUserWithHttpInfo(userId)).body;
  }

  /**
   * Unlink rich menu from user
   * Calls `DELETE https://api.line.me/v2/bot/user/{userId}/richmenu`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param userId User ID. Found in the `source` object of webhook event objects. Do not use the LINE ID used in LINE.
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-user">LINE Developers documentation</a>
   */
  public async unlinkRichMenuIdFromUserWithHttpInfo(
    userId: string,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const requestPath = buildPath("/v2/bot/user/{userId}/richmenu", {
      userId: userId,
    });

    const res = await this.httpClient.delete(requestPath);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Unlink rich menus from multiple users
   * Calls `POST https://api.line.me/v2/bot/richmenu/bulk/unlink`.
   * To inspect the HTTP status code or response headers, use {@link unlinkRichMenuIdFromUsersWithHttpInfo}.
   * @param richMenuBulkUnlinkRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-users">LINE Developers documentation</a>
   */
  public async unlinkRichMenuIdFromUsers(
    richMenuBulkUnlinkRequest: RichMenuBulkUnlinkRequest,
  ): Promise<Types.MessageAPIResponseBase> {
    return (
      await this.unlinkRichMenuIdFromUsersWithHttpInfo(
        richMenuBulkUnlinkRequest,
      )
    ).body;
  }

  /**
   * Unlink rich menus from multiple users
   * Calls `POST https://api.line.me/v2/bot/richmenu/bulk/unlink`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param richMenuBulkUnlinkRequest
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#unlink-rich-menu-from-users">LINE Developers documentation</a>
   */
  public async unlinkRichMenuIdFromUsersWithHttpInfo(
    richMenuBulkUnlinkRequest: RichMenuBulkUnlinkRequest,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const params = richMenuBulkUnlinkRequest;

    const res = await this.httpClient.post(
      "/v2/bot/richmenu/bulk/unlink",
      params,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Update rich menu alias
   * Calls `POST https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId}`.
   * To inspect the HTTP status code or response headers, use {@link updateRichMenuAliasWithHttpInfo}.
   * @param richMenuAliasId The rich menu alias ID you want to update.
   * @param updateRichMenuAliasRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#update-rich-menu-alias">LINE Developers documentation</a>
   */
  public async updateRichMenuAlias(
    richMenuAliasId: string,
    updateRichMenuAliasRequest: UpdateRichMenuAliasRequest,
  ): Promise<Types.MessageAPIResponseBase> {
    return (
      await this.updateRichMenuAliasWithHttpInfo(
        richMenuAliasId,
        updateRichMenuAliasRequest,
      )
    ).body;
  }

  /**
   * Update rich menu alias
   * Calls `POST https://api.line.me/v2/bot/richmenu/alias/{richMenuAliasId}`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param richMenuAliasId The rich menu alias ID you want to update.
   * @param updateRichMenuAliasRequest
   * @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-rich-menu-alias">LINE Developers documentation</a>
   */
  public async updateRichMenuAliasWithHttpInfo(
    richMenuAliasId: string,
    updateRichMenuAliasRequest: UpdateRichMenuAliasRequest,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const requestPath = buildPath("/v2/bot/richmenu/alias/{richMenuAliasId}", {
      richMenuAliasId: richMenuAliasId,
    });

    const params = updateRichMenuAliasRequest;

    const res = await this.httpClient.post(requestPath, params);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Validate message objects of a broadcast message
   * Calls `POST https://api.line.me/v2/bot/message/validate/broadcast`.
   * To inspect the HTTP status code or response headers, use {@link validateBroadcastWithHttpInfo}.
   * @param validateMessageRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-broadcast-message">LINE Developers documentation</a>
   */
  public async validateBroadcast(
    validateMessageRequest: ValidateMessageRequest,
  ): Promise<Types.MessageAPIResponseBase> {
    return (await this.validateBroadcastWithHttpInfo(validateMessageRequest))
      .body;
  }

  /**
   * Validate message objects of a broadcast message
   * Calls `POST https://api.line.me/v2/bot/message/validate/broadcast`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param validateMessageRequest
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-broadcast-message">LINE Developers documentation</a>
   */
  public async validateBroadcastWithHttpInfo(
    validateMessageRequest: ValidateMessageRequest,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const params = validateMessageRequest;

    const res = await this.httpClient.post(
      "/v2/bot/message/validate/broadcast",
      params,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Validate message objects of a multicast message
   * Calls `POST https://api.line.me/v2/bot/message/validate/multicast`.
   * To inspect the HTTP status code or response headers, use {@link validateMulticastWithHttpInfo}.
   * @param validateMessageRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-multicast-message">LINE Developers documentation</a>
   */
  public async validateMulticast(
    validateMessageRequest: ValidateMessageRequest,
  ): Promise<Types.MessageAPIResponseBase> {
    return (await this.validateMulticastWithHttpInfo(validateMessageRequest))
      .body;
  }

  /**
   * Validate message objects of a multicast message
   * Calls `POST https://api.line.me/v2/bot/message/validate/multicast`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param validateMessageRequest
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-multicast-message">LINE Developers documentation</a>
   */
  public async validateMulticastWithHttpInfo(
    validateMessageRequest: ValidateMessageRequest,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const params = validateMessageRequest;

    const res = await this.httpClient.post(
      "/v2/bot/message/validate/multicast",
      params,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Validate message objects of a narrowcast message
   * Calls `POST https://api.line.me/v2/bot/message/validate/narrowcast`.
   * To inspect the HTTP status code or response headers, use {@link validateNarrowcastWithHttpInfo}.
   * @param validateMessageRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-narrowcast-message">LINE Developers documentation</a>
   */
  public async validateNarrowcast(
    validateMessageRequest: ValidateMessageRequest,
  ): Promise<Types.MessageAPIResponseBase> {
    return (await this.validateNarrowcastWithHttpInfo(validateMessageRequest))
      .body;
  }

  /**
   * Validate message objects of a narrowcast message
   * Calls `POST https://api.line.me/v2/bot/message/validate/narrowcast`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param validateMessageRequest
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-narrowcast-message">LINE Developers documentation</a>
   */
  public async validateNarrowcastWithHttpInfo(
    validateMessageRequest: ValidateMessageRequest,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const params = validateMessageRequest;

    const res = await this.httpClient.post(
      "/v2/bot/message/validate/narrowcast",
      params,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Validate message objects of a push message
   * Calls `POST https://api.line.me/v2/bot/message/validate/push`.
   * To inspect the HTTP status code or response headers, use {@link validatePushWithHttpInfo}.
   * @param validateMessageRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-push-message">LINE Developers documentation</a>
   */
  public async validatePush(
    validateMessageRequest: ValidateMessageRequest,
  ): Promise<Types.MessageAPIResponseBase> {
    return (await this.validatePushWithHttpInfo(validateMessageRequest)).body;
  }

  /**
   * Validate message objects of a push message
   * Calls `POST https://api.line.me/v2/bot/message/validate/push`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param validateMessageRequest
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-push-message">LINE Developers documentation</a>
   */
  public async validatePushWithHttpInfo(
    validateMessageRequest: ValidateMessageRequest,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const params = validateMessageRequest;

    const res = await this.httpClient.post(
      "/v2/bot/message/validate/push",
      params,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Validate message objects of a reply message
   * Calls `POST https://api.line.me/v2/bot/message/validate/reply`.
   * To inspect the HTTP status code or response headers, use {@link validateReplyWithHttpInfo}.
   * @param validateMessageRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-reply-message">LINE Developers documentation</a>
   */
  public async validateReply(
    validateMessageRequest: ValidateMessageRequest,
  ): Promise<Types.MessageAPIResponseBase> {
    return (await this.validateReplyWithHttpInfo(validateMessageRequest)).body;
  }

  /**
   * Validate message objects of a reply message
   * Calls `POST https://api.line.me/v2/bot/message/validate/reply`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param validateMessageRequest
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-message-objects-of-reply-message">LINE Developers documentation</a>
   */
  public async validateReplyWithHttpInfo(
    validateMessageRequest: ValidateMessageRequest,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const params = validateMessageRequest;

    const res = await this.httpClient.post(
      "/v2/bot/message/validate/reply",
      params,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Validate a request body of the Replace or unlink the linked rich menus in batches endpoint.
   * Calls `POST https://api.line.me/v2/bot/richmenu/validate/batch`.
   * To inspect the HTTP status code or response headers, use {@link validateRichMenuBatchRequestWithHttpInfo}.
   * @param richMenuBatchRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-batch-control-rich-menus-request">LINE Developers documentation</a>
   */
  public async validateRichMenuBatchRequest(
    richMenuBatchRequest: RichMenuBatchRequest,
  ): Promise<Types.MessageAPIResponseBase> {
    return (
      await this.validateRichMenuBatchRequestWithHttpInfo(richMenuBatchRequest)
    ).body;
  }

  /**
   * Validate a request body of the Replace or unlink the linked rich menus in batches endpoint.
   * Calls `POST https://api.line.me/v2/bot/richmenu/validate/batch`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param richMenuBatchRequest
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-batch-control-rich-menus-request">LINE Developers documentation</a>
   */
  public async validateRichMenuBatchRequestWithHttpInfo(
    richMenuBatchRequest: RichMenuBatchRequest,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const params = richMenuBatchRequest;

    const res = await this.httpClient.post(
      "/v2/bot/richmenu/validate/batch",
      params,
    );
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
  /**
   * Validate rich menu object
   * Calls `POST https://api.line.me/v2/bot/richmenu/validate`.
   * To inspect the HTTP status code or response headers, use {@link validateRichMenuObjectWithHttpInfo}.
   * @param richMenuRequest
   * @returns A promise resolving to the response body.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-rich-menu-object">LINE Developers documentation</a>
   */
  public async validateRichMenuObject(
    richMenuRequest: RichMenuRequest,
  ): Promise<Types.MessageAPIResponseBase> {
    return (await this.validateRichMenuObjectWithHttpInfo(richMenuRequest))
      .body;
  }

  /**
   * Validate rich menu object
   * Calls `POST https://api.line.me/v2/bot/richmenu/validate`.
   * This method returns the response body together with the underlying `httpResponse`.
   * @param richMenuRequest
   * @returns A promise resolving to the response body together with the underlying `httpResponse`.
   * @see <a href="https://developers.line.biz/en/reference/messaging-api/#validate-rich-menu-object">LINE Developers documentation</a>
   */
  public async validateRichMenuObjectWithHttpInfo(
    richMenuRequest: RichMenuRequest,
  ): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
    const params = richMenuRequest;

    const res = await this.httpClient.post("/v2/bot/richmenu/validate", params);
    const text = await res.text();
    const parsedBody = text ? JSON.parse(text) : null;
    return { httpResponse: res, body: parsedBody };
  }
}
