Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate latest changes from OpenApi spec #429

Merged
merged 3 commits into from
Sep 5, 2023
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ body:
id: language-version
attributes:
label: Rust version
placeholder: Our MSRV is 1.65.0
placeholder: Our MSRV is 1.68.0
validations:
required: true
- type: input
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/async-stripe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: "1.65.0"
toolchain: "1.68.0"
override: true
- uses: actions/cache@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ members = [
name = "async-stripe"
version = "0.22.2"
description = "API bindings for the Stripe HTTP API"
rust-version = "1.65.0"
rust-version = "1.68.0"
authors = [
"Anna Baldwin <[email protected]>",
"Kevin Stenerson <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ If you don't see the specific version you are on, prefer the next available vers

## MSRV

We currently have `1.65.0` pinned in CI, so any version of rustc newer than that should work.
We currently have `1.68.0` pinned in CI, so any version of rustc newer than that should work.
If this is not the case, please open an issue. As a policy, we permit MSRV increases in non-breaking releases.
If you have a compelling usecase for bumping it, we are usually open to do so, as long as
the rust version is not too new (generally 3 releases).
Expand Down
2 changes: 1 addition & 1 deletion openapi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ serde_json = "1"
anyhow = "1.0.34"
tracing = "0.1.36"
openapiv3 = "1.0.1"
indexmap = "1"
indexmap = "2"
tracing-subscriber = "0.3.15"
structopt = "0.3.26"
indoc = "1.0.7"
2 changes: 1 addition & 1 deletion openapi/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "v446"
"version": "v484"
}
1 change: 0 additions & 1 deletion src/resources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

mod currency;
pub mod generated;
mod placeholders;

Check warning on line 11 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper-rustls-webpki)

file is loaded as a module multiple times: `src/resources/placeholders.rs`

Check warning on line 11 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking-rustls-webpki)

file is loaded as a module multiple times: `src/resources/placeholders.rs`

Check warning on line 11 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper)

file is loaded as a module multiple times: `src/resources/placeholders.rs`

Check warning on line 11 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking-rustls)

file is loaded as a module multiple times: `src/resources/placeholders.rs`

Check warning on line 11 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper-rustls)

file is loaded as a module multiple times: `src/resources/placeholders.rs`

Check warning on line 11 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (blocking)

file is loaded as a module multiple times: `src/resources/placeholders.rs`

Check warning on line 11 in src/resources.rs

View workflow job for this annotation

GitHub Actions / clippy (async-std-surf)

file is loaded as a module multiple times: `src/resources/placeholders.rs`
mod types;

