-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add membership and functionality to other services (#48)
- Loading branch information
Showing
262 changed files
with
2,767 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,4 @@ jobs: | |
run: cargo login ${{ secrets.CARGO_TOKEN }} | ||
|
||
- name: publish | ||
run: cargo publish | ||
run: make publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.PHONY: publish | ||
publish: | ||
cargo publish --manifest-path core/lib/Cargo.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[package] | ||
name = "line_membership" | ||
version = "0.0.1" | ||
authors = ["OpenAPI Generator team and contributors"] | ||
description = "This document describes LINE Official Account Membership API." | ||
# Override this license by providing a License Object in the OpenAPI. | ||
license = "Unlicense" | ||
edition = "2018" | ||
|
||
[dependencies] | ||
serde = "^1.0" | ||
serde_derive = "^1.0" | ||
serde_json = "^1.0" | ||
url = "^2.2" | ||
uuid = { version = "^1.0", features = ["serde", "v4"] } | ||
hyper = { version = "~0.14", features = ["full"] } | ||
hyper-tls = "~0.5" | ||
http = "~0.2" | ||
base64 = "~0.7.0" | ||
futures = "^0.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Rust API client for line_membership | ||
|
||
This document describes LINE Official Account Membership API. | ||
|
||
|
||
## Overview | ||
|
||
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. | ||
|
||
- API version: 0.0.1 | ||
- Package version: 0.0.1 | ||
- Build package: `org.openapitools.codegen.languages.RustClientCodegen` | ||
|
||
## Installation | ||
|
||
Put the package under your project folder in a directory named `line_membership` and add the following to `Cargo.toml` under `[dependencies]`: | ||
|
||
``` | ||
line_membership = { path = "./line_membership" } | ||
``` | ||
|
||
## Documentation for API Endpoints | ||
|
||
All URIs are relative to *https://api.line.me* | ||
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
*MembershipApi* | [**get_membership_list**](docs/MembershipApi.md#get_membership_list) | **Get** /membership/v1/list | | ||
*MembershipApi* | [**get_membership_subscription**](docs/MembershipApi.md#get_membership_subscription) | **Get** /membership/v1/subscription/{userId} | | ||
|
||
|
||
## Documentation For Models | ||
|
||
- [ErrorResponse](docs/ErrorResponse.md) | ||
- [GetMembershipSubscriptionResponse](docs/GetMembershipSubscriptionResponse.md) | ||
- [Membership](docs/Membership.md) | ||
- [MembershipListResponse](docs/MembershipListResponse.md) | ||
- [MembershipMeta](docs/MembershipMeta.md) | ||
- [MembershipUser](docs/MembershipUser.md) | ||
- [Subscription](docs/Subscription.md) | ||
|
||
|
||
To get access to the crate's generated documentation, use: | ||
|
||
``` | ||
cargo doc --open | ||
``` | ||
|
||
## Author | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# ErrorResponse | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**message** | **String** | Error message | | ||
**details** | Option<**Vec<String>**> | | [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) | ||
|
||
|
11 changes: 11 additions & 0 deletions
11
core/line_membership/docs/GetMembershipSubscriptionResponse.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# GetMembershipSubscriptionResponse | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**subscriptions** | [**Vec<crate::models::Subscription>**](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) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<String>** | 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) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# \MembershipApi | ||
|
||
All URIs are relative to *https://api.line.me* | ||
|
||
Method | HTTP request | Description | ||
------------- | ------------- | ------------- | ||
[**get_membership_list**](MembershipApi.md#get_membership_list) | **Get** /membership/v1/list | | ||
[**get_membership_subscription**](MembershipApi.md#get_membership_subscription) | **Get** /membership/v1/subscription/{userId} | | ||
|
||
|
||
|
||
## 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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# MembershipListResponse | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**memberships** | [**Vec<crate::models::Membership>**](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) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# MembershipMeta | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**membership_id** | **i32** | Membership plan ID. | | ||
**title** | **String** | Membership plan name. | | ||
**description** | **String** | Membership plan description. | | ||
**benefits** | **Vec<String>** | 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) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# MembershipUser | ||
|
||
## 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) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Subscription | ||
|
||
## Properties | ||
|
||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**membership** | [**crate::models::MembershipMeta**](MembershipMeta.md) | | | ||
**user** | [**crate::models::MembershipUser**](MembershipUser.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) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
*/ | ||
|
||
use std::rc::Rc; | ||
|
||
use super::configuration::Configuration; | ||
use hyper; | ||
|
||
pub struct APIClient { | ||
membership_api: Box<dyn crate::apis::MembershipApi>, | ||
} | ||
|
||
impl APIClient { | ||
pub fn new<C: hyper::client::connect::Connect>(configuration: Configuration<C>) -> APIClient | ||
where | ||
C: Clone + std::marker::Send + Sync + 'static, | ||
{ | ||
let rc = Rc::new(configuration); | ||
|
||
APIClient { | ||
membership_api: Box::new(crate::apis::MembershipApiClient::new(rc.clone())), | ||
} | ||
} | ||
|
||
pub fn membership_api(&self) -> &dyn crate::apis::MembershipApi { | ||
self.membership_api.as_ref() | ||
} | ||
} |
Oops, something went wrong.