Skip to content

Commit fdc8cd2

Browse files
authored
Add membership and functionality to other services (#48)
1 parent 196678f commit fdc8cd2

File tree

262 files changed

+2767
-203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+2767
-203
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
run: cargo login ${{ secrets.CARGO_TOKEN }}
1717

1818
- name: publish
19-
run: cargo publish
19+
run: make publish

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ members = [
77
"core/lib/",
88
"core/line_liff",
99
"core/line_manage_audience",
10+
"core/line_membership",
1011
"core/line_messaging_api",
1112
"core/line_module",
1213
"core/line_module_attach",

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.PHONY: publish
2+
publish:
3+
cargo publish --manifest-path core/lib/Cargo.toml

core/lib/Cargo.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "line-bot-sdk-rust"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
authors = ["nanato12 <admin@okj.info>"]
55
edition = "2021"
66
description = "LINE Messaging API SDK for Rust"
@@ -48,8 +48,12 @@ path = "../line_liff"
4848
version = "0.0.1"
4949
path = "../line_manage_audience"
5050

51-
[dependencies.line_messaging_api]
51+
[dependencies.line_membership]
5252
version = "0.0.1"
53+
path = "../line_membership"
54+
55+
[dependencies.line_messaging_api]
56+
version = "0.0.2"
5357
path = "../line_messaging_api"
5458

5559
[dependencies.line_module]
@@ -65,5 +69,5 @@ version = "0.0.1"
6569
path = "../line_shop"
6670

6771
[dependencies.line_webhook]
68-
version = "1.0.0"
72+
version = "1.0.1"
6973
path = "../line_webhook"

core/lib/src/client/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ use line_liff::apis::{configuration::Configuration as LiffConfiguration, LiffApi
2727
use line_manage_audience::apis::{
2828
configuration::Configuration as ManageAudienceConfiguration, ManageAudienceApiClient,
2929
};
30+
use line_membership::apis::{
31+
configuration::Configuration as MembershipConfiguration, MembershipApiClient,
32+
};
3033
use line_messaging_api::apis::{
3134
configuration::Configuration as MessagingApiConfiguration, MessagingApiApiClient,
3235
};
@@ -48,6 +51,7 @@ pub struct LINE {
4851
pub insight_api_client: InsightApiClient<C>,
4952
pub liff_api_client: LiffApiClient<C>,
5053
pub manage_audience_api_client: ManageAudienceApiClient<C>,
54+
pub membership_api_client: MembershipApiClient<C>,
5155
pub messaging_api_client: MessagingApiApiClient<C>,
5256
pub module_api_client: LineModuleApiClient<C>,
5357
pub module_attach_api_client: LineModuleAttachApiClient<C>,
@@ -82,6 +86,11 @@ impl LINE {
8286
let manage_audience_api_client =
8387
ManageAudienceApiClient::new(Rc::new(manage_audience_conf));
8488

89+
// membership
90+
let mut membership_conf = MembershipConfiguration::new(client.clone());
91+
membership_conf.oauth_access_token = Some(token.to_owned());
92+
let membership_api_client = MembershipApiClient::new(Rc::new(membership_conf));
93+
8594
// messaging_api
8695
let mut messaging_api_conf = MessagingApiConfiguration::new(client.clone());
8796
messaging_api_conf.oauth_access_token = Some(token.to_owned());
@@ -112,6 +121,7 @@ impl LINE {
112121
insight_api_client,
113122
liff_api_client,
114123
manage_audience_api_client,
124+
membership_api_client,
115125
messaging_api_client,
116126
module_api_client,
117127
module_attach_api_client,

core/line_membership/Cargo.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[package]
2+
name = "line_membership"
3+
version = "0.0.1"
4+
authors = ["OpenAPI Generator team and contributors"]
5+
description = "This document describes LINE Official Account Membership API."
6+
# Override this license by providing a License Object in the OpenAPI.
7+
license = "Unlicense"
8+
edition = "2018"
9+
10+
[dependencies]
11+
serde = "^1.0"
12+
serde_derive = "^1.0"
13+
serde_json = "^1.0"
14+
url = "^2.2"
15+
uuid = { version = "^1.0", features = ["serde", "v4"] }
16+
hyper = { version = "~0.14", features = ["full"] }
17+
hyper-tls = "~0.5"
18+
http = "~0.2"
19+
base64 = "~0.7.0"
20+
futures = "^0.3"

core/line_membership/README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Rust API client for line_membership
2+
3+
This document describes LINE Official Account Membership API.
4+
5+
6+
## Overview
7+
8+
This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client.
9+
10+
- API version: 0.0.1
11+
- Package version: 0.0.1
12+
- Build package: `org.openapitools.codegen.languages.RustClientCodegen`
13+
14+
## Installation
15+
16+
Put the package under your project folder in a directory named `line_membership` and add the following to `Cargo.toml` under `[dependencies]`:
17+
18+
```
19+
line_membership = { path = "./line_membership" }
20+
```
21+
22+
## Documentation for API Endpoints
23+
24+
All URIs are relative to *https://api.line.me*
25+
26+
Class | Method | HTTP request | Description
27+
------------ | ------------- | ------------- | -------------
28+
*MembershipApi* | [**get_membership_list**](docs/MembershipApi.md#get_membership_list) | **Get** /membership/v1/list |
29+
*MembershipApi* | [**get_membership_subscription**](docs/MembershipApi.md#get_membership_subscription) | **Get** /membership/v1/subscription/{userId} |
30+
31+
32+
## Documentation For Models
33+
34+
- [ErrorResponse](docs/ErrorResponse.md)
35+
- [GetMembershipSubscriptionResponse](docs/GetMembershipSubscriptionResponse.md)
36+
- [Membership](docs/Membership.md)
37+
- [MembershipListResponse](docs/MembershipListResponse.md)
38+
- [MembershipMeta](docs/MembershipMeta.md)
39+
- [MembershipUser](docs/MembershipUser.md)
40+
- [Subscription](docs/Subscription.md)
41+
42+
43+
To get access to the crate's generated documentation, use:
44+
45+
```
46+
cargo doc --open
47+
```
48+
49+
## Author
50+
51+
52+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# ErrorResponse
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**message** | **String** | Error message |
8+
**details** | Option<**Vec<String>**> | | [optional]
9+
10+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
11+
12+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# GetMembershipSubscriptionResponse
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**subscriptions** | [**Vec<crate::models::Subscription>**](Subscription.md) | List of subscription information |
8+
9+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
10+
11+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Membership
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**membership_id** | **i32** | Membership plan ID. |
8+
**title** | **String** | Membership plan name. |
9+
**description** | **String** | Membership plan description. |
10+
**benefits** | **Vec<String>** | List of membership plan perks. |
11+
**price** | **f64** | Monthly fee for membership plan. (e.g. 1500.00) |
12+
**currency** | **String** | The currency of membership.price. |
13+
**member_count** | **i32** | Number of members subscribed to the membership plan. |
14+
**member_limit** | Option<**i32**> | The upper limit of members who can subscribe. If no upper limit is set, it will be null. |
15+
**is_in_app_purchase** | **bool** | Payment method for users who subscribe to a membership plan. |
16+
**is_published** | **bool** | Membership plan status. |
17+
18+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
19+
20+

0 commit comments

Comments
 (0)