#[path = "resources"]
Expand Down Expand Up @@ -122,7 +122,6 @@
file_link::*,
invoice_setting_rendering_options::*,
mandate::*,
mandate_options_off_session_details_blik::*,
payment_intent::*,
payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code::*,
linked_account_options_us_bank_account::*,
Expand Down
1 change: 0 additions & 1 deletion src/resources/generated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ pub mod core {
pub mod invoice_setting_rendering_options;
pub mod linked_account_options_us_bank_account;
pub mod mandate;
pub mod mandate_options_off_session_details_blik;
pub mod payment_intent;
pub mod payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code;
pub mod payment_method_details_card_checks;
Expand Down
22 changes: 19 additions & 3 deletions src/resources/generated/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl Account {
/// Any parameters not provided are left unchanged. For Custom accounts, you can update any information on the account.
/// For other accounts, you can update all information until that account has started to go through Connect Onboarding.
/// Once you create an [Account Link](https://stripe.com/docs/api/account_links) for a Standard or Express account, some parameters can no longer be changed.
/// These are marked as **Custom Only** or **Custom and Express** below. To update your own account, use the [Dashboard](https://dashboard.stripe.com/account).
/// These are marked as **Custom Only** or **Custom and Express** below. To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account).
/// Refer to our [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts.
pub fn update(client: &Client, id: &AccountId, params: UpdateAccount<'_>) -> Response<Account> {
client.post_form(&format!("/accounts/{}", id), &params)
Expand All @@ -153,7 +153,7 @@ impl Account {
/// Accounts created using test-mode keys can be deleted at any time.
///
/// Standard accounts created using live-mode keys cannot be deleted.
/// Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/account) instead.
/// Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead.
pub fn delete(client: &Client, id: &AccountId) -> Response<Deleted<AccountId>> {
client.delete(&format!("/accounts/{}", id))
}
Expand Down Expand Up @@ -1460,7 +1460,7 @@ pub struct PersonParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub gender: Option<String>,

/// The government-issued ID number of the individual, as appropriate for the representatives country.
/// The government-issued ID number of the individual, as appropriate for the representative's country.
///
/// (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada).
/// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).
Expand Down Expand Up @@ -3820,10 +3820,12 @@ pub enum AccountRequirementsErrorCode {
InvalidStreetAddress,
InvalidTosAcceptance,
InvalidValueOther,
VerificationDirectorsMismatch,
VerificationDocumentAddressMismatch,
VerificationDocumentAddressMissing,
VerificationDocumentCorrupt,
VerificationDocumentCountryNotSupported,
VerificationDocumentDirectorsMismatch,
VerificationDocumentDobMismatch,
VerificationDocumentDuplicateType,
VerificationDocumentExpired,
Expand All @@ -3849,6 +3851,7 @@ pub enum AccountRequirementsErrorCode {
VerificationDocumentPhotoMismatch,
VerificationDocumentTooLarge,
VerificationDocumentTypeNotSupported,
VerificationExtraneousDirectors,
VerificationFailedAddressMatch,
VerificationFailedBusinessIecNumber,
VerificationFailedDocumentMatch,
Expand All @@ -3860,6 +3863,7 @@ pub enum AccountRequirementsErrorCode {
VerificationFailedResidentialAddress,
VerificationFailedTaxIdMatch,
VerificationFailedTaxIdNotIssued,
VerificationMissingDirectors,
VerificationMissingExecutives,
VerificationMissingOwners,
VerificationRequiresAdditionalMemorandumOfAssociations,
Expand All @@ -3874,10 +3878,12 @@ impl AccountRequirementsErrorCode {
AccountRequirementsErrorCode::InvalidStreetAddress => "invalid_street_address",
AccountRequirementsErrorCode::InvalidTosAcceptance => "invalid_tos_acceptance",
AccountRequirementsErrorCode::InvalidValueOther => "invalid_value_other",
AccountRequirementsErrorCode::VerificationDirectorsMismatch => "verification_directors_mismatch",
AccountRequirementsErrorCode::VerificationDocumentAddressMismatch => "verification_document_address_mismatch",
AccountRequirementsErrorCode::VerificationDocumentAddressMissing => "verification_document_address_missing",
AccountRequirementsErrorCode::VerificationDocumentCorrupt => "verification_document_corrupt",
AccountRequirementsErrorCode::VerificationDocumentCountryNotSupported => "verification_document_country_not_supported",
AccountRequirementsErrorCode::VerificationDocumentDirectorsMismatch => "verification_document_directors_mismatch",
AccountRequirementsErrorCode::VerificationDocumentDobMismatch => "verification_document_dob_mismatch",
AccountRequirementsErrorCode::VerificationDocumentDuplicateType => "verification_document_duplicate_type",
AccountRequirementsErrorCode::VerificationDocumentExpired => "verification_document_expired",
Expand All @@ -3903,6 +3909,7 @@ impl AccountRequirementsErrorCode {
AccountRequirementsErrorCode::VerificationDocumentPhotoMismatch => "verification_document_photo_mismatch",
AccountRequirementsErrorCode::VerificationDocumentTooLarge => "verification_document_too_large",
AccountRequirementsErrorCode::VerificationDocumentTypeNotSupported => "verification_document_type_not_supported",
AccountRequirementsErrorCode::VerificationExtraneousDirectors => "verification_extraneous_directors",
AccountRequirementsErrorCode::VerificationFailedAddressMatch => "verification_failed_address_match",
AccountRequirementsErrorCode::VerificationFailedBusinessIecNumber => "verification_failed_business_iec_number",
AccountRequirementsErrorCode::VerificationFailedDocumentMatch => "verification_failed_document_match",
Expand All @@ -3914,6 +3921,7 @@ impl AccountRequirementsErrorCode {
AccountRequirementsErrorCode::VerificationFailedResidentialAddress => "verification_failed_residential_address",
AccountRequirementsErrorCode::VerificationFailedTaxIdMatch => "verification_failed_tax_id_match",
AccountRequirementsErrorCode::VerificationFailedTaxIdNotIssued => "verification_failed_tax_id_not_issued",
AccountRequirementsErrorCode::VerificationMissingDirectors => "verification_missing_directors",
AccountRequirementsErrorCode::VerificationMissingExecutives => "verification_missing_executives",
AccountRequirementsErrorCode::VerificationMissingOwners => "verification_missing_owners",
AccountRequirementsErrorCode::VerificationRequiresAdditionalMemorandumOfAssociations => "verification_requires_additional_memorandum_of_associations",
Expand Down Expand Up @@ -4053,6 +4061,7 @@ pub enum CompanyParamsStructure {
GovernmentInstrumentality,
GovernmentalUnit,
IncorporatedNonProfit,
IncorporatedPartnership,
LimitedLiabilityPartnership,
Llc,
MultiMemberLlc,
Expand All @@ -4068,6 +4077,7 @@ pub enum CompanyParamsStructure {
TaxExemptGovernmentInstrumentality,
UnincorporatedAssociation,
UnincorporatedNonProfit,
UnincorporatedPartnership,
}

impl CompanyParamsStructure {
Expand All @@ -4078,6 +4088,7 @@ impl CompanyParamsStructure {
CompanyParamsStructure::GovernmentInstrumentality => "government_instrumentality",
CompanyParamsStructure::GovernmentalUnit => "governmental_unit",
CompanyParamsStructure::IncorporatedNonProfit => "incorporated_non_profit",
CompanyParamsStructure::IncorporatedPartnership => "incorporated_partnership",
CompanyParamsStructure::LimitedLiabilityPartnership => "limited_liability_partnership",
CompanyParamsStructure::Llc => "llc",
CompanyParamsStructure::MultiMemberLlc => "multi_member_llc",
Expand All @@ -4095,6 +4106,7 @@ impl CompanyParamsStructure {
}
CompanyParamsStructure::UnincorporatedAssociation => "unincorporated_association",
CompanyParamsStructure::UnincorporatedNonProfit => "unincorporated_non_profit",
CompanyParamsStructure::UnincorporatedPartnership => "unincorporated_partnership",
}
}
}
Expand Down Expand Up @@ -4125,6 +4137,7 @@ pub enum CompanyStructure {
GovernmentInstrumentality,
GovernmentalUnit,
IncorporatedNonProfit,
IncorporatedPartnership,
LimitedLiabilityPartnership,
Llc,
MultiMemberLlc,
Expand All @@ -4140,6 +4153,7 @@ pub enum CompanyStructure {
TaxExemptGovernmentInstrumentality,
UnincorporatedAssociation,
UnincorporatedNonProfit,
UnincorporatedPartnership,
}

impl CompanyStructure {
Expand All @@ -4150,6 +4164,7 @@ impl CompanyStructure {
CompanyStructure::GovernmentInstrumentality => "government_instrumentality",
CompanyStructure::GovernmentalUnit => "governmental_unit",
CompanyStructure::IncorporatedNonProfit => "incorporated_non_profit",
CompanyStructure::IncorporatedPartnership => "incorporated_partnership",
CompanyStructure::LimitedLiabilityPartnership => "limited_liability_partnership",
CompanyStructure::Llc => "llc",
CompanyStructure::MultiMemberLlc => "multi_member_llc",
Expand All @@ -4167,6 +4182,7 @@ impl CompanyStructure {
}
CompanyStructure::UnincorporatedAssociation => "unincorporated_association",
CompanyStructure::UnincorporatedNonProfit => "unincorporated_non_profit",
CompanyStructure::UnincorporatedPartnership => "unincorporated_partnership",
}
}
}
Expand Down
4 changes: 0 additions & 4 deletions src/resources/generated/account_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,13 @@ impl std::default::Default for AccountLinkCollect {
pub enum AccountLinkType {
AccountOnboarding,
AccountUpdate,
CustomAccountUpdate,
CustomAccountVerification,
}

impl AccountLinkType {
pub fn as_str(self) -> &'static str {
match self {
AccountLinkType::AccountOnboarding => "account_onboarding",
AccountLinkType::AccountUpdate => "account_update",
AccountLinkType::CustomAccountUpdate => "custom_account_update",
AccountLinkType::CustomAccountVerification => "custom_account_verification",
}
}
}
Expand Down
11 changes: 4 additions & 7 deletions src/resources/generated/balance_transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
/// Either `available` or `pending`.
pub status: BalanceTransactionStatus,

/// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
/// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
///
/// [Learn more](https://stripe.com/docs/reports/balance-transaction-types) about balance transaction types and what they represent.
/// If you are looking to classify transactions for accounting purposes, you might want to consider `reporting_category` instead.
Expand All @@ -85,7 +85,7 @@
client: &Client,
params: &ListBalanceTransactions<'_>,
) -> Response<List<BalanceTransaction>> {
client.get_query("/balance_transactions", &params)

Check warning on line 88 in src/resources/generated/balance_transaction.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper-rustls-webpki)

the borrowed expression implements the required traits

Check warning on line 88 in src/resources/generated/balance_transaction.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper)

the borrowed expression implements the required traits

Check warning on line 88 in src/resources/generated/balance_transaction.rs

View workflow job for this annotation

GitHub Actions / clippy (tokio-hyper-rustls)

the borrowed expression implements the required traits

Check warning on line 88 in src/resources/generated/balance_transaction.rs

View workflow job for this annotation

GitHub Actions / clippy (async-std-surf)

the borrowed expression implements the required traits
}

/// Retrieves the balance transaction with the given ID.
Expand Down Expand Up @@ -136,10 +136,6 @@
/// The parameters for `BalanceTransaction::list`.
#[derive(Clone, Debug, Serialize, Default)]
pub struct ListBalanceTransactions<'a> {
/// This parameter is deprecated and we recommend listing by created and filtering in memory instead.
#[serde(skip_serializing_if = "Option::is_none")]
pub available_on: Option<RangeQuery<Timestamp>>,

#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<RangeQuery<Timestamp>>,

Expand Down Expand Up @@ -184,7 +180,7 @@

/// Only returns transactions of the given type.
///
/// One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
/// One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payment_reversal`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.
#[serde(rename = "type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<&'a str>,
Expand All @@ -193,7 +189,6 @@
impl<'a> ListBalanceTransactions<'a> {
pub fn new() -> Self {
ListBalanceTransactions {
available_on: Default::default(),
created: Default::default(),
currency: Default::default(),
ending_before: Default::default(),
Expand Down Expand Up @@ -232,6 +227,7 @@
Payment,
PaymentFailureRefund,
PaymentRefund,
PaymentReversal,
Payout,
PayoutCancel,
PayoutFailure,
Expand Down Expand Up @@ -269,6 +265,7 @@
BalanceTransactionType::Payment => "payment",
BalanceTransactionType::PaymentFailureRefund => "payment_failure_refund",
BalanceTransactionType::PaymentRefund => "payment_refund",
BalanceTransactionType::PaymentReversal => "payment_reversal",
BalanceTransactionType::Payout => "payout",
BalanceTransactionType::PayoutCancel => "payout_cancel",
BalanceTransactionType::PayoutFailure => "payout_failure",
Expand Down
Loading
Loading