Skip to content

Commit

Permalink
Codes are generated by openapi generator (#1283)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
github-actions[bot] and github-actions authored Apr 3, 2024
1 parent 7919852 commit 9d6c276
Show file tree
Hide file tree
Showing 9 changed files with 532 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ src/main/java/com/linecorp/bot/messaging/model/GenderDemographicFilter.java
src/main/java/com/linecorp/bot/messaging/model/GetAggregationUnitNameListResponse.java
src/main/java/com/linecorp/bot/messaging/model/GetAggregationUnitUsageResponse.java
src/main/java/com/linecorp/bot/messaging/model/GetFollowersResponse.java
src/main/java/com/linecorp/bot/messaging/model/GetMembershipSubscriptionResponse.java
src/main/java/com/linecorp/bot/messaging/model/GetMessageContentTranscodingResponse.java
src/main/java/com/linecorp/bot/messaging/model/GetWebhookEndpointResponse.java
src/main/java/com/linecorp/bot/messaging/model/GroupMemberCountResponse.java
Expand All @@ -82,6 +83,8 @@ src/main/java/com/linecorp/bot/messaging/model/LocationAction.java
src/main/java/com/linecorp/bot/messaging/model/LocationMessage.java
src/main/java/com/linecorp/bot/messaging/model/MarkMessagesAsReadRequest.java
src/main/java/com/linecorp/bot/messaging/model/MembersIdsResponse.java
src/main/java/com/linecorp/bot/messaging/model/Membership.java
src/main/java/com/linecorp/bot/messaging/model/MembershipListResponse.java
src/main/java/com/linecorp/bot/messaging/model/Message.java
src/main/java/com/linecorp/bot/messaging/model/MessageAction.java
src/main/java/com/linecorp/bot/messaging/model/MessageImagemapAction.java
Expand Down Expand Up @@ -129,6 +132,9 @@ src/main/java/com/linecorp/bot/messaging/model/Sender.java
src/main/java/com/linecorp/bot/messaging/model/SentMessage.java
src/main/java/com/linecorp/bot/messaging/model/SetWebhookEndpointRequest.java
src/main/java/com/linecorp/bot/messaging/model/StickerMessage.java
src/main/java/com/linecorp/bot/messaging/model/SubscribedMembershipPlan.java
src/main/java/com/linecorp/bot/messaging/model/SubscribedMembershipUser.java
src/main/java/com/linecorp/bot/messaging/model/Subscription.java
src/main/java/com/linecorp/bot/messaging/model/SubscriptionPeriodDemographic.java
src/main/java/com/linecorp/bot/messaging/model/SubscriptionPeriodDemographicFilter.java
src/main/java/com/linecorp/bot/messaging/model/Template.java
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@
import com.linecorp.bot.messaging.model.GetAggregationUnitNameListResponse;
import com.linecorp.bot.messaging.model.GetAggregationUnitUsageResponse;
import com.linecorp.bot.messaging.model.GetFollowersResponse;
import com.linecorp.bot.messaging.model.GetMembershipSubscriptionResponse;
import com.linecorp.bot.messaging.model.GetWebhookEndpointResponse;
import com.linecorp.bot.messaging.model.GroupMemberCountResponse;
import com.linecorp.bot.messaging.model.GroupSummaryResponse;
import com.linecorp.bot.messaging.model.GroupUserProfileResponse;
import com.linecorp.bot.messaging.model.IssueLinkTokenResponse;
import com.linecorp.bot.messaging.model.MarkMessagesAsReadRequest;
import com.linecorp.bot.messaging.model.MembersIdsResponse;
import com.linecorp.bot.messaging.model.MembershipListResponse;
import com.linecorp.bot.messaging.model.MessageQuotaResponse;
import com.linecorp.bot.messaging.model.MulticastRequest;
import com.linecorp.bot.messaging.model.NarrowcastProgressResponse;
Expand Down Expand Up @@ -272,6 +274,27 @@ CompletableFuture<Result<MembersIdsResponse>> getGroupMembersIds(
@GET("/v2/bot/group/{groupId}/summary")
CompletableFuture<Result<GroupSummaryResponse>> getGroupSummary(@Path("groupId") String groupId);

/**
* Get a list of memberships.
*
* @see <a href="https://developers.line.biz/en/reference/messaging-api/#get-membership-plans">
* Documentation</a>
*/
@GET("/v2/bot/membership/list")
CompletableFuture<Result<MembershipListResponse>> getMembershipList();

/**
* Get a user&#39;s membership subscription.
*
* @param userId User ID (required)
* @see <a
* href="https://developers.line.biz/en/reference/messaging-api/#get-a-users-membership-subscription-status">
* Documentation</a>
*/
@GET("/v2/bot/membership/subscription/{userId}")
CompletableFuture<Result<GetMembershipSubscriptionResponse>> getMembershipSubscription(
@Path("userId") String userId);

/**
* Gets the target limit for sending messages in the current month. The total number of the free
* messages and the additional messages is returned.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright 2023 LINE Corporation
*
* LINE Corporation licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech Do not edit the class manually.
*/
package com.linecorp.bot.messaging.model;



import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/**
* A user&#39;s membership subscription status
*
* @see <a
* href="https://developers.line.biz/en/reference/messaging-api/#get-a-users-membership-subscription-status">
* Documentation</a>
*/
@JsonInclude(Include.NON_NULL)
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
public record GetMembershipSubscriptionResponse(
/** List of subscription information */
@JsonProperty("subscriptions") List<Subscription> subscriptions) {

public static class Builder {
private List<Subscription> subscriptions;

public Builder(List<Subscription> subscriptions) {

this.subscriptions = subscriptions;
}

public GetMembershipSubscriptionResponse build() {
return new GetMembershipSubscriptionResponse(subscriptions);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/*
* Copyright 2023 LINE Corporation
*
* LINE Corporation licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech Do not edit the class manually.
*/
package com.linecorp.bot.messaging.model;



import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Membership */
@JsonInclude(Include.NON_NULL)
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
public record Membership(
/** Membership plan ID. */
@JsonProperty("membershipId") Integer membershipId,
/** Membership plan name. */
@JsonProperty("title") String title,
/** Membership plan description. */
@JsonProperty("description") String description,
/** List of membership plan perks. */
@JsonProperty("benefits") List<String> benefits,
/** Monthly fee for membership plan. (e.g. 1500.00) */
@JsonProperty("price") Double price,
/** The currency of membership.price. */
@JsonProperty("currency") Currency currency,
/** Number of members subscribed to the membership plan. */
@JsonProperty("memberCount") Integer memberCount,
/** The upper limit of members who can subscribe. If no upper limit is set, it will be null. */
@JsonProperty("memberLimit") Integer memberLimit,
/** Payment method for users who subscribe to a membership plan. */
@JsonProperty("isInAppPurchase") Boolean isInAppPurchase,
/** Membership plan status. */
@JsonProperty("isPublished") Boolean isPublished) {

/** The currency of membership.price. */
public enum Currency {
@JsonProperty("JPY")
JPY,
@JsonProperty("TWD")
TWD,
@JsonProperty("THB")
THB,

@JsonEnumDefaultValue
UNDEFINED;
}

public static class Builder {
private Integer membershipId;
private String title;
private String description;
private List<String> benefits;
private Double price;
private Currency currency;
private Integer memberCount;
private Integer memberLimit;
private Boolean isInAppPurchase;
private Boolean isPublished;

public Builder(
Integer membershipId,
String title,
String description,
List<String> benefits,
Double price,
Currency currency,
Integer memberCount,
Integer memberLimit,
Boolean isInAppPurchase,
Boolean isPublished) {

this.membershipId = membershipId;

this.title = title;

this.description = description;

this.benefits = benefits;

this.price = price;

this.currency = currency;

this.memberCount = memberCount;

this.memberLimit = memberLimit;

this.isInAppPurchase = isInAppPurchase;

this.isPublished = isPublished;
}

public Membership build() {
return new Membership(
membershipId,
title,
description,
benefits,
price,
currency,
memberCount,
memberLimit,
isInAppPurchase,
isPublished);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright 2023 LINE Corporation
*
* LINE Corporation licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/

/**
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech Do not edit the class manually.
*/
package com.linecorp.bot.messaging.model;



import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** List of memberships */
@JsonInclude(Include.NON_NULL)
@javax.annotation.Generated(value = "com.linecorp.bot.codegen.LineJavaCodegenGenerator")
public record MembershipListResponse(
/** List of membership information */
@JsonProperty("memberships") List<Membership> memberships) {

public static class Builder {
private List<Membership> memberships;

public Builder(List<Membership> memberships) {

this.memberships = memberships;
}

public MembershipListResponse build() {
return new MembershipListResponse(memberships);
}
}
}
Loading

0 comments on commit 9d6c276

Please sign in to comment.