Skip to content

Commit 9d6c276

Browse files
github-actions[bot]github-actions
andauthored
Codes are generated by openapi generator (#1283)
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 7919852 commit 9d6c276

File tree

9 files changed

+532
-0
lines changed

9 files changed

+532
-0
lines changed

clients/line-bot-messaging-api-client/.openapi-generator/FILES

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ src/main/java/com/linecorp/bot/messaging/model/GenderDemographicFilter.java
6262
src/main/java/com/linecorp/bot/messaging/model/GetAggregationUnitNameListResponse.java
6363
src/main/java/com/linecorp/bot/messaging/model/GetAggregationUnitUsageResponse.java
6464
src/main/java/com/linecorp/bot/messaging/model/GetFollowersResponse.java
65+
src/main/java/com/linecorp/bot/messaging/model/GetMembershipSubscriptionResponse.java
6566
src/main/java/com/linecorp/bot/messaging/model/GetMessageContentTranscodingResponse.java
6667
src/main/java/com/linecorp/bot/messaging/model/GetWebhookEndpointResponse.java
6768
src/main/java/com/linecorp/bot/messaging/model/GroupMemberCountResponse.java
@@ -82,6 +83,8 @@ src/main/java/com/linecorp/bot/messaging/model/LocationAction.java
8283
src/main/java/com/linecorp/bot/messaging/model/LocationMessage.java
8384
src/main/java/com/linecorp/bot/messaging/model/MarkMessagesAsReadRequest.java
8485
src/main/java/com/linecorp/bot/messaging/model/MembersIdsResponse.java
86+
src/main/java/com/linecorp/bot/messaging/model/Membership.java
87+
src/main/java/com/linecorp/bot/messaging/model/MembershipListResponse.java
8588
src/main/java/com/linecorp/bot/messaging/model/Message.java
8689
src/main/java/com/linecorp/bot/messaging/model/MessageAction.java
8790
src/main/java/com/linecorp/bot/messaging/model/MessageImagemapAction.java
@@ -129,6 +132,9 @@ src/main/java/com/linecorp/bot/messaging/model/Sender.java
129132
src/main/java/com/linecorp/bot/messaging/model/SentMessage.java
130133
src/main/java/com/linecorp/bot/messaging/model/SetWebhookEndpointRequest.java
131134
src/main/java/com/linecorp/bot/messaging/model/StickerMessage.java
135+
src/main/java/com/linecorp/bot/messaging/model/SubscribedMembershipPlan.java
136+
src/main/java/com/linecorp/bot/messaging/model/SubscribedMembershipUser.java
137+
src/main/java/com/linecorp/bot/messaging/model/Subscription.java
132138
src/main/java/com/linecorp/bot/messaging/model/SubscriptionPeriodDemographic.java
133139
src/main/java/com/linecorp/bot/messaging/model/SubscriptionPeriodDemographicFilter.java
134140
src/main/java/com/linecorp/bot/messaging/model/Template.java

clients/line-bot-messaging-api-client/src/main/java/com/linecorp/bot/messaging/client/MessagingApiClient.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,15 @@
3030
import com.linecorp.bot.messaging.model.GetAggregationUnitNameListResponse;
3131
import com.linecorp.bot.messaging.model.GetAggregationUnitUsageResponse;
3232
import com.linecorp.bot.messaging.model.GetFollowersResponse;
33+
import com.linecorp.bot.messaging.model.GetMembershipSubscriptionResponse;
3334
import com.linecorp.bot.messaging.model.GetWebhookEndpointResponse;
3435
import com.linecorp.bot.messaging.model.GroupMemberCountResponse;
3536
import com.linecorp.bot.messaging.model.GroupSummaryResponse;
3637
import com.linecorp.bot.messaging.model.GroupUserProfileResponse;
3738
import com.linecorp.bot.messaging.model.IssueLinkTokenResponse;
3839
import com.linecorp.bot.messaging.model.MarkMessagesAsReadRequest;
3940
import com.linecorp.bot.messaging.model.MembersIdsResponse;
41+
import com.linecorp.bot.messaging.model.MembershipListResponse;
4042
import com.linecorp.bot.messaging.model.MessageQuotaResponse;
4143
import com.linecorp.bot.messaging.model.MulticastRequest;
4244
import com.linecorp.bot.messaging.model.NarrowcastProgressResponse;
@@ -272,6 +274,27 @@ CompletableFuture<Result<MembersIdsResponse>> getGroupMembersIds(
272274
@GET("/v2/bot/group/{groupId}/summary")
273275
CompletableFuture<Result<GroupSummaryResponse>> getGroupSummary(@Path("groupId") String groupId);
274276

277+
/**
278+
* Get a list of memberships.
279+
*
280+
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-membership-plans">
281+
* Documentation</a>
282+
*/
283+
@GET("/v2/bot/membership/list")
284+
CompletableFuture<Result<MembershipListResponse>> getMembershipList();
285+
286+
/**
287+
* Get a user&#39;s membership subscription.
288+
*
289+
* @param userId User ID (required)
290+
* @see <a
291+
* href="https://developers.line.biz/en/reference/messaging-api/#get-a-users-membership-subscription-status">
292+
* Documentation</a>
293+
*/
294+
@GET("/v2/bot/membership/subscription/{userId}")
295+
CompletableFuture<Result<GetMembershipSubscriptionResponse>> getMembershipSubscription(
296+
@Path("userId") String userId);
297+
275298
/**
276299
* Gets the target limit for sending messages in the current month. The total number of the free
277300
* messages and the additional messages is returned.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
* Copyright 2023 LINE Corporation
3+
*
4+
* LINE Corporation licenses this file to you under the Apache License,
5+
* version 2.0 (the "License"); you may not use this file except in compliance
6+
* with the License. You may obtain a copy of the License at:
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations
14+
* under the License.
15+
*/
16+
17+
/**
18+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19+
* https://openapi-generator.tech Do not edit the class manually.
20+
*/
21+
package com.linecorp.bot.messaging.model;
22+
23+
24+
25+
import com.fasterxml.jackson.annotation.JsonInclude;
26+
import com.fasterxml.jackson.annotation.JsonInclude.Include;
27+
import com.fasterxml.jackson.annotation.JsonProperty;
28+
import java.util.List;
29+
30+
/**
31+
* A user&#39;s membership subscription status
32+
*
33+
* @see <a
34+
* href="https://developers.line.biz/en/reference/messaging-api/#get-a-users-membership-subscription-status">
35+
* Documentation</a>
36+
*/
37+
@JsonInclude(Include.NON_NULL)
38+
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
39+
public record GetMembershipSubscriptionResponse(
40+
/** List of subscription information */
41+
@JsonProperty("subscriptions") List<Subscription> subscriptions) {
42+
43+
public static class Builder {
44+
private List<Subscription> subscriptions;
45+
46+
public Builder(List<Subscription> subscriptions) {
47+
48+
this.subscriptions = subscriptions;
49+
}
50+
51+
public GetMembershipSubscriptionResponse build() {
52+
return new GetMembershipSubscriptionResponse(subscriptions);
53+
}
54+
}
55+
}
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
/*
2+
* Copyright 2023 LINE Corporation
3+
*
4+
* LINE Corporation licenses this file to you under the Apache License,
5+
* version 2.0 (the "License"); you may not use this file except in compliance
6+
* with the License. You may obtain a copy of the License at:
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations
14+
* under the License.
15+
*/
16+
17+
/**
18+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19+
* https://openapi-generator.tech Do not edit the class manually.
20+
*/
21+
package com.linecorp.bot.messaging.model;
22+
23+
24+
25+
import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
26+
import com.fasterxml.jackson.annotation.JsonInclude;
27+
import com.fasterxml.jackson.annotation.JsonInclude.Include;
28+
import com.fasterxml.jackson.annotation.JsonProperty;
29+
import java.util.List;
30+
31+
/** Membership */
32+
@JsonInclude(Include.NON_NULL)
33+
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
34+
public record Membership(
35+
/** Membership plan ID. */
36+
@JsonProperty("membershipId") Integer membershipId,
37+
/** Membership plan name. */
38+
@JsonProperty("title") String title,
39+
/** Membership plan description. */
40+
@JsonProperty("description") String description,
41+
/** List of membership plan perks. */
42+
@JsonProperty("benefits") List<String> benefits,
43+
/** Monthly fee for membership plan. (e.g. 1500.00) */
44+
@JsonProperty("price") Double price,
45+
/** The currency of membership.price. */
46+
@JsonProperty("currency") Currency currency,
47+
/** Number of members subscribed to the membership plan. */
48+
@JsonProperty("memberCount") Integer memberCount,
49+
/** The upper limit of members who can subscribe. If no upper limit is set, it will be null. */
50+
@JsonProperty("memberLimit") Integer memberLimit,
51+
/** Payment method for users who subscribe to a membership plan. */
52+
@JsonProperty("isInAppPurchase") Boolean isInAppPurchase,
53+
/** Membership plan status. */
54+
@JsonProperty("isPublished") Boolean isPublished) {
55+
56+
/** The currency of membership.price. */
57+
public enum Currency {
58+
@JsonProperty("JPY")
59+
JPY,
60+
@JsonProperty("TWD")
61+
TWD,
62+
@JsonProperty("THB")
63+
THB,
64+
65+
@JsonEnumDefaultValue
66+
UNDEFINED;
67+
}
68+
69+
public static class Builder {
70+
private Integer membershipId;
71+
private String title;
72+
private String description;
73+
private List<String> benefits;
74+
private Double price;
75+
private Currency currency;
76+
private Integer memberCount;
77+
private Integer memberLimit;
78+
private Boolean isInAppPurchase;
79+
private Boolean isPublished;
80+
81+
public Builder(
82+
Integer membershipId,
83+
String title,
84+
String description,
85+
List<String> benefits,
86+
Double price,
87+
Currency currency,
88+
Integer memberCount,
89+
Integer memberLimit,
90+
Boolean isInAppPurchase,
91+
Boolean isPublished) {
92+
93+
this.membershipId = membershipId;
94+
95+
this.title = title;
96+
97+
this.description = description;
98+
99+
this.benefits = benefits;
100+
101+
this.price = price;
102+
103+
this.currency = currency;
104+
105+
this.memberCount = memberCount;
106+
107+
this.memberLimit = memberLimit;
108+
109+
this.isInAppPurchase = isInAppPurchase;
110+
111+
this.isPublished = isPublished;
112+
}
113+
114+
public Membership build() {
115+
return new Membership(
116+
membershipId,
117+
title,
118+
description,
119+
benefits,
120+
price,
121+
currency,
122+
memberCount,
123+
memberLimit,
124+
isInAppPurchase,
125+
isPublished);
126+
}
127+
}
128+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
* Copyright 2023 LINE Corporation
3+
*
4+
* LINE Corporation licenses this file to you under the Apache License,
5+
* version 2.0 (the "License"); you may not use this file except in compliance
6+
* with the License. You may obtain a copy of the License at:
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations
14+
* under the License.
15+
*/
16+
17+
/**
18+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
19+
* https://openapi-generator.tech Do not edit the class manually.
20+
*/
21+
package com.linecorp.bot.messaging.model;
22+
23+
24+
25+
import com.fasterxml.jackson.annotation.JsonInclude;
26+
import com.fasterxml.jackson.annotation.JsonInclude.Include;
27+
import com.fasterxml.jackson.annotation.JsonProperty;
28+
import java.util.List;
29+
30+
/** List of memberships */
31+
@JsonInclude(Include.NON_NULL)
32+
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
33+
public record MembershipListResponse(
34+
/** List of membership information */
35+
@JsonProperty("memberships") List<Membership> memberships) {
36+
37+
public static class Builder {
38+
private List<Membership> memberships;
39+
40+
public Builder(List<Membership> memberships) {
41+
42+
this.memberships = memberships;
43+
}
44+
45+
public MembershipListResponse build() {
46+
return new MembershipListResponse(memberships);
47+
}
48+
}
49+
}

0 commit comments

Comments
 (0)