Skip to content

Commit

Permalink
generate API bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-Avery committed Mar 21, 2024
1 parent c66892b commit 89ec8c0
Show file tree
Hide file tree
Showing 12 changed files with 363 additions and 64 deletions.
4 changes: 3 additions & 1 deletion crates/bitwarden-api-api/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ src/models/organization_api_key_information_list_response_model.rs
src/models/organization_api_key_request_model.rs
src/models/organization_api_key_type.rs
src/models/organization_auto_enroll_status_response_model.rs
src/models/organization_billing_status_response_model.rs
src/models/organization_collection_management_update_request_model.rs
src/models/organization_connection_request_model.rs
src/models/organization_connection_response_model.rs
Expand All @@ -223,7 +224,6 @@ src/models/organization_keys_response_model.rs
src/models/organization_license.rs
src/models/organization_public_key_response_model.rs
src/models/organization_response_model.rs
src/models/organization_risks_subscription_failure_response_model.rs
src/models/organization_seat_request_model.rs
src/models/organization_sponsorship_create_request_model.rs
src/models/organization_sponsorship_redeem_request_model.rs
Expand Down Expand Up @@ -347,6 +347,7 @@ src/models/secret_with_projects_list_response_model.rs
src/models/secrets_manager_plan_features_response_model.rs
src/models/secrets_manager_subscribe_request_model.rs
src/models/secrets_manager_subscription_update_request_model.rs
src/models/secrets_sync_response_model.rs
src/models/secrets_with_projects_inner_secret.rs
src/models/secure_note_type.rs
src/models/selection_read_only_request_model.rs
Expand Down Expand Up @@ -379,6 +380,7 @@ src/models/sso_configuration_data_request.rs
src/models/sso_type.rs
src/models/sso_urls.rs
src/models/storage_request_model.rs
src/models/subscription_cancellation_request_model.rs
src/models/subscription_response_model.rs
src/models/sync_response_model.rs
src/models/tax_info_response_model.rs
Expand Down
10 changes: 8 additions & 2 deletions crates/bitwarden-api-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ All URIs are relative to _http://localhost_
| _AccountsApi_ | [**accounts_avatar_post**](docs/AccountsApi.md#accounts_avatar_post) | **POST** /accounts/avatar |
| _AccountsApi_ | [**accounts_avatar_put**](docs/AccountsApi.md#accounts_avatar_put) | **PUT** /accounts/avatar |
| _AccountsApi_ | [**accounts_cancel_premium_post**](docs/AccountsApi.md#accounts_cancel_premium_post) | **POST** /accounts/cancel-premium |
| _AccountsApi_ | [**accounts_churn_premium_post**](docs/AccountsApi.md#accounts_churn_premium_post) | **POST** /accounts/churn-premium |
| _AccountsApi_ | [**accounts_convert_to_key_connector_post**](docs/AccountsApi.md#accounts_convert_to_key_connector_post) | **POST** /accounts/convert-to-key-connector |
| _AccountsApi_ | [**accounts_delete**](docs/AccountsApi.md#accounts_delete) | **DELETE** /accounts |
| _AccountsApi_ | [**accounts_delete_post**](docs/AccountsApi.md#accounts_delete_post) | **POST** /accounts/delete |
Expand Down Expand Up @@ -140,6 +141,7 @@ All URIs are relative to _http://localhost_
| _CiphersApi_ | [**ciphers_id_share_put**](docs/CiphersApi.md#ciphers_id_share_put) | **PUT** /ciphers/{id}/share |
| _CiphersApi_ | [**ciphers_move_post**](docs/CiphersApi.md#ciphers_move_post) | **POST** /ciphers/move |
| _CiphersApi_ | [**ciphers_move_put**](docs/CiphersApi.md#ciphers_move_put) | **PUT** /ciphers/move |
| _CiphersApi_ | [**ciphers_organization_details_assigned_get**](docs/CiphersApi.md#ciphers_organization_details_assigned_get) | **GET** /ciphers/organization-details/assigned |
| _CiphersApi_ | [**ciphers_organization_details_get**](docs/CiphersApi.md#ciphers_organization_details_get) | **GET** /ciphers/organization-details |
| _CiphersApi_ | [**ciphers_post**](docs/CiphersApi.md#ciphers_post) | **POST** /ciphers |
| _CiphersApi_ | [**ciphers_purge_post**](docs/CiphersApi.md#ciphers_purge_post) | **POST** /ciphers/purge |
Expand Down Expand Up @@ -305,7 +307,9 @@ All URIs are relative to _http://localhost_
| _OrganizationsApi_ | [**organizations_id_api_key_information_type_get**](docs/OrganizationsApi.md#organizations_id_api_key_information_type_get) | **GET** /organizations/{id}/api-key-information/{type} |
| _OrganizationsApi_ | [**organizations_id_api_key_post**](docs/OrganizationsApi.md#organizations_id_api_key_post) | **POST** /organizations/{id}/api-key |
| _OrganizationsApi_ | [**organizations_id_billing_get**](docs/OrganizationsApi.md#organizations_id_billing_get) | **GET** /organizations/{id}/billing |
| _OrganizationsApi_ | [**organizations_id_billing_status_get**](docs/OrganizationsApi.md#organizations_id_billing_status_get) | **GET** /organizations/{id}/billing-status |
| _OrganizationsApi_ | [**organizations_id_cancel_post**](docs/OrganizationsApi.md#organizations_id_cancel_post) | **POST** /organizations/{id}/cancel |
| _OrganizationsApi_ | [**organizations_id_churn_post**](docs/OrganizationsApi.md#organizations_id_churn_post) | **POST** /organizations/{id}/churn |
| _OrganizationsApi_ | [**organizations_id_collection_management_put**](docs/OrganizationsApi.md#organizations_id_collection_management_put) | **PUT** /organizations/{id}/collection-management |
| _OrganizationsApi_ | [**organizations_id_delete**](docs/OrganizationsApi.md#organizations_id_delete) | **DELETE** /organizations/{id} |
| _OrganizationsApi_ | [**organizations_id_delete_post**](docs/OrganizationsApi.md#organizations_id_delete_post) | **POST** /organizations/{id}/delete |
Expand All @@ -321,7 +325,6 @@ All URIs are relative to _http://localhost_
| _OrganizationsApi_ | [**organizations_id_public_key_get**](docs/OrganizationsApi.md#organizations_id_public_key_get) | **GET** /organizations/{id}/public-key |
| _OrganizationsApi_ | [**organizations_id_put**](docs/OrganizationsApi.md#organizations_id_put) | **PUT** /organizations/{id} |
| _OrganizationsApi_ | [**organizations_id_reinstate_post**](docs/OrganizationsApi.md#organizations_id_reinstate_post) | **POST** /organizations/{id}/reinstate |
| _OrganizationsApi_ | [**organizations_id_risks_subscription_failure_get**](docs/OrganizationsApi.md#organizations_id_risks_subscription_failure_get) | **GET** /organizations/{id}/risks-subscription-failure |
| _OrganizationsApi_ | [**organizations_id_rotate_api_key_post**](docs/OrganizationsApi.md#organizations_id_rotate_api_key_post) | **POST** /organizations/{id}/rotate-api-key |
| _OrganizationsApi_ | [**organizations_id_seat_post**](docs/OrganizationsApi.md#organizations_id_seat_post) | **POST** /organizations/{id}/seat |
| _OrganizationsApi_ | [**organizations_id_sm_subscription_post**](docs/OrganizationsApi.md#organizations_id_sm_subscription_post) | **POST** /organizations/{id}/sm-subscription |
Expand Down Expand Up @@ -381,6 +384,7 @@ All URIs are relative to _http://localhost_
| _PushApi_ | [**push_send_post**](docs/PushApi.md#push_send_post) | **POST** /push/send |
| _SecretsApi_ | [**organizations_organization_id_secrets_get**](docs/SecretsApi.md#organizations_organization_id_secrets_get) | **GET** /organizations/{organizationId}/secrets |
| _SecretsApi_ | [**organizations_organization_id_secrets_post**](docs/SecretsApi.md#organizations_organization_id_secrets_post) | **POST** /organizations/{organizationId}/secrets |
| _SecretsApi_ | [**organizations_organization_id_secrets_sync_get**](docs/SecretsApi.md#organizations_organization_id_secrets_sync_get) | **GET** /organizations/{organizationId}/secrets/sync |
| _SecretsApi_ | [**projects_project_id_secrets_get**](docs/SecretsApi.md#projects_project_id_secrets_get) | **GET** /projects/{projectId}/secrets |
| _SecretsApi_ | [**secrets_delete_post**](docs/SecretsApi.md#secrets_delete_post) | **POST** /secrets/delete |
| _SecretsApi_ | [**secrets_get_by_ids_post**](docs/SecretsApi.md#secrets_get_by_ids_post) | **POST** /secrets/get-by-ids |
Expand Down Expand Up @@ -622,6 +626,7 @@ All URIs are relative to _http://localhost_
- [OrganizationApiKeyRequestModel](docs/OrganizationApiKeyRequestModel.md)
- [OrganizationApiKeyType](docs/OrganizationApiKeyType.md)
- [OrganizationAutoEnrollStatusResponseModel](docs/OrganizationAutoEnrollStatusResponseModel.md)
- [OrganizationBillingStatusResponseModel](docs/OrganizationBillingStatusResponseModel.md)
- [OrganizationCollectionManagementUpdateRequestModel](docs/OrganizationCollectionManagementUpdateRequestModel.md)
- [OrganizationConnectionRequestModel](docs/OrganizationConnectionRequestModel.md)
- [OrganizationConnectionResponseModel](docs/OrganizationConnectionResponseModel.md)
Expand All @@ -637,7 +642,6 @@ All URIs are relative to _http://localhost_
- [OrganizationLicense](docs/OrganizationLicense.md)
- [OrganizationPublicKeyResponseModel](docs/OrganizationPublicKeyResponseModel.md)
- [OrganizationResponseModel](docs/OrganizationResponseModel.md)
- [OrganizationRisksSubscriptionFailureResponseModel](docs/OrganizationRisksSubscriptionFailureResponseModel.md)
- [OrganizationSeatRequestModel](docs/OrganizationSeatRequestModel.md)
- [OrganizationSponsorshipCreateRequestModel](docs/OrganizationSponsorshipCreateRequestModel.md)
- [OrganizationSponsorshipRedeemRequestModel](docs/OrganizationSponsorshipRedeemRequestModel.md)
Expand Down Expand Up @@ -761,6 +765,7 @@ All URIs are relative to _http://localhost_
- [SecretsManagerPlanFeaturesResponseModel](docs/SecretsManagerPlanFeaturesResponseModel.md)
- [SecretsManagerSubscribeRequestModel](docs/SecretsManagerSubscribeRequestModel.md)
- [SecretsManagerSubscriptionUpdateRequestModel](docs/SecretsManagerSubscriptionUpdateRequestModel.md)
- [SecretsSyncResponseModel](docs/SecretsSyncResponseModel.md)
- [SecretsWithProjectsInnerSecret](docs/SecretsWithProjectsInnerSecret.md)
- [SecureNoteType](docs/SecureNoteType.md)
- [SelectionReadOnlyRequestModel](docs/SelectionReadOnlyRequestModel.md)
Expand Down Expand Up @@ -793,6 +798,7 @@ All URIs are relative to _http://localhost_
- [SsoType](docs/SsoType.md)
- [SsoUrls](docs/SsoUrls.md)
- [StorageRequestModel](docs/StorageRequestModel.md)
- [SubscriptionCancellationRequestModel](docs/SubscriptionCancellationRequestModel.md)
- [SubscriptionResponseModel](docs/SubscriptionResponseModel.md)
- [SyncResponseModel](docs/SyncResponseModel.md)
- [TaxInfoResponseModel](docs/TaxInfoResponseModel.md)
Expand Down
53 changes: 53 additions & 0 deletions crates/bitwarden-api-api/src/apis/accounts_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ pub enum AccountsCancelPremiumPostError {
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`accounts_churn_premium_post`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AccountsChurnPremiumPostError {
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`accounts_convert_to_key_connector_post`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
Expand Down Expand Up @@ -486,6 +493,52 @@ pub async fn accounts_cancel_premium_post(
}
}

pub async fn accounts_churn_premium_post(
configuration: &configuration::Configuration,
subscription_cancellation_request_model: Option<
crate::models::SubscriptionCancellationRequestModel,
>,
) -> Result<(), Error<AccountsChurnPremiumPostError>> {
let local_var_configuration = configuration;

let local_var_client = &local_var_configuration.client;

let local_var_uri_str = format!(
"{}/accounts/churn-premium",
local_var_configuration.base_path
);
let mut local_var_req_builder =
local_var_client.request(reqwest::Method::POST, 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());
}
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());
};
local_var_req_builder = local_var_req_builder.json(&subscription_cancellation_request_model);

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<AccountsChurnPremiumPostError> =
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))
}
}

pub async fn accounts_convert_to_key_connector_post(
configuration: &configuration::Configuration,
) -> Result<(), Error<AccountsConvertToKeyConnectorPostError>> {
Expand Down
Loading

0 comments on commit 89ec8c0

Please sign in to comment.