Skip to content

Commit 32a8d8a

Browse files
Update API to 1274fe656234f06507f9af73927fa9ff7982438b (#561)
Updates the API bindings to `1274fe656234f06507f9af73927fa9ff7982438b` Co-authored-by: bw-ghapp[bot] <178206702+bw-ghapp[bot]@users.noreply.github.com>
1 parent 9574dcc commit 32a8d8a

File tree

7 files changed

+44
-11
lines changed

7 files changed

+44
-11
lines changed

crates/bitwarden-api-api/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ client.
1212
- API version: latest
1313
- Package version: 1.0.0
1414
- Server Git commit:
15-
[`d1fecc2a0f96eef119f536c8488323e088f99d44`](https://github.com/bitwarden/server/commit/d1fecc2a0f96eef119f536c8488323e088f99d44)
15+
[`1274fe656234f06507f9af73927fa9ff7982438b`](https://github.com/bitwarden/server/commit/1274fe656234f06507f9af73927fa9ff7982438b)
1616
- Generator version: 7.15.0
1717
- Build package: `org.openapitools.codegen.languages.RustClientCodegen`
1818

crates/bitwarden-api-api/src/apis/policies_api.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub trait PoliciesApi: Send + Sync {
6666
async fn put_v_next<'a>(
6767
&self,
6868
org_id: uuid::Uuid,
69-
r#type: &'a str,
69+
r#type: models::PolicyType,
7070
save_policy_request: Option<models::SavePolicyRequest>,
7171
) -> Result<models::PolicyResponseModel, Error<PutVNextError>>;
7272
}
@@ -406,14 +406,14 @@ impl PoliciesApi for PoliciesApiClient {
406406
async fn put_v_next<'a>(
407407
&self,
408408
org_id: uuid::Uuid,
409-
r#type: &'a str,
409+
r#type: models::PolicyType,
410410
save_policy_request: Option<models::SavePolicyRequest>,
411411
) -> Result<models::PolicyResponseModel, Error<PutVNextError>> {
412412
let local_var_configuration = &self.configuration;
413413

414414
let local_var_client = &local_var_configuration.client;
415415

416-
let local_var_uri_str = format!("{}/organizations/{orgId}/policies/{type}/vnext", local_var_configuration.base_path, orgId=org_id, type=crate::apis::urlencode(r#type));
416+
let local_var_uri_str = format!("{}/organizations/{orgId}/policies/{type}/vnext", local_var_configuration.base_path, orgId=org_id, type=r#type.to_string());
417417
let mut local_var_req_builder =
418418
local_var_client.request(reqwest::Method::PUT, local_var_uri_str.as_str());
419419

crates/bitwarden-api-api/src/models/billing_customer_discount.rs

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,47 @@ use serde::{Deserialize, Serialize};
1212

1313
use crate::models;
1414

15+
/// BillingCustomerDiscount : Customer discount information from Stripe billing.
1516
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
1617
pub struct BillingCustomerDiscount {
18+
/// The Stripe coupon ID (e.g., \"cm3nHfO1\").
1719
#[serde(rename = "id", alias = "Id", skip_serializing_if = "Option::is_none")]
1820
pub id: Option<String>,
21+
/// Whether the discount is a recurring/perpetual discount with no expiration date. This
22+
/// property is true only when the discount has no end date, meaning it applies indefinitely to
23+
/// all future renewals. This is a product decision for Milestone 2 to only display perpetual
24+
/// discounts in the UI. Note: This does NOT indicate whether the discount is \"currently
25+
/// active\" in the billing sense. A discount with a future end date is functionally active and
26+
/// will be applied by Stripe, but this property will be false because it has an expiration
27+
/// date.
1928
#[serde(
2029
rename = "active",
2130
alias = "Active",
2231
skip_serializing_if = "Option::is_none"
2332
)]
2433
pub active: Option<bool>,
34+
/// Percentage discount applied to the subscription (e.g., 20.0 for 20% off). Null if this is
35+
/// an amount-based discount.
2536
#[serde(
2637
rename = "percentOff",
2738
alias = "PercentOff",
2839
skip_serializing_if = "Option::is_none"
2940
)]
3041
pub percent_off: Option<f64>,
42+
/// Fixed amount discount in USD (e.g., 14.00 for $14 off). Converted from Stripe's cent-based
43+
/// values (1400 cents → $14.00). Null if this is a percentage-based discount. Note: Stripe
44+
/// stores amounts in the smallest currency unit. This value is always in USD.
45+
#[serde(
46+
rename = "amountOff",
47+
alias = "AmountOff",
48+
skip_serializing_if = "Option::is_none"
49+
)]
50+
pub amount_off: Option<f64>,
51+
/// List of Stripe product IDs that this discount applies to (e.g., [\"prod_premium\",
52+
/// \"prod_families\"]). Null: discount applies to all products with no restrictions
53+
/// (AppliesTo not specified in Stripe). Empty list: discount restricted to zero products (edge
54+
/// case - AppliesTo.Products = [] in Stripe). Non-empty list: discount applies only to the
55+
/// specified product IDs.
3156
#[serde(
3257
rename = "appliesTo",
3358
alias = "AppliesTo",
@@ -37,11 +62,13 @@ pub struct BillingCustomerDiscount {
3762
}
3863

3964
impl BillingCustomerDiscount {
65+
/// Customer discount information from Stripe billing.
4066
pub fn new() -> BillingCustomerDiscount {
4167
BillingCustomerDiscount {
4268
id: None,
4369
active: None,
4470
percent_off: None,
71+
amount_off: None,
4572
applies_to: None,
4673
}
4774
}

crates/bitwarden-api-api/src/models/plan_type.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub enum PlanType {
2525
EnterpriseMonthly2019 = 4,
2626
EnterpriseAnnually2019 = 5,
2727
Custom = 6,
28-
FamiliesAnnually = 7,
28+
FamiliesAnnually2025 = 7,
2929
TeamsMonthly2020 = 8,
3030
TeamsAnnually2020 = 9,
3131
EnterpriseMonthly2020 = 10,
@@ -40,6 +40,7 @@ pub enum PlanType {
4040
EnterpriseMonthly = 19,
4141
EnterpriseAnnually = 20,
4242
TeamsStarter = 21,
43+
FamiliesAnnually = 22,
4344
}
4445

4546
impl std::fmt::Display for PlanType {
@@ -55,7 +56,7 @@ impl std::fmt::Display for PlanType {
5556
Self::EnterpriseMonthly2019 => "4",
5657
Self::EnterpriseAnnually2019 => "5",
5758
Self::Custom => "6",
58-
Self::FamiliesAnnually => "7",
59+
Self::FamiliesAnnually2025 => "7",
5960
Self::TeamsMonthly2020 => "8",
6061
Self::TeamsAnnually2020 => "9",
6162
Self::EnterpriseMonthly2020 => "10",
@@ -70,6 +71,7 @@ impl std::fmt::Display for PlanType {
7071
Self::EnterpriseMonthly => "19",
7172
Self::EnterpriseAnnually => "20",
7273
Self::TeamsStarter => "21",
74+
Self::FamiliesAnnually => "22",
7375
}
7476
)
7577
}

crates/bitwarden-api-api/src/models/policy_request_model.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ use crate::models;
1414

1515
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
1616
pub struct PolicyRequestModel {
17-
#[serde(rename = "type", alias = "R#type")]
18-
pub r#type: models::PolicyType,
1917
#[serde(rename = "enabled", alias = "Enabled")]
2018
pub enabled: bool,
2119
#[serde(
@@ -27,9 +25,8 @@ pub struct PolicyRequestModel {
2725
}
2826

2927
impl PolicyRequestModel {
30-
pub fn new(r#type: models::PolicyType, enabled: bool) -> PolicyRequestModel {
28+
pub fn new(enabled: bool) -> PolicyRequestModel {
3129
PolicyRequestModel {
32-
r#type,
3330
enabled,
3431
data: None,
3532
}

crates/bitwarden-api-api/src/models/subscription_response_model.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ pub struct SubscriptionResponseModel {
5050
skip_serializing_if = "Option::is_none"
5151
)]
5252
pub subscription: Option<Box<models::BillingSubscription>>,
53+
#[serde(
54+
rename = "customerDiscount",
55+
alias = "CustomerDiscount",
56+
skip_serializing_if = "Option::is_none"
57+
)]
58+
pub customer_discount: Option<Box<models::BillingCustomerDiscount>>,
5359
#[serde(
5460
rename = "license",
5561
alias = "License",
@@ -73,6 +79,7 @@ impl SubscriptionResponseModel {
7379
max_storage_gb: None,
7480
upcoming_invoice: None,
7581
subscription: None,
82+
customer_discount: None,
7683
license: None,
7784
expiration: None,
7885
}

crates/bitwarden-api-identity/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ client.
1212
- API version: v1
1313
- Package version: 1.0.0
1414
- Server Git commit:
15-
[`d1fecc2a0f96eef119f536c8488323e088f99d44`](https://github.com/bitwarden/server/commit/d1fecc2a0f96eef119f536c8488323e088f99d44)
15+
[`1274fe656234f06507f9af73927fa9ff7982438b`](https://github.com/bitwarden/server/commit/1274fe656234f06507f9af73927fa9ff7982438b)
1616
- Generator version: 7.15.0
1717
- Build package: `org.openapitools.codegen.languages.RustClientCodegen`
1818

0 commit comments

Comments
 (0)