mirror of
https://github.com/mii443/vrchatapi-rust.git
synced 2025-08-22 15:45:35 +00:00
Upgrade Rust SDK to spec 1.5.2
This commit is contained in:
@ -17,6 +17,7 @@ docs/DeploymentGroup.md
|
||||
docs/DeveloperType.md
|
||||
docs/DownloadUrlList.md
|
||||
docs/DynamicWorldRow.md
|
||||
docs/EconomyApi.md
|
||||
docs/Error.md
|
||||
docs/Favorite.md
|
||||
docs/FavoriteGroup.md
|
||||
@ -33,7 +34,6 @@ docs/FilesApi.md
|
||||
docs/FinishFileDataUploadRequest.md
|
||||
docs/FriendStatus.md
|
||||
docs/FriendsApi.md
|
||||
docs/InlineResponse404.md
|
||||
docs/Instance.md
|
||||
docs/InstancePlatforms.md
|
||||
docs/InstancesApi.md
|
||||
@ -42,6 +42,10 @@ docs/InviteMessage.md
|
||||
docs/InviteMessageType.md
|
||||
docs/InviteRequest.md
|
||||
docs/InviteResponse.md
|
||||
docs/License.md
|
||||
docs/LicenseAction.md
|
||||
docs/LicenseGroup.md
|
||||
docs/LicenseType.md
|
||||
docs/LimitedUnityPackage.md
|
||||
docs/LimitedUser.md
|
||||
docs/LimitedWorld.md
|
||||
@ -59,8 +63,15 @@ docs/PlayermoderationApi.md
|
||||
docs/PublicAnnouncement.md
|
||||
docs/ReleaseStatus.md
|
||||
docs/Response.md
|
||||
docs/Subscription.md
|
||||
docs/SubscriptionPeriod.md
|
||||
docs/Success.md
|
||||
docs/SystemApi.md
|
||||
docs/Transaction.md
|
||||
docs/TransactionAgreement.md
|
||||
docs/TransactionStatus.md
|
||||
docs/TransactionSteamInfo.md
|
||||
docs/TransactionSteamWalletInfo.md
|
||||
docs/TwoFactorAuthCode.md
|
||||
docs/UnityPackage.md
|
||||
docs/UpdateAvatarRequest.md
|
||||
@ -72,6 +83,7 @@ docs/User.md
|
||||
docs/UserExists.md
|
||||
docs/UserState.md
|
||||
docs/UserStatus.md
|
||||
docs/UserSubscription.md
|
||||
docs/UsersApi.md
|
||||
docs/Verify2FaResult.md
|
||||
docs/VerifyAuthTokenResult.md
|
||||
@ -83,6 +95,7 @@ git_push.sh
|
||||
src/apis/authentication_api.rs
|
||||
src/apis/avatars_api.rs
|
||||
src/apis/configuration.rs
|
||||
src/apis/economy_api.rs
|
||||
src/apis/favorites_api.rs
|
||||
src/apis/files_api.rs
|
||||
src/apis/friends_api.rs
|
||||
@ -124,13 +137,16 @@ src/models/file_version.rs
|
||||
src/models/file_version_upload_status.rs
|
||||
src/models/finish_file_data_upload_request.rs
|
||||
src/models/friend_status.rs
|
||||
src/models/inline_response_404.rs
|
||||
src/models/instance.rs
|
||||
src/models/instance_platforms.rs
|
||||
src/models/invite_message.rs
|
||||
src/models/invite_message_type.rs
|
||||
src/models/invite_request.rs
|
||||
src/models/invite_response.rs
|
||||
src/models/license.rs
|
||||
src/models/license_action.rs
|
||||
src/models/license_group.rs
|
||||
src/models/license_type.rs
|
||||
src/models/limited_unity_package.rs
|
||||
src/models/limited_user.rs
|
||||
src/models/limited_world.rs
|
||||
@ -146,7 +162,14 @@ src/models/player_moderation_type.rs
|
||||
src/models/public_announcement.rs
|
||||
src/models/release_status.rs
|
||||
src/models/response.rs
|
||||
src/models/subscription.rs
|
||||
src/models/subscription_period.rs
|
||||
src/models/success.rs
|
||||
src/models/transaction.rs
|
||||
src/models/transaction_agreement.rs
|
||||
src/models/transaction_status.rs
|
||||
src/models/transaction_steam_info.rs
|
||||
src/models/transaction_steam_wallet_info.rs
|
||||
src/models/two_factor_auth_code.rs
|
||||
src/models/unity_package.rs
|
||||
src/models/update_avatar_request.rs
|
||||
@ -158,6 +181,7 @@ src/models/user.rs
|
||||
src/models/user_exists.rs
|
||||
src/models/user_state.rs
|
||||
src/models/user_status.rs
|
||||
src/models/user_subscription.rs
|
||||
src/models/verify2_fa_result.rs
|
||||
src/models/verify_auth_token_result.rs
|
||||
src/models/world.rs
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "vrchatapi"
|
||||
version = "1.5.1"
|
||||
version = "1.5.2"
|
||||
authors = ["OpenAPI Generator team and contributors"]
|
||||
license = "MIT"
|
||||
edition = "2018"
|
||||
|
154
docs/EconomyApi.md
Normal file
154
docs/EconomyApi.md
Normal file
@ -0,0 +1,154 @@
|
||||
# \EconomyApi
|
||||
|
||||
All URIs are relative to *https://api.vrchat.cloud/api/1*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**get_current_subscriptions**](EconomyApi.md#get_current_subscriptions) | **GET** /auth/user/subscription | Get Current Subscriptions
|
||||
[**get_license_group**](EconomyApi.md#get_license_group) | **GET** /licenseGroups/{licenseGroupId} | Get License Group
|
||||
[**get_steam_transaction**](EconomyApi.md#get_steam_transaction) | **GET** /Steam/transactions/{transactionId} | Get Steam Transaction
|
||||
[**get_steam_transactions**](EconomyApi.md#get_steam_transactions) | **GET** /Steam/transactions | List Steam Transactions
|
||||
[**get_subscriptions**](EconomyApi.md#get_subscriptions) | **GET** /subscriptions | List Subscriptions
|
||||
|
||||
|
||||
|
||||
## get_current_subscriptions
|
||||
|
||||
> Vec<crate::models::UserSubscription> get_current_subscriptions()
|
||||
Get Current Subscriptions
|
||||
|
||||
Get a list of all current user subscriptions.
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**Vec<crate::models::UserSubscription>**](UserSubscription.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[apiKeyCookie](../README.md#apiKeyCookie), [authCookie](../README.md#authCookie)
|
||||
|
||||
### 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_license_group
|
||||
|
||||
> crate::models::LicenseGroup get_license_group(license_group_id)
|
||||
Get License Group
|
||||
|
||||
Get a single License Group by given ID.
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Required | Notes
|
||||
------------- | ------------- | ------------- | ------------- | -------------
|
||||
**license_group_id** | **String** | | [required] |
|
||||
|
||||
### Return type
|
||||
|
||||
[**crate::models::LicenseGroup**](LicenseGroup.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[apiKeyCookie](../README.md#apiKeyCookie), [authCookie](../README.md#authCookie)
|
||||
|
||||
### 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_steam_transaction
|
||||
|
||||
> crate::models::Transaction get_steam_transaction(transaction_id)
|
||||
Get Steam Transaction
|
||||
|
||||
Get a single Steam transactions by ID. This returns the exact same information as `getSteamTransactions`, so no point in using this endpoint.
|
||||
|
||||
### Parameters
|
||||
|
||||
|
||||
Name | Type | Description | Required | Notes
|
||||
------------- | ------------- | ------------- | ------------- | -------------
|
||||
**transaction_id** | **String** | | [required] |
|
||||
|
||||
### Return type
|
||||
|
||||
[**crate::models::Transaction**](Transaction.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[apiKeyCookie](../README.md#apiKeyCookie), [authCookie](../README.md#authCookie)
|
||||
|
||||
### 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_steam_transactions
|
||||
|
||||
> Vec<crate::models::Transaction> get_steam_transactions()
|
||||
List Steam Transactions
|
||||
|
||||
Get all own Steam transactions.
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**Vec<crate::models::Transaction>**](Transaction.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[apiKeyCookie](../README.md#apiKeyCookie), [authCookie](../README.md#authCookie)
|
||||
|
||||
### 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_subscriptions
|
||||
|
||||
> Vec<crate::models::Subscription> get_subscriptions()
|
||||
List Subscriptions
|
||||
|
||||
List all existing Subscriptions. For example, \"vrchatplus-monthly\" and \"vrchatplus-yearly\".
|
||||
|
||||
### Parameters
|
||||
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**Vec<crate::models::Subscription>**](Subscription.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[apiKeyCookie](../README.md#apiKeyCookie), [authCookie](../README.md#authCookie)
|
||||
|
||||
### 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)
|
||||
|
@ -143,7 +143,7 @@ Name | Type | Description | Required | Notes
|
||||
> Vec<crate::models::InviteMessage> reset_invite_message(user_id, message_type, slot)
|
||||
Reset Invite Message
|
||||
|
||||
Resets a single Invite Message back to it's original message, and then returns a list of all of them. Admin Credentials are required to update messages of other users! Resetting a message respects the rate-limit, so it is not possible to reset within the 60 minutes countdown. Resetting it does however not set the rate-limit to 60 like when editing it. It is possible to edit it right after resetting it. Trying to edit a message before the cooldown timer expires results in a 429 \"Too Fast Error\". Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite The DELETE endpoint does not have/require any request body.
|
||||
Resets a single Invite Message back to its original message, and then returns a list of all of them. Admin Credentials are required to update messages of other users! Resetting a message respects the rate-limit, so it is not possible to reset within the 60 minutes countdown. Resetting it does however not set the rate-limit to 60 like when editing it. It is possible to edit it right after resetting it. Trying to edit a message before the cooldown timer expires results in a 429 \"Too Fast Error\". Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite The DELETE endpoint does not have/require any request body.
|
||||
|
||||
### Parameters
|
||||
|
||||
|
14
docs/License.md
Normal file
14
docs/License.md
Normal file
@ -0,0 +1,14 @@
|
||||
# License
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**for_id** | **String** | Either a AvatarID, LicenseGroupID, PermissionID or ProductID. This depends on the `forType` field. |
|
||||
**for_type** | [**crate::models::LicenseType**](LicenseType.md) | |
|
||||
**for_name** | **String** | |
|
||||
**for_action** | [**crate::models::LicenseAction**](LicenseAction.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)
|
||||
|
||||
|
@ -1,10 +1,9 @@
|
||||
# InlineResponse404
|
||||
# LicenseAction
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**error** | [**crate::models::Error**](Error.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)
|
||||
|
14
docs/LicenseGroup.md
Normal file
14
docs/LicenseGroup.md
Normal file
@ -0,0 +1,14 @@
|
||||
# LicenseGroup
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **String** | |
|
||||
**name** | **String** | |
|
||||
**description** | **String** | |
|
||||
**licenses** | [**Vec<crate::models::License>**](License.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)
|
||||
|
||||
|
10
docs/LicenseType.md
Normal file
10
docs/LicenseType.md
Normal file
@ -0,0 +1,10 @@
|
||||
# LicenseType
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
16
docs/Subscription.md
Normal file
16
docs/Subscription.md
Normal file
@ -0,0 +1,16 @@
|
||||
# Subscription
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **String** | |
|
||||
**steam_item_id** | **String** | |
|
||||
**amount** | **f32** | |
|
||||
**description** | **String** | |
|
||||
**period** | [**crate::models::SubscriptionPeriod**](SubscriptionPeriod.md) | |
|
||||
**tier** | **f32** | |
|
||||
|
||||
[[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
docs/SubscriptionPeriod.md
Normal file
10
docs/SubscriptionPeriod.md
Normal file
@ -0,0 +1,10 @@
|
||||
# SubscriptionPeriod
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
[[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
docs/Transaction.md
Normal file
19
docs/Transaction.md
Normal file
@ -0,0 +1,19 @@
|
||||
# Transaction
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **String** | |
|
||||
**status** | [**crate::models::TransactionStatus**](TransactionStatus.md) | |
|
||||
**subscription** | [**crate::models::Subscription**](Subscription.md) | |
|
||||
**sandbox** | **bool** | | [default to false]
|
||||
**created_at** | **String** | |
|
||||
**updated_at** | **String** | |
|
||||
**steam** | Option<[**crate::models::TransactionSteamInfo**](TransactionSteamInfo.md)> | | [optional]
|
||||
**agreement** | Option<[**crate::models::TransactionAgreement**](TransactionAgreement.md)> | | [optional]
|
||||
**error** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
27
docs/TransactionAgreement.md
Normal file
27
docs/TransactionAgreement.md
Normal file
@ -0,0 +1,27 @@
|
||||
# TransactionAgreement
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**agreement_id** | **String** | |
|
||||
**item_id** | **f32** | |
|
||||
**status** | **String** | This is NOT TransactionStatus, but whatever Steam return. |
|
||||
**period** | **String** | |
|
||||
**frequency** | **f32** | |
|
||||
**billing_type** | **String** | |
|
||||
**start_date** | **String** | |
|
||||
**end_date** | **String** | |
|
||||
**recurring_amt** | **f32** | |
|
||||
**currency** | **String** | |
|
||||
**time_created** | **String** | |
|
||||
**next_payment** | **String** | |
|
||||
**last_payment** | **String** | |
|
||||
**last_amount** | **f32** | |
|
||||
**last_amount_vat** | **f32** | |
|
||||
**outstanding** | **f32** | |
|
||||
**failed_attempts** | **f32** | |
|
||||
|
||||
[[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
docs/TransactionStatus.md
Normal file
10
docs/TransactionStatus.md
Normal file
@ -0,0 +1,10 @@
|
||||
# TransactionStatus
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
15
docs/TransactionSteamInfo.md
Normal file
15
docs/TransactionSteamInfo.md
Normal file
@ -0,0 +1,15 @@
|
||||
# TransactionSteamInfo
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**wallet_info** | [**crate::models::TransactionSteamWalletInfo**](TransactionSteamWalletInfo.md) | |
|
||||
**steam_id** | **String** | Steam User ID |
|
||||
**order_id** | **String** | Steam Order ID |
|
||||
**steam_url** | **String** | Empty |
|
||||
**trans_id** | **String** | Steam Transaction ID, NOT the same as VRChat TransactionID |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
14
docs/TransactionSteamWalletInfo.md
Normal file
14
docs/TransactionSteamWalletInfo.md
Normal file
@ -0,0 +1,14 @@
|
||||
# TransactionSteamWalletInfo
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**state** | **String** | |
|
||||
**country** | **String** | | [default to US]
|
||||
**currency** | **String** | | [default to USD]
|
||||
**status** | **String** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
25
docs/UserSubscription.md
Normal file
25
docs/UserSubscription.md
Normal file
@ -0,0 +1,25 @@
|
||||
# UserSubscription
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **String** | |
|
||||
**transaction_id** | **String** | |
|
||||
**store** | **String** | Which \"Store\" it came from. Right now only Stores are \"Steam\" and \"Admin\". |
|
||||
**steam_item_id** | Option<**String**> | | [optional]
|
||||
**amount** | **f32** | |
|
||||
**description** | **String** | |
|
||||
**period** | [**crate::models::SubscriptionPeriod**](SubscriptionPeriod.md) | |
|
||||
**tier** | **f32** | |
|
||||
**active** | **bool** | | [default to true]
|
||||
**status** | [**crate::models::TransactionStatus**](TransactionStatus.md) | |
|
||||
**expires** | **String** | |
|
||||
**created_at** | **String** | |
|
||||
**updated_at** | **String** | |
|
||||
**license_groups** | **Vec<String>** | |
|
||||
**is_gift** | **bool** | | [default to false]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
196
src/apis/economy_api.rs
Normal file
196
src/apis/economy_api.rs
Normal file
@ -0,0 +1,196 @@
|
||||
/*
|
||||
* VRChat API Documentation
|
||||
*
|
||||
*
|
||||
* Contact: me@ruby.js.org
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
use reqwest;
|
||||
|
||||
use crate::apis::ResponseContent;
|
||||
use super::{Error, configuration};
|
||||
|
||||
|
||||
/// struct for typed errors of method [`get_current_subscriptions`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum GetCurrentSubscriptionsError {
|
||||
Status401(crate::models::Error),
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`get_license_group`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum GetLicenseGroupError {
|
||||
Status401(crate::models::Error),
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`get_steam_transaction`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum GetSteamTransactionError {
|
||||
Status401(crate::models::Error),
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`get_steam_transactions`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum GetSteamTransactionsError {
|
||||
Status401(crate::models::Error),
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
/// struct for typed errors of method [`get_subscriptions`]
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum GetSubscriptionsError {
|
||||
Status401(crate::models::Error),
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
|
||||
|
||||
/// Get a list of all current user subscriptions.
|
||||
pub fn get_current_subscriptions(configuration: &configuration::Configuration, ) -> Result<Vec<crate::models::UserSubscription>, Error<GetCurrentSubscriptionsError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/auth/user/subscription", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let mut local_var_resp = local_var_client.execute(local_var_req)?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text()?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<GetCurrentSubscriptionsError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get a single License Group by given ID.
|
||||
pub fn get_license_group(configuration: &configuration::Configuration, license_group_id: &str) -> Result<crate::models::LicenseGroup, Error<GetLicenseGroupError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/licenseGroups/{licenseGroupId}", local_var_configuration.base_path, licenseGroupId=crate::apis::urlencode(license_group_id));
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let mut local_var_resp = local_var_client.execute(local_var_req)?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text()?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<GetLicenseGroupError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get a single Steam transactions by ID. This returns the exact same information as `getSteamTransactions`, so no point in using this endpoint.
|
||||
pub fn get_steam_transaction(configuration: &configuration::Configuration, transaction_id: &str) -> Result<crate::models::Transaction, Error<GetSteamTransactionError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/Steam/transactions/{transactionId}", local_var_configuration.base_path, transactionId=crate::apis::urlencode(transaction_id));
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let mut local_var_resp = local_var_client.execute(local_var_req)?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text()?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<GetSteamTransactionError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
||||
/// Get all own Steam transactions.
|
||||
pub fn get_steam_transactions(configuration: &configuration::Configuration, ) -> Result<Vec<crate::models::Transaction>, Error<GetSteamTransactionsError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/Steam/transactions", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let mut local_var_resp = local_var_client.execute(local_var_req)?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text()?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<GetSteamTransactionsError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
||||
/// List all existing Subscriptions. For example, \"vrchatplus-monthly\" and \"vrchatplus-yearly\".
|
||||
pub fn get_subscriptions(configuration: &configuration::Configuration, ) -> Result<Vec<crate::models::Subscription>, Error<GetSubscriptionsError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
let local_var_client = &local_var_configuration.client;
|
||||
|
||||
let local_var_uri_str = format!("{}/subscriptions", local_var_configuration.base_path);
|
||||
let mut local_var_req_builder = local_var_client.request(reqwest::Method::GET, local_var_uri_str.as_str());
|
||||
|
||||
if let Some(ref local_var_user_agent) = local_var_configuration.user_agent {
|
||||
local_var_req_builder = local_var_req_builder.header(reqwest::header::USER_AGENT, local_var_user_agent.clone());
|
||||
}
|
||||
|
||||
let local_var_req = local_var_req_builder.build()?;
|
||||
let mut local_var_resp = local_var_client.execute(local_var_req)?;
|
||||
|
||||
let local_var_status = local_var_resp.status();
|
||||
let local_var_content = local_var_resp.text()?;
|
||||
|
||||
if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
|
||||
serde_json::from_str(&local_var_content).map_err(Error::from)
|
||||
} else {
|
||||
let local_var_entity: Option<GetSubscriptionsError> = serde_json::from_str(&local_var_content).ok();
|
||||
let local_var_error = ResponseContent { status: local_var_status, content: local_var_content, entity: local_var_entity };
|
||||
Err(Error::ResponseError(local_var_error))
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ pub enum RequestInviteError {
|
||||
pub enum ResetInviteMessageError {
|
||||
Status400(crate::models::Error),
|
||||
Status401(crate::models::Error),
|
||||
Status404(crate::models::InlineResponse404),
|
||||
Status404(crate::models::Error),
|
||||
Status429(crate::models::Error),
|
||||
UnknownValue(serde_json::Value),
|
||||
}
|
||||
@ -191,7 +191,7 @@ pub fn request_invite(configuration: &configuration::Configuration, user_id: &st
|
||||
}
|
||||
}
|
||||
|
||||
/// Resets a single Invite Message back to it's original message, and then returns a list of all of them. Admin Credentials are required to update messages of other users! Resetting a message respects the rate-limit, so it is not possible to reset within the 60 minutes countdown. Resetting it does however not set the rate-limit to 60 like when editing it. It is possible to edit it right after resetting it. Trying to edit a message before the cooldown timer expires results in a 429 \"Too Fast Error\". Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite The DELETE endpoint does not have/require any request body.
|
||||
/// Resets a single Invite Message back to its original message, and then returns a list of all of them. Admin Credentials are required to update messages of other users! Resetting a message respects the rate-limit, so it is not possible to reset within the 60 minutes countdown. Resetting it does however not set the rate-limit to 60 like when editing it. It is possible to edit it right after resetting it. Trying to edit a message before the cooldown timer expires results in a 429 \"Too Fast Error\". Message type refers to a different collection of messages, used during different types of responses. * `message` = Message during a normal invite * `response` = Message when replying to a message * `request` = Message when requesting an invite * `requestResponse` = Message when replying to a request for invite The DELETE endpoint does not have/require any request body.
|
||||
pub fn reset_invite_message(configuration: &configuration::Configuration, user_id: &str, message_type: &str, slot: i32) -> Result<Vec<crate::models::InviteMessage>, Error<ResetInviteMessageError>> {
|
||||
let local_var_configuration = configuration;
|
||||
|
||||
|
@ -63,6 +63,7 @@ pub fn urlencode<T: AsRef<str>>(s: T) -> String {
|
||||
|
||||
pub mod authentication_api;
|
||||
pub mod avatars_api;
|
||||
pub mod economy_api;
|
||||
pub mod favorites_api;
|
||||
pub mod files_api;
|
||||
pub mod friends_api;
|
||||
|
@ -1,26 +0,0 @@
|
||||
/*
|
||||
* VRChat API Documentation
|
||||
*
|
||||
*
|
||||
* Contact: me@ruby.js.org
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
|
||||
pub struct InlineResponse404 {
|
||||
#[serde(rename = "error")]
|
||||
pub error: Box<crate::models::Error>,
|
||||
}
|
||||
|
||||
impl InlineResponse404 {
|
||||
pub fn new(error: crate::models::Error) -> InlineResponse404 {
|
||||
InlineResponse404 {
|
||||
error: Box::new(error),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
36
src/models/license.rs
Normal file
36
src/models/license.rs
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* VRChat API Documentation
|
||||
*
|
||||
*
|
||||
* Contact: me@ruby.js.org
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
|
||||
pub struct License {
|
||||
/// Either a AvatarID, LicenseGroupID, PermissionID or ProductID. This depends on the `forType` field.
|
||||
#[serde(rename = "forId")]
|
||||
pub for_id: String,
|
||||
#[serde(rename = "forType")]
|
||||
pub for_type: crate::models::LicenseType,
|
||||
#[serde(rename = "forName")]
|
||||
pub for_name: String,
|
||||
#[serde(rename = "forAction")]
|
||||
pub for_action: crate::models::LicenseAction,
|
||||
}
|
||||
|
||||
impl License {
|
||||
pub fn new(for_id: String, for_type: crate::models::LicenseType, for_name: String, for_action: crate::models::LicenseAction) -> License {
|
||||
License {
|
||||
for_id,
|
||||
for_type,
|
||||
for_name,
|
||||
for_action,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
37
src/models/license_action.rs
Normal file
37
src/models/license_action.rs
Normal file
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* VRChat API Documentation
|
||||
*
|
||||
*
|
||||
* Contact: me@ruby.js.org
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
///
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
|
||||
pub enum LicenseAction {
|
||||
#[serde(rename = "wear")]
|
||||
Wear,
|
||||
#[serde(rename = "have")]
|
||||
Have,
|
||||
|
||||
}
|
||||
|
||||
impl ToString for LicenseAction {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
Self::Wear => String::from("wear"),
|
||||
Self::Have => String::from("have"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for LicenseAction {
|
||||
fn default() -> LicenseAction {
|
||||
Self::Wear
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
35
src/models/license_group.rs
Normal file
35
src/models/license_group.rs
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* VRChat API Documentation
|
||||
*
|
||||
*
|
||||
* Contact: me@ruby.js.org
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
|
||||
pub struct LicenseGroup {
|
||||
#[serde(rename = "id")]
|
||||
pub id: String,
|
||||
#[serde(rename = "name")]
|
||||
pub name: String,
|
||||
#[serde(rename = "description")]
|
||||
pub description: String,
|
||||
#[serde(rename = "licenses")]
|
||||
pub licenses: Vec<crate::models::License>,
|
||||
}
|
||||
|
||||
impl LicenseGroup {
|
||||
pub fn new(id: String, name: String, description: String, licenses: Vec<crate::models::License>) -> LicenseGroup {
|
||||
LicenseGroup {
|
||||
id,
|
||||
name,
|
||||
description,
|
||||
licenses,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
43
src/models/license_type.rs
Normal file
43
src/models/license_type.rs
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* VRChat API Documentation
|
||||
*
|
||||
*
|
||||
* Contact: me@ruby.js.org
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
///
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
|
||||
pub enum LicenseType {
|
||||
#[serde(rename = "avatar")]
|
||||
Avatar,
|
||||
#[serde(rename = "licenseGroup")]
|
||||
LicenseGroup,
|
||||
#[serde(rename = "permission")]
|
||||
Permission,
|
||||
#[serde(rename = "product")]
|
||||
Product,
|
||||
|
||||
}
|
||||
|
||||
impl ToString for LicenseType {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
Self::Avatar => String::from("avatar"),
|
||||
Self::LicenseGroup => String::from("licenseGroup"),
|
||||
Self::Permission => String::from("permission"),
|
||||
Self::Product => String::from("product"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for LicenseType {
|
||||
fn default() -> LicenseType {
|
||||
Self::Avatar
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -54,8 +54,6 @@ pub mod finish_file_data_upload_request;
|
||||
pub use self::finish_file_data_upload_request::FinishFileDataUploadRequest;
|
||||
pub mod friend_status;
|
||||
pub use self::friend_status::FriendStatus;
|
||||
pub mod inline_response_404;
|
||||
pub use self::inline_response_404::InlineResponse404;
|
||||
pub mod instance;
|
||||
pub use self::instance::Instance;
|
||||
pub mod instance_platforms;
|
||||
@ -68,6 +66,14 @@ pub mod invite_request;
|
||||
pub use self::invite_request::InviteRequest;
|
||||
pub mod invite_response;
|
||||
pub use self::invite_response::InviteResponse;
|
||||
pub mod license;
|
||||
pub use self::license::License;
|
||||
pub mod license_action;
|
||||
pub use self::license_action::LicenseAction;
|
||||
pub mod license_group;
|
||||
pub use self::license_group::LicenseGroup;
|
||||
pub mod license_type;
|
||||
pub use self::license_type::LicenseType;
|
||||
pub mod limited_unity_package;
|
||||
pub use self::limited_unity_package::LimitedUnityPackage;
|
||||
pub mod limited_user;
|
||||
@ -96,8 +102,22 @@ pub mod release_status;
|
||||
pub use self::release_status::ReleaseStatus;
|
||||
pub mod response;
|
||||
pub use self::response::Response;
|
||||
pub mod subscription;
|
||||
pub use self::subscription::Subscription;
|
||||
pub mod subscription_period;
|
||||
pub use self::subscription_period::SubscriptionPeriod;
|
||||
pub mod success;
|
||||
pub use self::success::Success;
|
||||
pub mod transaction;
|
||||
pub use self::transaction::Transaction;
|
||||
pub mod transaction_agreement;
|
||||
pub use self::transaction_agreement::TransactionAgreement;
|
||||
pub mod transaction_status;
|
||||
pub use self::transaction_status::TransactionStatus;
|
||||
pub mod transaction_steam_info;
|
||||
pub use self::transaction_steam_info::TransactionSteamInfo;
|
||||
pub mod transaction_steam_wallet_info;
|
||||
pub use self::transaction_steam_wallet_info::TransactionSteamWalletInfo;
|
||||
pub mod two_factor_auth_code;
|
||||
pub use self::two_factor_auth_code::TwoFactorAuthCode;
|
||||
pub mod unity_package;
|
||||
@ -120,6 +140,8 @@ pub mod user_state;
|
||||
pub use self::user_state::UserState;
|
||||
pub mod user_status;
|
||||
pub use self::user_status::UserStatus;
|
||||
pub mod user_subscription;
|
||||
pub use self::user_subscription::UserSubscription;
|
||||
pub mod verify2_fa_result;
|
||||
pub use self::verify2_fa_result::Verify2FaResult;
|
||||
pub mod verify_auth_token_result;
|
||||
|
41
src/models/subscription.rs
Normal file
41
src/models/subscription.rs
Normal file
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* VRChat API Documentation
|
||||
*
|
||||
*
|
||||
* Contact: me@ruby.js.org
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
|
||||
pub struct Subscription {
|
||||
#[serde(rename = "id")]
|
||||
pub id: String,
|
||||
#[serde(rename = "steamItemId")]
|
||||
pub steam_item_id: String,
|
||||
#[serde(rename = "amount")]
|
||||
pub amount: f32,
|
||||
#[serde(rename = "description")]
|
||||
pub description: String,
|
||||
#[serde(rename = "period")]
|
||||
pub period: crate::models::SubscriptionPeriod,
|
||||
#[serde(rename = "tier")]
|
||||
pub tier: f32,
|
||||
}
|
||||
|
||||
impl Subscription {
|
||||
pub fn new(id: String, steam_item_id: String, amount: f32, description: String, period: crate::models::SubscriptionPeriod, tier: f32) -> Subscription {
|
||||
Subscription {
|
||||
id,
|
||||
steam_item_id,
|
||||
amount,
|
||||
description,
|
||||
period,
|
||||
tier,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
46
src/models/subscription_period.rs
Normal file
46
src/models/subscription_period.rs
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* VRChat API Documentation
|
||||
*
|
||||
*
|
||||
* Contact: me@ruby.js.org
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
///
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
|
||||
pub enum SubscriptionPeriod {
|
||||
#[serde(rename = "hour")]
|
||||
Hour,
|
||||
#[serde(rename = "day")]
|
||||
Day,
|
||||
#[serde(rename = "week")]
|
||||
Week,
|
||||
#[serde(rename = "month")]
|
||||
Month,
|
||||
#[serde(rename = "year")]
|
||||
Year,
|
||||
|
||||
}
|
||||
|
||||
impl ToString for SubscriptionPeriod {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
Self::Hour => String::from("hour"),
|
||||
Self::Day => String::from("day"),
|
||||
Self::Week => String::from("week"),
|
||||
Self::Month => String::from("month"),
|
||||
Self::Year => String::from("year"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for SubscriptionPeriod {
|
||||
fn default() -> SubscriptionPeriod {
|
||||
Self::Hour
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
50
src/models/transaction.rs
Normal file
50
src/models/transaction.rs
Normal file
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* VRChat API Documentation
|
||||
*
|
||||
*
|
||||
* Contact: me@ruby.js.org
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
|
||||
pub struct Transaction {
|
||||
#[serde(rename = "id")]
|
||||
pub id: String,
|
||||
#[serde(rename = "status")]
|
||||
pub status: crate::models::TransactionStatus,
|
||||
#[serde(rename = "subscription")]
|
||||
pub subscription: Box<crate::models::Subscription>,
|
||||
#[serde(rename = "sandbox")]
|
||||
pub sandbox: bool,
|
||||
#[serde(rename = "created_at")]
|
||||
pub created_at: String,
|
||||
#[serde(rename = "updated_at")]
|
||||
pub updated_at: String,
|
||||
#[serde(rename = "steam", skip_serializing_if = "Option::is_none")]
|
||||
pub steam: Option<Box<crate::models::TransactionSteamInfo>>,
|
||||
#[serde(rename = "agreement", skip_serializing_if = "Option::is_none")]
|
||||
pub agreement: Option<Box<crate::models::TransactionAgreement>>,
|
||||
#[serde(rename = "error")]
|
||||
pub error: String,
|
||||
}
|
||||
|
||||
impl Transaction {
|
||||
pub fn new(id: String, status: crate::models::TransactionStatus, subscription: crate::models::Subscription, sandbox: bool, created_at: String, updated_at: String, error: String) -> Transaction {
|
||||
Transaction {
|
||||
id,
|
||||
status,
|
||||
subscription: Box::new(subscription),
|
||||
sandbox,
|
||||
created_at,
|
||||
updated_at,
|
||||
steam: None,
|
||||
agreement: None,
|
||||
error,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
75
src/models/transaction_agreement.rs
Normal file
75
src/models/transaction_agreement.rs
Normal file
@ -0,0 +1,75 @@
|
||||
/*
|
||||
* VRChat API Documentation
|
||||
*
|
||||
*
|
||||
* Contact: me@ruby.js.org
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
|
||||
pub struct TransactionAgreement {
|
||||
#[serde(rename = "agreementId")]
|
||||
pub agreement_id: String,
|
||||
#[serde(rename = "itemId")]
|
||||
pub item_id: f32,
|
||||
/// This is NOT TransactionStatus, but whatever Steam return.
|
||||
#[serde(rename = "status")]
|
||||
pub status: String,
|
||||
#[serde(rename = "period")]
|
||||
pub period: String,
|
||||
#[serde(rename = "frequency")]
|
||||
pub frequency: f32,
|
||||
#[serde(rename = "billingType")]
|
||||
pub billing_type: String,
|
||||
#[serde(rename = "startDate")]
|
||||
pub start_date: String,
|
||||
#[serde(rename = "endDate")]
|
||||
pub end_date: String,
|
||||
#[serde(rename = "recurringAmt")]
|
||||
pub recurring_amt: f32,
|
||||
#[serde(rename = "currency")]
|
||||
pub currency: String,
|
||||
#[serde(rename = "timeCreated")]
|
||||
pub time_created: String,
|
||||
#[serde(rename = "nextPayment")]
|
||||
pub next_payment: String,
|
||||
#[serde(rename = "lastPayment")]
|
||||
pub last_payment: String,
|
||||
#[serde(rename = "lastAmount")]
|
||||
pub last_amount: f32,
|
||||
#[serde(rename = "lastAmountVat")]
|
||||
pub last_amount_vat: f32,
|
||||
#[serde(rename = "outstanding")]
|
||||
pub outstanding: f32,
|
||||
#[serde(rename = "failedAttempts")]
|
||||
pub failed_attempts: f32,
|
||||
}
|
||||
|
||||
impl TransactionAgreement {
|
||||
pub fn new(agreement_id: String, item_id: f32, status: String, period: String, frequency: f32, billing_type: String, start_date: String, end_date: String, recurring_amt: f32, currency: String, time_created: String, next_payment: String, last_payment: String, last_amount: f32, last_amount_vat: f32, outstanding: f32, failed_attempts: f32) -> TransactionAgreement {
|
||||
TransactionAgreement {
|
||||
agreement_id,
|
||||
item_id,
|
||||
status,
|
||||
period,
|
||||
frequency,
|
||||
billing_type,
|
||||
start_date,
|
||||
end_date,
|
||||
recurring_amt,
|
||||
currency,
|
||||
time_created,
|
||||
next_payment,
|
||||
last_payment,
|
||||
last_amount,
|
||||
last_amount_vat,
|
||||
outstanding,
|
||||
failed_attempts,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
43
src/models/transaction_status.rs
Normal file
43
src/models/transaction_status.rs
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* VRChat API Documentation
|
||||
*
|
||||
*
|
||||
* Contact: me@ruby.js.org
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
///
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
|
||||
pub enum TransactionStatus {
|
||||
#[serde(rename = "active")]
|
||||
Active,
|
||||
#[serde(rename = "failed")]
|
||||
Failed,
|
||||
#[serde(rename = "expired")]
|
||||
Expired,
|
||||
#[serde(rename = "chargeback")]
|
||||
Chargeback,
|
||||
|
||||
}
|
||||
|
||||
impl ToString for TransactionStatus {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
Self::Active => String::from("active"),
|
||||
Self::Failed => String::from("failed"),
|
||||
Self::Expired => String::from("expired"),
|
||||
Self::Chargeback => String::from("chargeback"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for TransactionStatus {
|
||||
fn default() -> TransactionStatus {
|
||||
Self::Active
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
42
src/models/transaction_steam_info.rs
Normal file
42
src/models/transaction_steam_info.rs
Normal file
@ -0,0 +1,42 @@
|
||||
/*
|
||||
* VRChat API Documentation
|
||||
*
|
||||
*
|
||||
* Contact: me@ruby.js.org
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
|
||||
pub struct TransactionSteamInfo {
|
||||
#[serde(rename = "walletInfo")]
|
||||
pub wallet_info: Box<crate::models::TransactionSteamWalletInfo>,
|
||||
/// Steam User ID
|
||||
#[serde(rename = "steamId")]
|
||||
pub steam_id: String,
|
||||
/// Steam Order ID
|
||||
#[serde(rename = "orderId")]
|
||||
pub order_id: String,
|
||||
/// Empty
|
||||
#[serde(rename = "steamUrl")]
|
||||
pub steam_url: String,
|
||||
/// Steam Transaction ID, NOT the same as VRChat TransactionID
|
||||
#[serde(rename = "transId")]
|
||||
pub trans_id: String,
|
||||
}
|
||||
|
||||
impl TransactionSteamInfo {
|
||||
pub fn new(wallet_info: crate::models::TransactionSteamWalletInfo, steam_id: String, order_id: String, steam_url: String, trans_id: String) -> TransactionSteamInfo {
|
||||
TransactionSteamInfo {
|
||||
wallet_info: Box::new(wallet_info),
|
||||
steam_id,
|
||||
order_id,
|
||||
steam_url,
|
||||
trans_id,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
35
src/models/transaction_steam_wallet_info.rs
Normal file
35
src/models/transaction_steam_wallet_info.rs
Normal file
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* VRChat API Documentation
|
||||
*
|
||||
*
|
||||
* Contact: me@ruby.js.org
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
|
||||
pub struct TransactionSteamWalletInfo {
|
||||
#[serde(rename = "state")]
|
||||
pub state: String,
|
||||
#[serde(rename = "country")]
|
||||
pub country: String,
|
||||
#[serde(rename = "currency")]
|
||||
pub currency: String,
|
||||
#[serde(rename = "status")]
|
||||
pub status: String,
|
||||
}
|
||||
|
||||
impl TransactionSteamWalletInfo {
|
||||
pub fn new(state: String, country: String, currency: String, status: String) -> TransactionSteamWalletInfo {
|
||||
TransactionSteamWalletInfo {
|
||||
state,
|
||||
country,
|
||||
currency,
|
||||
status,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
69
src/models/user_subscription.rs
Normal file
69
src/models/user_subscription.rs
Normal file
@ -0,0 +1,69 @@
|
||||
/*
|
||||
* VRChat API Documentation
|
||||
*
|
||||
*
|
||||
* Contact: me@ruby.js.org
|
||||
* Generated by: https://openapi-generator.tech
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
|
||||
pub struct UserSubscription {
|
||||
#[serde(rename = "id")]
|
||||
pub id: String,
|
||||
#[serde(rename = "transactionId")]
|
||||
pub transaction_id: String,
|
||||
/// Which \"Store\" it came from. Right now only Stores are \"Steam\" and \"Admin\".
|
||||
#[serde(rename = "store")]
|
||||
pub store: String,
|
||||
#[serde(rename = "steamItemId", skip_serializing_if = "Option::is_none")]
|
||||
pub steam_item_id: Option<String>,
|
||||
#[serde(rename = "amount")]
|
||||
pub amount: f32,
|
||||
#[serde(rename = "description")]
|
||||
pub description: String,
|
||||
#[serde(rename = "period")]
|
||||
pub period: crate::models::SubscriptionPeriod,
|
||||
#[serde(rename = "tier")]
|
||||
pub tier: f32,
|
||||
#[serde(rename = "active")]
|
||||
pub active: bool,
|
||||
#[serde(rename = "status")]
|
||||
pub status: crate::models::TransactionStatus,
|
||||
#[serde(rename = "expires")]
|
||||
pub expires: String,
|
||||
#[serde(rename = "created_at")]
|
||||
pub created_at: String,
|
||||
#[serde(rename = "updated_at")]
|
||||
pub updated_at: String,
|
||||
#[serde(rename = "licenseGroups")]
|
||||
pub license_groups: Vec<String>,
|
||||
#[serde(rename = "isGift")]
|
||||
pub is_gift: bool,
|
||||
}
|
||||
|
||||
impl UserSubscription {
|
||||
pub fn new(id: String, transaction_id: String, store: String, amount: f32, description: String, period: crate::models::SubscriptionPeriod, tier: f32, active: bool, status: crate::models::TransactionStatus, expires: String, created_at: String, updated_at: String, license_groups: Vec<String>, is_gift: bool) -> UserSubscription {
|
||||
UserSubscription {
|
||||
id,
|
||||
transaction_id,
|
||||
store,
|
||||
steam_item_id: None,
|
||||
amount,
|
||||
description,
|
||||
period,
|
||||
tier,
|
||||
active,
|
||||
status,
|
||||
expires,
|
||||
created_at,
|
||||
updated_at,
|
||||
license_groups,
|
||||
is_gift,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user