From 4c7172fcbba9ce971ebc2f80737f5845c6886b15 Mon Sep 17 00:00:00 2001 From: Stephen Leitnick Date: Wed, 12 Jun 2024 08:10:09 -0400 Subject: [PATCH 1/2] Finish subscription response type --- src/rbx/v2/subscription.rs | 61 +++++++++++++++++++++++++++++++++++++- 1 file changed, 60 insertions(+), 1 deletion(-) diff --git a/src/rbx/v2/subscription.rs b/src/rbx/v2/subscription.rs index 5112e8a..c3dee4e 100644 --- a/src/rbx/v2/subscription.rs +++ b/src/rbx/v2/subscription.rs @@ -33,7 +33,66 @@ pub struct GetSubscriptionParams { #[derive(Deserialize, Serialize, Debug)] #[serde(rename_all = "camelCase")] -pub struct GetSubscriptionResponse {} +pub struct GetSubscriptionResponse { + path: String, + create_time: String, + update_time: String, + active: bool, + will_renew: bool, + last_billing_time: String, + next_renew_time: String, + expire_time: String, + state: SubscriptionState, + expiration_details: SubscriptionExpirationDetails, + purchase_platform: SubscriptionPurchasePlatform, + payment_provider: SubscriptionPaymentProvider, + user: String, +} + +#[derive(Deserialize, Serialize, Debug)] +#[serde(rename_all = "camelCase")] +pub struct SubscriptionExpirationDetails { + reason: SubscriptionExpirationReason, +} + +#[derive(Deserialize, Serialize, Debug)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum SubscriptionState { + StateUnspecified, + SubscribedWillRenew, + SubscribedWillNotRenew, + SubscribedRenewalPaymentPending, + Expired, +} + +#[derive(Deserialize, Serialize, Debug)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum SubscriptionExpirationReason { + ExpirationReasonUnspecified, + ProductInactive, + ProductDeleted, + SubscriberCancelled, + SubscriberRefunded, + Lapsed, +} + +#[derive(Deserialize, Serialize, Debug)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum SubscriptionPurchasePlatform { + PurchasePlatformUnspecified, + Desktop, + Mobile, +} + +#[derive(Deserialize, Serialize, Debug)] +#[serde(rename_all = "SCREAMING_SNAKE_CASE")] +pub enum SubscriptionPaymentProvider { + PaymentProviderUnspecified, + Stripe, + Apple, + Google, + RobloxCredit, +} pub async fn get_subscription( params: &GetSubscriptionParams, From 97ed7effb8a4310dc6ecc4140d3cadd260b6ca35 Mon Sep 17 00:00:00 2001 From: Stephen Leitnick Date: Wed, 12 Jun 2024 08:12:54 -0400 Subject: [PATCH 2/2] Bump version --- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 4 ++-- docs/cli/cli-install.md | 4 ++-- docs/lib/lib-install.md | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81fd903..662647a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -660,7 +660,7 @@ dependencies = [ [[package]] name = "rbxcloud" -version = "0.12.0" +version = "0.13.0" dependencies = [ "anyhow", "base64 0.22.0", diff --git a/Cargo.toml b/Cargo.toml index 574ea46..1e2061a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "rbxcloud" -version = "0.12.0" +version = "0.13.0" description = "CLI and SDK for the Roblox Open Cloud APIs" authors = ["Stephen Leitnick"] license = "MIT" diff --git a/README.md b/README.md index fd8f4ee..934ff8a 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ The goal of this project is to support all API endpoints that Roblox provides. ### Aftman Run the `aftman add` command within your project directory. This will add `rbxcloud` to the project's `aftman.toml` file (or create one if it doesn't yet exist). ```sh -$ aftman add Sleitnick/rbxcloud@0.12.0 +$ aftman add Sleitnick/rbxcloud@0.13.0 ``` ### From Release @@ -61,7 +61,7 @@ The library built for the CLI tool is available to use directly in Rust projects To use `rbxcloud` in a Rust project, simply add `rbxcloud` to the `Cargo.toml` dependency list. ```toml [dependencies] -rbxcloud = "0.12.0" +rbxcloud = "0.13.0" ``` Alternatively, use `cargo add`. diff --git a/docs/cli/cli-install.md b/docs/cli/cli-install.md index 4149c49..b276045 100644 --- a/docs/cli/cli-install.md +++ b/docs/cli/cli-install.md @@ -7,7 +7,7 @@ There are a few different ways to install the `rbxcloud` CLI. ### [Aftman](https://github.com/LPGhatguy/aftman) (Preferred) Run the `aftman add` command within your project directory. This will add `rbxcloud` to the project's `aftman.toml` file (or create one if it doesn't yet exist). ```sh -$ aftman add Sleitnick/rbxcloud@0.12.0 +$ aftman add Sleitnick/rbxcloud@0.13.0 ``` Next, run `aftman install` to install `rbxcloud`. @@ -17,7 +17,7 @@ Add `rbxcloud` under the `[tools]` section of your `foreman.toml` file. ```toml # foreman.toml [tools] -rbxcloud = { github = "Sleitnick/rbxcloud", version = "0.12.0" } +rbxcloud = { github = "Sleitnick/rbxcloud", version = "0.13.0" } ``` Next, run `foreman install` to install `rbxcloud`. diff --git a/docs/lib/lib-install.md b/docs/lib/lib-install.md index 86d6b18..769a4c4 100644 --- a/docs/lib/lib-install.md +++ b/docs/lib/lib-install.md @@ -5,7 +5,7 @@ To use `rbxcloud` in a Rust project, simply add `rbxcloud` to the `Cargo.toml` dependency list. ```toml [dependencies] -rbxcloud = "0.12.0" +rbxcloud = "0.13.0" ``` Alternatively, use `cargo add`.