Skip to content

Commit d7303ae

Browse files
github-actions[bot]github-actions
andauthored
Codes are generated by openapi (#805)
We're excited to announce that the Membership API is now available in the Messaging API. With this update, our SDK also supports the use of this API. For more details, check out the announcement: https://developers.line.biz/en/news/2024/03/28/re-release-endpoints-for-membership Co-authored-by: github-actions <[email protected]>
1 parent 1800bbd commit d7303ae

File tree

10 files changed

+449
-0
lines changed

10 files changed

+449
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ model/genderDemographicFilter.ts
6565
model/getAggregationUnitNameListResponse.ts
6666
model/getAggregationUnitUsageResponse.ts
6767
model/getFollowersResponse.ts
68+
model/getMembershipSubscriptionResponse.ts
6869
model/getMessageContentTranscodingResponse.ts
6970
model/getWebhookEndpointResponse.ts
7071
model/groupMemberCountResponse.ts
@@ -85,6 +86,8 @@ model/locationAction.ts
8586
model/locationMessage.ts
8687
model/markMessagesAsReadRequest.ts
8788
model/membersIdsResponse.ts
89+
model/membership.ts
90+
model/membershipListResponse.ts
8891
model/message.ts
8992
model/messageAction.ts
9093
model/messageImagemapAction.ts
@@ -133,6 +136,9 @@ model/sender.ts
133136
model/sentMessage.ts
134137
model/setWebhookEndpointRequest.ts
135138
model/stickerMessage.ts
139+
model/subscribedMembershipPlan.ts
140+
model/subscribedMembershipUser.ts
141+
model/subscription.ts
136142
model/subscriptionPeriodDemographic.ts
137143
model/subscriptionPeriodDemographicFilter.ts
138144
model/template.ts

lib/messaging-api/api/messagingApiClient.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ import { ErrorResponse } from "../model/errorResponse.js";
1919
import { GetAggregationUnitNameListResponse } from "../model/getAggregationUnitNameListResponse.js";
2020
import { GetAggregationUnitUsageResponse } from "../model/getAggregationUnitUsageResponse.js";
2121
import { GetFollowersResponse } from "../model/getFollowersResponse.js";
22+
import { GetMembershipSubscriptionResponse } from "../model/getMembershipSubscriptionResponse.js";
2223
import { GetWebhookEndpointResponse } from "../model/getWebhookEndpointResponse.js";
2324
import { GroupMemberCountResponse } from "../model/groupMemberCountResponse.js";
2425
import { GroupSummaryResponse } from "../model/groupSummaryResponse.js";
2526
import { GroupUserProfileResponse } from "../model/groupUserProfileResponse.js";
2627
import { IssueLinkTokenResponse } from "../model/issueLinkTokenResponse.js";
2728
import { MarkMessagesAsReadRequest } from "../model/markMessagesAsReadRequest.js";
2829
import { MembersIdsResponse } from "../model/membersIdsResponse.js";
30+
import { MembershipListResponse } from "../model/membershipListResponse.js";
2931
import { MessageQuotaResponse } from "../model/messageQuotaResponse.js";
3032
import { MulticastRequest } from "../model/multicastRequest.js";
3133
import { NarrowcastProgressResponse } from "../model/narrowcastProgressResponse.js";
@@ -624,6 +626,57 @@ export class MessagingApiClient {
624626
);
625627
return { httpResponse: res, body: await res.json() };
626628
}
629+
/**
630+
* Get a list of memberships.
631+
*
632+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-membership-plans"> Documentation</a>
633+
*/
634+
public async getMembershipList(): Promise<MembershipListResponse> {
635+
return (await this.getMembershipListWithHttpInfo()).body;
636+
}
637+
638+
/**
639+
* Get a list of memberships..
640+
* This method includes HttpInfo object to return additional information.
641+
*
642+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-membership-plans"> Documentation</a>
643+
*/
644+
public async getMembershipListWithHttpInfo(): Promise<
645+
Types.ApiResponseType<MembershipListResponse>
646+
> {
647+
const res = await this.httpClient.get("/v2/bot/membership/list");
648+
return { httpResponse: res, body: await res.json() };
649+
}
650+
/**
651+
* Get a user\'s membership subscription.
652+
* @param userId User ID
653+
*
654+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-a-users-membership-subscription-status"> Documentation</a>
655+
*/
656+
public async getMembershipSubscription(
657+
userId: string,
658+
): Promise<GetMembershipSubscriptionResponse> {
659+
return (await this.getMembershipSubscriptionWithHttpInfo(userId)).body;
660+
}
661+
662+
/**
663+
* Get a user\'s membership subscription..
664+
* This method includes HttpInfo object to return additional information.
665+
* @param userId User ID
666+
*
667+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-a-users-membership-subscription-status"> Documentation</a>
668+
*/
669+
public async getMembershipSubscriptionWithHttpInfo(
670+
userId: string,
671+
): Promise<Types.ApiResponseType<GetMembershipSubscriptionResponse>> {
672+
const res = await this.httpClient.get(
673+
"/v2/bot/membership/subscription/{userId}".replace(
674+
"{userId}",
675+
String(userId),
676+
),
677+
);
678+
return { httpResponse: res, body: await res.json() };
679+
}
627680
/**
628681
* Gets the target limit for sending messages in the current month. The total number of the free messages and the additional messages is returned.
629682
*
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* LINE Messaging API
3+
* This document describes LINE Messaging API.
4+
*
5+
* The version of the OpenAPI document: 0.0.1
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
import { Subscription } from "./subscription.js";
14+
15+
/**
16+
* A user\'s membership subscription status
17+
*/
18+
export type GetMembershipSubscriptionResponse = {
19+
/**
20+
* List of subscription information
21+
*
22+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-a-users-membership-subscription-status">subscriptions Documentation</a>
23+
*/
24+
subscriptions: Array<Subscription> /**/;
25+
};
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/**
2+
* LINE Messaging API
3+
* This document describes LINE Messaging API.
4+
*
5+
* The version of the OpenAPI document: 0.0.1
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
export type Membership = {
14+
/**
15+
* Membership plan ID.
16+
*/
17+
membershipId: number /**/;
18+
/**
19+
* Membership plan name.
20+
*/
21+
title: string /**/;
22+
/**
23+
* Membership plan description.
24+
*/
25+
description: string /**/;
26+
/**
27+
* List of membership plan perks.
28+
*/
29+
benefits: Array<string> /**/;
30+
/**
31+
* Monthly fee for membership plan. (e.g. 1500.00)
32+
*/
33+
price: number /**/;
34+
/**
35+
* The currency of membership.price.
36+
*/
37+
currency: Membership.CurrencyEnum /**/;
38+
/**
39+
* Number of members subscribed to the membership plan.
40+
*/
41+
memberCount: number /**/;
42+
/**
43+
* The upper limit of members who can subscribe. If no upper limit is set, it will be null.
44+
*/
45+
memberLimit: number | null /**/;
46+
/**
47+
* Payment method for users who subscribe to a membership plan.
48+
*/
49+
isInAppPurchase: boolean /**/;
50+
/**
51+
* Membership plan status.
52+
*/
53+
isPublished: boolean /**/;
54+
};
55+
56+
export namespace Membership {
57+
export type CurrencyEnum = "JPY" | "TWD" | "THB";
58+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* LINE Messaging API
3+
* This document describes LINE Messaging API.
4+
*
5+
* The version of the OpenAPI document: 0.0.1
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
import { Membership } from "./membership.js";
14+
15+
/**
16+
* List of memberships
17+
*/
18+
export type MembershipListResponse = {
19+
/**
20+
* List of membership information
21+
*/
22+
memberships: Array<Membership> /**/;
23+
};

lib/messaging-api/model/models.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ export * from "./genderDemographicFilter.js";
6060
export * from "./getAggregationUnitNameListResponse.js";
6161
export * from "./getAggregationUnitUsageResponse.js";
6262
export * from "./getFollowersResponse.js";
63+
export * from "./getMembershipSubscriptionResponse.js";
6364
export * from "./getMessageContentTranscodingResponse.js";
6465
export * from "./getWebhookEndpointResponse.js";
6566
export * from "./groupMemberCountResponse.js";
@@ -80,6 +81,8 @@ export * from "./locationAction.js";
8081
export * from "./locationMessage.js";
8182
export * from "./markMessagesAsReadRequest.js";
8283
export * from "./membersIdsResponse.js";
84+
export * from "./membership.js";
85+
export * from "./membershipListResponse.js";
8386
export * from "./message.js";
8487
export * from "./messageAction.js";
8588
export * from "./messageImagemapAction.js";
@@ -127,6 +130,9 @@ export * from "./sender.js";
127130
export * from "./sentMessage.js";
128131
export * from "./setWebhookEndpointRequest.js";
129132
export * from "./stickerMessage.js";
133+
export * from "./subscribedMembershipPlan.js";
134+
export * from "./subscribedMembershipUser.js";
135+
export * from "./subscription.js";
130136
export * from "./subscriptionPeriodDemographic.js";
131137
export * from "./subscriptionPeriodDemographicFilter.js";
132138
export * from "./template.js";
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* LINE Messaging API
3+
* This document describes LINE Messaging API.
4+
*
5+
* The version of the OpenAPI document: 0.0.1
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
/**
14+
* Object containing information about the membership plan.
15+
*/
16+
export type SubscribedMembershipPlan = {
17+
/**
18+
* Membership plan ID.
19+
*/
20+
membershipId: number /**/;
21+
/**
22+
* Membership plan name.
23+
*/
24+
title: string /**/;
25+
/**
26+
* Membership plan description.
27+
*/
28+
description: string /**/;
29+
/**
30+
* List of membership plan perks.
31+
*/
32+
benefits: Array<string> /**/;
33+
/**
34+
* Monthly fee for membership plan. (e.g. 1500.00)
35+
*/
36+
price: number /**/;
37+
/**
38+
* The currency of membership.price.
39+
*/
40+
currency: SubscribedMembershipPlan.CurrencyEnum /**/;
41+
};
42+
43+
export namespace SubscribedMembershipPlan {
44+
export type CurrencyEnum = "JPY" | "TWD" | "THB";
45+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/**
2+
* LINE Messaging API
3+
* This document describes LINE Messaging API.
4+
*
5+
* The version of the OpenAPI document: 0.0.1
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
/**
14+
* Object containing user membership subscription information.
15+
*/
16+
export type SubscribedMembershipUser = {
17+
/**
18+
* The user\'s member number in the membership plan.
19+
*/
20+
membershipNo: number /**/;
21+
/**
22+
* UNIX timestamp at which the user subscribed to the membership.
23+
*/
24+
joinedTime: number /**/;
25+
/**
26+
* Next payment date for membership plan. - Format: yyyy-MM-dd (e.g. 2024-02-08) - Timezone: UTC+9
27+
*/
28+
nextBillingDate: string /**/;
29+
/**
30+
* The period of time in months that the user has been subscribed to a membership plan. If a user previously canceled and then re-subscribed to the same membership plan, only the period after the re-subscription will be counted.
31+
*/
32+
totalSubscriptionMonths: number /**/;
33+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* LINE Messaging API
3+
* This document describes LINE Messaging API.
4+
*
5+
* The version of the OpenAPI document: 0.0.1
6+
*
7+
*
8+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9+
* https://openapi-generator.tech
10+
* Do not edit the class manually.
11+
*/
12+
13+
import { SubscribedMembershipPlan } from "./subscribedMembershipPlan.js";
14+
import { SubscribedMembershipUser } from "./subscribedMembershipUser.js";
15+
16+
/**
17+
* An array of memberships.
18+
*/
19+
export type Subscription = {
20+
/**
21+
*/
22+
membership: SubscribedMembershipPlan /**/;
23+
/**
24+
*/
25+
user: SubscribedMembershipUser /**/;
26+
};

0 commit comments

Comments
 (0)