Skip to content

Commit 0ac4d2f

Browse files
github-actions[bot]github-actions
and
github-actions
authored
Remove obsolete feature: Audience Match (#1130)
line/line-openapi#80 The Audience Match feature (/bot/ad/multicast/phone) was sunset in October 2023. This change removes it as it's no longer necessary to include it in line-openapi. Co-authored-by: github-actions <[email protected]>
1 parent 7588c03 commit 0ac4d2f

File tree

5 files changed

+0
-148
lines changed

5 files changed

+0
-148
lines changed

lib/messaging-api/.openapi-generator/FILES

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ model/appTypeDemographic.ts
1212
model/appTypeDemographicFilter.ts
1313
model/areaDemographic.ts
1414
model/areaDemographicFilter.ts
15-
model/audienceMatchMessagesRequest.ts
1615
model/audienceRecipient.ts
1716
model/audioMessage.ts
1817
model/botInfoResponse.ts

lib/messaging-api/api/messagingApiClient.ts

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
*/
1212

1313
/* tslint:disable:no-unused-locals */
14-
import { AudienceMatchMessagesRequest } from "../model/audienceMatchMessagesRequest.js";
1514
import { BotInfoResponse } from "../model/botInfoResponse.js";
1615
import { BroadcastRequest } from "../model/broadcastRequest.js";
1716
import { CreateRichMenuAliasRequest } from "../model/createRichMenuAliasRequest.js";
@@ -103,36 +102,6 @@ export class MessagingApiClient {
103102
return resBody;
104103
}
105104

106-
/**
107-
* Send a message using phone number
108-
* @param audienceMatchMessagesRequest
109-
*
110-
* @see <a href="https://developers.line.biz/en/reference/partner-docs/#phone-audience-match"> Documentation</a>
111-
*/
112-
public async audienceMatch(
113-
audienceMatchMessagesRequest: AudienceMatchMessagesRequest,
114-
): Promise<Types.MessageAPIResponseBase> {
115-
return (await this.audienceMatchWithHttpInfo(audienceMatchMessagesRequest))
116-
.body;
117-
}
118-
119-
/**
120-
* Send a message using phone number.
121-
* This method includes HttpInfo object to return additional information.
122-
* @param audienceMatchMessagesRequest
123-
*
124-
* @see <a href="https://developers.line.biz/en/reference/partner-docs/#phone-audience-match"> Documentation</a>
125-
*/
126-
public async audienceMatchWithHttpInfo(
127-
audienceMatchMessagesRequest: AudienceMatchMessagesRequest,
128-
): Promise<Types.ApiResponseType<Types.MessageAPIResponseBase>> {
129-
const params = audienceMatchMessagesRequest;
130-
131-
const res = await this.httpClient.post("/bot/ad/multicast/phone", params);
132-
const text = await res.text();
133-
const parsedBody = text ? JSON.parse(text) : null;
134-
return { httpResponse: res, body: parsedBody };
135-
}
136105
/**
137106
* Sends a message to multiple users at any time.
138107
* @param broadcastRequest

lib/messaging-api/model/audienceMatchMessagesRequest.ts

Lines changed: 0 additions & 34 deletions
This file was deleted.

lib/messaging-api/model/models.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export * from "./appTypeDemographic.js";
77
export * from "./appTypeDemographicFilter.js";
88
export * from "./areaDemographic.js";
99
export * from "./areaDemographicFilter.js";
10-
export * from "./audienceMatchMessagesRequest.js";
1110
export * from "./audienceRecipient.js";
1211
export * from "./audioMessage.js";
1312
export * from "./botInfoResponse.js";

lib/messaging-api/tests/api/MessagingApiClientTest.spec.ts

Lines changed: 0 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { MessagingApiClient } from "../../api.js";
22

3-
import { AudienceMatchMessagesRequest } from "../../model/audienceMatchMessagesRequest.js";
43
import { BotInfoResponse } from "../../model/botInfoResponse.js";
54
import { BroadcastRequest } from "../../model/broadcastRequest.js";
65
import { CreateRichMenuAliasRequest } from "../../model/createRichMenuAliasRequest.js";
@@ -103,86 +102,6 @@ function parseForm(arrayBuffer: ArrayBuffer): Record<string, string | Blob> {
103102
}
104103

105104
describe("MessagingApiClient", () => {
106-
it("audienceMatchWithHttpInfo", async () => {
107-
let requestCount = 0;
108-
109-
const server = createServer((req, res) => {
110-
requestCount++;
111-
112-
equal(req.method, "POST");
113-
const reqUrl = new URL(req.url, "http://localhost/");
114-
equal(reqUrl.pathname, "/bot/ad/multicast/phone");
115-
116-
equal(req.headers["authorization"], `Bearer ${channel_access_token}`);
117-
equal(req.headers["user-agent"], "@line/bot-sdk/1.0.0-test");
118-
119-
res.writeHead(200, { "Content-Type": "application/json" });
120-
res.end(JSON.stringify({}));
121-
});
122-
await new Promise(resolve => {
123-
server.listen(0);
124-
server.on("listening", resolve);
125-
});
126-
127-
const serverAddress = server.address();
128-
if (typeof serverAddress === "string" || serverAddress === null) {
129-
throw new Error("Unexpected server address: " + serverAddress);
130-
}
131-
132-
const client = new MessagingApiClient({
133-
channelAccessToken: channel_access_token,
134-
baseURL: `http://localhost:${String(serverAddress.port)}/`,
135-
});
136-
137-
const res = await client.audienceMatchWithHttpInfo(
138-
// audienceMatchMessagesRequest: AudienceMatchMessagesRequest
139-
{} as unknown as AudienceMatchMessagesRequest, // paramName=audienceMatchMessagesRequest
140-
);
141-
142-
equal(requestCount, 1);
143-
server.close();
144-
});
145-
146-
it("audienceMatch", async () => {
147-
let requestCount = 0;
148-
149-
const server = createServer((req, res) => {
150-
requestCount++;
151-
152-
equal(req.method, "POST");
153-
const reqUrl = new URL(req.url, "http://localhost/");
154-
equal(reqUrl.pathname, "/bot/ad/multicast/phone");
155-
156-
equal(req.headers["authorization"], `Bearer ${channel_access_token}`);
157-
equal(req.headers["user-agent"], "@line/bot-sdk/1.0.0-test");
158-
159-
res.writeHead(200, { "Content-Type": "application/json" });
160-
res.end(JSON.stringify({}));
161-
});
162-
await new Promise(resolve => {
163-
server.listen(0);
164-
server.on("listening", resolve);
165-
});
166-
167-
const serverAddress = server.address();
168-
if (typeof serverAddress === "string" || serverAddress === null) {
169-
throw new Error("Unexpected server address: " + serverAddress);
170-
}
171-
172-
const client = new MessagingApiClient({
173-
channelAccessToken: channel_access_token,
174-
baseURL: `http://localhost:${String(serverAddress.port)}/`,
175-
});
176-
177-
const res = await client.audienceMatch(
178-
// audienceMatchMessagesRequest: AudienceMatchMessagesRequest
179-
{} as unknown as AudienceMatchMessagesRequest, // paramName=audienceMatchMessagesRequest
180-
);
181-
182-
equal(requestCount, 1);
183-
server.close();
184-
});
185-
186105
it("broadcastWithHttpInfo", async () => {
187106
let requestCount = 0;
188107

0 commit comments

Comments
 (0)