From 15267a0cf90f624c4d7b4e0d904b761e1f12a049 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 20 Jan 2025 02:29:36 +0000 Subject: [PATCH] Codes are generated by openapi --- lib/messaging-api/.openapi-generator/FILES | 1 - lib/messaging-api/api/messagingApiClient.ts | 31 ------- .../model/audienceMatchMessagesRequest.ts | 34 -------- lib/messaging-api/model/models.ts | 1 - .../tests/api/MessagingApiClientTest.spec.ts | 81 ------------------- line-openapi | 2 +- 6 files changed, 1 insertion(+), 149 deletions(-) delete mode 100644 lib/messaging-api/model/audienceMatchMessagesRequest.ts diff --git a/lib/messaging-api/.openapi-generator/FILES b/lib/messaging-api/.openapi-generator/FILES index 38f8dc0f6..8a4bbb761 100644 --- a/lib/messaging-api/.openapi-generator/FILES +++ b/lib/messaging-api/.openapi-generator/FILES @@ -12,7 +12,6 @@ model/appTypeDemographic.ts model/appTypeDemographicFilter.ts model/areaDemographic.ts model/areaDemographicFilter.ts -model/audienceMatchMessagesRequest.ts model/audienceRecipient.ts model/audioMessage.ts model/botInfoResponse.ts diff --git a/lib/messaging-api/api/messagingApiClient.ts b/lib/messaging-api/api/messagingApiClient.ts index bbf9d6b19..a6f2d4d5d 100644 --- a/lib/messaging-api/api/messagingApiClient.ts +++ b/lib/messaging-api/api/messagingApiClient.ts @@ -11,7 +11,6 @@ */ /* tslint:disable:no-unused-locals */ -import { AudienceMatchMessagesRequest } from "../model/audienceMatchMessagesRequest.js"; import { BotInfoResponse } from "../model/botInfoResponse.js"; import { BroadcastRequest } from "../model/broadcastRequest.js"; import { CreateRichMenuAliasRequest } from "../model/createRichMenuAliasRequest.js"; @@ -103,36 +102,6 @@ export class MessagingApiClient { return resBody; } - /** - * Send a message using phone number - * @param audienceMatchMessagesRequest - * - * @see Documentation - */ - public async audienceMatch( - audienceMatchMessagesRequest: AudienceMatchMessagesRequest, - ): Promise { - return (await this.audienceMatchWithHttpInfo(audienceMatchMessagesRequest)) - .body; - } - - /** - * Send a message using phone number. - * This method includes HttpInfo object to return additional information. - * @param audienceMatchMessagesRequest - * - * @see Documentation - */ - public async audienceMatchWithHttpInfo( - audienceMatchMessagesRequest: AudienceMatchMessagesRequest, - ): Promise> { - const params = audienceMatchMessagesRequest; - - const res = await this.httpClient.post("/bot/ad/multicast/phone", params); - const text = await res.text(); - const parsedBody = text ? JSON.parse(text) : null; - return { httpResponse: res, body: parsedBody }; - } /** * Sends a message to multiple users at any time. * @param broadcastRequest diff --git a/lib/messaging-api/model/audienceMatchMessagesRequest.ts b/lib/messaging-api/model/audienceMatchMessagesRequest.ts deleted file mode 100644 index 7644d5f1e..000000000 --- a/lib/messaging-api/model/audienceMatchMessagesRequest.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * 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"; - -export type AudienceMatchMessagesRequest = { - /** - * Destination of the message (A value obtained by hashing the telephone number, which is another value normalized to E.164 format, with SHA256). - * - * @see messages Documentation - */ - messages: Array /**/; - /** - * Message to send. - * - * @see to Documentation - */ - to: Array /**/; - /** - * `true`: The user doesn’t receive a push notification when a message is sent. `false`: The user receives a push notification when the message is sent (unless they have disabled push notifications in LINE and/or their device). The default value is false. - * - * @see notificationDisabled Documentation - */ - notificationDisabled?: boolean /* = false*/; -}; diff --git a/lib/messaging-api/model/models.ts b/lib/messaging-api/model/models.ts index 63a7962ba..9a4031e9d 100644 --- a/lib/messaging-api/model/models.ts +++ b/lib/messaging-api/model/models.ts @@ -7,7 +7,6 @@ export * from "./appTypeDemographic.js"; export * from "./appTypeDemographicFilter.js"; export * from "./areaDemographic.js"; export * from "./areaDemographicFilter.js"; -export * from "./audienceMatchMessagesRequest.js"; export * from "./audienceRecipient.js"; export * from "./audioMessage.js"; export * from "./botInfoResponse.js"; diff --git a/lib/messaging-api/tests/api/MessagingApiClientTest.spec.ts b/lib/messaging-api/tests/api/MessagingApiClientTest.spec.ts index 574373a79..5d3721504 100644 --- a/lib/messaging-api/tests/api/MessagingApiClientTest.spec.ts +++ b/lib/messaging-api/tests/api/MessagingApiClientTest.spec.ts @@ -1,6 +1,5 @@ import { MessagingApiClient } from "../../api.js"; -import { AudienceMatchMessagesRequest } from "../../model/audienceMatchMessagesRequest.js"; import { BotInfoResponse } from "../../model/botInfoResponse.js"; import { BroadcastRequest } from "../../model/broadcastRequest.js"; import { CreateRichMenuAliasRequest } from "../../model/createRichMenuAliasRequest.js"; @@ -103,86 +102,6 @@ function parseForm(arrayBuffer: ArrayBuffer): Record { } describe("MessagingApiClient", () => { - it("audienceMatchWithHttpInfo", 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, "/bot/ad/multicast/phone"); - - 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.audienceMatchWithHttpInfo( - // audienceMatchMessagesRequest: AudienceMatchMessagesRequest - {} as unknown as AudienceMatchMessagesRequest, // paramName=audienceMatchMessagesRequest - ); - - equal(requestCount, 1); - server.close(); - }); - - it("audienceMatch", 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, "/bot/ad/multicast/phone"); - - 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.audienceMatch( - // audienceMatchMessagesRequest: AudienceMatchMessagesRequest - {} as unknown as AudienceMatchMessagesRequest, // paramName=audienceMatchMessagesRequest - ); - - equal(requestCount, 1); - server.close(); - }); - it("broadcastWithHttpInfo", async () => { let requestCount = 0; diff --git a/line-openapi b/line-openapi index 491e11809..5ae51b6a9 160000 --- a/line-openapi +++ b/line-openapi @@ -1 +1 @@ -Subproject commit 491e11809ece8248dc079d60df40fff6096a094a +Subproject commit 5ae51b6a91aea5da364666cdc60d24919ad0b6ad