From 779711ad72b1157b2c695d0b7f862dff69465983 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 20 Apr 2024 14:38:30 +0900 Subject: [PATCH] Generate line bot modules (#53) Co-authored-by: nanato12 --- core/line_messaging_api/README.md | 10 ++ .../docs/GetMembershipSubscriptionResponse.md | 11 ++ core/line_messaging_api/docs/Membership.md | 20 ++++ .../docs/MembershipListResponse.md | 11 ++ .../docs/MessagingApiApi.md | 90 +++++++++++++++ .../docs/ShowLoadingAnimationRequest.md | 12 ++ .../docs/SubscribedMembershipPlan.md | 16 +++ .../docs/SubscribedMembershipUser.md | 14 +++ core/line_messaging_api/docs/Subscription.md | 12 ++ .../src/apis/messaging_api_api.rs | 55 +++++++++ .../get_membership_subscription_response.rs | 43 ++++++++ .../src/models/membership.rs | 104 ++++++++++++++++++ .../src/models/membership_list_response.rs | 41 +++++++ core/line_messaging_api/src/models/mod.rs | 14 +++ .../models/show_loading_animation_request.rs | 44 ++++++++ .../src/models/subscribed_membership_plan.rs | 87 +++++++++++++++ .../src/models/subscribed_membership_user.rs | 60 ++++++++++ .../src/models/subscription.rs | 48 ++++++++ 18 files changed, 692 insertions(+) create mode 100644 core/line_messaging_api/docs/GetMembershipSubscriptionResponse.md create mode 100644 core/line_messaging_api/docs/Membership.md create mode 100644 core/line_messaging_api/docs/MembershipListResponse.md create mode 100644 core/line_messaging_api/docs/ShowLoadingAnimationRequest.md create mode 100644 core/line_messaging_api/docs/SubscribedMembershipPlan.md create mode 100644 core/line_messaging_api/docs/SubscribedMembershipUser.md create mode 100644 core/line_messaging_api/docs/Subscription.md create mode 100644 core/line_messaging_api/src/models/get_membership_subscription_response.rs create mode 100644 core/line_messaging_api/src/models/membership.rs create mode 100644 core/line_messaging_api/src/models/membership_list_response.rs create mode 100644 core/line_messaging_api/src/models/show_loading_animation_request.rs create mode 100644 core/line_messaging_api/src/models/subscribed_membership_plan.rs create mode 100644 core/line_messaging_api/src/models/subscribed_membership_user.rs create mode 100644 core/line_messaging_api/src/models/subscription.rs diff --git a/core/line_messaging_api/README.md b/core/line_messaging_api/README.md index 94faf26..813dab5 100644 --- a/core/line_messaging_api/README.md +++ b/core/line_messaging_api/README.md @@ -42,6 +42,8 @@ Class | Method | HTTP request | Description *MessagingApiApi* | [**get_group_member_profile**](docs/MessagingApiApi.md#get_group_member_profile) | **Get** /v2/bot/group/{groupId}/member/{userId} | *MessagingApiApi* | [**get_group_members_ids**](docs/MessagingApiApi.md#get_group_members_ids) | **Get** /v2/bot/group/{groupId}/members/ids | *MessagingApiApi* | [**get_group_summary**](docs/MessagingApiApi.md#get_group_summary) | **Get** /v2/bot/group/{groupId}/summary | +*MessagingApiApi* | [**get_membership_list**](docs/MessagingApiApi.md#get_membership_list) | **Get** /v2/bot/membership/list | +*MessagingApiApi* | [**get_membership_subscription**](docs/MessagingApiApi.md#get_membership_subscription) | **Get** /v2/bot/membership/subscription/{userId} | *MessagingApiApi* | [**get_message_quota**](docs/MessagingApiApi.md#get_message_quota) | **Get** /v2/bot/message/quota | *MessagingApiApi* | [**get_message_quota_consumption**](docs/MessagingApiApi.md#get_message_quota_consumption) | **Get** /v2/bot/message/quota/consumption | *MessagingApiApi* | [**get_narrowcast_progress**](docs/MessagingApiApi.md#get_narrowcast_progress) | **Get** /v2/bot/message/progress/narrowcast | @@ -75,6 +77,7 @@ Class | Method | HTTP request | Description *MessagingApiApi* | [**rich_menu_batch**](docs/MessagingApiApi.md#rich_menu_batch) | **Post** /v2/bot/richmenu/batch | *MessagingApiApi* | [**set_default_rich_menu**](docs/MessagingApiApi.md#set_default_rich_menu) | **Post** /v2/bot/user/all/richmenu/{richMenuId} | *MessagingApiApi* | [**set_webhook_endpoint**](docs/MessagingApiApi.md#set_webhook_endpoint) | **Put** /v2/bot/channel/webhook/endpoint | +*MessagingApiApi* | [**show_loading_animation**](docs/MessagingApiApi.md#show_loading_animation) | **Post** /v2/bot/chat/loading/start | *MessagingApiApi* | [**test_webhook_endpoint**](docs/MessagingApiApi.md#test_webhook_endpoint) | **Post** /v2/bot/channel/webhook/test | *MessagingApiApi* | [**unlink_rich_menu_id_from_user**](docs/MessagingApiApi.md#unlink_rich_menu_id_from_user) | **Delete** /v2/bot/user/{userId}/richmenu | *MessagingApiApi* | [**unlink_rich_menu_id_from_users**](docs/MessagingApiApi.md#unlink_rich_menu_id_from_users) | **Post** /v2/bot/richmenu/bulk/unlink | @@ -157,6 +160,7 @@ Class | Method | HTTP request | Description - [GetAggregationUnitNameListResponse](docs/GetAggregationUnitNameListResponse.md) - [GetAggregationUnitUsageResponse](docs/GetAggregationUnitUsageResponse.md) - [GetFollowersResponse](docs/GetFollowersResponse.md) + - [GetMembershipSubscriptionResponse](docs/GetMembershipSubscriptionResponse.md) - [GetMessageContentTranscodingResponse](docs/GetMessageContentTranscodingResponse.md) - [GetWebhookEndpointResponse](docs/GetWebhookEndpointResponse.md) - [GroupMemberCountResponse](docs/GroupMemberCountResponse.md) @@ -177,6 +181,8 @@ Class | Method | HTTP request | Description - [LocationMessage](docs/LocationMessage.md) - [MarkMessagesAsReadRequest](docs/MarkMessagesAsReadRequest.md) - [MembersIdsResponse](docs/MembersIdsResponse.md) + - [Membership](docs/Membership.md) + - [MembershipListResponse](docs/MembershipListResponse.md) - [Message](docs/Message.md) - [MessageAction](docs/MessageAction.md) - [MessageImagemapAction](docs/MessageImagemapAction.md) @@ -223,7 +229,11 @@ Class | Method | HTTP request | Description - [Sender](docs/Sender.md) - [SentMessage](docs/SentMessage.md) - [SetWebhookEndpointRequest](docs/SetWebhookEndpointRequest.md) + - [ShowLoadingAnimationRequest](docs/ShowLoadingAnimationRequest.md) - [StickerMessage](docs/StickerMessage.md) + - [SubscribedMembershipPlan](docs/SubscribedMembershipPlan.md) + - [SubscribedMembershipUser](docs/SubscribedMembershipUser.md) + - [Subscription](docs/Subscription.md) - [SubscriptionPeriodDemographic](docs/SubscriptionPeriodDemographic.md) - [SubscriptionPeriodDemographicFilter](docs/SubscriptionPeriodDemographicFilter.md) - [Template](docs/Template.md) diff --git a/core/line_messaging_api/docs/GetMembershipSubscriptionResponse.md b/core/line_messaging_api/docs/GetMembershipSubscriptionResponse.md new file mode 100644 index 0000000..b94913d --- /dev/null +++ b/core/line_messaging_api/docs/GetMembershipSubscriptionResponse.md @@ -0,0 +1,11 @@ +# GetMembershipSubscriptionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**subscriptions** | [**Vec**](Subscription.md) | List of subscription information | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/core/line_messaging_api/docs/Membership.md b/core/line_messaging_api/docs/Membership.md new file mode 100644 index 0000000..15602cf --- /dev/null +++ b/core/line_messaging_api/docs/Membership.md @@ -0,0 +1,20 @@ +# Membership + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**membership_id** | **i32** | Membership plan ID. | +**title** | **String** | Membership plan name. | +**description** | **String** | Membership plan description. | +**benefits** | **Vec** | List of membership plan perks. | +**price** | **f64** | Monthly fee for membership plan. (e.g. 1500.00) | +**currency** | **String** | The currency of membership.price. | +**member_count** | **i32** | Number of members subscribed to the membership plan. | +**member_limit** | Option<**i32**> | The upper limit of members who can subscribe. If no upper limit is set, it will be null. | +**is_in_app_purchase** | **bool** | Payment method for users who subscribe to a membership plan. | +**is_published** | **bool** | Membership plan status. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/core/line_messaging_api/docs/MembershipListResponse.md b/core/line_messaging_api/docs/MembershipListResponse.md new file mode 100644 index 0000000..97d557e --- /dev/null +++ b/core/line_messaging_api/docs/MembershipListResponse.md @@ -0,0 +1,11 @@ +# MembershipListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**memberships** | [**Vec**](Membership.md) | List of membership information | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/core/line_messaging_api/docs/MessagingApiApi.md b/core/line_messaging_api/docs/MessagingApiApi.md index 4e1b546..69c6cd8 100644 --- a/core/line_messaging_api/docs/MessagingApiApi.md +++ b/core/line_messaging_api/docs/MessagingApiApi.md @@ -21,6 +21,8 @@ Method | HTTP request | Description [**get_group_member_profile**](MessagingApiApi.md#get_group_member_profile) | **Get** /v2/bot/group/{groupId}/member/{userId} | [**get_group_members_ids**](MessagingApiApi.md#get_group_members_ids) | **Get** /v2/bot/group/{groupId}/members/ids | [**get_group_summary**](MessagingApiApi.md#get_group_summary) | **Get** /v2/bot/group/{groupId}/summary | +[**get_membership_list**](MessagingApiApi.md#get_membership_list) | **Get** /v2/bot/membership/list | +[**get_membership_subscription**](MessagingApiApi.md#get_membership_subscription) | **Get** /v2/bot/membership/subscription/{userId} | [**get_message_quota**](MessagingApiApi.md#get_message_quota) | **Get** /v2/bot/message/quota | [**get_message_quota_consumption**](MessagingApiApi.md#get_message_quota_consumption) | **Get** /v2/bot/message/quota/consumption | [**get_narrowcast_progress**](MessagingApiApi.md#get_narrowcast_progress) | **Get** /v2/bot/message/progress/narrowcast | @@ -54,6 +56,7 @@ Method | HTTP request | Description [**rich_menu_batch**](MessagingApiApi.md#rich_menu_batch) | **Post** /v2/bot/richmenu/batch | [**set_default_rich_menu**](MessagingApiApi.md#set_default_rich_menu) | **Post** /v2/bot/user/all/richmenu/{richMenuId} | [**set_webhook_endpoint**](MessagingApiApi.md#set_webhook_endpoint) | **Put** /v2/bot/channel/webhook/endpoint | +[**show_loading_animation**](MessagingApiApi.md#show_loading_animation) | **Post** /v2/bot/chat/loading/start | [**test_webhook_endpoint**](MessagingApiApi.md#test_webhook_endpoint) | **Post** /v2/bot/channel/webhook/test | [**unlink_rich_menu_id_from_user**](MessagingApiApi.md#unlink_rich_menu_id_from_user) | **Delete** /v2/bot/user/{userId}/richmenu | [**unlink_rich_menu_id_from_users**](MessagingApiApi.md#unlink_rich_menu_id_from_users) | **Post** /v2/bot/richmenu/bulk/unlink | @@ -571,6 +574,63 @@ Name | Type | Description | Required | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## get_membership_list + +> crate::models::MembershipListResponse get_membership_list() + + +Get a list of memberships. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**crate::models::MembershipListResponse**](MembershipListResponse.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + +## get_membership_subscription + +> crate::models::GetMembershipSubscriptionResponse get_membership_subscription(user_id) + + +Get a user's membership subscription. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_id** | **String** | User ID | [required] | + +### Return type + +[**crate::models::GetMembershipSubscriptionResponse**](GetMembershipSubscriptionResponse.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## get_message_quota > crate::models::MessageQuotaResponse get_message_quota() @@ -1553,6 +1613,36 @@ Name | Type | Description | Required | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## show_loading_animation + +> serde_json::Value show_loading_animation(show_loading_animation_request) + + +Display a loading animation in one-on-one chats between users and LINE Official Accounts. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**show_loading_animation_request** | [**ShowLoadingAnimationRequest**](ShowLoadingAnimationRequest.md) | | [required] | + +### Return type + +[**serde_json::Value**](serde_json::Value.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## test_webhook_endpoint > crate::models::TestWebhookEndpointResponse test_webhook_endpoint(test_webhook_endpoint_request) diff --git a/core/line_messaging_api/docs/ShowLoadingAnimationRequest.md b/core/line_messaging_api/docs/ShowLoadingAnimationRequest.md new file mode 100644 index 0000000..54e1ab2 --- /dev/null +++ b/core/line_messaging_api/docs/ShowLoadingAnimationRequest.md @@ -0,0 +1,12 @@ +# ShowLoadingAnimationRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**chat_id** | **String** | User ID of the target user for whom the loading animation is to be displayed. | +**loading_seconds** | Option<**i32**> | The number of seconds to display the loading indicator. It must be a multiple of 5. The maximum value is 60 seconds. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/core/line_messaging_api/docs/SubscribedMembershipPlan.md b/core/line_messaging_api/docs/SubscribedMembershipPlan.md new file mode 100644 index 0000000..69f4e18 --- /dev/null +++ b/core/line_messaging_api/docs/SubscribedMembershipPlan.md @@ -0,0 +1,16 @@ +# SubscribedMembershipPlan + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**membership_id** | **i32** | Membership plan ID. | +**title** | **String** | Membership plan name. | +**description** | **String** | Membership plan description. | +**benefits** | **Vec** | List of membership plan perks. | +**price** | **f64** | Monthly fee for membership plan. (e.g. 1500.00) | +**currency** | **String** | The currency of membership.price. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/core/line_messaging_api/docs/SubscribedMembershipUser.md b/core/line_messaging_api/docs/SubscribedMembershipUser.md new file mode 100644 index 0000000..258ee53 --- /dev/null +++ b/core/line_messaging_api/docs/SubscribedMembershipUser.md @@ -0,0 +1,14 @@ +# SubscribedMembershipUser + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**membership_no** | **i32** | The user's member number in the membership plan. | +**joined_time** | **i32** | UNIX timestamp at which the user subscribed to the membership. | +**next_billing_date** | **String** | Next payment date for membership plan. - Format: yyyy-MM-dd (e.g. 2024-02-08) - Timezone: UTC+9 | +**total_subscription_months** | **i32** | 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. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/core/line_messaging_api/docs/Subscription.md b/core/line_messaging_api/docs/Subscription.md new file mode 100644 index 0000000..3b7b2c1 --- /dev/null +++ b/core/line_messaging_api/docs/Subscription.md @@ -0,0 +1,12 @@ +# Subscription + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**membership** | [**crate::models::SubscribedMembershipPlan**](SubscribedMembershipPlan.md) | | +**user** | [**crate::models::SubscribedMembershipUser**](SubscribedMembershipUser.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/core/line_messaging_api/src/apis/messaging_api_api.rs b/core/line_messaging_api/src/apis/messaging_api_api.rs index 3748130..2c88ae9 100644 --- a/core/line_messaging_api/src/apis/messaging_api_api.rs +++ b/core/line_messaging_api/src/apis/messaging_api_api.rs @@ -122,6 +122,15 @@ pub trait MessagingApiApi { &self, group_id: &str, ) -> Pin>>>; + fn get_membership_list( + &self, + ) -> Pin>>>; + fn get_membership_subscription( + &self, + user_id: &str, + ) -> Pin< + Box>>, + >; fn get_message_quota( &self, ) -> Pin>>>; @@ -250,6 +259,10 @@ pub trait MessagingApiApi { &self, set_webhook_endpoint_request: crate::models::SetWebhookEndpointRequest, ) -> Pin>>>; + fn show_loading_animation( + &self, + show_loading_animation_request: crate::models::ShowLoadingAnimationRequest, + ) -> Pin>>>; fn test_webhook_endpoint( &self, test_webhook_endpoint_request: Option, @@ -563,6 +576,34 @@ where req.execute(self.configuration.borrow()) } + #[allow(unused_mut)] + fn get_membership_list( + &self, + ) -> Pin>>> { + let mut req = __internal_request::Request::new( + hyper::Method::GET, + "/v2/bot/membership/list".to_string(), + ); + + req.execute(self.configuration.borrow()) + } + + #[allow(unused_mut)] + fn get_membership_subscription( + &self, + user_id: &str, + ) -> Pin< + Box>>, + > { + let mut req = __internal_request::Request::new( + hyper::Method::GET, + "/v2/bot/membership/subscription/{userId}".to_string(), + ); + req = req.with_path_param("userId".to_string(), user_id.to_string()); + + req.execute(self.configuration.borrow()) + } + #[allow(unused_mut)] fn get_message_quota( &self, @@ -1048,6 +1089,20 @@ where req.execute(self.configuration.borrow()) } + #[allow(unused_mut)] + fn show_loading_animation( + &self, + show_loading_animation_request: crate::models::ShowLoadingAnimationRequest, + ) -> Pin>>> { + let mut req = __internal_request::Request::new( + hyper::Method::POST, + "/v2/bot/chat/loading/start".to_string(), + ); + req = req.with_body_param(show_loading_animation_request); + + req.execute(self.configuration.borrow()) + } + #[allow(unused_mut)] fn test_webhook_endpoint( &self, diff --git a/core/line_messaging_api/src/models/get_membership_subscription_response.rs b/core/line_messaging_api/src/models/get_membership_subscription_response.rs new file mode 100644 index 0000000..eb92f76 --- /dev/null +++ b/core/line_messaging_api/src/models/get_membership_subscription_response.rs @@ -0,0 +1,43 @@ +/* +* Copyright (C) 2016 LINE Corp. +* +* Licensed 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. +*/ + +/* + * LINE Messaging API + * + * This document describes LINE Messaging API. + * + * The version of the OpenAPI document: 0.0.2 + * + * Generated by: https://openapi-generator.tech + */ + +/// GetMembershipSubscriptionResponse : A user's membership subscription status + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct GetMembershipSubscriptionResponse { + /// List of subscription information + #[serde(rename = "subscriptions")] + pub subscriptions: Vec, +} + +impl GetMembershipSubscriptionResponse { + /// A user's membership subscription status + pub fn new( + subscriptions: Vec, + ) -> GetMembershipSubscriptionResponse { + GetMembershipSubscriptionResponse { subscriptions } + } +} diff --git a/core/line_messaging_api/src/models/membership.rs b/core/line_messaging_api/src/models/membership.rs new file mode 100644 index 0000000..25b7fc7 --- /dev/null +++ b/core/line_messaging_api/src/models/membership.rs @@ -0,0 +1,104 @@ +/* +* Copyright (C) 2016 LINE Corp. +* +* Licensed 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. +*/ + +/* + * LINE Messaging API + * + * This document describes LINE Messaging API. + * + * The version of the OpenAPI document: 0.0.2 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Membership { + /// Membership plan ID. + #[serde(rename = "membershipId")] + pub membership_id: i32, + /// Membership plan name. + #[serde(rename = "title")] + pub title: String, + /// Membership plan description. + #[serde(rename = "description")] + pub description: String, + /// List of membership plan perks. + #[serde(rename = "benefits")] + pub benefits: Vec, + /// Monthly fee for membership plan. (e.g. 1500.00) + #[serde(rename = "price")] + pub price: f64, + /// The currency of membership.price. + #[serde(rename = "currency")] + pub currency: Currency, + /// Number of members subscribed to the membership plan. + #[serde(rename = "memberCount")] + pub member_count: i32, + /// The upper limit of members who can subscribe. If no upper limit is set, it will be null. + #[serde(rename = "memberLimit", deserialize_with = "Option::deserialize")] + pub member_limit: Option, + /// Payment method for users who subscribe to a membership plan. + #[serde(rename = "isInAppPurchase")] + pub is_in_app_purchase: bool, + /// Membership plan status. + #[serde(rename = "isPublished")] + pub is_published: bool, +} + +impl Membership { + pub fn new( + membership_id: i32, + title: String, + description: String, + benefits: Vec, + price: f64, + currency: Currency, + member_count: i32, + member_limit: Option, + is_in_app_purchase: bool, + is_published: bool, + ) -> Membership { + Membership { + membership_id, + title, + description, + benefits, + price, + currency, + member_count, + member_limit, + is_in_app_purchase, + is_published, + } + } +} + +/// The currency of membership.price. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Currency { + #[serde(rename = "JPY")] + Jpy, + #[serde(rename = "TWD")] + Twd, + #[serde(rename = "THB")] + Thb, +} + +impl Default for Currency { + fn default() -> Currency { + Self::Jpy + } +} diff --git a/core/line_messaging_api/src/models/membership_list_response.rs b/core/line_messaging_api/src/models/membership_list_response.rs new file mode 100644 index 0000000..22b2f01 --- /dev/null +++ b/core/line_messaging_api/src/models/membership_list_response.rs @@ -0,0 +1,41 @@ +/* +* Copyright (C) 2016 LINE Corp. +* +* Licensed 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. +*/ + +/* + * LINE Messaging API + * + * This document describes LINE Messaging API. + * + * The version of the OpenAPI document: 0.0.2 + * + * Generated by: https://openapi-generator.tech + */ + +/// MembershipListResponse : List of memberships + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct MembershipListResponse { + /// List of membership information + #[serde(rename = "memberships")] + pub memberships: Vec, +} + +impl MembershipListResponse { + /// List of memberships + pub fn new(memberships: Vec) -> MembershipListResponse { + MembershipListResponse { memberships } + } +} diff --git a/core/line_messaging_api/src/models/mod.rs b/core/line_messaging_api/src/models/mod.rs index b94ba39..8cce726 100644 --- a/core/line_messaging_api/src/models/mod.rs +++ b/core/line_messaging_api/src/models/mod.rs @@ -138,6 +138,8 @@ pub mod get_aggregation_unit_usage_response; pub use self::get_aggregation_unit_usage_response::GetAggregationUnitUsageResponse; pub mod get_followers_response; pub use self::get_followers_response::GetFollowersResponse; +pub mod get_membership_subscription_response; +pub use self::get_membership_subscription_response::GetMembershipSubscriptionResponse; pub mod get_message_content_transcoding_response; pub use self::get_message_content_transcoding_response::GetMessageContentTranscodingResponse; pub mod get_webhook_endpoint_response; @@ -178,6 +180,10 @@ pub mod mark_messages_as_read_request; pub use self::mark_messages_as_read_request::MarkMessagesAsReadRequest; pub mod members_ids_response; pub use self::members_ids_response::MembersIdsResponse; +pub mod membership; +pub use self::membership::Membership; +pub mod membership_list_response; +pub use self::membership_list_response::MembershipListResponse; pub mod message; pub use self::message::Message; pub mod message_action; @@ -270,8 +276,16 @@ pub mod sent_message; pub use self::sent_message::SentMessage; pub mod set_webhook_endpoint_request; pub use self::set_webhook_endpoint_request::SetWebhookEndpointRequest; +pub mod show_loading_animation_request; +pub use self::show_loading_animation_request::ShowLoadingAnimationRequest; pub mod sticker_message; pub use self::sticker_message::StickerMessage; +pub mod subscribed_membership_plan; +pub use self::subscribed_membership_plan::SubscribedMembershipPlan; +pub mod subscribed_membership_user; +pub use self::subscribed_membership_user::SubscribedMembershipUser; +pub mod subscription; +pub use self::subscription::Subscription; pub mod subscription_period_demographic; pub use self::subscription_period_demographic::SubscriptionPeriodDemographic; pub mod subscription_period_demographic_filter; diff --git a/core/line_messaging_api/src/models/show_loading_animation_request.rs b/core/line_messaging_api/src/models/show_loading_animation_request.rs new file mode 100644 index 0000000..e8874a5 --- /dev/null +++ b/core/line_messaging_api/src/models/show_loading_animation_request.rs @@ -0,0 +1,44 @@ +/* +* Copyright (C) 2016 LINE Corp. +* +* Licensed 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. +*/ + +/* + * LINE Messaging API + * + * This document describes LINE Messaging API. + * + * The version of the OpenAPI document: 0.0.2 + * + * Generated by: https://openapi-generator.tech + */ + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct ShowLoadingAnimationRequest { + /// User ID of the target user for whom the loading animation is to be displayed. + #[serde(rename = "chatId")] + pub chat_id: String, + /// The number of seconds to display the loading indicator. It must be a multiple of 5. The maximum value is 60 seconds. + #[serde(rename = "loadingSeconds", skip_serializing_if = "Option::is_none")] + pub loading_seconds: Option, +} + +impl ShowLoadingAnimationRequest { + pub fn new(chat_id: String) -> ShowLoadingAnimationRequest { + ShowLoadingAnimationRequest { + chat_id, + loading_seconds: None, + } + } +} diff --git a/core/line_messaging_api/src/models/subscribed_membership_plan.rs b/core/line_messaging_api/src/models/subscribed_membership_plan.rs new file mode 100644 index 0000000..4a71bcb --- /dev/null +++ b/core/line_messaging_api/src/models/subscribed_membership_plan.rs @@ -0,0 +1,87 @@ +/* +* Copyright (C) 2016 LINE Corp. +* +* Licensed 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. +*/ + +/* + * LINE Messaging API + * + * This document describes LINE Messaging API. + * + * The version of the OpenAPI document: 0.0.2 + * + * Generated by: https://openapi-generator.tech + */ + +/// SubscribedMembershipPlan : Object containing information about the membership plan. + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SubscribedMembershipPlan { + /// Membership plan ID. + #[serde(rename = "membershipId")] + pub membership_id: i32, + /// Membership plan name. + #[serde(rename = "title")] + pub title: String, + /// Membership plan description. + #[serde(rename = "description")] + pub description: String, + /// List of membership plan perks. + #[serde(rename = "benefits")] + pub benefits: Vec, + /// Monthly fee for membership plan. (e.g. 1500.00) + #[serde(rename = "price")] + pub price: f64, + /// The currency of membership.price. + #[serde(rename = "currency")] + pub currency: Currency, +} + +impl SubscribedMembershipPlan { + /// Object containing information about the membership plan. + pub fn new( + membership_id: i32, + title: String, + description: String, + benefits: Vec, + price: f64, + currency: Currency, + ) -> SubscribedMembershipPlan { + SubscribedMembershipPlan { + membership_id, + title, + description, + benefits, + price, + currency, + } + } +} + +/// The currency of membership.price. +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Currency { + #[serde(rename = "JPY")] + Jpy, + #[serde(rename = "TWD")] + Twd, + #[serde(rename = "THB")] + Thb, +} + +impl Default for Currency { + fn default() -> Currency { + Self::Jpy + } +} diff --git a/core/line_messaging_api/src/models/subscribed_membership_user.rs b/core/line_messaging_api/src/models/subscribed_membership_user.rs new file mode 100644 index 0000000..a647188 --- /dev/null +++ b/core/line_messaging_api/src/models/subscribed_membership_user.rs @@ -0,0 +1,60 @@ +/* +* Copyright (C) 2016 LINE Corp. +* +* Licensed 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. +*/ + +/* + * LINE Messaging API + * + * This document describes LINE Messaging API. + * + * The version of the OpenAPI document: 0.0.2 + * + * Generated by: https://openapi-generator.tech + */ + +/// SubscribedMembershipUser : Object containing user membership subscription information. + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct SubscribedMembershipUser { + /// The user's member number in the membership plan. + #[serde(rename = "membershipNo")] + pub membership_no: i32, + /// UNIX timestamp at which the user subscribed to the membership. + #[serde(rename = "joinedTime")] + pub joined_time: i32, + /// Next payment date for membership plan. - Format: yyyy-MM-dd (e.g. 2024-02-08) - Timezone: UTC+9 + #[serde(rename = "nextBillingDate")] + pub next_billing_date: String, + /// 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. + #[serde(rename = "totalSubscriptionMonths")] + pub total_subscription_months: i32, +} + +impl SubscribedMembershipUser { + /// Object containing user membership subscription information. + pub fn new( + membership_no: i32, + joined_time: i32, + next_billing_date: String, + total_subscription_months: i32, + ) -> SubscribedMembershipUser { + SubscribedMembershipUser { + membership_no, + joined_time, + next_billing_date, + total_subscription_months, + } + } +} diff --git a/core/line_messaging_api/src/models/subscription.rs b/core/line_messaging_api/src/models/subscription.rs new file mode 100644 index 0000000..8d9e248 --- /dev/null +++ b/core/line_messaging_api/src/models/subscription.rs @@ -0,0 +1,48 @@ +/* +* Copyright (C) 2016 LINE Corp. +* +* Licensed 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. +*/ + +/* + * LINE Messaging API + * + * This document describes LINE Messaging API. + * + * The version of the OpenAPI document: 0.0.2 + * + * Generated by: https://openapi-generator.tech + */ + +/// Subscription : An array of memberships. + +#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Subscription { + #[serde(rename = "membership")] + pub membership: Box, + #[serde(rename = "user")] + pub user: Box, +} + +impl Subscription { + /// An array of memberships. + pub fn new( + membership: crate::models::SubscribedMembershipPlan, + user: crate::models::SubscribedMembershipUser, + ) -> Subscription { + Subscription { + membership: Box::new(membership), + user: Box::new(user), + } + } +}