Skip to content

Commit 5cc9b27

Browse files
github-actions[bot]github-actions
andauthored
Retire GET /v2/bot/message/delivery/ad_phone (#1138)
line/line-openapi#82 `GET /v2/bot/message/delivery/ad_phone` was sunset. 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 68d36c7 commit 5cc9b27

File tree

3 files changed

+1
-146
lines changed

3 files changed

+1
-146
lines changed

lib/messaging-api/api/messagingApiClient.ts

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -292,45 +292,6 @@ export class MessagingApiClient {
292292
const parsedBody = text ? JSON.parse(text) : null;
293293
return { httpResponse: res, body: parsedBody };
294294
}
295-
/**
296-
* Get result of message delivery using phone number
297-
* @param date Date the message was sent Format: `yyyyMMdd` (e.g. `20190831`) Time Zone: UTC+9
298-
*
299-
* @see <a href="https://developers.line.biz/en/reference/partner-docs/#get-phone-audience-match"> Documentation</a>
300-
*/
301-
public async getAdPhoneMessageStatistics(
302-
date: string,
303-
): Promise<NumberOfMessagesResponse> {
304-
return (await this.getAdPhoneMessageStatisticsWithHttpInfo(date)).body;
305-
}
306-
307-
/**
308-
* Get result of message delivery using phone number.
309-
* This method includes HttpInfo object to return additional information.
310-
* @param date Date the message was sent Format: `yyyyMMdd` (e.g. `20190831`) Time Zone: UTC+9
311-
*
312-
* @see <a href="https://developers.line.biz/en/reference/partner-docs/#get-phone-audience-match"> Documentation</a>
313-
*/
314-
public async getAdPhoneMessageStatisticsWithHttpInfo(
315-
date: string,
316-
): Promise<Types.ApiResponseType<NumberOfMessagesResponse>> {
317-
const queryParams = {
318-
date: date,
319-
};
320-
Object.keys(queryParams).forEach((key: keyof typeof queryParams) => {
321-
if (queryParams[key] === undefined) {
322-
delete queryParams[key];
323-
}
324-
});
325-
326-
const res = await this.httpClient.get(
327-
"/v2/bot/message/delivery/ad_phone",
328-
queryParams,
329-
);
330-
const text = await res.text();
331-
const parsedBody = text ? JSON.parse(text) : null;
332-
return { httpResponse: res, body: parsedBody };
333-
}
334295
/**
335296
* Get name list of units used this month
336297
* @param limit The maximum number of aggregation units you can get per request.

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

Lines changed: 0 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -606,112 +606,6 @@ describe("MessagingApiClient", () => {
606606
server.close();
607607
});
608608

609-
it("getAdPhoneMessageStatisticsWithHttpInfo", async () => {
610-
let requestCount = 0;
611-
612-
const server = createServer((req, res) => {
613-
requestCount++;
614-
615-
equal(req.method, "GET");
616-
const reqUrl = new URL(req.url, "http://localhost/");
617-
equal(
618-
reqUrl.pathname,
619-
"/v2/bot/message/delivery/ad_phone".replace("{date}", "DUMMY"), // string
620-
);
621-
622-
// Query parameters
623-
const queryParams = new URLSearchParams(reqUrl.search);
624-
equal(
625-
queryParams.get("date"),
626-
String(
627-
// date: string
628-
"DUMMY" as unknown as string, // paramName=date(enum)
629-
),
630-
);
631-
632-
equal(req.headers["authorization"], `Bearer ${channel_access_token}`);
633-
equal(req.headers["user-agent"], "@line/bot-sdk/1.0.0-test");
634-
635-
res.writeHead(200, { "Content-Type": "application/json" });
636-
res.end(JSON.stringify({}));
637-
});
638-
await new Promise(resolve => {
639-
server.listen(0);
640-
server.on("listening", resolve);
641-
});
642-
643-
const serverAddress = server.address();
644-
if (typeof serverAddress === "string" || serverAddress === null) {
645-
throw new Error("Unexpected server address: " + serverAddress);
646-
}
647-
648-
const client = new MessagingApiClient({
649-
channelAccessToken: channel_access_token,
650-
baseURL: `http://localhost:${String(serverAddress.port)}/`,
651-
});
652-
653-
const res = await client.getAdPhoneMessageStatisticsWithHttpInfo(
654-
// date: string
655-
"DUMMY" as unknown as string, // paramName=date(enum)
656-
);
657-
658-
equal(requestCount, 1);
659-
server.close();
660-
});
661-
662-
it("getAdPhoneMessageStatistics", async () => {
663-
let requestCount = 0;
664-
665-
const server = createServer((req, res) => {
666-
requestCount++;
667-
668-
equal(req.method, "GET");
669-
const reqUrl = new URL(req.url, "http://localhost/");
670-
equal(
671-
reqUrl.pathname,
672-
"/v2/bot/message/delivery/ad_phone".replace("{date}", "DUMMY"), // string
673-
);
674-
675-
// Query parameters
676-
const queryParams = new URLSearchParams(reqUrl.search);
677-
equal(
678-
queryParams.get("date"),
679-
String(
680-
// date: string
681-
"DUMMY" as unknown as string, // paramName=date(enum)
682-
),
683-
);
684-
685-
equal(req.headers["authorization"], `Bearer ${channel_access_token}`);
686-
equal(req.headers["user-agent"], "@line/bot-sdk/1.0.0-test");
687-
688-
res.writeHead(200, { "Content-Type": "application/json" });
689-
res.end(JSON.stringify({}));
690-
});
691-
await new Promise(resolve => {
692-
server.listen(0);
693-
server.on("listening", resolve);
694-
});
695-
696-
const serverAddress = server.address();
697-
if (typeof serverAddress === "string" || serverAddress === null) {
698-
throw new Error("Unexpected server address: " + serverAddress);
699-
}
700-
701-
const client = new MessagingApiClient({
702-
channelAccessToken: channel_access_token,
703-
baseURL: `http://localhost:${String(serverAddress.port)}/`,
704-
});
705-
706-
const res = await client.getAdPhoneMessageStatistics(
707-
// date: string
708-
"DUMMY" as unknown as string, // paramName=date(enum)
709-
);
710-
711-
equal(requestCount, 1);
712-
server.close();
713-
});
714-
715609
it("getAggregationUnitNameListWithHttpInfo", async () => {
716610
let requestCount = 0;
717611

line-openapi

0 commit comments

Comments
 (0)