diff --git a/lib/messaging-api/.openapi-generator/FILES b/lib/messaging-api/.openapi-generator/FILES index 6d81453e2..6f32b583b 100644 --- a/lib/messaging-api/.openapi-generator/FILES +++ b/lib/messaging-api/.openapi-generator/FILES @@ -3,6 +3,8 @@ api.ts api/apis.ts api/messagingApiBlobClient.ts api/messagingApiClient.ts +model/acquisitionConditionRequest.ts +model/acquisitionConditionResponse.ts model/action.ts model/ageDemographic.ts model/ageDemographicFilter.ts @@ -21,13 +23,44 @@ model/cameraAction.ts model/cameraRollAction.ts model/carouselColumn.ts model/carouselTemplate.ts +model/cashBackFixedPriceInfoRequest.ts +model/cashBackFixedPriceInfoResponse.ts +model/cashBackPercentagePriceInfoRequest.ts +model/cashBackPercentagePriceInfoResponse.ts +model/cashBackPriceInfoRequest.ts +model/cashBackPriceInfoResponse.ts model/chatReference.ts model/clipboardAction.ts model/clipboardImagemapAction.ts model/confirmTemplate.ts +model/couponCashBackRewardRequest.ts +model/couponCashBackRewardResponse.ts +model/couponCreateRequest.ts +model/couponCreateResponse.ts +model/couponDiscountRewardRequest.ts +model/couponDiscountRewardResponse.ts +model/couponFreeRewardRequest.ts +model/couponFreeRewardResponse.ts +model/couponGiftRewardRequest.ts +model/couponGiftRewardResponse.ts +model/couponListResponse.ts +model/couponMessage.ts +model/couponOthersRewardRequest.ts +model/couponOthersRewardResponse.ts +model/couponResponse.ts +model/couponRewardRequest.ts +model/couponRewardResponse.ts model/createRichMenuAliasRequest.ts model/datetimePickerAction.ts model/demographicFilter.ts +model/discountExplicitPriceInfoRequest.ts +model/discountExplicitPriceInfoResponse.ts +model/discountFixedPriceInfoRequest.ts +model/discountFixedPriceInfoResponse.ts +model/discountPercentagePriceInfoRequest.ts +model/discountPercentagePriceInfoResponse.ts +model/discountPriceInfoRequest.ts +model/discountPriceInfoResponse.ts model/emoji.ts model/emojiSubstitutionObject.ts model/errorDetail.ts @@ -86,6 +119,8 @@ model/issueLinkTokenResponse.ts model/limit.ts model/locationAction.ts model/locationMessage.ts +model/lotteryAcquisitionConditionRequest.ts +model/lotteryAcquisitionConditionResponse.ts model/markMessagesAsReadRequest.ts model/membersIdsResponse.ts model/membership.ts @@ -96,10 +131,13 @@ model/message.ts model/messageAction.ts model/messageImagemapAction.ts model/messageQuotaResponse.ts +model/messagingApiPagerCouponListResponse.ts model/models.ts model/multicastRequest.ts model/narrowcastProgressResponse.ts model/narrowcastRequest.ts +model/normalAcquisitionConditionRequest.ts +model/normalAcquisitionConditionResponse.ts model/numberOfMessagesResponse.ts model/operatorDemographicFilter.ts model/operatorRecipient.ts @@ -113,6 +151,7 @@ model/quotaConsumptionResponse.ts model/quotaType.ts model/recipient.ts model/redeliveryRecipient.ts +model/referralAcquisitionConditionResponse.ts model/replyMessageRequest.ts model/replyMessageResponse.ts model/richMenuAliasListResponse.ts diff --git a/lib/messaging-api/api/messagingApiClient.ts b/lib/messaging-api/api/messagingApiClient.ts index f814b2b29..09f090144 100644 --- a/lib/messaging-api/api/messagingApiClient.ts +++ b/lib/messaging-api/api/messagingApiClient.ts @@ -13,6 +13,9 @@ /* 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"; @@ -29,6 +32,7 @@ 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"; @@ -158,6 +162,64 @@ export class MessagingApiClient { const parsedBody = text ? JSON.parse(text) : null; return { httpResponse: res, body: parsedBody }; } + /** + * Close coupon + * @param couponId + * + * @see Documentation + */ + public async closeCoupon( + couponId: string, + ): Promise { + return (await this.closeCouponWithHttpInfo(couponId)).body; + } + + /** + * Close coupon. + * This method includes HttpInfo object to return additional information. + * @param couponId + * + * @see Documentation + */ + public async closeCouponWithHttpInfo( + couponId: string, + ): Promise> { + const res = await this.httpClient.put( + "/v2/bot/coupon/{couponId}/close".replace("{couponId}", String(couponId)), + ); + 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. + * @param couponCreateRequest + * + * @see Documentation + */ + public async createCoupon( + couponCreateRequest?: CouponCreateRequest, + ): Promise { + return (await this.createCouponWithHttpInfo(couponCreateRequest)).body; + } + + /** + * Create a new coupon. Define coupon details such as type, title, and validity period.. + * This method includes HttpInfo object to return additional information. + * @param couponCreateRequest + * + * @see Documentation + */ + public async createCouponWithHttpInfo( + couponCreateRequest?: CouponCreateRequest, + ): Promise> { + 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 * @param richMenuRequest @@ -373,6 +435,33 @@ export class MessagingApiClient { const parsedBody = text ? JSON.parse(text) : null; return { httpResponse: res, body: parsedBody }; } + /** + * Get coupon detail + * @param couponId + * + * @see Documentation + */ + public async getCouponDetail(couponId: string): Promise { + return (await this.getCouponDetailWithHttpInfo(couponId)).body; + } + + /** + * Get coupon detail. + * This method includes HttpInfo object to return additional information. + * @param couponId + * + * @see Documentation + */ + public async getCouponDetailWithHttpInfo( + couponId: string, + ): Promise> { + const res = await this.httpClient.get( + "/v2/bot/coupon/{couponId}".replace("{couponId}", String(couponId)), + ); + 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. * @@ -1463,6 +1552,52 @@ export class MessagingApiClient { const parsedBody = text ? JSON.parse(text) : null; return { httpResponse: res, body: parsedBody }; } + /** + * Get a paginated list of coupons. + * @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. + * + * @see Documentation + */ + public async listCoupon( + status?: Set<"DRAFT" | "RUNNING" | "CLOSED">, + start?: string, + limit?: number, + ): Promise { + return (await this.listCouponWithHttpInfo(status, start, limit)).body; + } + + /** + * Get a paginated list of coupons.. + * This method includes HttpInfo object to return additional information. + * @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. + * + * @see Documentation + */ + public async listCouponWithHttpInfo( + status?: Set<"DRAFT" | "RUNNING" | "CLOSED">, + start?: string, + limit?: number, + ): Promise> { + const queryParams = { + status: status, + start: start, + limit: limit, + }; + Object.keys(queryParams).forEach((key: keyof typeof queryParams) => { + if (queryParams[key] === undefined) { + delete queryParams[key]; + } + }); + + 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 * @param markMessagesAsReadRequest diff --git a/lib/messaging-api/model/acquisitionConditionRequest.ts b/lib/messaging-api/model/acquisitionConditionRequest.ts new file mode 100644 index 000000000..2b8d40e92 --- /dev/null +++ b/lib/messaging-api/model/acquisitionConditionRequest.ts @@ -0,0 +1,25 @@ +/** + * 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. + */ + +import { LotteryAcquisitionConditionRequest } from "./models.js"; +import { NormalAcquisitionConditionRequest } from "./models.js"; + +export type AcquisitionConditionRequest = + | LotteryAcquisitionConditionRequest // lottery + | NormalAcquisitionConditionRequest; // normal + +export type AcquisitionConditionRequestBase = { + /** + * Determines how the coupon is distributed or used. + */ + type: string /**/; +}; diff --git a/lib/messaging-api/model/acquisitionConditionResponse.ts b/lib/messaging-api/model/acquisitionConditionResponse.ts new file mode 100644 index 000000000..458247734 --- /dev/null +++ b/lib/messaging-api/model/acquisitionConditionResponse.ts @@ -0,0 +1,27 @@ +/** + * 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. + */ + +import { LotteryAcquisitionConditionResponse } from "./models.js"; +import { NormalAcquisitionConditionResponse } from "./models.js"; +import { ReferralAcquisitionConditionResponse } from "./models.js"; + +export type AcquisitionConditionResponse = + | LotteryAcquisitionConditionResponse // lottery + | NormalAcquisitionConditionResponse // normal + | ReferralAcquisitionConditionResponse; // referral + +export type AcquisitionConditionResponseBase = { + /** + * Determines how the coupon is distributed or used. + */ + type: string /**/; +}; diff --git a/lib/messaging-api/model/cashBackFixedPriceInfoRequest.ts b/lib/messaging-api/model/cashBackFixedPriceInfoRequest.ts new file mode 100644 index 000000000..6c674ffb7 --- /dev/null +++ b/lib/messaging-api/model/cashBackFixedPriceInfoRequest.ts @@ -0,0 +1,22 @@ +/** + * 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. + */ + +import { CashBackPriceInfoRequest } from "./cashBackPriceInfoRequest.js"; + +import { CashBackPriceInfoRequestBase } from "./models.js"; + +export type CashBackFixedPriceInfoRequest = CashBackPriceInfoRequestBase & { + type: "fixed"; + /** + */ + fixedAmount?: number /**/; +}; diff --git a/lib/messaging-api/model/cashBackFixedPriceInfoResponse.ts b/lib/messaging-api/model/cashBackFixedPriceInfoResponse.ts new file mode 100644 index 000000000..bb9335920 --- /dev/null +++ b/lib/messaging-api/model/cashBackFixedPriceInfoResponse.ts @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { CashBackPriceInfoResponse } from "./cashBackPriceInfoResponse.js"; + +import { CashBackPriceInfoResponseBase } from "./models.js"; + +export type CashBackFixedPriceInfoResponse = CashBackPriceInfoResponseBase & { + type: "fixed"; + /** + * Currency code (e.g., JPY, THB, TWD). + */ + currency?: CashBackFixedPriceInfoResponse.CurrencyEnum /**/; + /** + */ + fixedAmount?: number /**/; +}; + +export namespace CashBackFixedPriceInfoResponse { + export type CurrencyEnum = "JPY" | "THB" | "TWD"; +} diff --git a/lib/messaging-api/model/cashBackPercentagePriceInfoRequest.ts b/lib/messaging-api/model/cashBackPercentagePriceInfoRequest.ts new file mode 100644 index 000000000..654af0e50 --- /dev/null +++ b/lib/messaging-api/model/cashBackPercentagePriceInfoRequest.ts @@ -0,0 +1,24 @@ +/** + * 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. + */ + +import { CashBackPriceInfoRequest } from "./cashBackPriceInfoRequest.js"; + +import { CashBackPriceInfoRequestBase } from "./models.js"; + +export type CashBackPercentagePriceInfoRequest = + CashBackPriceInfoRequestBase & { + type: "percentage"; + /** + * Specifies the cashback rate as a percentage. Must be an integer between 1 and 99. + */ + percentage?: number /**/; + }; diff --git a/lib/messaging-api/model/cashBackPercentagePriceInfoResponse.ts b/lib/messaging-api/model/cashBackPercentagePriceInfoResponse.ts new file mode 100644 index 000000000..65bd2fb01 --- /dev/null +++ b/lib/messaging-api/model/cashBackPercentagePriceInfoResponse.ts @@ -0,0 +1,23 @@ +/** + * 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. + */ + +import { CashBackPriceInfoResponse } from "./cashBackPriceInfoResponse.js"; + +import { CashBackPriceInfoResponseBase } from "./models.js"; + +export type CashBackPercentagePriceInfoResponse = + CashBackPriceInfoResponseBase & { + type: "percentage"; + /** + */ + percentage?: number /**/; + }; diff --git a/lib/messaging-api/model/cashBackPriceInfoRequest.ts b/lib/messaging-api/model/cashBackPriceInfoRequest.ts new file mode 100644 index 000000000..560cf8c8c --- /dev/null +++ b/lib/messaging-api/model/cashBackPriceInfoRequest.ts @@ -0,0 +1,24 @@ +/** + * 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. + */ + +import { CashBackFixedPriceInfoRequest } from "./models.js"; +import { CashBackPercentagePriceInfoRequest } from "./models.js"; + +export type CashBackPriceInfoRequest = + | CashBackFixedPriceInfoRequest // fixed + | CashBackPercentagePriceInfoRequest; // percentage + +export type CashBackPriceInfoRequestBase = { + /** + */ + type: string /**/; +}; diff --git a/lib/messaging-api/model/cashBackPriceInfoResponse.ts b/lib/messaging-api/model/cashBackPriceInfoResponse.ts new file mode 100644 index 000000000..a68e1a6d2 --- /dev/null +++ b/lib/messaging-api/model/cashBackPriceInfoResponse.ts @@ -0,0 +1,24 @@ +/** + * 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. + */ + +import { CashBackFixedPriceInfoResponse } from "./models.js"; +import { CashBackPercentagePriceInfoResponse } from "./models.js"; + +export type CashBackPriceInfoResponse = + | CashBackFixedPriceInfoResponse // fixed + | CashBackPercentagePriceInfoResponse; // percentage + +export type CashBackPriceInfoResponseBase = { + /** + */ + type: string /**/; +}; diff --git a/lib/messaging-api/model/couponCashBackRewardRequest.ts b/lib/messaging-api/model/couponCashBackRewardRequest.ts new file mode 100644 index 000000000..1902bd63c --- /dev/null +++ b/lib/messaging-api/model/couponCashBackRewardRequest.ts @@ -0,0 +1,23 @@ +/** + * 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. + */ + +import { CashBackPriceInfoRequest } from "./cashBackPriceInfoRequest.js"; +import { CouponRewardRequest } from "./couponRewardRequest.js"; + +import { CouponRewardRequestBase } from "./models.js"; + +export type CouponCashBackRewardRequest = CouponRewardRequestBase & { + type: "cashBack"; + /** + */ + priceInfo?: CashBackPriceInfoRequest /**/; +}; diff --git a/lib/messaging-api/model/couponCashBackRewardResponse.ts b/lib/messaging-api/model/couponCashBackRewardResponse.ts new file mode 100644 index 000000000..ad5ff4f1d --- /dev/null +++ b/lib/messaging-api/model/couponCashBackRewardResponse.ts @@ -0,0 +1,23 @@ +/** + * 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. + */ + +import { CashBackPriceInfoResponse } from "./cashBackPriceInfoResponse.js"; +import { CouponRewardResponse } from "./couponRewardResponse.js"; + +import { CouponRewardResponseBase } from "./models.js"; + +export type CouponCashBackRewardResponse = CouponRewardResponseBase & { + type: "cashBack"; + /** + */ + priceInfo?: CashBackPriceInfoResponse /**/; +}; diff --git a/lib/messaging-api/model/couponCreateRequest.ts b/lib/messaging-api/model/couponCreateRequest.ts new file mode 100644 index 000000000..d9bc771a2 --- /dev/null +++ b/lib/messaging-api/model/couponCreateRequest.ts @@ -0,0 +1,110 @@ +/** + * 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. + */ + +import { AcquisitionConditionRequest } from "./acquisitionConditionRequest.js"; +import { CouponRewardRequest } from "./couponRewardRequest.js"; + +/** + * Request object for creating a coupon. Contains all configurable coupon properties. + */ +export type CouponCreateRequest = { + /** + */ + acquisitionCondition: AcquisitionConditionRequest /**/; + /** + * URL of the barcode image associated with the coupon. Used for in-store redemption. + */ + barcodeImageUrl?: string /**/; + /** + * Unique code to be presented by the user to redeem the coupon. Optional. + */ + couponCode?: string /**/; + /** + * Detailed description of the coupon. Displayed to users. + */ + description?: string /**/; + /** + * Coupon expiration time (epoch seconds). Coupon cannot be used after this time. + */ + endTimestamp: number /**/; + /** + * URL of the main image representing the coupon. Displayed in the coupon list. + */ + imageUrl?: string /**/; + /** + * Maximum number of times a single coupon ticket can be used. Use -1 to indicate no limit. + */ + maxUseCountPerTicket: number /**/; + /** + * Coupon start time (epoch seconds). Coupon can be used from this time. + */ + startTimestamp: number /**/; + /** + * Title of the coupon. Displayed in the coupon list. + */ + title: string /**/; + /** + * Conditions for using the coupon. Shown to users. + */ + usageCondition?: string /**/; + /** + */ + reward?: CouponRewardRequest /**/; + /** + * Visibility of the coupon. Determines who can see or acquire the coupon. + */ + visibility: CouponCreateRequest.VisibilityEnum /**/; + /** + * Timezone for interpreting start and end timestamps. + */ + timezone: CouponCreateRequest.TimezoneEnum /**/; +}; + +export namespace CouponCreateRequest { + export type VisibilityEnum = "UNLISTED" | "PUBLIC"; + + export type TimezoneEnum = + | "ETC_GMT_MINUS_12" + | "ETC_GMT_MINUS_11" + | "PACIFIC_HONOLULU" + | "AMERICA_ANCHORAGE" + | "AMERICA_LOS_ANGELES" + | "AMERICA_PHOENIX" + | "AMERICA_CHICAGO" + | "AMERICA_NEW_YORK" + | "AMERICA_CARACAS" + | "AMERICA_SANTIAGO" + | "AMERICA_ST_JOHNS" + | "AMERICA_SAO_PAULO" + | "ETC_GMT_MINUS_2" + | "ATLANTIC_CAPE_VERDE" + | "EUROPE_LONDON" + | "EUROPE_PARIS" + | "EUROPE_ISTANBUL" + | "EUROPE_MOSCOW" + | "ASIA_TEHRAN" + | "ASIA_TBILISI" + | "ASIA_KABUL" + | "ASIA_TASHKENT" + | "ASIA_COLOMBO" + | "ASIA_KATHMANDU" + | "ASIA_ALMATY" + | "ASIA_RANGOON" + | "ASIA_BANGKOK" + | "ASIA_TAIPEI" + | "ASIA_TOKYO" + | "AUSTRALIA_DARWIN" + | "AUSTRALIA_SYDNEY" + | "ASIA_VLADIVOSTOK" + | "ETC_GMT_PLUS_12" + | "PACIFIC_TONGATAPU"; +} diff --git a/lib/messaging-api/model/couponCreateResponse.ts b/lib/messaging-api/model/couponCreateResponse.ts new file mode 100644 index 000000000..2ccb2e0c2 --- /dev/null +++ b/lib/messaging-api/model/couponCreateResponse.ts @@ -0,0 +1,21 @@ +/** + * 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. + */ + +/** + * Response object returned after creating a coupon. Contains the coupon ID. + */ +export type CouponCreateResponse = { + /** + * Unique identifier of the coupon. + */ + couponId: string /**/; +}; diff --git a/lib/messaging-api/model/couponDiscountRewardRequest.ts b/lib/messaging-api/model/couponDiscountRewardRequest.ts new file mode 100644 index 000000000..bb400916f --- /dev/null +++ b/lib/messaging-api/model/couponDiscountRewardRequest.ts @@ -0,0 +1,23 @@ +/** + * 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. + */ + +import { CouponRewardRequest } from "./couponRewardRequest.js"; +import { DiscountPriceInfoRequest } from "./discountPriceInfoRequest.js"; + +import { CouponRewardRequestBase } from "./models.js"; + +export type CouponDiscountRewardRequest = CouponRewardRequestBase & { + type: "discount"; + /** + */ + priceInfo?: DiscountPriceInfoRequest /**/; +}; diff --git a/lib/messaging-api/model/couponDiscountRewardResponse.ts b/lib/messaging-api/model/couponDiscountRewardResponse.ts new file mode 100644 index 000000000..f5fa0d1c8 --- /dev/null +++ b/lib/messaging-api/model/couponDiscountRewardResponse.ts @@ -0,0 +1,23 @@ +/** + * 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. + */ + +import { CouponRewardResponse } from "./couponRewardResponse.js"; +import { DiscountPriceInfoResponse } from "./discountPriceInfoResponse.js"; + +import { CouponRewardResponseBase } from "./models.js"; + +export type CouponDiscountRewardResponse = CouponRewardResponseBase & { + type: "discount"; + /** + */ + priceInfo?: DiscountPriceInfoResponse /**/; +}; diff --git a/lib/messaging-api/model/couponFreeRewardRequest.ts b/lib/messaging-api/model/couponFreeRewardRequest.ts new file mode 100644 index 000000000..ab09c744a --- /dev/null +++ b/lib/messaging-api/model/couponFreeRewardRequest.ts @@ -0,0 +1,19 @@ +/** + * 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. + */ + +import { CouponRewardRequest } from "./couponRewardRequest.js"; + +import { CouponRewardRequestBase } from "./models.js"; + +export type CouponFreeRewardRequest = CouponRewardRequestBase & { + type: "free"; +}; diff --git a/lib/messaging-api/model/couponFreeRewardResponse.ts b/lib/messaging-api/model/couponFreeRewardResponse.ts new file mode 100644 index 000000000..0a2165df9 --- /dev/null +++ b/lib/messaging-api/model/couponFreeRewardResponse.ts @@ -0,0 +1,19 @@ +/** + * 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. + */ + +import { CouponRewardResponse } from "./couponRewardResponse.js"; + +import { CouponRewardResponseBase } from "./models.js"; + +export type CouponFreeRewardResponse = CouponRewardResponseBase & { + type: "free"; +}; diff --git a/lib/messaging-api/model/couponGiftRewardRequest.ts b/lib/messaging-api/model/couponGiftRewardRequest.ts new file mode 100644 index 000000000..987205aa6 --- /dev/null +++ b/lib/messaging-api/model/couponGiftRewardRequest.ts @@ -0,0 +1,19 @@ +/** + * 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. + */ + +import { CouponRewardRequest } from "./couponRewardRequest.js"; + +import { CouponRewardRequestBase } from "./models.js"; + +export type CouponGiftRewardRequest = CouponRewardRequestBase & { + type: "gift"; +}; diff --git a/lib/messaging-api/model/couponGiftRewardResponse.ts b/lib/messaging-api/model/couponGiftRewardResponse.ts new file mode 100644 index 000000000..5762c67ba --- /dev/null +++ b/lib/messaging-api/model/couponGiftRewardResponse.ts @@ -0,0 +1,19 @@ +/** + * 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. + */ + +import { CouponRewardResponse } from "./couponRewardResponse.js"; + +import { CouponRewardResponseBase } from "./models.js"; + +export type CouponGiftRewardResponse = CouponRewardResponseBase & { + type: "gift"; +}; diff --git a/lib/messaging-api/model/couponListResponse.ts b/lib/messaging-api/model/couponListResponse.ts new file mode 100644 index 000000000..da1656a55 --- /dev/null +++ b/lib/messaging-api/model/couponListResponse.ts @@ -0,0 +1,25 @@ +/** + * 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. + */ + +/** + * Summary information about a coupon, used in coupon lists. + */ +export type CouponListResponse = { + /** + * Unique identifier of the coupon. + */ + couponId: string /**/; + /** + * Title of the coupon. Displayed in the coupon list. + */ + title: string /**/; +}; diff --git a/lib/messaging-api/model/couponMessage.ts b/lib/messaging-api/model/couponMessage.ts new file mode 100644 index 000000000..8be4f6732 --- /dev/null +++ b/lib/messaging-api/model/couponMessage.ts @@ -0,0 +1,33 @@ +/** + * 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. + */ + +import { Message } from "./message.js"; +import { QuickReply } from "./quickReply.js"; +import { Sender } from "./sender.js"; + +import { MessageBase } from "./models.js"; + +export type CouponMessage = MessageBase & { + type: "coupon"; + /** + * Unique identifier of the coupon. + * + * @see couponId Documentation + */ + couponId: string /**/; + /** + * Delivery route tag information. It can be used for analysis in LINE OA Manager. + * + * @see deliveryTag Documentation + */ + deliveryTag?: string /**/; +}; diff --git a/lib/messaging-api/model/couponOthersRewardRequest.ts b/lib/messaging-api/model/couponOthersRewardRequest.ts new file mode 100644 index 000000000..343c638a9 --- /dev/null +++ b/lib/messaging-api/model/couponOthersRewardRequest.ts @@ -0,0 +1,19 @@ +/** + * 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. + */ + +import { CouponRewardRequest } from "./couponRewardRequest.js"; + +import { CouponRewardRequestBase } from "./models.js"; + +export type CouponOthersRewardRequest = CouponRewardRequestBase & { + type: "others"; +}; diff --git a/lib/messaging-api/model/couponOthersRewardResponse.ts b/lib/messaging-api/model/couponOthersRewardResponse.ts new file mode 100644 index 000000000..6bf095053 --- /dev/null +++ b/lib/messaging-api/model/couponOthersRewardResponse.ts @@ -0,0 +1,19 @@ +/** + * 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. + */ + +import { CouponRewardResponse } from "./couponRewardResponse.js"; + +import { CouponRewardResponseBase } from "./models.js"; + +export type CouponOthersRewardResponse = CouponRewardResponseBase & { + type: "others"; +}; diff --git a/lib/messaging-api/model/couponResponse.ts b/lib/messaging-api/model/couponResponse.ts new file mode 100644 index 000000000..bde201f7c --- /dev/null +++ b/lib/messaging-api/model/couponResponse.ts @@ -0,0 +1,132 @@ +/** + * 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. + */ + +import { AcquisitionConditionResponse } from "./acquisitionConditionResponse.js"; +import { CouponRewardResponse } from "./couponRewardResponse.js"; + +/** + * Detailed information about a coupon, including all properties and current status. + */ +export type CouponResponse = { + /** + */ + acquisitionCondition?: AcquisitionConditionResponse /**/; + /** + * URL of the barcode image associated with the coupon. Used for in-store redemption. + */ + barcodeImageUrl?: string /**/; + /** + * Unique code to be presented by the user to redeem the coupon. + */ + couponCode?: string /**/; + /** + * Detailed description of the coupon. Displayed to users. + */ + description?: string /**/; + /** + * Coupon expiration time (epoch seconds). Coupon cannot be used after this time. + */ + endTimestamp?: number /**/; + /** + * URL of the main image representing the coupon. Displayed in the coupon list. + */ + imageUrl?: string /**/; + /** + * Maximum number of coupons that can be issued in total. + */ + maxAcquireCount?: number /**/; + /** + * Maximum number of times a single coupon ticket can be used. + */ + maxUseCountPerTicket?: number /**/; + /** + * Maximum number of coupon tickets a single user can acquire. + */ + maxTicketPerUser?: number /**/; + /** + * Coupon start time (epoch seconds). Coupon can be used from this time. + */ + startTimestamp?: number /**/; + /** + * Title of the coupon. Displayed in the coupon list. + */ + title?: string /**/; + /** + * Conditions for using the coupon. Shown to users. + */ + usageCondition?: string /**/; + /** + */ + reward?: CouponRewardResponse /**/; + /** + * Visibility of the coupon. Determines who can see or acquire the coupon. + */ + visibility?: CouponResponse.VisibilityEnum /**/; + /** + * Timezone for interpreting start and end timestamps. + */ + timezone?: CouponResponse.TimezoneEnum /**/; + /** + * Unique identifier of the coupon. + */ + couponId?: string /**/; + /** + * Created timestamp (seconds) of the coupon. + */ + createdTimestamp?: number /**/; + /** + * Current status of the coupon. + */ + status?: CouponResponse.StatusEnum /**/; +}; + +export namespace CouponResponse { + export type VisibilityEnum = "UNLISTED" | "PUBLIC" | "PRIVATE"; + + export type TimezoneEnum = + | "ETC_GMT_MINUS_12" + | "ETC_GMT_MINUS_11" + | "PACIFIC_HONOLULU" + | "AMERICA_ANCHORAGE" + | "AMERICA_LOS_ANGELES" + | "AMERICA_PHOENIX" + | "AMERICA_CHICAGO" + | "AMERICA_NEW_YORK" + | "AMERICA_CARACAS" + | "AMERICA_SANTIAGO" + | "AMERICA_ST_JOHNS" + | "AMERICA_SAO_PAULO" + | "ETC_GMT_MINUS_2" + | "ATLANTIC_CAPE_VERDE" + | "EUROPE_LONDON" + | "EUROPE_PARIS" + | "EUROPE_ISTANBUL" + | "EUROPE_MOSCOW" + | "ASIA_TEHRAN" + | "ASIA_TBILISI" + | "ASIA_KABUL" + | "ASIA_TASHKENT" + | "ASIA_COLOMBO" + | "ASIA_KATHMANDU" + | "ASIA_ALMATY" + | "ASIA_RANGOON" + | "ASIA_BANGKOK" + | "ASIA_TAIPEI" + | "ASIA_TOKYO" + | "AUSTRALIA_DARWIN" + | "AUSTRALIA_SYDNEY" + | "ASIA_VLADIVOSTOK" + | "ETC_GMT_PLUS_12" + | "PACIFIC_TONGATAPU"; + + export type StatusEnum = "DRAFT" | "RUNNING" | "CLOSED"; +} diff --git a/lib/messaging-api/model/couponRewardRequest.ts b/lib/messaging-api/model/couponRewardRequest.ts new file mode 100644 index 000000000..d345261ca --- /dev/null +++ b/lib/messaging-api/model/couponRewardRequest.ts @@ -0,0 +1,31 @@ +/** + * 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. + */ + +import { CouponCashBackRewardRequest } from "./models.js"; +import { CouponDiscountRewardRequest } from "./models.js"; +import { CouponFreeRewardRequest } from "./models.js"; +import { CouponGiftRewardRequest } from "./models.js"; +import { CouponOthersRewardRequest } from "./models.js"; + +export type CouponRewardRequest = + | CouponCashBackRewardRequest // cashBack + | CouponDiscountRewardRequest // discount + | CouponFreeRewardRequest // free + | CouponGiftRewardRequest // gift + | CouponOthersRewardRequest; // others + +export type CouponRewardRequestBase = { + /** + * Type of coupon. Determines the benefit provided. + */ + type: string /**/; +}; diff --git a/lib/messaging-api/model/couponRewardResponse.ts b/lib/messaging-api/model/couponRewardResponse.ts new file mode 100644 index 000000000..b6c5f7eae --- /dev/null +++ b/lib/messaging-api/model/couponRewardResponse.ts @@ -0,0 +1,31 @@ +/** + * 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. + */ + +import { CouponCashBackRewardResponse } from "./models.js"; +import { CouponDiscountRewardResponse } from "./models.js"; +import { CouponFreeRewardResponse } from "./models.js"; +import { CouponGiftRewardResponse } from "./models.js"; +import { CouponOthersRewardResponse } from "./models.js"; + +export type CouponRewardResponse = + | CouponCashBackRewardResponse // cashBack + | CouponDiscountRewardResponse // discount + | CouponFreeRewardResponse // free + | CouponGiftRewardResponse // gift + | CouponOthersRewardResponse; // others + +export type CouponRewardResponseBase = { + /** + * Type of coupon. Determines the benefit provided. + */ + type: string /**/; +}; diff --git a/lib/messaging-api/model/discountExplicitPriceInfoRequest.ts b/lib/messaging-api/model/discountExplicitPriceInfoRequest.ts new file mode 100644 index 000000000..e0b2545fc --- /dev/null +++ b/lib/messaging-api/model/discountExplicitPriceInfoRequest.ts @@ -0,0 +1,25 @@ +/** + * 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. + */ + +import { DiscountPriceInfoRequest } from "./discountPriceInfoRequest.js"; + +import { DiscountPriceInfoRequestBase } from "./models.js"; + +export type DiscountExplicitPriceInfoRequest = DiscountPriceInfoRequestBase & { + type: "explicit"; + /** + */ + priceAfterDiscount?: number /**/; + /** + */ + originalPrice?: number /**/; +}; diff --git a/lib/messaging-api/model/discountExplicitPriceInfoResponse.ts b/lib/messaging-api/model/discountExplicitPriceInfoResponse.ts new file mode 100644 index 000000000..40c2e27a6 --- /dev/null +++ b/lib/messaging-api/model/discountExplicitPriceInfoResponse.ts @@ -0,0 +1,34 @@ +/** + * 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. + */ + +import { DiscountPriceInfoResponse } from "./discountPriceInfoResponse.js"; + +import { DiscountPriceInfoResponseBase } from "./models.js"; + +export type DiscountExplicitPriceInfoResponse = + DiscountPriceInfoResponseBase & { + type: "explicit"; + /** + * Currency code (e.g., JPY, THB, TWD). + */ + currency?: DiscountExplicitPriceInfoResponse.CurrencyEnum /**/; + /** + */ + priceAfterDiscount?: number /**/; + /** + */ + originalPrice?: number /**/; + }; + +export namespace DiscountExplicitPriceInfoResponse { + export type CurrencyEnum = "JPY" | "THB" | "TWD"; +} diff --git a/lib/messaging-api/model/discountFixedPriceInfoRequest.ts b/lib/messaging-api/model/discountFixedPriceInfoRequest.ts new file mode 100644 index 000000000..e0fff0ddf --- /dev/null +++ b/lib/messaging-api/model/discountFixedPriceInfoRequest.ts @@ -0,0 +1,22 @@ +/** + * 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. + */ + +import { DiscountPriceInfoRequest } from "./discountPriceInfoRequest.js"; + +import { DiscountPriceInfoRequestBase } from "./models.js"; + +export type DiscountFixedPriceInfoRequest = DiscountPriceInfoRequestBase & { + type: "fixed"; + /** + */ + fixedAmount?: number /**/; +}; diff --git a/lib/messaging-api/model/discountFixedPriceInfoResponse.ts b/lib/messaging-api/model/discountFixedPriceInfoResponse.ts new file mode 100644 index 000000000..999e8ab23 --- /dev/null +++ b/lib/messaging-api/model/discountFixedPriceInfoResponse.ts @@ -0,0 +1,30 @@ +/** + * 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. + */ + +import { DiscountPriceInfoResponse } from "./discountPriceInfoResponse.js"; + +import { DiscountPriceInfoResponseBase } from "./models.js"; + +export type DiscountFixedPriceInfoResponse = DiscountPriceInfoResponseBase & { + type: "fixed"; + /** + * Currency code (e.g., JPY, THB, TWD). + */ + currency?: DiscountFixedPriceInfoResponse.CurrencyEnum /**/; + /** + */ + fixedAmount?: number /**/; +}; + +export namespace DiscountFixedPriceInfoResponse { + export type CurrencyEnum = "JPY" | "THB" | "TWD"; +} diff --git a/lib/messaging-api/model/discountPercentagePriceInfoRequest.ts b/lib/messaging-api/model/discountPercentagePriceInfoRequest.ts new file mode 100644 index 000000000..26e5beb34 --- /dev/null +++ b/lib/messaging-api/model/discountPercentagePriceInfoRequest.ts @@ -0,0 +1,24 @@ +/** + * 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. + */ + +import { DiscountPriceInfoRequest } from "./discountPriceInfoRequest.js"; + +import { DiscountPriceInfoRequestBase } from "./models.js"; + +export type DiscountPercentagePriceInfoRequest = + DiscountPriceInfoRequestBase & { + type: "percentage"; + /** + * Specifies the discount rate as a percentage. Must be an integer between 1 and 99. + */ + percentage?: number /**/; + }; diff --git a/lib/messaging-api/model/discountPercentagePriceInfoResponse.ts b/lib/messaging-api/model/discountPercentagePriceInfoResponse.ts new file mode 100644 index 000000000..be3374439 --- /dev/null +++ b/lib/messaging-api/model/discountPercentagePriceInfoResponse.ts @@ -0,0 +1,23 @@ +/** + * 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. + */ + +import { DiscountPriceInfoResponse } from "./discountPriceInfoResponse.js"; + +import { DiscountPriceInfoResponseBase } from "./models.js"; + +export type DiscountPercentagePriceInfoResponse = + DiscountPriceInfoResponseBase & { + type: "percentage"; + /** + */ + percentage?: number /**/; + }; diff --git a/lib/messaging-api/model/discountPriceInfoRequest.ts b/lib/messaging-api/model/discountPriceInfoRequest.ts new file mode 100644 index 000000000..a49fb860a --- /dev/null +++ b/lib/messaging-api/model/discountPriceInfoRequest.ts @@ -0,0 +1,26 @@ +/** + * 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. + */ + +import { DiscountExplicitPriceInfoRequest } from "./models.js"; +import { DiscountFixedPriceInfoRequest } from "./models.js"; +import { DiscountPercentagePriceInfoRequest } from "./models.js"; + +export type DiscountPriceInfoRequest = + | DiscountExplicitPriceInfoRequest // explicit + | DiscountFixedPriceInfoRequest // fixed + | DiscountPercentagePriceInfoRequest; // percentage + +export type DiscountPriceInfoRequestBase = { + /** + */ + type: string /**/; +}; diff --git a/lib/messaging-api/model/discountPriceInfoResponse.ts b/lib/messaging-api/model/discountPriceInfoResponse.ts new file mode 100644 index 000000000..6c1e48870 --- /dev/null +++ b/lib/messaging-api/model/discountPriceInfoResponse.ts @@ -0,0 +1,26 @@ +/** + * 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. + */ + +import { DiscountExplicitPriceInfoResponse } from "./models.js"; +import { DiscountFixedPriceInfoResponse } from "./models.js"; +import { DiscountPercentagePriceInfoResponse } from "./models.js"; + +export type DiscountPriceInfoResponse = + | DiscountExplicitPriceInfoResponse // explicit + | DiscountFixedPriceInfoResponse // fixed + | DiscountPercentagePriceInfoResponse; // percentage + +export type DiscountPriceInfoResponseBase = { + /** + */ + type: string /**/; +}; diff --git a/lib/messaging-api/model/lotteryAcquisitionConditionRequest.ts b/lib/messaging-api/model/lotteryAcquisitionConditionRequest.ts new file mode 100644 index 000000000..da36a3ceb --- /dev/null +++ b/lib/messaging-api/model/lotteryAcquisitionConditionRequest.ts @@ -0,0 +1,28 @@ +/** + * 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. + */ + +import { AcquisitionConditionRequest } from "./acquisitionConditionRequest.js"; + +import { AcquisitionConditionRequestBase } from "./models.js"; + +export type LotteryAcquisitionConditionRequest = + AcquisitionConditionRequestBase & { + type: "lottery"; + /** + * Probability (1-99) of winning the coupon in lottery-type campaigns. + */ + lotteryProbability: number /**/; + /** + * Maximum number of coupons that can be issued in total. Use -1 to indicate no limit + */ + maxAcquireCount: number /**/; + }; diff --git a/lib/messaging-api/model/lotteryAcquisitionConditionResponse.ts b/lib/messaging-api/model/lotteryAcquisitionConditionResponse.ts new file mode 100644 index 000000000..ec4f6dc3a --- /dev/null +++ b/lib/messaging-api/model/lotteryAcquisitionConditionResponse.ts @@ -0,0 +1,26 @@ +/** + * 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. + */ + +import { AcquisitionConditionResponse } from "./acquisitionConditionResponse.js"; + +import { AcquisitionConditionResponseBase } from "./models.js"; + +export type LotteryAcquisitionConditionResponse = + AcquisitionConditionResponseBase & { + type: "lottery"; + /** + */ + lotteryProbability?: number /**/; + /** + */ + maxAcquireCount?: number /**/; + }; diff --git a/lib/messaging-api/model/message.ts b/lib/messaging-api/model/message.ts index 840aef894..797abc964 100644 --- a/lib/messaging-api/model/message.ts +++ b/lib/messaging-api/model/message.ts @@ -14,6 +14,7 @@ import { QuickReply } from "./quickReply.js"; import { Sender } from "./sender.js"; import { AudioMessage } from "./models.js"; +import { CouponMessage } from "./models.js"; import { FlexMessage } from "./models.js"; import { ImageMessage } from "./models.js"; import { ImagemapMessage } from "./models.js"; @@ -26,6 +27,7 @@ import { VideoMessage } from "./models.js"; export type Message = | AudioMessage // audio + | CouponMessage // coupon | FlexMessage // flex | ImageMessage // image | ImagemapMessage // imagemap diff --git a/lib/messaging-api/model/messagingApiPagerCouponListResponse.ts b/lib/messaging-api/model/messagingApiPagerCouponListResponse.ts new file mode 100644 index 000000000..7c84620e4 --- /dev/null +++ b/lib/messaging-api/model/messagingApiPagerCouponListResponse.ts @@ -0,0 +1,27 @@ +/** + * 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. + */ + +import { CouponListResponse } from "./couponListResponse.js"; + +/** + * Paginated response object containing a list of coupons. + */ +export type MessagingApiPagerCouponListResponse = { + /** + * List of coupon summary objects. + */ + items: Array /**/; + /** + * Token for fetching the next page of results. + */ + next?: string /**/; +}; diff --git a/lib/messaging-api/model/models.ts b/lib/messaging-api/model/models.ts index a9972f71d..bb475957c 100644 --- a/lib/messaging-api/model/models.ts +++ b/lib/messaging-api/model/models.ts @@ -1,3 +1,5 @@ +export * from "./acquisitionConditionRequest.js"; +export * from "./acquisitionConditionResponse.js"; export * from "./action.js"; export * from "./ageDemographic.js"; export * from "./ageDemographicFilter.js"; @@ -16,13 +18,44 @@ export * from "./cameraAction.js"; export * from "./cameraRollAction.js"; export * from "./carouselColumn.js"; export * from "./carouselTemplate.js"; +export * from "./cashBackFixedPriceInfoRequest.js"; +export * from "./cashBackFixedPriceInfoResponse.js"; +export * from "./cashBackPercentagePriceInfoRequest.js"; +export * from "./cashBackPercentagePriceInfoResponse.js"; +export * from "./cashBackPriceInfoRequest.js"; +export * from "./cashBackPriceInfoResponse.js"; export * from "./chatReference.js"; export * from "./clipboardAction.js"; export * from "./clipboardImagemapAction.js"; export * from "./confirmTemplate.js"; +export * from "./couponCashBackRewardRequest.js"; +export * from "./couponCashBackRewardResponse.js"; +export * from "./couponCreateRequest.js"; +export * from "./couponCreateResponse.js"; +export * from "./couponDiscountRewardRequest.js"; +export * from "./couponDiscountRewardResponse.js"; +export * from "./couponFreeRewardRequest.js"; +export * from "./couponFreeRewardResponse.js"; +export * from "./couponGiftRewardRequest.js"; +export * from "./couponGiftRewardResponse.js"; +export * from "./couponListResponse.js"; +export * from "./couponMessage.js"; +export * from "./couponOthersRewardRequest.js"; +export * from "./couponOthersRewardResponse.js"; +export * from "./couponResponse.js"; +export * from "./couponRewardRequest.js"; +export * from "./couponRewardResponse.js"; export * from "./createRichMenuAliasRequest.js"; export * from "./datetimePickerAction.js"; export * from "./demographicFilter.js"; +export * from "./discountExplicitPriceInfoRequest.js"; +export * from "./discountExplicitPriceInfoResponse.js"; +export * from "./discountFixedPriceInfoRequest.js"; +export * from "./discountFixedPriceInfoResponse.js"; +export * from "./discountPercentagePriceInfoRequest.js"; +export * from "./discountPercentagePriceInfoResponse.js"; +export * from "./discountPriceInfoRequest.js"; +export * from "./discountPriceInfoResponse.js"; export * from "./emoji.js"; export * from "./emojiSubstitutionObject.js"; export * from "./errorDetail.js"; @@ -81,6 +114,8 @@ export * from "./issueLinkTokenResponse.js"; export * from "./limit.js"; export * from "./locationAction.js"; export * from "./locationMessage.js"; +export * from "./lotteryAcquisitionConditionRequest.js"; +export * from "./lotteryAcquisitionConditionResponse.js"; export * from "./markMessagesAsReadRequest.js"; export * from "./membersIdsResponse.js"; export * from "./membership.js"; @@ -91,9 +126,12 @@ export * from "./message.js"; export * from "./messageAction.js"; export * from "./messageImagemapAction.js"; export * from "./messageQuotaResponse.js"; +export * from "./messagingApiPagerCouponListResponse.js"; export * from "./multicastRequest.js"; export * from "./narrowcastProgressResponse.js"; export * from "./narrowcastRequest.js"; +export * from "./normalAcquisitionConditionRequest.js"; +export * from "./normalAcquisitionConditionResponse.js"; export * from "./numberOfMessagesResponse.js"; export * from "./operatorDemographicFilter.js"; export * from "./operatorRecipient.js"; @@ -107,6 +145,7 @@ export * from "./quotaConsumptionResponse.js"; export * from "./quotaType.js"; export * from "./recipient.js"; export * from "./redeliveryRecipient.js"; +export * from "./referralAcquisitionConditionResponse.js"; export * from "./replyMessageRequest.js"; export * from "./replyMessageResponse.js"; export * from "./richMenuAliasListResponse.js"; diff --git a/lib/messaging-api/model/normalAcquisitionConditionRequest.ts b/lib/messaging-api/model/normalAcquisitionConditionRequest.ts new file mode 100644 index 000000000..427acd5d6 --- /dev/null +++ b/lib/messaging-api/model/normalAcquisitionConditionRequest.ts @@ -0,0 +1,20 @@ +/** + * 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. + */ + +import { AcquisitionConditionRequest } from "./acquisitionConditionRequest.js"; + +import { AcquisitionConditionRequestBase } from "./models.js"; + +export type NormalAcquisitionConditionRequest = + AcquisitionConditionRequestBase & { + type: "normal"; + }; diff --git a/lib/messaging-api/model/normalAcquisitionConditionResponse.ts b/lib/messaging-api/model/normalAcquisitionConditionResponse.ts new file mode 100644 index 000000000..fd183e881 --- /dev/null +++ b/lib/messaging-api/model/normalAcquisitionConditionResponse.ts @@ -0,0 +1,20 @@ +/** + * 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. + */ + +import { AcquisitionConditionResponse } from "./acquisitionConditionResponse.js"; + +import { AcquisitionConditionResponseBase } from "./models.js"; + +export type NormalAcquisitionConditionResponse = + AcquisitionConditionResponseBase & { + type: "normal"; + }; diff --git a/lib/messaging-api/model/referralAcquisitionConditionResponse.ts b/lib/messaging-api/model/referralAcquisitionConditionResponse.ts new file mode 100644 index 000000000..95c49ed0c --- /dev/null +++ b/lib/messaging-api/model/referralAcquisitionConditionResponse.ts @@ -0,0 +1,20 @@ +/** + * 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. + */ + +import { AcquisitionConditionResponse } from "./acquisitionConditionResponse.js"; + +import { AcquisitionConditionResponseBase } from "./models.js"; + +export type ReferralAcquisitionConditionResponse = + AcquisitionConditionResponseBase & { + type: "referral"; + }; diff --git a/lib/messaging-api/tests/api/MessagingApiClientTest.spec.ts b/lib/messaging-api/tests/api/MessagingApiClientTest.spec.ts index 3aefde46e..124a02822 100644 --- a/lib/messaging-api/tests/api/MessagingApiClientTest.spec.ts +++ b/lib/messaging-api/tests/api/MessagingApiClientTest.spec.ts @@ -2,6 +2,9 @@ import { MessagingApiClient } from "../../api.js"; 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"; @@ -18,6 +21,7 @@ import { MarkMessagesAsReadRequest } from "../../model/markMessagesAsReadRequest 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"; @@ -269,6 +273,172 @@ describe("MessagingApiClient", () => { server.close(); }); + it("closeCouponWithHttpInfo", async () => { + let requestCount = 0; + + const server = createServer((req, res) => { + requestCount++; + + equal(req.method, "PUT"); + const reqUrl = new URL(req.url, "http://localhost/"); + equal( + reqUrl.pathname, + "/v2/bot/coupon/{couponId}/close".replace("{couponId}", "DUMMY"), // string + ); + + equal(req.headers["authorization"], `Bearer ${channel_access_token}`); + equal(req.headers["user-agent"], "@line/bot-sdk/1.0.0-test"); + + res.writeHead(200, { "Content-Type": "application/json" }); + res.end(JSON.stringify({})); + }); + await new Promise(resolve => { + server.listen(0); + server.on("listening", resolve); + }); + + const serverAddress = server.address(); + if (typeof serverAddress === "string" || serverAddress === null) { + throw new Error("Unexpected server address: " + serverAddress); + } + + const client = new MessagingApiClient({ + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/`, + }); + + const res = await client.closeCouponWithHttpInfo( + // couponId: string + "DUMMY", // couponId(string) + ); + + equal(requestCount, 1); + server.close(); + }); + + it("closeCoupon", async () => { + let requestCount = 0; + + const server = createServer((req, res) => { + requestCount++; + + equal(req.method, "PUT"); + const reqUrl = new URL(req.url, "http://localhost/"); + equal( + reqUrl.pathname, + "/v2/bot/coupon/{couponId}/close".replace("{couponId}", "DUMMY"), // string + ); + + equal(req.headers["authorization"], `Bearer ${channel_access_token}`); + equal(req.headers["user-agent"], "@line/bot-sdk/1.0.0-test"); + + res.writeHead(200, { "Content-Type": "application/json" }); + res.end(JSON.stringify({})); + }); + await new Promise(resolve => { + server.listen(0); + server.on("listening", resolve); + }); + + const serverAddress = server.address(); + if (typeof serverAddress === "string" || serverAddress === null) { + throw new Error("Unexpected server address: " + serverAddress); + } + + const client = new MessagingApiClient({ + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/`, + }); + + const res = await client.closeCoupon( + // couponId: string + "DUMMY", // couponId(string) + ); + + equal(requestCount, 1); + server.close(); + }); + + it("createCouponWithHttpInfo", async () => { + let requestCount = 0; + + const server = createServer((req, res) => { + requestCount++; + + equal(req.method, "POST"); + const reqUrl = new URL(req.url, "http://localhost/"); + equal(reqUrl.pathname, "/v2/bot/coupon"); + + equal(req.headers["authorization"], `Bearer ${channel_access_token}`); + equal(req.headers["user-agent"], "@line/bot-sdk/1.0.0-test"); + + res.writeHead(200, { "Content-Type": "application/json" }); + res.end(JSON.stringify({})); + }); + await new Promise(resolve => { + server.listen(0); + server.on("listening", resolve); + }); + + const serverAddress = server.address(); + if (typeof serverAddress === "string" || serverAddress === null) { + throw new Error("Unexpected server address: " + serverAddress); + } + + const client = new MessagingApiClient({ + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/`, + }); + + const res = await client.createCouponWithHttpInfo( + // couponCreateRequest: CouponCreateRequest + {} as unknown as CouponCreateRequest, // paramName=couponCreateRequest + ); + + equal(requestCount, 1); + server.close(); + }); + + it("createCoupon", async () => { + let requestCount = 0; + + const server = createServer((req, res) => { + requestCount++; + + equal(req.method, "POST"); + const reqUrl = new URL(req.url, "http://localhost/"); + equal(reqUrl.pathname, "/v2/bot/coupon"); + + equal(req.headers["authorization"], `Bearer ${channel_access_token}`); + equal(req.headers["user-agent"], "@line/bot-sdk/1.0.0-test"); + + res.writeHead(200, { "Content-Type": "application/json" }); + res.end(JSON.stringify({})); + }); + await new Promise(resolve => { + server.listen(0); + server.on("listening", resolve); + }); + + const serverAddress = server.address(); + if (typeof serverAddress === "string" || serverAddress === null) { + throw new Error("Unexpected server address: " + serverAddress); + } + + const client = new MessagingApiClient({ + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/`, + }); + + const res = await client.createCoupon( + // couponCreateRequest: CouponCreateRequest + {} as unknown as CouponCreateRequest, // paramName=couponCreateRequest + ); + + equal(requestCount, 1); + server.close(); + }); + it("createRichMenuWithHttpInfo", async () => { let requestCount = 0; @@ -885,6 +1055,92 @@ describe("MessagingApiClient", () => { server.close(); }); + it("getCouponDetailWithHttpInfo", async () => { + let requestCount = 0; + + const server = createServer((req, res) => { + requestCount++; + + equal(req.method, "GET"); + const reqUrl = new URL(req.url, "http://localhost/"); + equal( + reqUrl.pathname, + "/v2/bot/coupon/{couponId}".replace("{couponId}", "DUMMY"), // string + ); + + equal(req.headers["authorization"], `Bearer ${channel_access_token}`); + equal(req.headers["user-agent"], "@line/bot-sdk/1.0.0-test"); + + res.writeHead(200, { "Content-Type": "application/json" }); + res.end(JSON.stringify({})); + }); + await new Promise(resolve => { + server.listen(0); + server.on("listening", resolve); + }); + + const serverAddress = server.address(); + if (typeof serverAddress === "string" || serverAddress === null) { + throw new Error("Unexpected server address: " + serverAddress); + } + + const client = new MessagingApiClient({ + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/`, + }); + + const res = await client.getCouponDetailWithHttpInfo( + // couponId: string + "DUMMY", // couponId(string) + ); + + equal(requestCount, 1); + server.close(); + }); + + it("getCouponDetail", async () => { + let requestCount = 0; + + const server = createServer((req, res) => { + requestCount++; + + equal(req.method, "GET"); + const reqUrl = new URL(req.url, "http://localhost/"); + equal( + reqUrl.pathname, + "/v2/bot/coupon/{couponId}".replace("{couponId}", "DUMMY"), // string + ); + + equal(req.headers["authorization"], `Bearer ${channel_access_token}`); + equal(req.headers["user-agent"], "@line/bot-sdk/1.0.0-test"); + + res.writeHead(200, { "Content-Type": "application/json" }); + res.end(JSON.stringify({})); + }); + await new Promise(resolve => { + server.listen(0); + server.on("listening", resolve); + }); + + const serverAddress = server.address(); + if (typeof serverAddress === "string" || serverAddress === null) { + throw new Error("Unexpected server address: " + serverAddress); + } + + const client = new MessagingApiClient({ + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/`, + }); + + const res = await client.getCouponDetail( + // couponId: string + "DUMMY", // couponId(string) + ); + + equal(requestCount, 1); + server.close(); + }); + it("getDefaultRichMenuIdWithHttpInfo", async () => { let requestCount = 0; @@ -3965,6 +4221,156 @@ describe("MessagingApiClient", () => { server.close(); }); + it("listCouponWithHttpInfo", async () => { + let requestCount = 0; + + const server = createServer((req, res) => { + requestCount++; + + equal(req.method, "GET"); + const reqUrl = new URL(req.url, "http://localhost/"); + equal( + reqUrl.pathname, + "/v2/bot/coupon" + .replace("{start}", "DUMMY") // string + .replace("{limit}", "0"), // number + ); + + // Query parameters + const queryParams = new URLSearchParams(reqUrl.search); + equal( + queryParams.get("status"), + String( + // status: Set<'DRAFT' | 'RUNNING' | 'CLOSED'> + "DUMMY" as unknown as Set<"DRAFT" | "RUNNING" | "CLOSED">, // paramName=status(enum) + ), + ); + equal( + queryParams.get("start"), + String( + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + ), + ); + equal( + queryParams.get("limit"), + String( + // limit: number + "DUMMY" as unknown as number, // paramName=limit(enum) + ), + ); + + equal(req.headers["authorization"], `Bearer ${channel_access_token}`); + equal(req.headers["user-agent"], "@line/bot-sdk/1.0.0-test"); + + res.writeHead(200, { "Content-Type": "application/json" }); + res.end(JSON.stringify({})); + }); + await new Promise(resolve => { + server.listen(0); + server.on("listening", resolve); + }); + + const serverAddress = server.address(); + if (typeof serverAddress === "string" || serverAddress === null) { + throw new Error("Unexpected server address: " + serverAddress); + } + + const client = new MessagingApiClient({ + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/`, + }); + + const res = await client.listCouponWithHttpInfo( + // status: Set<'DRAFT' | 'RUNNING' | 'CLOSED'> + "DUMMY" as unknown as Set<"DRAFT" | "RUNNING" | "CLOSED">, // paramName=status(enum) + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + + // limit: number + "DUMMY" as unknown as number, // paramName=limit(enum) + ); + + equal(requestCount, 1); + server.close(); + }); + + it("listCoupon", async () => { + let requestCount = 0; + + const server = createServer((req, res) => { + requestCount++; + + equal(req.method, "GET"); + const reqUrl = new URL(req.url, "http://localhost/"); + equal( + reqUrl.pathname, + "/v2/bot/coupon" + .replace("{start}", "DUMMY") // string + .replace("{limit}", "0"), // number + ); + + // Query parameters + const queryParams = new URLSearchParams(reqUrl.search); + equal( + queryParams.get("status"), + String( + // status: Set<'DRAFT' | 'RUNNING' | 'CLOSED'> + "DUMMY" as unknown as Set<"DRAFT" | "RUNNING" | "CLOSED">, // paramName=status(enum) + ), + ); + equal( + queryParams.get("start"), + String( + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + ), + ); + equal( + queryParams.get("limit"), + String( + // limit: number + "DUMMY" as unknown as number, // paramName=limit(enum) + ), + ); + + equal(req.headers["authorization"], `Bearer ${channel_access_token}`); + equal(req.headers["user-agent"], "@line/bot-sdk/1.0.0-test"); + + res.writeHead(200, { "Content-Type": "application/json" }); + res.end(JSON.stringify({})); + }); + await new Promise(resolve => { + server.listen(0); + server.on("listening", resolve); + }); + + const serverAddress = server.address(); + if (typeof serverAddress === "string" || serverAddress === null) { + throw new Error("Unexpected server address: " + serverAddress); + } + + const client = new MessagingApiClient({ + channelAccessToken: channel_access_token, + baseURL: `http://localhost:${String(serverAddress.port)}/`, + }); + + const res = await client.listCoupon( + // status: Set<'DRAFT' | 'RUNNING' | 'CLOSED'> + "DUMMY" as unknown as Set<"DRAFT" | "RUNNING" | "CLOSED">, // paramName=status(enum) + + // start: string + "DUMMY" as unknown as string, // paramName=start(enum) + + // limit: number + "DUMMY" as unknown as number, // paramName=limit(enum) + ); + + equal(requestCount, 1); + server.close(); + }); + it("markMessagesAsReadWithHttpInfo", async () => { let requestCount = 0; diff --git a/line-openapi b/line-openapi index 92f9320b8..b4589bc62 160000 --- a/line-openapi +++ b/line-openapi @@ -1 +1 @@ -Subproject commit 92f9320b891ee6a071c93220ce4a3e34e1f4d38b +Subproject commit b4589bc62a4c1a42016a08e2b8945154e10e7193