Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/bitwarden-api-api/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ src/models/auth_request_response_model.rs
src/models/auth_request_response_model_list_response_model.rs
src/models/auth_request_type.rs
src/models/auth_request_update_request_model.rs
src/models/auth_type.rs
src/models/authentication_extensions_client_inputs.rs
src/models/authentication_extensions_client_outputs.rs
src/models/authenticator_assertion_raw_response.rs
Expand Down
4 changes: 3 additions & 1 deletion crates/bitwarden-api-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ client.
- API version: latest
- Package version: 2.0.0
- Server Git commit:
[`bf5cacdfc56451ef14d9aadbbd6cbac76b7b37b8`](https://github.com/bitwarden/server/commit/bf5cacdfc56451ef14d9aadbbd6cbac76b7b37b8)
[`484a8e42dc7cdf1e3e3178b14f43193e56694e87`](https://github.com/bitwarden/server/commit/484a8e42dc7cdf1e3e3178b14f43193e56694e87)
- Generator version: 7.15.0
- Build package: `org.openapitools.codegen.languages.RustClientCodegen`

Expand All @@ -47,6 +47,7 @@ All URIs are relative to *https://api.bitwarden.com*
| _AccountBillingVNextApi_ | [**add_credit_via_bit_pay**](docs/AccountBillingVNextApi.md#account_billing_v_next_add_credit_via_bit_pay) | **POST** /account/billing/vnext/credit/bitpay |
| _AccountBillingVNextApi_ | [**create_subscription**](docs/AccountBillingVNextApi.md#account_billing_v_next_create_subscription) | **POST** /account/billing/vnext/subscription |
| _AccountBillingVNextApi_ | [**get_credit**](docs/AccountBillingVNextApi.md#account_billing_v_next_get_credit) | **GET** /account/billing/vnext/credit |
| _AccountBillingVNextApi_ | [**get_license**](docs/AccountBillingVNextApi.md#account_billing_v_next_get_license) | **GET** /account/billing/vnext/license |
| _AccountBillingVNextApi_ | [**get_payment_method**](docs/AccountBillingVNextApi.md#account_billing_v_next_get_payment_method) | **GET** /account/billing/vnext/payment-method |
| _AccountBillingVNextApi_ | [**update_payment_method**](docs/AccountBillingVNextApi.md#account_billing_v_next_update_payment_method) | **PUT** /account/billing/vnext/payment-method |
| _AccountsApi_ | [**api_key**](docs/AccountsApi.md#accounts_api_key) | **POST** /accounts/api-key |
Expand Down Expand Up @@ -528,6 +529,7 @@ All URIs are relative to *https://api.bitwarden.com*
- [AuthRequestResponseModelListResponseModel](docs/AuthRequestResponseModelListResponseModel.md)
- [AuthRequestType](docs/AuthRequestType.md)
- [AuthRequestUpdateRequestModel](docs/AuthRequestUpdateRequestModel.md)
- [AuthType](docs/AuthType.md)
- [AuthenticationExtensionsClientInputs](docs/AuthenticationExtensionsClientInputs.md)
- [AuthenticationExtensionsClientOutputs](docs/AuthenticationExtensionsClientOutputs.md)
- [AuthenticatorAssertionRawResponse](docs/AuthenticatorAssertionRawResponse.md)
Expand Down
321 changes: 321 additions & 0 deletions crates/bitwarden-api-api/src/apis/account_billing_v_next_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,57 @@ pub trait AccountBillingVNextApi: Send + Sync {
verify_devices: Option<bool>,
) -> Result<(), Error<GetCreditError>>;

/// GET /account/billing/vnext/license
async fn get_license<'a>(
&self,
email: &'a str,
security_stamp: &'a str,
api_key: &'a str,
id: Option<uuid::Uuid>,
name: Option<&'a str>,
email_verified: Option<bool>,
master_password: Option<&'a str>,
master_password_hint: Option<&'a str>,
culture: Option<&'a str>,
two_factor_providers: Option<&'a str>,
two_factor_recovery_code: Option<&'a str>,
equivalent_domains: Option<&'a str>,
excluded_global_equivalent_domains: Option<&'a str>,
account_revision_date: Option<String>,
key: Option<&'a str>,
public_key: Option<&'a str>,
private_key: Option<&'a str>,
signed_public_key: Option<&'a str>,
security_version: Option<i32>,
security_state: Option<&'a str>,
premium: Option<bool>,
premium_expiration_date: Option<String>,
renewal_reminder_date: Option<String>,
storage: Option<i64>,
max_storage_gb: Option<i32>,
gateway: Option<models::GatewayType>,
gateway_customer_id: Option<&'a str>,
gateway_subscription_id: Option<&'a str>,
reference_data: Option<&'a str>,
license_key: Option<&'a str>,
kdf: Option<models::KdfType>,
kdf_iterations: Option<i32>,
kdf_memory: Option<i32>,
kdf_parallelism: Option<i32>,
creation_date: Option<String>,
revision_date: Option<String>,
force_password_reset: Option<bool>,
uses_key_connector: Option<bool>,
failed_login_count: Option<i32>,
last_failed_login_date: Option<String>,
avatar_color: Option<&'a str>,
last_password_change_date: Option<String>,
last_kdf_change_date: Option<String>,
last_key_rotation_date: Option<String>,
last_email_change_date: Option<String>,
verify_devices: Option<bool>,
) -> Result<(), Error<GetLicenseError>>;

/// GET /account/billing/vnext/payment-method
async fn get_payment_method<'a>(
&self,
Expand Down Expand Up @@ -1099,6 +1150,270 @@ impl AccountBillingVNextApi for AccountBillingVNextApiClient {
}
}

async fn get_license<'a>(
&self,
email: &'a str,
security_stamp: &'a str,
api_key: &'a str,
id: Option<uuid::Uuid>,
name: Option<&'a str>,
email_verified: Option<bool>,
master_password: Option<&'a str>,
master_password_hint: Option<&'a str>,
culture: Option<&'a str>,
two_factor_providers: Option<&'a str>,
two_factor_recovery_code: Option<&'a str>,
equivalent_domains: Option<&'a str>,
excluded_global_equivalent_domains: Option<&'a str>,
account_revision_date: Option<String>,
key: Option<&'a str>,
public_key: Option<&'a str>,
private_key: Option<&'a str>,
signed_public_key: Option<&'a str>,
security_version: Option<i32>,
security_state: Option<&'a str>,
premium: Option<bool>,
premium_expiration_date: Option<String>,
renewal_reminder_date: Option<String>,
storage: Option<i64>,
max_storage_gb: Option<i32>,
gateway: Option<models::GatewayType>,
gateway_customer_id: Option<&'a str>,
gateway_subscription_id: Option<&'a str>,
reference_data: Option<&'a str>,
license_key: Option<&'a str>,
kdf: Option<models::KdfType>,
kdf_iterations: Option<i32>,
kdf_memory: Option<i32>,
kdf_parallelism: Option<i32>,
creation_date: Option<String>,
revision_date: Option<String>,
force_password_reset: Option<bool>,
uses_key_connector: Option<bool>,
failed_login_count: Option<i32>,
last_failed_login_date: Option<String>,
avatar_color: Option<&'a str>,
last_password_change_date: Option<String>,
last_kdf_change_date: Option<String>,
last_key_rotation_date: Option<String>,
last_email_change_date: Option<String>,
verify_devices: Option<bool>,
) -> Result<(), Error<GetLicenseError>> {
let local_var_configuration = &self.configuration;

let local_var_client = &local_var_configuration.client;

let local_var_uri_str = format!(
"{}/account/billing/vnext/license",
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 param_value) = id {
local_var_req_builder =
local_var_req_builder.query(&[("id", &param_value.to_string())]);
}
if let Some(ref param_value) = name {
local_var_req_builder =
local_var_req_builder.query(&[("name", &param_value.to_string())]);
}
local_var_req_builder = local_var_req_builder.query(&[("email", &email.to_string())]);
if let Some(ref param_value) = email_verified {
local_var_req_builder =
local_var_req_builder.query(&[("emailVerified", &param_value.to_string())]);
}
if let Some(ref param_value) = master_password {
local_var_req_builder =
local_var_req_builder.query(&[("masterPassword", &param_value.to_string())]);
}
if let Some(ref param_value) = master_password_hint {
local_var_req_builder =
local_var_req_builder.query(&[("masterPasswordHint", &param_value.to_string())]);
}
if let Some(ref param_value) = culture {
local_var_req_builder =
local_var_req_builder.query(&[("culture", &param_value.to_string())]);
}
local_var_req_builder =
local_var_req_builder.query(&[("securityStamp", &security_stamp.to_string())]);
if let Some(ref param_value) = two_factor_providers {
local_var_req_builder =
local_var_req_builder.query(&[("twoFactorProviders", &param_value.to_string())]);
}
if let Some(ref param_value) = two_factor_recovery_code {
local_var_req_builder =
local_var_req_builder.query(&[("twoFactorRecoveryCode", &param_value.to_string())]);
}
if let Some(ref param_value) = equivalent_domains {
local_var_req_builder =
local_var_req_builder.query(&[("equivalentDomains", &param_value.to_string())]);
}
if let Some(ref param_value) = excluded_global_equivalent_domains {
local_var_req_builder = local_var_req_builder
.query(&[("excludedGlobalEquivalentDomains", &param_value.to_string())]);
}
if let Some(ref param_value) = account_revision_date {
local_var_req_builder =
local_var_req_builder.query(&[("accountRevisionDate", &param_value.to_string())]);
}
if let Some(ref param_value) = key {
local_var_req_builder =
local_var_req_builder.query(&[("key", &param_value.to_string())]);
}
if let Some(ref param_value) = public_key {
local_var_req_builder =
local_var_req_builder.query(&[("publicKey", &param_value.to_string())]);
}
if let Some(ref param_value) = private_key {
local_var_req_builder =
local_var_req_builder.query(&[("privateKey", &param_value.to_string())]);
}
if let Some(ref param_value) = signed_public_key {
local_var_req_builder =
local_var_req_builder.query(&[("signedPublicKey", &param_value.to_string())]);
}
if let Some(ref param_value) = security_version {
local_var_req_builder =
local_var_req_builder.query(&[("securityVersion", &param_value.to_string())]);
}
if let Some(ref param_value) = security_state {
local_var_req_builder =
local_var_req_builder.query(&[("securityState", &param_value.to_string())]);
}
if let Some(ref param_value) = premium {
local_var_req_builder =
local_var_req_builder.query(&[("premium", &param_value.to_string())]);
}
if let Some(ref param_value) = premium_expiration_date {
local_var_req_builder =
local_var_req_builder.query(&[("premiumExpirationDate", &param_value.to_string())]);
}
if let Some(ref param_value) = renewal_reminder_date {
local_var_req_builder =
local_var_req_builder.query(&[("renewalReminderDate", &param_value.to_string())]);
}
if let Some(ref param_value) = storage {
local_var_req_builder =
local_var_req_builder.query(&[("storage", &param_value.to_string())]);
}
if let Some(ref param_value) = max_storage_gb {
local_var_req_builder =
local_var_req_builder.query(&[("maxStorageGb", &param_value.to_string())]);
}
if let Some(ref param_value) = gateway {
local_var_req_builder =
local_var_req_builder.query(&[("gateway", &param_value.to_string())]);
}
if let Some(ref param_value) = gateway_customer_id {
local_var_req_builder =
local_var_req_builder.query(&[("gatewayCustomerId", &param_value.to_string())]);
}
if let Some(ref param_value) = gateway_subscription_id {
local_var_req_builder =
local_var_req_builder.query(&[("gatewaySubscriptionId", &param_value.to_string())]);
}
if let Some(ref param_value) = reference_data {
local_var_req_builder =
local_var_req_builder.query(&[("referenceData", &param_value.to_string())]);
}
if let Some(ref param_value) = license_key {
local_var_req_builder =
local_var_req_builder.query(&[("licenseKey", &param_value.to_string())]);
}
local_var_req_builder = local_var_req_builder.query(&[("apiKey", &api_key.to_string())]);
if let Some(ref param_value) = kdf {
local_var_req_builder =
local_var_req_builder.query(&[("kdf", &param_value.to_string())]);
}
if let Some(ref param_value) = kdf_iterations {
local_var_req_builder =
local_var_req_builder.query(&[("kdfIterations", &param_value.to_string())]);
}
if let Some(ref param_value) = kdf_memory {
local_var_req_builder =
local_var_req_builder.query(&[("kdfMemory", &param_value.to_string())]);
}
if let Some(ref param_value) = kdf_parallelism {
local_var_req_builder =
local_var_req_builder.query(&[("kdfParallelism", &param_value.to_string())]);
}
if let Some(ref param_value) = creation_date {
local_var_req_builder =
local_var_req_builder.query(&[("creationDate", &param_value.to_string())]);
}
if let Some(ref param_value) = revision_date {
local_var_req_builder =
local_var_req_builder.query(&[("revisionDate", &param_value.to_string())]);
}
if let Some(ref param_value) = force_password_reset {
local_var_req_builder =
local_var_req_builder.query(&[("forcePasswordReset", &param_value.to_string())]);
}
if let Some(ref param_value) = uses_key_connector {
local_var_req_builder =
local_var_req_builder.query(&[("usesKeyConnector", &param_value.to_string())]);
}
if let Some(ref param_value) = failed_login_count {
local_var_req_builder =
local_var_req_builder.query(&[("failedLoginCount", &param_value.to_string())]);
}
if let Some(ref param_value) = last_failed_login_date {
local_var_req_builder =
local_var_req_builder.query(&[("lastFailedLoginDate", &param_value.to_string())]);
}
if let Some(ref param_value) = avatar_color {
local_var_req_builder =
local_var_req_builder.query(&[("avatarColor", &param_value.to_string())]);
}
if let Some(ref param_value) = last_password_change_date {
local_var_req_builder = local_var_req_builder
.query(&[("lastPasswordChangeDate", &param_value.to_string())]);
}
if let Some(ref param_value) = last_kdf_change_date {
local_var_req_builder =
local_var_req_builder.query(&[("lastKdfChangeDate", &param_value.to_string())]);
}
if let Some(ref param_value) = last_key_rotation_date {
local_var_req_builder =
local_var_req_builder.query(&[("lastKeyRotationDate", &param_value.to_string())]);
}
if let Some(ref param_value) = last_email_change_date {
local_var_req_builder =
local_var_req_builder.query(&[("lastEmailChangeDate", &param_value.to_string())]);
}
if let Some(ref param_value) = verify_devices {
local_var_req_builder =
local_var_req_builder.query(&[("verifyDevices", &param_value.to_string())]);
}
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());
}
if let Some(ref local_var_token) = local_var_configuration.oauth_access_token {
local_var_req_builder = local_var_req_builder.bearer_auth(local_var_token.to_owned());
};

let local_var_req = local_var_req_builder.build()?;
let local_var_resp = local_var_client.execute(local_var_req).await?;

let local_var_status = local_var_resp.status();
let local_var_content = local_var_resp.text().await?;

if !local_var_status.is_client_error() && !local_var_status.is_server_error() {
Ok(())
} else {
let local_var_entity: Option<GetLicenseError> =
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))
}
}

async fn get_payment_method<'a>(
&self,
email: &'a str,
Expand Down Expand Up @@ -1648,6 +1963,12 @@ pub enum CreateSubscriptionError {
pub enum GetCreditError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`AccountBillingVNextApi::get_license`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetLicenseError {
UnknownValue(serde_json::Value),
}
/// struct for typed errors of method [`AccountBillingVNextApi::get_payment_method`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
Expand Down
Loading
Loading