From 25077cb6eb070120db7e8a05c163f15c5e1bda89 Mon Sep 17 00:00:00 2001 From: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sat, 25 Nov 2023 13:49:41 -0500 Subject: [PATCH] Stripe client changes + core types crate --- Cargo.toml | 196 +- async-stripe/Cargo.toml | 105 + build.rs => async-stripe/build.rs | 0 .../src}/client/base/async_std.rs | 20 +- .../src}/client/base/tokio.rs | 60 +- .../src}/client/base/tokio_blocking.rs | 12 +- {src => async-stripe/src}/client/mod.rs | 6 +- .../src}/client/request_strategy.rs | 0 {src => async-stripe/src}/client/stripe.rs | 65 +- async-stripe/src/error.rs | 32 + {src => async-stripe/src}/lib.rs | 13 +- async-stripe/src/pagination.rs | 155 + .../src/resources/generated/account.rs | 0 .../src/resources/generated/account_link.rs | 0 .../resources/generated/account_session.rs | 0 .../src/resources/generated/address.rs | 0 .../src/resources/generated/api_errors.rs | 0 .../resources/generated/apple_pay_domain.rs | 0 .../src/resources/generated/application.rs | 0 .../resources/generated/application_fee.rs | 0 .../src/resources/generated/apps_secret.rs | 0 .../src/resources/generated/balance.rs | 0 .../generated/balance_transaction.rs | 0 .../src/resources/generated/bank_account.rs | 0 ...bank_connections_resource_accountholder.rs | 0 .../resources/generated/billing_details.rs | 0 .../generated/billing_portal_configuration.rs | 0 .../generated/billing_portal_session.rs | 0 .../src/resources/generated/capability.rs | 0 async-stripe/src/resources/generated/card.rs | 0 .../src/resources/generated/cash_balance.rs | 0 .../src/resources/generated/charge.rs | 0 .../resources/generated/checkout_session.rs | 0 .../generated/connect_collection_transfer.rs | 0 .../src/resources/generated/country_spec.rs | 0 .../src/resources/generated/coupon.rs | 0 .../src/resources/generated/credit_note.rs | 0 .../generated/credit_note_line_item.rs | 0 .../resources/generated/custom_unit_amount.rs | 0 .../src/resources/generated/customer.rs | 0 .../generated/customer_balance_transaction.rs | 0 .../customer_cash_balance_transaction.rs | 0 .../src/resources/generated/discount.rs | 0 .../src/resources/generated/dispute.rs | 0 .../src/resources/generated/ephemeral_key.rs | 0 async-stripe/src/resources/generated/event.rs | 0 .../src/resources/generated/exchange_rate.rs | 0 .../src/resources/generated/fee_refund.rs | 0 async-stripe/src/resources/generated/file.rs | 0 .../src/resources/generated/file_link.rs | 0 .../financial_connections_account.rs | 0 .../financial_connections_account_owner.rs | 0 ...financial_connections_account_ownership.rs | 0 .../financial_connections_session.rs | 0 .../generated/funding_instructions.rs | 0 .../generated/identity_verification_report.rs | 0 .../identity_verification_session.rs | 0 .../src/resources/generated/invoice.rs | 0 ...voice_payment_method_options_acss_debit.rs | 0 ...voice_payment_method_options_bancontact.rs | 0 ...payment_method_options_customer_balance.rs | 0 .../invoice_payment_method_options_konbini.rs | 0 ..._payment_method_options_us_bank_account.rs | 0 .../invoice_setting_rendering_options.rs | 0 .../src/resources/generated/invoiceitem.rs | 0 .../generated/invoices_shipping_cost.rs | 0 .../generated/issuing_authorization.rs | 0 .../issuing_authorization_amount_details.rs | 0 .../issuing_authorization_merchant_data.rs | 0 .../src/resources/generated/issuing_card.rs | 0 .../resources/generated/issuing_cardholder.rs | 0 .../resources/generated/issuing_dispute.rs | 0 .../generated/issuing_transaction.rs | 0 async-stripe/src/resources/generated/item.rs | 0 .../generated/legal_entity_japan_address.rs | 0 .../src/resources/generated/line_item.rs | 0 .../linked_account_options_us_bank_account.rs | 0 .../src/resources/generated/login_link.rs | 0 .../src/resources/generated/mandate.rs | 0 .../generated/notification_event_data.rs | 0 .../src/resources/generated/payment_intent.rs | 0 ...happ_handle_redirect_or_display_qr_code.rs | 0 .../src/resources/generated/payment_link.rs | 0 .../src/resources/generated/payment_method.rs | 0 .../payment_method_card_present_networks.rs | 0 ...iz_payment_method_configuration_details.rs | 0 .../generated/payment_method_configuration.rs | 0 .../payment_method_details_card_checks.rs | 0 ...t_method_details_card_installments_plan.rs | 0 ...nt_method_details_card_wallet_apple_pay.rs | 0 ...t_method_details_card_wallet_google_pay.rs | 0 .../generated/payment_method_domain.rs | 0 ...ptions_customer_balance_eu_bank_account.rs | 0 .../src/resources/generated/payout.rs | 0 .../src/resources/generated/person.rs | 0 .../src/resources/generated/placeholders.rs | 0 async-stripe/src/resources/generated/plan.rs | 0 .../resources/generated/platform_tax_fee.rs | 0 async-stripe/src/resources/generated/price.rs | 0 .../src/resources/generated/product.rs | 0 .../src/resources/generated/promotion_code.rs | 0 async-stripe/src/resources/generated/quote.rs | 0 .../quotes_resource_total_details.rs | 0 .../generated/radar_early_fraud_warning.rs | 0 .../generated/radar_radar_options.rs | 0 .../resources/generated/radar_value_list.rs | 0 .../generated/radar_value_list_item.rs | 0 .../src/resources/generated/refund.rs | 0 .../generated/reporting_report_run.rs | 0 .../generated/reporting_report_type.rs | 0 .../generated/reserve_transaction.rs | 0 .../src/resources/generated/review.rs | 0 .../generated/scheduled_query_run.rs | 0 .../src/resources/generated/setup_attempt.rs | 0 .../src/resources/generated/setup_intent.rs | 0 .../src/resources/generated/shipping.rs | 0 .../src/resources/generated/shipping_rate.rs | 0 .../src/resources/generated/source.rs | 0 .../generated/source_mandate_notification.rs | 0 .../resources/generated/source_transaction.rs | 0 .../src/resources/generated/subscription.rs | 0 .../subscription_billing_thresholds.rs | 0 .../resources/generated/subscription_item.rs | 0 .../subscription_item_billing_thresholds.rs | 0 .../generated/subscription_schedule.rs | 0 .../generated/subscription_transfer_data.rs | 0 .../resources/generated/tax_calculation.rs | 0 .../generated/tax_calculation_line_item.rs | 0 .../src/resources/generated/tax_code.rs | 0 .../generated/tax_deducted_at_source.rs | 0 .../src/resources/generated/tax_id.rs | 0 .../tax_product_resource_customer_details.rs | 0 .../src/resources/generated/tax_rate.rs | 0 .../src/resources/generated/tax_settings.rs | 0 .../resources/generated/tax_transaction.rs | 0 .../generated/tax_transaction_line_item.rs | 0 .../generated/terminal_configuration.rs | 0 .../generated/terminal_connection_token.rs | 0 .../resources/generated/terminal_location.rs | 0 .../resources/generated/terminal_reader.rs | 0 .../generated/test_helpers_test_clock.rs | 0 async-stripe/src/resources/generated/token.rs | 0 async-stripe/src/resources/generated/topup.rs | 0 .../src/resources/generated/transfer.rs | 0 .../resources/generated/transfer_reversal.rs | 0 .../generated/treasury_credit_reversal.rs | 0 .../generated/treasury_debit_reversal.rs | 0 .../generated/treasury_financial_account.rs | 0 .../treasury_financial_account_features.rs | 0 ...l_accounts_resource_ach_toggle_settings.rs | 0 ...ncial_accounts_resource_toggle_settings.rs | 0 .../generated/treasury_inbound_transfer.rs | 0 .../generated/treasury_outbound_payment.rs | 0 .../generated/treasury_outbound_transfer.rs | 0 .../generated/treasury_received_credit.rs | 0 .../generated/treasury_received_debit.rs | 0 ...reasury_shared_resource_billing_details.rs | 0 ...tails_initiating_payment_method_details.rs | 0 .../generated/treasury_transaction.rs | 0 .../generated/treasury_transaction_entry.rs | 0 ...ry_transactions_resource_balance_impact.rs | 0 ...sury_transactions_resource_flow_details.rs | 0 .../src/resources/generated/usage_record.rs | 0 .../generated/usage_record_summary.rs | 0 .../src/resources/generated/version.rs | 0 .../resources/generated/webhook_endpoint.rs | 0 async-stripe/src/resources/types.rs | 0 .../src/resources/usage_record_ext.rs | 0 .../src/resources/webhook_endpoint_ext.rs | 0 .../src}/resources/webhook_events.rs | 0 src/error.rs | 215 - src/ids.rs | 757 - src/params.rs | 694 - src/resources.rs | 356 - src/resources/account_ext.rs | 15 - src/resources/balance_ext.rs | 15 - src/resources/balance_transaction_ext.rs | 159 - src/resources/bank_account_ext.rs | 36 - src/resources/card.rs | 55 - src/resources/charge_ext.rs | 80 - src/resources/checkout_session_ext.rs | 24 - src/resources/credit_note_ext.rs | 12 - .../customer_balance_transaction_ext.rs | 137 - src/resources/customer_ext.rs | 183 - src/resources/generated.rs | 168 - src/resources/generated/account.rs | 4321 ----- src/resources/generated/account_link.rs | 157 - src/resources/generated/account_session.rs | 104 - src/resources/generated/address.rs | 27 - src/resources/generated/api_errors.rs | 491 - src/resources/generated/apple_pay_domain.rs | 41 - src/resources/generated/application.rs | 32 - src/resources/generated/application_fee.rs | 150 - src/resources/generated/apps_secret.rs | 93 - src/resources/generated/balance.rs | 83 - .../generated/balance_transaction.rs | 312 - src/resources/generated/bank_account.rs | 324 - ...bank_connections_resource_accountholder.rs | 62 - src/resources/generated/billing_details.rs | 23 - .../generated/billing_portal_configuration.rs | 418 - .../generated/billing_portal_session.rs | 729 - src/resources/generated/capability.rs | 331 - src/resources/generated/card.rs | 216 - src/resources/generated/cash_balance.rs | 78 - src/resources/generated/charge.rs | 2923 ---- src/resources/generated/checkout_session.rs | 8645 ---------- .../generated/connect_collection_transfer.rs | 40 - src/resources/generated/country_spec.rs | 129 - src/resources/generated/coupon.rs | 391 - src/resources/generated/credit_note.rs | 614 - .../generated/credit_note_line_item.rs | 197 - src/resources/generated/custom_unit_amount.rs | 20 - src/resources/generated/customer.rs | 1217 -- .../generated/customer_balance_transaction.rs | 127 - .../customer_cash_balance_transaction.rs | 309 - src/resources/generated/discount.rs | 66 - src/resources/generated/dispute.rs | 380 - src/resources/generated/ephemeral_key.rs | 93 - src/resources/generated/event.rs | 160 - src/resources/generated/exchange_rate.rs | 91 - src/resources/generated/fee_refund.rs | 52 - src/resources/generated/file.rs | 192 - src/resources/generated/file_link.rs | 208 - .../financial_connections_account.rs | 465 - .../financial_connections_account_owner.rs | 42 - ...financial_connections_account_ownership.rs | 33 - .../financial_connections_session.rs | 321 - .../generated/funding_instructions.rs | 284 - .../generated/identity_verification_report.rs | 623 - .../identity_verification_session.rs | 411 - src/resources/generated/invoice.rs | 2652 ---- ...voice_payment_method_options_acss_debit.rs | 98 - ...voice_payment_method_options_bancontact.rs | 50 - ...payment_method_options_customer_balance.rs | 122 - .../invoice_payment_method_options_konbini.rs | 9 - ..._payment_method_options_us_bank_account.rs | 141 - .../invoice_setting_rendering_options.rs | 12 - src/resources/generated/invoiceitem.rs | 633 - .../generated/invoices_shipping_cost.rs | 106 - .../generated/issuing_authorization.rs | 259 - .../issuing_authorization_amount_details.rs | 16 - .../issuing_authorization_merchant_data.rs | 41 - src/resources/generated/issuing_card.rs | 1156 -- src/resources/generated/issuing_cardholder.rs | 1093 -- src/resources/generated/issuing_dispute.rs | 459 - .../generated/issuing_transaction.rs | 257 - src/resources/generated/item.rs | 151 - .../generated/legal_entity_japan_address.rs | 31 - src/resources/generated/line_item.rs | 251 - .../linked_account_options_us_bank_account.rs | 94 - src/resources/generated/login_link.rs | 29 - src/resources/generated/mandate.rs | 465 - .../generated/notification_event_data.rs | 21 - src/resources/generated/payment_intent.rs | 12994 ---------------- ...happ_handle_redirect_or_display_qr_code.rs | 31 - src/resources/generated/payment_link.rs | 4619 ------ src/resources/generated/payment_method.rs | 2834 ---- .../payment_method_card_present_networks.rs | 15 - ...iz_payment_method_configuration_details.rs | 12 - .../generated/payment_method_configuration.rs | 4198 ----- .../payment_method_details_card_checks.rs | 18 - ...t_method_details_card_installments_plan.rs | 85 - ...nt_method_details_card_wallet_apple_pay.rs | 9 - ...t_method_details_card_wallet_google_pay.rs | 9 - .../generated/payment_method_domain.rs | 234 - ...ptions_customer_balance_eu_bank_account.rs | 62 - src/resources/generated/payout.rs | 446 - src/resources/generated/person.rs | 486 - src/resources/generated/placeholders.rs | 582 - src/resources/generated/plan.rs | 516 - src/resources/generated/platform_tax_fee.rs | 35 - src/resources/generated/price.rs | 1460 -- src/resources/generated/product.rs | 763 - src/resources/generated/promotion_code.rs | 247 - src/resources/generated/quote.rs | 500 - .../quotes_resource_total_details.rs | 116 - .../generated/radar_early_fraud_warning.rs | 50 - .../generated/radar_radar_options.rs | 13 - src/resources/generated/radar_value_list.rs | 119 - .../generated/radar_value_list_item.rs | 52 - src/resources/generated/refund.rs | 416 - .../generated/reporting_report_run.rs | 103 - .../generated/reporting_report_type.rs | 57 - .../generated/reserve_transaction.rs | 38 - src/resources/generated/review.rs | 245 - .../generated/scheduled_query_run.rs | 63 - src/resources/generated/setup_attempt.rs | 867 -- src/resources/generated/setup_intent.rs | 4874 ------ src/resources/generated/shipping.rs | 32 - src/resources/generated/shipping_rate.rs | 712 - src/resources/generated/source.rs | 1780 --- .../generated/source_mandate_notification.rs | 98 - src/resources/generated/source_transaction.rs | 237 - src/resources/generated/subscription.rs | 3581 ----- .../subscription_billing_thresholds.rs | 18 - src/resources/generated/subscription_item.rs | 551 - .../subscription_item_billing_thresholds.rs | 12 - .../generated/subscription_schedule.rs | 1686 -- .../generated/subscription_transfer_data.rs | 21 - src/resources/generated/tax_calculation.rs | 560 - .../generated/tax_calculation_line_item.rs | 364 - src/resources/generated/tax_code.rs | 93 - .../generated/tax_deducted_at_source.rs | 38 - src/resources/generated/tax_id.rs | 279 - .../tax_product_resource_customer_details.rs | 293 - src/resources/generated/tax_rate.rs | 368 - src/resources/generated/tax_settings.rs | 150 - src/resources/generated/tax_transaction.rs | 423 - .../generated/tax_transaction_line_item.rs | 142 - .../generated/terminal_configuration.rs | 116 - .../generated/terminal_connection_token.rs | 31 - src/resources/generated/terminal_location.rs | 53 - src/resources/generated/terminal_reader.rs | 428 - .../generated/test_helpers_test_clock.rs | 91 - src/resources/generated/token.rs | 495 - src/resources/generated/topup.rs | 283 - src/resources/generated/transfer.rs | 320 - src/resources/generated/transfer_reversal.rs | 58 - .../generated/treasury_credit_reversal.rs | 143 - .../generated/treasury_debit_reversal.rs | 153 - .../generated/treasury_financial_account.rs | 518 - .../treasury_financial_account_features.rs | 256 - ...l_accounts_resource_ach_toggle_settings.rs | 187 - ...ncial_accounts_resource_toggle_settings.rs | 187 - .../generated/treasury_inbound_transfer.rs | 389 - .../generated/treasury_outbound_payment.rs | 452 - .../generated/treasury_outbound_transfer.rs | 380 - .../generated/treasury_received_credit.rs | 314 - .../generated/treasury_received_debit.rs | 251 - ...reasury_shared_resource_billing_details.rs | 19 - ...tails_initiating_payment_method_details.rs | 164 - .../generated/treasury_transaction.rs | 164 - .../generated/treasury_transaction_entry.rs | 180 - ...ry_transactions_resource_balance_impact.rs | 19 - ...sury_transactions_resource_flow_details.rs | 89 - src/resources/generated/usage_record.rs | 39 - .../generated/usage_record_summary.rs | 52 - src/resources/generated/version.rs | 3 - src/resources/generated/webhook_endpoint.rs | 1019 -- src/resources/invoice_ext.rs | 96 - src/resources/issuing_authorization_ext.rs | 93 - src/resources/issuing_card_ext.rs | 137 - src/resources/issuing_dispute_ext.rs | 69 - src/resources/issuing_merchant_data.rs | 331 - src/resources/issuing_transaction_ext.rs | 44 - src/resources/line_item_ext.rs | 46 - src/resources/login_links_ext.rs | 26 - src/resources/order_ext.rs | 34 - src/resources/payment_intent_ext.rs | 233 - src/resources/payment_method_ext.rs | 33 - src/resources/payment_source.rs | 111 - src/resources/payout_ext.rs | 42 - src/resources/placeholders.rs | 34 - src/resources/price_ext.rs | 29 - src/resources/product_ext.rs | 29 - src/resources/review_ext.rs | 44 - src/resources/setup_intent_ext.rs | 55 - src/resources/source_ext.rs | 147 - src/resources/subscription_ext.rs | 62 - src/resources/token_ext.rs | 40 - src/resources/transfer_reversal_ext.rs | 35 - src/resources/types.rs | 408 - src/resources/usage_record_ext.rs | 44 - src/resources/webhook_endpoint_ext.rs | 30 - stripe_types/Cargo.toml | 12 + .../src}/currency.rs | 45 +- stripe_types/src/expandable.rs | 49 + stripe_types/src/ids.rs | 309 + stripe_types/src/lib.rs | 23 + stripe_types/src/pagination.rs | 37 + stripe_types/src/params.rs | 179 + 371 files changed, 1063 insertions(+), 95043 deletions(-) create mode 100644 async-stripe/Cargo.toml rename build.rs => async-stripe/build.rs (100%) rename {src => async-stripe/src}/client/base/async_std.rs (94%) rename {src => async-stripe/src}/client/base/tokio.rs (85%) rename {src => async-stripe/src}/client/base/tokio_blocking.rs (93%) rename {src => async-stripe/src}/client/mod.rs (91%) rename {src => async-stripe/src}/client/request_strategy.rs (100%) rename {src => async-stripe/src}/client/stripe.rs (84%) create mode 100644 async-stripe/src/error.rs rename {src => async-stripe/src}/lib.rs (92%) create mode 100644 async-stripe/src/pagination.rs create mode 100644 async-stripe/src/resources/generated/account.rs create mode 100644 async-stripe/src/resources/generated/account_link.rs create mode 100644 async-stripe/src/resources/generated/account_session.rs create mode 100644 async-stripe/src/resources/generated/address.rs create mode 100644 async-stripe/src/resources/generated/api_errors.rs create mode 100644 async-stripe/src/resources/generated/apple_pay_domain.rs create mode 100644 async-stripe/src/resources/generated/application.rs create mode 100644 async-stripe/src/resources/generated/application_fee.rs create mode 100644 async-stripe/src/resources/generated/apps_secret.rs create mode 100644 async-stripe/src/resources/generated/balance.rs create mode 100644 async-stripe/src/resources/generated/balance_transaction.rs create mode 100644 async-stripe/src/resources/generated/bank_account.rs create mode 100644 async-stripe/src/resources/generated/bank_connections_resource_accountholder.rs create mode 100644 async-stripe/src/resources/generated/billing_details.rs create mode 100644 async-stripe/src/resources/generated/billing_portal_configuration.rs create mode 100644 async-stripe/src/resources/generated/billing_portal_session.rs create mode 100644 async-stripe/src/resources/generated/capability.rs create mode 100644 async-stripe/src/resources/generated/card.rs create mode 100644 async-stripe/src/resources/generated/cash_balance.rs create mode 100644 async-stripe/src/resources/generated/charge.rs create mode 100644 async-stripe/src/resources/generated/checkout_session.rs create mode 100644 async-stripe/src/resources/generated/connect_collection_transfer.rs create mode 100644 async-stripe/src/resources/generated/country_spec.rs create mode 100644 async-stripe/src/resources/generated/coupon.rs create mode 100644 async-stripe/src/resources/generated/credit_note.rs create mode 100644 async-stripe/src/resources/generated/credit_note_line_item.rs create mode 100644 async-stripe/src/resources/generated/custom_unit_amount.rs create mode 100644 async-stripe/src/resources/generated/customer.rs create mode 100644 async-stripe/src/resources/generated/customer_balance_transaction.rs create mode 100644 async-stripe/src/resources/generated/customer_cash_balance_transaction.rs create mode 100644 async-stripe/src/resources/generated/discount.rs create mode 100644 async-stripe/src/resources/generated/dispute.rs create mode 100644 async-stripe/src/resources/generated/ephemeral_key.rs create mode 100644 async-stripe/src/resources/generated/event.rs create mode 100644 async-stripe/src/resources/generated/exchange_rate.rs create mode 100644 async-stripe/src/resources/generated/fee_refund.rs create mode 100644 async-stripe/src/resources/generated/file.rs create mode 100644 async-stripe/src/resources/generated/file_link.rs create mode 100644 async-stripe/src/resources/generated/financial_connections_account.rs create mode 100644 async-stripe/src/resources/generated/financial_connections_account_owner.rs create mode 100644 async-stripe/src/resources/generated/financial_connections_account_ownership.rs create mode 100644 async-stripe/src/resources/generated/financial_connections_session.rs create mode 100644 async-stripe/src/resources/generated/funding_instructions.rs create mode 100644 async-stripe/src/resources/generated/identity_verification_report.rs create mode 100644 async-stripe/src/resources/generated/identity_verification_session.rs create mode 100644 async-stripe/src/resources/generated/invoice.rs create mode 100644 async-stripe/src/resources/generated/invoice_payment_method_options_acss_debit.rs create mode 100644 async-stripe/src/resources/generated/invoice_payment_method_options_bancontact.rs create mode 100644 async-stripe/src/resources/generated/invoice_payment_method_options_customer_balance.rs create mode 100644 async-stripe/src/resources/generated/invoice_payment_method_options_konbini.rs create mode 100644 async-stripe/src/resources/generated/invoice_payment_method_options_us_bank_account.rs create mode 100644 async-stripe/src/resources/generated/invoice_setting_rendering_options.rs create mode 100644 async-stripe/src/resources/generated/invoiceitem.rs create mode 100644 async-stripe/src/resources/generated/invoices_shipping_cost.rs create mode 100644 async-stripe/src/resources/generated/issuing_authorization.rs create mode 100644 async-stripe/src/resources/generated/issuing_authorization_amount_details.rs create mode 100644 async-stripe/src/resources/generated/issuing_authorization_merchant_data.rs create mode 100644 async-stripe/src/resources/generated/issuing_card.rs create mode 100644 async-stripe/src/resources/generated/issuing_cardholder.rs create mode 100644 async-stripe/src/resources/generated/issuing_dispute.rs create mode 100644 async-stripe/src/resources/generated/issuing_transaction.rs create mode 100644 async-stripe/src/resources/generated/item.rs create mode 100644 async-stripe/src/resources/generated/legal_entity_japan_address.rs create mode 100644 async-stripe/src/resources/generated/line_item.rs create mode 100644 async-stripe/src/resources/generated/linked_account_options_us_bank_account.rs create mode 100644 async-stripe/src/resources/generated/login_link.rs create mode 100644 async-stripe/src/resources/generated/mandate.rs create mode 100644 async-stripe/src/resources/generated/notification_event_data.rs create mode 100644 async-stripe/src/resources/generated/payment_intent.rs create mode 100644 async-stripe/src/resources/generated/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs create mode 100644 async-stripe/src/resources/generated/payment_link.rs create mode 100644 async-stripe/src/resources/generated/payment_method.rs create mode 100644 async-stripe/src/resources/generated/payment_method_card_present_networks.rs create mode 100644 async-stripe/src/resources/generated/payment_method_config_biz_payment_method_configuration_details.rs create mode 100644 async-stripe/src/resources/generated/payment_method_configuration.rs create mode 100644 async-stripe/src/resources/generated/payment_method_details_card_checks.rs create mode 100644 async-stripe/src/resources/generated/payment_method_details_card_installments_plan.rs create mode 100644 async-stripe/src/resources/generated/payment_method_details_card_wallet_apple_pay.rs create mode 100644 async-stripe/src/resources/generated/payment_method_details_card_wallet_google_pay.rs create mode 100644 async-stripe/src/resources/generated/payment_method_domain.rs create mode 100644 async-stripe/src/resources/generated/payment_method_options_customer_balance_eu_bank_account.rs create mode 100644 async-stripe/src/resources/generated/payout.rs create mode 100644 async-stripe/src/resources/generated/person.rs create mode 100644 async-stripe/src/resources/generated/placeholders.rs create mode 100644 async-stripe/src/resources/generated/plan.rs create mode 100644 async-stripe/src/resources/generated/platform_tax_fee.rs create mode 100644 async-stripe/src/resources/generated/price.rs create mode 100644 async-stripe/src/resources/generated/product.rs create mode 100644 async-stripe/src/resources/generated/promotion_code.rs create mode 100644 async-stripe/src/resources/generated/quote.rs create mode 100644 async-stripe/src/resources/generated/quotes_resource_total_details.rs create mode 100644 async-stripe/src/resources/generated/radar_early_fraud_warning.rs create mode 100644 async-stripe/src/resources/generated/radar_radar_options.rs create mode 100644 async-stripe/src/resources/generated/radar_value_list.rs create mode 100644 async-stripe/src/resources/generated/radar_value_list_item.rs create mode 100644 async-stripe/src/resources/generated/refund.rs create mode 100644 async-stripe/src/resources/generated/reporting_report_run.rs create mode 100644 async-stripe/src/resources/generated/reporting_report_type.rs create mode 100644 async-stripe/src/resources/generated/reserve_transaction.rs create mode 100644 async-stripe/src/resources/generated/review.rs create mode 100644 async-stripe/src/resources/generated/scheduled_query_run.rs create mode 100644 async-stripe/src/resources/generated/setup_attempt.rs create mode 100644 async-stripe/src/resources/generated/setup_intent.rs create mode 100644 async-stripe/src/resources/generated/shipping.rs create mode 100644 async-stripe/src/resources/generated/shipping_rate.rs create mode 100644 async-stripe/src/resources/generated/source.rs create mode 100644 async-stripe/src/resources/generated/source_mandate_notification.rs create mode 100644 async-stripe/src/resources/generated/source_transaction.rs create mode 100644 async-stripe/src/resources/generated/subscription.rs create mode 100644 async-stripe/src/resources/generated/subscription_billing_thresholds.rs create mode 100644 async-stripe/src/resources/generated/subscription_item.rs create mode 100644 async-stripe/src/resources/generated/subscription_item_billing_thresholds.rs create mode 100644 async-stripe/src/resources/generated/subscription_schedule.rs create mode 100644 async-stripe/src/resources/generated/subscription_transfer_data.rs create mode 100644 async-stripe/src/resources/generated/tax_calculation.rs create mode 100644 async-stripe/src/resources/generated/tax_calculation_line_item.rs create mode 100644 async-stripe/src/resources/generated/tax_code.rs create mode 100644 async-stripe/src/resources/generated/tax_deducted_at_source.rs create mode 100644 async-stripe/src/resources/generated/tax_id.rs create mode 100644 async-stripe/src/resources/generated/tax_product_resource_customer_details.rs create mode 100644 async-stripe/src/resources/generated/tax_rate.rs create mode 100644 async-stripe/src/resources/generated/tax_settings.rs create mode 100644 async-stripe/src/resources/generated/tax_transaction.rs create mode 100644 async-stripe/src/resources/generated/tax_transaction_line_item.rs create mode 100644 async-stripe/src/resources/generated/terminal_configuration.rs create mode 100644 async-stripe/src/resources/generated/terminal_connection_token.rs create mode 100644 async-stripe/src/resources/generated/terminal_location.rs create mode 100644 async-stripe/src/resources/generated/terminal_reader.rs create mode 100644 async-stripe/src/resources/generated/test_helpers_test_clock.rs create mode 100644 async-stripe/src/resources/generated/token.rs create mode 100644 async-stripe/src/resources/generated/topup.rs create mode 100644 async-stripe/src/resources/generated/transfer.rs create mode 100644 async-stripe/src/resources/generated/transfer_reversal.rs create mode 100644 async-stripe/src/resources/generated/treasury_credit_reversal.rs create mode 100644 async-stripe/src/resources/generated/treasury_debit_reversal.rs create mode 100644 async-stripe/src/resources/generated/treasury_financial_account.rs create mode 100644 async-stripe/src/resources/generated/treasury_financial_account_features.rs create mode 100644 async-stripe/src/resources/generated/treasury_financial_accounts_resource_ach_toggle_settings.rs create mode 100644 async-stripe/src/resources/generated/treasury_financial_accounts_resource_toggle_settings.rs create mode 100644 async-stripe/src/resources/generated/treasury_inbound_transfer.rs create mode 100644 async-stripe/src/resources/generated/treasury_outbound_payment.rs create mode 100644 async-stripe/src/resources/generated/treasury_outbound_transfer.rs create mode 100644 async-stripe/src/resources/generated/treasury_received_credit.rs create mode 100644 async-stripe/src/resources/generated/treasury_received_debit.rs create mode 100644 async-stripe/src/resources/generated/treasury_shared_resource_billing_details.rs create mode 100644 async-stripe/src/resources/generated/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details.rs create mode 100644 async-stripe/src/resources/generated/treasury_transaction.rs create mode 100644 async-stripe/src/resources/generated/treasury_transaction_entry.rs create mode 100644 async-stripe/src/resources/generated/treasury_transactions_resource_balance_impact.rs create mode 100644 async-stripe/src/resources/generated/treasury_transactions_resource_flow_details.rs create mode 100644 async-stripe/src/resources/generated/usage_record.rs create mode 100644 async-stripe/src/resources/generated/usage_record_summary.rs create mode 100644 async-stripe/src/resources/generated/version.rs create mode 100644 async-stripe/src/resources/generated/webhook_endpoint.rs create mode 100644 async-stripe/src/resources/types.rs create mode 100644 async-stripe/src/resources/usage_record_ext.rs create mode 100644 async-stripe/src/resources/webhook_endpoint_ext.rs rename {src => async-stripe/src}/resources/webhook_events.rs (100%) delete mode 100644 src/error.rs delete mode 100644 src/ids.rs delete mode 100644 src/params.rs delete mode 100644 src/resources.rs delete mode 100644 src/resources/account_ext.rs delete mode 100644 src/resources/balance_ext.rs delete mode 100644 src/resources/balance_transaction_ext.rs delete mode 100644 src/resources/bank_account_ext.rs delete mode 100644 src/resources/card.rs delete mode 100644 src/resources/charge_ext.rs delete mode 100644 src/resources/checkout_session_ext.rs delete mode 100644 src/resources/credit_note_ext.rs delete mode 100644 src/resources/customer_balance_transaction_ext.rs delete mode 100644 src/resources/customer_ext.rs delete mode 100644 src/resources/generated.rs delete mode 100644 src/resources/generated/account.rs delete mode 100644 src/resources/generated/account_link.rs delete mode 100644 src/resources/generated/account_session.rs delete mode 100644 src/resources/generated/address.rs delete mode 100644 src/resources/generated/api_errors.rs delete mode 100644 src/resources/generated/apple_pay_domain.rs delete mode 100644 src/resources/generated/application.rs delete mode 100644 src/resources/generated/application_fee.rs delete mode 100644 src/resources/generated/apps_secret.rs delete mode 100644 src/resources/generated/balance.rs delete mode 100644 src/resources/generated/balance_transaction.rs delete mode 100644 src/resources/generated/bank_account.rs delete mode 100644 src/resources/generated/bank_connections_resource_accountholder.rs delete mode 100644 src/resources/generated/billing_details.rs delete mode 100644 src/resources/generated/billing_portal_configuration.rs delete mode 100644 src/resources/generated/billing_portal_session.rs delete mode 100644 src/resources/generated/capability.rs delete mode 100644 src/resources/generated/card.rs delete mode 100644 src/resources/generated/cash_balance.rs delete mode 100644 src/resources/generated/charge.rs delete mode 100644 src/resources/generated/checkout_session.rs delete mode 100644 src/resources/generated/connect_collection_transfer.rs delete mode 100644 src/resources/generated/country_spec.rs delete mode 100644 src/resources/generated/coupon.rs delete mode 100644 src/resources/generated/credit_note.rs delete mode 100644 src/resources/generated/credit_note_line_item.rs delete mode 100644 src/resources/generated/custom_unit_amount.rs delete mode 100644 src/resources/generated/customer.rs delete mode 100644 src/resources/generated/customer_balance_transaction.rs delete mode 100644 src/resources/generated/customer_cash_balance_transaction.rs delete mode 100644 src/resources/generated/discount.rs delete mode 100644 src/resources/generated/dispute.rs delete mode 100644 src/resources/generated/ephemeral_key.rs delete mode 100644 src/resources/generated/event.rs delete mode 100644 src/resources/generated/exchange_rate.rs delete mode 100644 src/resources/generated/fee_refund.rs delete mode 100644 src/resources/generated/file.rs delete mode 100644 src/resources/generated/file_link.rs delete mode 100644 src/resources/generated/financial_connections_account.rs delete mode 100644 src/resources/generated/financial_connections_account_owner.rs delete mode 100644 src/resources/generated/financial_connections_account_ownership.rs delete mode 100644 src/resources/generated/financial_connections_session.rs delete mode 100644 src/resources/generated/funding_instructions.rs delete mode 100644 src/resources/generated/identity_verification_report.rs delete mode 100644 src/resources/generated/identity_verification_session.rs delete mode 100644 src/resources/generated/invoice.rs delete mode 100644 src/resources/generated/invoice_payment_method_options_acss_debit.rs delete mode 100644 src/resources/generated/invoice_payment_method_options_bancontact.rs delete mode 100644 src/resources/generated/invoice_payment_method_options_customer_balance.rs delete mode 100644 src/resources/generated/invoice_payment_method_options_konbini.rs delete mode 100644 src/resources/generated/invoice_payment_method_options_us_bank_account.rs delete mode 100644 src/resources/generated/invoice_setting_rendering_options.rs delete mode 100644 src/resources/generated/invoiceitem.rs delete mode 100644 src/resources/generated/invoices_shipping_cost.rs delete mode 100644 src/resources/generated/issuing_authorization.rs delete mode 100644 src/resources/generated/issuing_authorization_amount_details.rs delete mode 100644 src/resources/generated/issuing_authorization_merchant_data.rs delete mode 100644 src/resources/generated/issuing_card.rs delete mode 100644 src/resources/generated/issuing_cardholder.rs delete mode 100644 src/resources/generated/issuing_dispute.rs delete mode 100644 src/resources/generated/issuing_transaction.rs delete mode 100644 src/resources/generated/item.rs delete mode 100644 src/resources/generated/legal_entity_japan_address.rs delete mode 100644 src/resources/generated/line_item.rs delete mode 100644 src/resources/generated/linked_account_options_us_bank_account.rs delete mode 100644 src/resources/generated/login_link.rs delete mode 100644 src/resources/generated/mandate.rs delete mode 100644 src/resources/generated/notification_event_data.rs delete mode 100644 src/resources/generated/payment_intent.rs delete mode 100644 src/resources/generated/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs delete mode 100644 src/resources/generated/payment_link.rs delete mode 100644 src/resources/generated/payment_method.rs delete mode 100644 src/resources/generated/payment_method_card_present_networks.rs delete mode 100644 src/resources/generated/payment_method_config_biz_payment_method_configuration_details.rs delete mode 100644 src/resources/generated/payment_method_configuration.rs delete mode 100644 src/resources/generated/payment_method_details_card_checks.rs delete mode 100644 src/resources/generated/payment_method_details_card_installments_plan.rs delete mode 100644 src/resources/generated/payment_method_details_card_wallet_apple_pay.rs delete mode 100644 src/resources/generated/payment_method_details_card_wallet_google_pay.rs delete mode 100644 src/resources/generated/payment_method_domain.rs delete mode 100644 src/resources/generated/payment_method_options_customer_balance_eu_bank_account.rs delete mode 100644 src/resources/generated/payout.rs delete mode 100644 src/resources/generated/person.rs delete mode 100644 src/resources/generated/placeholders.rs delete mode 100644 src/resources/generated/plan.rs delete mode 100644 src/resources/generated/platform_tax_fee.rs delete mode 100644 src/resources/generated/price.rs delete mode 100644 src/resources/generated/product.rs delete mode 100644 src/resources/generated/promotion_code.rs delete mode 100644 src/resources/generated/quote.rs delete mode 100644 src/resources/generated/quotes_resource_total_details.rs delete mode 100644 src/resources/generated/radar_early_fraud_warning.rs delete mode 100644 src/resources/generated/radar_radar_options.rs delete mode 100644 src/resources/generated/radar_value_list.rs delete mode 100644 src/resources/generated/radar_value_list_item.rs delete mode 100644 src/resources/generated/refund.rs delete mode 100644 src/resources/generated/reporting_report_run.rs delete mode 100644 src/resources/generated/reporting_report_type.rs delete mode 100644 src/resources/generated/reserve_transaction.rs delete mode 100644 src/resources/generated/review.rs delete mode 100644 src/resources/generated/scheduled_query_run.rs delete mode 100644 src/resources/generated/setup_attempt.rs delete mode 100644 src/resources/generated/setup_intent.rs delete mode 100644 src/resources/generated/shipping.rs delete mode 100644 src/resources/generated/shipping_rate.rs delete mode 100644 src/resources/generated/source.rs delete mode 100644 src/resources/generated/source_mandate_notification.rs delete mode 100644 src/resources/generated/source_transaction.rs delete mode 100644 src/resources/generated/subscription.rs delete mode 100644 src/resources/generated/subscription_billing_thresholds.rs delete mode 100644 src/resources/generated/subscription_item.rs delete mode 100644 src/resources/generated/subscription_item_billing_thresholds.rs delete mode 100644 src/resources/generated/subscription_schedule.rs delete mode 100644 src/resources/generated/subscription_transfer_data.rs delete mode 100644 src/resources/generated/tax_calculation.rs delete mode 100644 src/resources/generated/tax_calculation_line_item.rs delete mode 100644 src/resources/generated/tax_code.rs delete mode 100644 src/resources/generated/tax_deducted_at_source.rs delete mode 100644 src/resources/generated/tax_id.rs delete mode 100644 src/resources/generated/tax_product_resource_customer_details.rs delete mode 100644 src/resources/generated/tax_rate.rs delete mode 100644 src/resources/generated/tax_settings.rs delete mode 100644 src/resources/generated/tax_transaction.rs delete mode 100644 src/resources/generated/tax_transaction_line_item.rs delete mode 100644 src/resources/generated/terminal_configuration.rs delete mode 100644 src/resources/generated/terminal_connection_token.rs delete mode 100644 src/resources/generated/terminal_location.rs delete mode 100644 src/resources/generated/terminal_reader.rs delete mode 100644 src/resources/generated/test_helpers_test_clock.rs delete mode 100644 src/resources/generated/token.rs delete mode 100644 src/resources/generated/topup.rs delete mode 100644 src/resources/generated/transfer.rs delete mode 100644 src/resources/generated/transfer_reversal.rs delete mode 100644 src/resources/generated/treasury_credit_reversal.rs delete mode 100644 src/resources/generated/treasury_debit_reversal.rs delete mode 100644 src/resources/generated/treasury_financial_account.rs delete mode 100644 src/resources/generated/treasury_financial_account_features.rs delete mode 100644 src/resources/generated/treasury_financial_accounts_resource_ach_toggle_settings.rs delete mode 100644 src/resources/generated/treasury_financial_accounts_resource_toggle_settings.rs delete mode 100644 src/resources/generated/treasury_inbound_transfer.rs delete mode 100644 src/resources/generated/treasury_outbound_payment.rs delete mode 100644 src/resources/generated/treasury_outbound_transfer.rs delete mode 100644 src/resources/generated/treasury_received_credit.rs delete mode 100644 src/resources/generated/treasury_received_debit.rs delete mode 100644 src/resources/generated/treasury_shared_resource_billing_details.rs delete mode 100644 src/resources/generated/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details.rs delete mode 100644 src/resources/generated/treasury_transaction.rs delete mode 100644 src/resources/generated/treasury_transaction_entry.rs delete mode 100644 src/resources/generated/treasury_transactions_resource_balance_impact.rs delete mode 100644 src/resources/generated/treasury_transactions_resource_flow_details.rs delete mode 100644 src/resources/generated/usage_record.rs delete mode 100644 src/resources/generated/usage_record_summary.rs delete mode 100644 src/resources/generated/version.rs delete mode 100644 src/resources/generated/webhook_endpoint.rs delete mode 100644 src/resources/invoice_ext.rs delete mode 100644 src/resources/issuing_authorization_ext.rs delete mode 100644 src/resources/issuing_card_ext.rs delete mode 100644 src/resources/issuing_dispute_ext.rs delete mode 100644 src/resources/issuing_merchant_data.rs delete mode 100644 src/resources/issuing_transaction_ext.rs delete mode 100644 src/resources/line_item_ext.rs delete mode 100644 src/resources/login_links_ext.rs delete mode 100644 src/resources/order_ext.rs delete mode 100644 src/resources/payment_intent_ext.rs delete mode 100644 src/resources/payment_method_ext.rs delete mode 100644 src/resources/payment_source.rs delete mode 100644 src/resources/payout_ext.rs delete mode 100644 src/resources/placeholders.rs delete mode 100644 src/resources/price_ext.rs delete mode 100644 src/resources/product_ext.rs delete mode 100644 src/resources/review_ext.rs delete mode 100644 src/resources/setup_intent_ext.rs delete mode 100644 src/resources/source_ext.rs delete mode 100644 src/resources/subscription_ext.rs delete mode 100644 src/resources/token_ext.rs delete mode 100644 src/resources/transfer_reversal_ext.rs delete mode 100644 src/resources/types.rs delete mode 100644 src/resources/usage_record_ext.rs delete mode 100644 src/resources/webhook_endpoint_ext.rs create mode 100644 stripe_types/Cargo.toml rename {src/resources => stripe_types/src}/currency.rs (92%) create mode 100644 stripe_types/src/expandable.rs create mode 100644 stripe_types/src/ids.rs create mode 100644 stripe_types/src/lib.rs create mode 100644 stripe_types/src/pagination.rs create mode 100644 stripe_types/src/params.rs diff --git a/Cargo.toml b/Cargo.toml index 84590c71f..219bf2777 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,19 +1,21 @@ [workspace] members = [ - ".", - "openapi", - "bench/binary_size" + "async-stripe", + "stripe_types" ] +resolver = "2" +# Makes dependency management simpler to allow codegen crate to use whichever dep versions +# it wants without affecting dependency resolution of the user-facing library crates +exclude = ["openapi"] -[package] -name = "async-stripe" -version = "0.26.0" +[workspace.package] +version = "0.22.2" description = "API bindings for the Stripe HTTP API" -rust-version = "1.68.0" +rust-version = "1.67.0" authors = [ - "Anna Baldwin ", - "Kevin Stenerson ", - "Alexander Lyon ", + "Anna Baldwin ", + "Kevin Stenerson ", + "Alexander Lyon ", ] license = "MIT OR Apache-2.0" readme = "README.md" @@ -24,174 +26,8 @@ keywords = ["stripe", "v1", "api", "async"] categories = ["api-bindings"] edition = "2021" -[package.metadata.docs.rs] -features = ["runtime-tokio-hyper"] - -[lib] -name = "stripe" - -[features] -default = ["full", "webhook-events", "uuid", "stream"] -full = [ - "checkout", - "billing", - "connect", - "fraud", - "issuing", - "orders", - "sigma", - "terminal", - "webhook-endpoints", - "tax-calculation", -] - -stream = [] - -# stripe feature groups -checkout = ["billing"] -billing = [] -connect = [] -fraud = [] -issuing = [] -orders = [] -sigma = [] -terminal = [] -webhook-endpoints = [] -tax-calculation = [] - -# deserialize events from webhooks -webhook-events = ["events", "hmac", "sha2", "chrono", "hex"] -events = [] - -# runtimes -async = ["futures-util"] -blocking = [] - -runtime-tokio-hyper = [ - "tokio", - "hyper-client", - "hyper-tls", - "async", -] -runtime-tokio-hyper-rustls = [ - "tokio", - "hyper-client", - "hyper-rustls", - "hyper-rustls-native", - "async", -] -runtime-tokio-hyper-rustls-webpki = [ - "tokio", - "hyper-client", - "hyper-rustls-webpki", - "async", -] -runtime-blocking = [ - "tokio", - "tokio/rt", - "hyper-client", - "hyper-tls", - "blocking", -] -runtime-blocking-rustls = [ - "tokio", - "tokio/rt", - "hyper-client", - "hyper-rustls-native", - "blocking", -] -runtime-blocking-rustls-webpki = [ - "tokio", - "tokio/rt", - "hyper-client", - "hyper-rustls-webpki", - "blocking", -] -runtime-async-std-surf = [ - "async-std", - "surf", - "async", -] - -# we need the compat crate if using hyper -hyper-client = ["hyper", "http-types/hyperium_http"] - -hyper-rustls-native = ["hyper-rustls", "hyper-rustls/native-tokio"] -hyper-rustls-webpki = ["hyper-rustls", "hyper-rustls/webpki-tokio"] - -[dependencies] -async-std = {version = "1.8,<1.11", optional = true} - -chrono = { version = "0.4", default-features = false, features = ["serde", "clock"], optional = true } -thiserror = "1.0.24" -http-types = { version = "2.12.0", default-features = false } -hyper = { version = "0.14", default-features = false, features = ["http1", "http2", "client", "tcp"], optional = true } -hyper-tls = { version = "0.5", optional = true } -hyper-rustls = { version = "0.24", default-features = false, features = ["http1", "http2", "tls12", "logging"], optional = true } +[workspace.dependencies] serde = {version = ">=1.0.79", features = ["derive"] } # we use `serde(other)` which was introduced in 1.0.79 -serde_json = "1.0" -serde_qs = "0.10.1" -serde_path_to_error = "0.1.8" -smol_str = "0.1" -surf = { version = "2.1", optional = true } -tokio = { version = "1.2", optional = true } -smart-default = "0.6.0" -uuid = { version = "0.8", optional=true, features=["v4"] } - -# stream for lists -futures-util = { version = "0.3.21", optional = true } - -# webhook support -hmac = { version = "0.12", optional = true } -sha2 = { version = "0.10", optional = true } -hex = { version = "0.4", optional = true } - -rocket = { version = "0.4", optional = true } - -[dev-dependencies] -async-std = { version = "1.10.0", features = ["attributes"] } -httpmock = "0.6.6" -tokio = { version = "1.24.1", features = ["rt", "macros"] } -axum = { version = "0.6.18", features = ["macros"] } -async-trait = "0.1" -actix-web = "4.2.1" - -[[example]] -name = "checkout" -required-features = ["async"] - -[[example]] -name = "connect" -required-features = ["async"] - -[[example]] -name = "customer" -required-features = ["async"] - -[[example]] -name = "payment-intent" -required-features = ["async"] - -[[example]] -name = "payment-link" -required-features = ["async"] - -[[example]] -name = "strategy" -required-features = ["async"] - -[[example]] -name = "subscriptions" -required-features = ["async"] - -[[example]] -name = "webhook-axum" -required-features = ["async"] - -[[example]] -name = "webhook-actix" -required-features = ["async"] - -[[example]] -name = "webhook-rocket" -required-features = ["rocket"] +http-types = { version = "2.12.0", default-features = false } +smol_str = "0.2.0" +serde_json = "1.0" \ No newline at end of file diff --git a/async-stripe/Cargo.toml b/async-stripe/Cargo.toml new file mode 100644 index 000000000..256f24d52 --- /dev/null +++ b/async-stripe/Cargo.toml @@ -0,0 +1,105 @@ +[package] +name = "async-stripe" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper"] + +[lib] +name = "stripe" + +[features] +default = ["uuid", "stream"] + +stream = [] + +# runtimes +async = ["futures-util"] +blocking = [] + +runtime-tokio-hyper = [ + "tokio", + "hyper-client", + "hyper-tls", + "async", +] +runtime-tokio-hyper-rustls = [ + "tokio", + "hyper-client", + "hyper-rustls", + "hyper-rustls-native", + "async", +] +runtime-tokio-hyper-rustls-webpki = [ + "tokio", + "hyper-client", + "hyper-rustls-webpki", + "async", +] +runtime-blocking = [ + "tokio", + "tokio/rt", + "hyper-client", + "hyper-tls", + "blocking", +] +runtime-blocking-rustls = [ + "tokio", + "tokio/rt", + "hyper-client", + "hyper-rustls-native", + "blocking", +] +runtime-blocking-rustls-webpki = [ + "tokio", + "tokio/rt", + "hyper-client", + "hyper-rustls-webpki", + "blocking", +] +runtime-async-std-surf = [ + "async-std", + "surf", + "async", +] + +# we need the compat crate if using hyper +hyper-client = ["hyper", "http-types/hyperium_http"] + +hyper-rustls-native = ["hyper-rustls", "hyper-rustls/native-tokio"] +hyper-rustls-webpki = ["hyper-rustls", "hyper-rustls/webpki-tokio"] + +[dependencies] +stripe_types = {path = "../stripe_types"} +async-std = {version = "1.8,<1.11", optional = true} + +thiserror = "1.0.24" +hyper = { version = "0.14", default-features = false, features = ["http1", "http2", "client", "tcp"], optional = true } +hyper-tls = { version = "0.5", optional = true } +hyper-rustls = { version = "0.23", default-features = false, features = ["http1", "http2", "tls12", "logging"], optional = true } +serde_json.workspace = true +serde_qs = "0.12.0" +serde_path_to_error = "0.1.8" +surf = { version = "2.1", optional = true } +tokio = { version = "1.2", optional = true } +uuid = { version = "1.6.1", optional=true, features=["v4"] } + +serde.workspace = true +http-types.workspace = true +smol_str.workspace = true + +# stream for lists +futures-util = { version = "0.3.21", optional = true } + +[dev-dependencies] +httpmock = "0.6.7" +async-std = { version = "1.10.0", features = ["attributes"] } +tokio = { version = "1.24.1", features = ["rt", "macros"] } \ No newline at end of file diff --git a/build.rs b/async-stripe/build.rs similarity index 100% rename from build.rs rename to async-stripe/build.rs diff --git a/src/client/base/async_std.rs b/async-stripe/src/client/base/async_std.rs similarity index 94% rename from src/client/base/async_std.rs rename to async-stripe/src/client/base/async_std.rs index 7cbec65ac..1c078868b 100644 --- a/src/client/base/async_std.rs +++ b/async-stripe/src/client/base/async_std.rs @@ -6,17 +6,10 @@ use http_types::{Request, StatusCode}; use serde::de::DeserializeOwned; use crate::client::request_strategy::{Outcome, RequestStrategy}; -use crate::error::{ErrorResponse, StripeError}; +use crate::error::StripeError; pub type Response = Pin> + Send>>; -#[allow(dead_code)] -#[inline(always)] -pub(crate) fn ok(ok: T) -> Response { - Box::pin(future::ready(Ok(ok))) -} - -#[allow(dead_code)] #[inline(always)] pub(crate) fn err(err: StripeError) -> Response { Box::pin(future::ready(Err(err))) @@ -51,6 +44,12 @@ impl AsyncStdClient { } } +impl Default for AsyncStdClient { + fn default() -> Self { + Self::new() + } +} + async fn send_inner( client: &surf::Client, mut request: Request, @@ -103,10 +102,7 @@ async fn send_inner( tries += 1; let json_deserializer = &mut serde_json::Deserializer::from_slice(&bytes); last_error = serde_path_to_error::deserialize(json_deserializer) - .map(|mut e: ErrorResponse| { - e.error.http_status = status.into(); - StripeError::from(e.error) - }) + .map(|e: stripe_types::Error| StripeError::Stripe(*e.error, status.into())) .unwrap_or_else(StripeError::from); last_status = Some(status); last_retry_header = retry; diff --git a/src/client/base/tokio.rs b/async-stripe/src/client/base/tokio.rs similarity index 85% rename from src/client/base/tokio.rs rename to async-stripe/src/client/base/tokio.rs index 3ba3ae73f..a285c659a 100644 --- a/src/client/base/tokio.rs +++ b/async-stripe/src/client/base/tokio.rs @@ -8,7 +8,7 @@ use serde::de::DeserializeOwned; use tokio::time::sleep; use crate::client::request_strategy::{Outcome, RequestStrategy}; -use crate::error::{ErrorResponse, StripeError}; +use crate::error::StripeError; #[cfg(feature = "hyper-rustls-native")] mod connector { @@ -59,12 +59,6 @@ type HttpClient = hyper::Client, Body>; pub type Response = Pin> + Send>>; -#[allow(dead_code)] -#[inline(always)] -pub(crate) fn ok(ok: T) -> Response { - Box::pin(future::ready(Ok(ok))) -} - #[allow(dead_code)] #[inline(always)] pub(crate) fn err(err: StripeError) -> Response { @@ -101,6 +95,12 @@ impl TokioClient { } } +impl Default for TokioClient { + fn default() -> Self { + Self::new() + } +} + async fn send_inner( client: &HttpClient, mut request: Request, @@ -155,9 +155,8 @@ async fn send_inner( tries += 1; let json_deserializer = &mut serde_json::Deserializer::from_slice(&bytes); last_error = serde_path_to_error::deserialize(json_deserializer) - .map(|mut e: ErrorResponse| { - e.error.http_status = status.into(); - StripeError::from(e.error) + .map(|e: stripe_types::Error| { + StripeError::Stripe(*e.error, status.as_u16()) }) .unwrap_or_else(StripeError::from); last_status = Some( @@ -191,6 +190,8 @@ mod tests { use http_types::{Method, Request, Url}; use httpmock::prelude::*; use hyper::{body::to_bytes, Body, Request as HyperRequest}; + use serde_json::json; + use stripe_types::api_errors::{ApiErrorsCode, ApiErrorsType}; use super::convert_request; use super::TokioClient; @@ -292,7 +293,7 @@ mod tests { mock.assert_hits_async(1).await; match res { - Err(StripeError::Stripe(x)) => println!("{:?}", x), + Err(StripeError::Stripe(x, _)) => println!("{:?}", x), _ => panic!("Expected stripe error {:?}", res), } } @@ -379,4 +380,41 @@ mod tests { hello_mock.assert_hits_async(5).await; assert!(res.is_err()); } + + // https://github.com/arlyon/async-stripe/issues/384 + #[tokio::test] + async fn user_error_transfers() { + let client = TokioClient::new(); + + // Start a lightweight mock server. + let server = MockServer::start_async().await; + let message ="Your destination account needs to have at least one of the following capabilities enabled: transfers, crypto_transfers, legacy_payments"; + let log_url = "https://dashboard.stripe.com/logs/req_nIhlutaV4amLEs?t=1685040634"; + let mock = server.mock(|when, then| { + when.method(GET).path("/v1/transfers"); + then.status(400).json_body(json!({ + "error": { + "code": "insufficient_capabilities_for_transfer", + "message": message, + "request_log_url": log_url, + "type": "invalid_request_error" + } + })); + }); + + let req = Request::get(Url::parse(&server.url("/v1/transfers")).unwrap()); + let res = client.execute::<()>(req, &RequestStrategy::Once).await.unwrap_err(); + mock.assert_hits_async(1).await; + + match res { + StripeError::Stripe(err, status_code) => { + assert_eq!(status_code, 400); + assert_eq!(err.type_, ApiErrorsType::InvalidRequestError); + assert_eq!(err.message.as_deref(), Some(message)); + assert_eq!(err.request_log_url.as_deref(), Some(log_url)); + assert_eq!(err.code, Some(ApiErrorsCode::Unknown)); + } + _ => panic!("Expected stripe error, got {:?}", res), + } + } } diff --git a/src/client/base/tokio_blocking.rs b/async-stripe/src/client/base/tokio_blocking.rs similarity index 93% rename from src/client/base/tokio_blocking.rs rename to async-stripe/src/client/base/tokio_blocking.rs index 8192eeabf..e29be6c22 100644 --- a/src/client/base/tokio_blocking.rs +++ b/async-stripe/src/client/base/tokio_blocking.rs @@ -1,3 +1,4 @@ +#![allow(clippy::missing_errors_doc)] use std::{sync::Arc, time::Duration}; use http_types::Request; @@ -12,11 +13,6 @@ const DEFAULT_TIMEOUT: Duration = Duration::from_secs(30); pub type Response = Result; -#[inline(always)] -pub(crate) fn ok(ok: T) -> Response { - Ok(ok) -} - #[inline(always)] pub(crate) fn err(err: crate::StripeError) -> Response { Err(err) @@ -59,3 +55,9 @@ impl TokioBlockingClient { } } } + +impl Default for TokioBlockingClient { + fn default() -> Self { + Self::new() + } +} diff --git a/src/client/mod.rs b/async-stripe/src/client/mod.rs similarity index 91% rename from src/client/mod.rs rename to async-stripe/src/client/mod.rs index 89228a48a..fbdcf9c2e 100644 --- a/src/client/mod.rs +++ b/async-stripe/src/client/mod.rs @@ -29,7 +29,7 @@ mod base { feature = "runtime-blocking-rustls-webpki" ))] pub(crate) mod config { - pub(crate) use super::base::tokio_blocking::{err, ok}; + pub(crate) use super::base::tokio_blocking::err; pub use super::base::tokio_blocking::{Response, TokioBlockingClient as BaseClient}; } @@ -39,13 +39,13 @@ pub(crate) mod config { feature = "runtime-tokio-hyper-rustls-webpki" ))] pub(crate) mod config { - pub(crate) use super::base::tokio::{err, ok}; + pub(crate) use super::base::tokio::err; pub use super::base::tokio::{Response, TokioClient as BaseClient}; } #[cfg(feature = "runtime-async-std-surf")] pub(crate) mod config { - pub(crate) use super::base::async_std::{err, ok}; + pub(crate) use super::base::async_std::err; pub use super::base::async_std::{AsyncStdClient as BaseClient, Response}; } diff --git a/src/client/request_strategy.rs b/async-stripe/src/client/request_strategy.rs similarity index 100% rename from src/client/request_strategy.rs rename to async-stripe/src/client/request_strategy.rs diff --git a/src/client/stripe.rs b/async-stripe/src/client/stripe.rs similarity index 84% rename from src/client/stripe.rs rename to async-stripe/src/client/stripe.rs index d3b0aa23d..00cd77c0e 100644 --- a/src/client/stripe.rs +++ b/async-stripe/src/client/stripe.rs @@ -1,19 +1,22 @@ +// Necessary under tokio-blocking since `Response` is a type alias to a `Result` +#![allow(clippy::missing_errors_doc)] use http_types::{Body, Method, Request, Url}; -use serde::{de::DeserializeOwned, Serialize}; +use serde::de::DeserializeOwned; +use serde::Serialize; +use stripe_types::version::VERSION; +use stripe_types::{AccountId, AppInfo, ApplicationId, Headers}; use crate::{ client::{request_strategy::RequestStrategy, BaseClient, Response}, config::err, - generated::core::version::VERSION, - params::AppInfo, - AccountId, ApplicationId, Headers, StripeError, + StripeError, }; static USER_AGENT: &str = concat!("Stripe/v1 RustBindings/", env!("CARGO_PKG_VERSION")); #[derive(Clone)] pub struct Client { - client: crate::client::BaseClient, + client: BaseClient, secret_key: String, headers: Headers, strategy: RequestStrategy, @@ -67,7 +70,7 @@ impl Client { /// Set the application info for the client. /// /// It is recommended that applications set this so that - /// stripe is able to undestand usage patterns from your + /// stripe is able to understand usage patterns from your /// user agent. pub fn with_app_info( mut self, @@ -83,8 +86,7 @@ impl Client { /// Make a `GET` http request with just a path pub fn get(&self, path: &str) -> Response { - let url = self.url(path); - self.client.execute::(self.create_request(Method::Get, url), &self.strategy) + self.send(path, Method::Get) } /// Make a `GET` http request with url query parameters @@ -100,29 +102,23 @@ impl Client { self.client.execute::(self.create_request(Method::Get, url), &self.strategy) } - /// Make a `DELETE` http request with just a path - pub fn delete(&self, path: &str) -> Response { - let url = self.url(path); - self.client.execute::(self.create_request(Method::Delete, url), &self.strategy) - } - - /// Make a `DELETE` http request with url query parameters - pub fn delete_query( + pub fn send( &self, path: &str, - params: P, + method: Method, ) -> Response { - let url = match self.url_with_params(path, params) { - Err(e) => return err(e), - Ok(ok) => ok, - }; - self.client.execute::(self.create_request(Method::Delete, url), &self.strategy) + let url = self.url(path); + self.client.execute::(self.create_request(method, url), &self.strategy) + } + + /// Make a `DELETE` http request with just a path + pub fn delete(&self, path: &str) -> Response { + self.send(path, Method::Delete) } /// Make a `POST` http request with just a path pub fn post(&self, path: &str) -> Response { - let url = self.url(path); - self.client.execute::(self.create_request(Method::Post, url), &self.strategy) + self.send(path, Method::Post) } /// Make a `POST` http request with urlencoded body @@ -130,9 +126,28 @@ impl Client { &self, path: &str, form: F, + ) -> Response { + self.send_form(path, form, Method::Post) + } + + /// Make a `DELETE` http request with urlencoded body + pub fn delete_form( + &self, + path: &str, + form: F, + ) -> Response { + self.send_form(path, form, Method::Delete) + } + + /// Make an http request with urlencoded body + pub fn send_form( + &self, + path: &str, + form: F, + method: Method, ) -> Response { let url = self.url(path); - let mut req = self.create_request(Method::Post, url); + let mut req = self.create_request(method, url); let mut params_buffer = Vec::new(); let qs_ser = &mut serde_qs::Serializer::new(&mut params_buffer); diff --git a/async-stripe/src/error.rs b/async-stripe/src/error.rs new file mode 100644 index 000000000..84d326bc8 --- /dev/null +++ b/async-stripe/src/error.rs @@ -0,0 +1,32 @@ +use stripe_types::ApiErrors; +use thiserror::Error; + +/// An error encountered when communicating with the Stripe API. +#[derive(Debug, Error)] +pub enum StripeError { + #[error("error reported by stripe: {0:#?}, status code: {1}")] + Stripe(ApiErrors, u16), + #[error("error serializing or deserializing a querystring: {0}")] + QueryStringSerialize(#[from] serde_path_to_error::Error), + #[error("error serializing or deserializing a request")] + JSONSerialize(#[from] serde_path_to_error::Error), + #[error("attempted to access an unsupported version of the api")] + UnsupportedVersion, + #[error("error communicating with stripe: {0}")] + ClientError(String), + #[error("timeout communicating with stripe")] + Timeout, +} + +#[cfg(feature = "hyper")] +impl From for StripeError { + fn from(err: hyper::Error) -> StripeError { + StripeError::ClientError(err.to_string()) + } +} + +impl From for StripeError { + fn from(err: http_types::Error) -> StripeError { + StripeError::ClientError(err.to_string()) + } +} diff --git a/src/lib.rs b/async-stripe/src/lib.rs similarity index 92% rename from src/lib.rs rename to async-stripe/src/lib.rs index 11bcab1ec..15f1f240b 100644 --- a/src/lib.rs +++ b/async-stripe/src/lib.rs @@ -63,9 +63,9 @@ mod client; mod error; -mod ids; -mod params; -mod resources; +mod pagination; + +pub use pagination::{ListPaginator, PaginationExt, PaginationParams}; // N.B. Ideally we would support both a blocking client and // an async client without a feature flag, but the originally @@ -75,9 +75,4 @@ mod resources; // See https://github.com/wyyerd/stripe-rs/issues/24#issuecomment-451514187 // See https://github.com/rust-lang/rust/issues/44265 pub use crate::client::*; -pub use crate::error::{ErrorCode, ErrorType, RequestError, StripeError, WebhookError}; -pub use crate::ids::*; -pub use crate::params::{ - Expandable, Headers, IdOrCreate, List, Metadata, Object, RangeBounds, RangeQuery, Timestamp, -}; -pub use crate::resources::*; +pub use crate::error::StripeError; diff --git a/async-stripe/src/pagination.rs b/async-stripe/src/pagination.rs new file mode 100644 index 000000000..8d269956a --- /dev/null +++ b/async-stripe/src/pagination.rs @@ -0,0 +1,155 @@ +// Necessary under tokio-blocking since `Response` is a type alias to a `Result` +#![allow(clippy::missing_errors_doc)] +use serde::de::DeserializeOwned; +use serde::Serialize; +use stripe_types::{List, Object}; + +use crate::{Client, Response}; + +pub trait PaginationParams: Serialize {} + +#[derive(Debug)] +pub struct ListPaginator { + data: Vec, + url: String, + has_more: bool, + total_count: Option, + params: serde_json::Value, +} + +pub trait PaginationExt { + fn into_paginator(self) -> ListPaginator; +} + +impl PaginationExt for List +where + T: Object + DeserializeOwned + Send + Sync + 'static, +{ + fn into_paginator(self) -> ListPaginator { + ListPaginator::new_from_list(self) + } +} + +impl ListPaginator { + pub fn from_params(url: &str, params: impl PaginationParams) -> Self { + ListPaginator { + data: vec![], + url: url.to_string(), + has_more: true, + total_count: None, + params: serde_json::to_value(params).expect("Invalid pagination params"), + } + } +} + +impl ListPaginator +where + T: Object + DeserializeOwned + Send + Sync + 'static, +{ + /// Repeatedly queries Stripe for more data until all elements in list are fetched, using + /// Stripe's default page size. + /// + /// Requires `feature = "blocking"`. + #[cfg(feature = "blocking")] + pub fn get_all(self, client: &Client) -> Response> { + let mut data = Vec::with_capacity(self.total_count.unwrap_or(0)); + let mut paginator = self; + loop { + if !paginator.has_more { + data.extend(paginator.data); + break; + } + let next_page = paginator.fetch_page_with_curr_params(client)?; + paginator.update_with_new_data(next_page); + } + Ok(data) + } + + /// Get all values in this List, consuming self and lazily paginating until all values are fetched. + /// + /// This function repeatedly queries Stripe for more data until all elements in list are fetched, using + /// the page size specified in params, or Stripe's default page size if none is specified. + /// + /// + /// Requires `feature = ["async", "stream"]`. + #[cfg(all(feature = "async", feature = "stream"))] + pub fn stream( + mut self, + client: &Client, + ) -> impl futures_util::Stream> + Unpin { + // We are going to be popping items off the end of the list, so we need to reverse it. + self.data.reverse(); + + Box::pin(futures_util::stream::unfold(Some((self, client.clone())), Self::unfold_stream)) + } + + /// unfold a single item from the stream + #[cfg(all(feature = "async", feature = "stream"))] + async fn unfold_stream( + state: Option<(Self, Client)>, + ) -> Option<(Result, Option<(Self, Client)>)> { + let (mut paginator, client) = state?; // If none, we sent the last item in the last iteration + + if let Some(next_val) = paginator.data.pop() { + // We have more data on this page + return Some((Ok(next_val), Some((paginator, client)))); + } + + // Final value of the stream, no errors + if !paginator.has_more { + return None; + } + + match paginator.fetch_page_with_curr_params(&client).await { + Ok(next_page) => { + debug_assert!(paginator.data.is_empty()); + paginator.update_with_new_data(next_page); + + // We are going to be popping items off the end of the list, so we need to reverse it. + // The assert above ensures we are only reversing this specific list we've + // just received + paginator.data.reverse(); + + let next_val = paginator.data.pop()?; + + // Yield last value of this page, the next page (and client) becomes the state + Some((Ok(next_val), Some((paginator, client)))) + } + Err(e) => Some((Err(e), None)), // We ran into an error. The last value of the stream will be the error. + } + } + + fn fetch_page_with_curr_params(&self, client: &Client) -> Response> { + client.get_query(&self.url, &self.params) + } + + fn new_from_list(list: List) -> Self { + let mut paginator = Self { + data: list.data, + // the url we get back is prefixed + url: list.url.trim_start_matches("/v1/").to_string(), + has_more: list.has_more, + total_count: list.total_count.map(|t| t as usize), + params: Default::default(), + }; + if let Some(curr_cursor) = paginator.data.last().and_then(|t| t.id()) { + paginator.update_cursor(curr_cursor.to_string()); + } + paginator + } + + fn update_cursor(&mut self, id: String) { + self.params["starting_after"] = serde_json::Value::String(id); + } + + fn update_with_new_data(&mut self, list: List) { + self.has_more = list.has_more; + self.total_count = list.total_count.map(|t| t as usize); + if let Some(new_cursor) = list.data.last().and_then(|l| l.id()) { + self.update_cursor(new_cursor.to_string()); + } else { + self.has_more = false; + } + self.data.extend(list.data); + } +} diff --git a/async-stripe/src/resources/generated/account.rs b/async-stripe/src/resources/generated/account.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/account_link.rs b/async-stripe/src/resources/generated/account_link.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/account_session.rs b/async-stripe/src/resources/generated/account_session.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/address.rs b/async-stripe/src/resources/generated/address.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/api_errors.rs b/async-stripe/src/resources/generated/api_errors.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/apple_pay_domain.rs b/async-stripe/src/resources/generated/apple_pay_domain.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/application.rs b/async-stripe/src/resources/generated/application.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/application_fee.rs b/async-stripe/src/resources/generated/application_fee.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/apps_secret.rs b/async-stripe/src/resources/generated/apps_secret.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/balance.rs b/async-stripe/src/resources/generated/balance.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/balance_transaction.rs b/async-stripe/src/resources/generated/balance_transaction.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/bank_account.rs b/async-stripe/src/resources/generated/bank_account.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/bank_connections_resource_accountholder.rs b/async-stripe/src/resources/generated/bank_connections_resource_accountholder.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/billing_details.rs b/async-stripe/src/resources/generated/billing_details.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/billing_portal_configuration.rs b/async-stripe/src/resources/generated/billing_portal_configuration.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/billing_portal_session.rs b/async-stripe/src/resources/generated/billing_portal_session.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/capability.rs b/async-stripe/src/resources/generated/capability.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/card.rs b/async-stripe/src/resources/generated/card.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/cash_balance.rs b/async-stripe/src/resources/generated/cash_balance.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/charge.rs b/async-stripe/src/resources/generated/charge.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/checkout_session.rs b/async-stripe/src/resources/generated/checkout_session.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/connect_collection_transfer.rs b/async-stripe/src/resources/generated/connect_collection_transfer.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/country_spec.rs b/async-stripe/src/resources/generated/country_spec.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/coupon.rs b/async-stripe/src/resources/generated/coupon.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/credit_note.rs b/async-stripe/src/resources/generated/credit_note.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/credit_note_line_item.rs b/async-stripe/src/resources/generated/credit_note_line_item.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/custom_unit_amount.rs b/async-stripe/src/resources/generated/custom_unit_amount.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/customer.rs b/async-stripe/src/resources/generated/customer.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/customer_balance_transaction.rs b/async-stripe/src/resources/generated/customer_balance_transaction.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/customer_cash_balance_transaction.rs b/async-stripe/src/resources/generated/customer_cash_balance_transaction.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/discount.rs b/async-stripe/src/resources/generated/discount.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/dispute.rs b/async-stripe/src/resources/generated/dispute.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/ephemeral_key.rs b/async-stripe/src/resources/generated/ephemeral_key.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/event.rs b/async-stripe/src/resources/generated/event.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/exchange_rate.rs b/async-stripe/src/resources/generated/exchange_rate.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/fee_refund.rs b/async-stripe/src/resources/generated/fee_refund.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/file.rs b/async-stripe/src/resources/generated/file.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/file_link.rs b/async-stripe/src/resources/generated/file_link.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/financial_connections_account.rs b/async-stripe/src/resources/generated/financial_connections_account.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/financial_connections_account_owner.rs b/async-stripe/src/resources/generated/financial_connections_account_owner.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/financial_connections_account_ownership.rs b/async-stripe/src/resources/generated/financial_connections_account_ownership.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/financial_connections_session.rs b/async-stripe/src/resources/generated/financial_connections_session.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/funding_instructions.rs b/async-stripe/src/resources/generated/funding_instructions.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/identity_verification_report.rs b/async-stripe/src/resources/generated/identity_verification_report.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/identity_verification_session.rs b/async-stripe/src/resources/generated/identity_verification_session.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/invoice.rs b/async-stripe/src/resources/generated/invoice.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/invoice_payment_method_options_acss_debit.rs b/async-stripe/src/resources/generated/invoice_payment_method_options_acss_debit.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/invoice_payment_method_options_bancontact.rs b/async-stripe/src/resources/generated/invoice_payment_method_options_bancontact.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/invoice_payment_method_options_customer_balance.rs b/async-stripe/src/resources/generated/invoice_payment_method_options_customer_balance.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/invoice_payment_method_options_konbini.rs b/async-stripe/src/resources/generated/invoice_payment_method_options_konbini.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/invoice_payment_method_options_us_bank_account.rs b/async-stripe/src/resources/generated/invoice_payment_method_options_us_bank_account.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/invoice_setting_rendering_options.rs b/async-stripe/src/resources/generated/invoice_setting_rendering_options.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/invoiceitem.rs b/async-stripe/src/resources/generated/invoiceitem.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/invoices_shipping_cost.rs b/async-stripe/src/resources/generated/invoices_shipping_cost.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/issuing_authorization.rs b/async-stripe/src/resources/generated/issuing_authorization.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/issuing_authorization_amount_details.rs b/async-stripe/src/resources/generated/issuing_authorization_amount_details.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/issuing_authorization_merchant_data.rs b/async-stripe/src/resources/generated/issuing_authorization_merchant_data.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/issuing_card.rs b/async-stripe/src/resources/generated/issuing_card.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/issuing_cardholder.rs b/async-stripe/src/resources/generated/issuing_cardholder.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/issuing_dispute.rs b/async-stripe/src/resources/generated/issuing_dispute.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/issuing_transaction.rs b/async-stripe/src/resources/generated/issuing_transaction.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/item.rs b/async-stripe/src/resources/generated/item.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/legal_entity_japan_address.rs b/async-stripe/src/resources/generated/legal_entity_japan_address.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/line_item.rs b/async-stripe/src/resources/generated/line_item.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/linked_account_options_us_bank_account.rs b/async-stripe/src/resources/generated/linked_account_options_us_bank_account.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/login_link.rs b/async-stripe/src/resources/generated/login_link.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/mandate.rs b/async-stripe/src/resources/generated/mandate.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/notification_event_data.rs b/async-stripe/src/resources/generated/notification_event_data.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/payment_intent.rs b/async-stripe/src/resources/generated/payment_intent.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs b/async-stripe/src/resources/generated/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/payment_link.rs b/async-stripe/src/resources/generated/payment_link.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/payment_method.rs b/async-stripe/src/resources/generated/payment_method.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/payment_method_card_present_networks.rs b/async-stripe/src/resources/generated/payment_method_card_present_networks.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/payment_method_config_biz_payment_method_configuration_details.rs b/async-stripe/src/resources/generated/payment_method_config_biz_payment_method_configuration_details.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/payment_method_configuration.rs b/async-stripe/src/resources/generated/payment_method_configuration.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/payment_method_details_card_checks.rs b/async-stripe/src/resources/generated/payment_method_details_card_checks.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/payment_method_details_card_installments_plan.rs b/async-stripe/src/resources/generated/payment_method_details_card_installments_plan.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/payment_method_details_card_wallet_apple_pay.rs b/async-stripe/src/resources/generated/payment_method_details_card_wallet_apple_pay.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/payment_method_details_card_wallet_google_pay.rs b/async-stripe/src/resources/generated/payment_method_details_card_wallet_google_pay.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/payment_method_domain.rs b/async-stripe/src/resources/generated/payment_method_domain.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/payment_method_options_customer_balance_eu_bank_account.rs b/async-stripe/src/resources/generated/payment_method_options_customer_balance_eu_bank_account.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/payout.rs b/async-stripe/src/resources/generated/payout.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/person.rs b/async-stripe/src/resources/generated/person.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/placeholders.rs b/async-stripe/src/resources/generated/placeholders.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/plan.rs b/async-stripe/src/resources/generated/plan.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/platform_tax_fee.rs b/async-stripe/src/resources/generated/platform_tax_fee.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/price.rs b/async-stripe/src/resources/generated/price.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/product.rs b/async-stripe/src/resources/generated/product.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/promotion_code.rs b/async-stripe/src/resources/generated/promotion_code.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/quote.rs b/async-stripe/src/resources/generated/quote.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/quotes_resource_total_details.rs b/async-stripe/src/resources/generated/quotes_resource_total_details.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/radar_early_fraud_warning.rs b/async-stripe/src/resources/generated/radar_early_fraud_warning.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/radar_radar_options.rs b/async-stripe/src/resources/generated/radar_radar_options.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/radar_value_list.rs b/async-stripe/src/resources/generated/radar_value_list.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/radar_value_list_item.rs b/async-stripe/src/resources/generated/radar_value_list_item.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/refund.rs b/async-stripe/src/resources/generated/refund.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/reporting_report_run.rs b/async-stripe/src/resources/generated/reporting_report_run.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/reporting_report_type.rs b/async-stripe/src/resources/generated/reporting_report_type.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/reserve_transaction.rs b/async-stripe/src/resources/generated/reserve_transaction.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/review.rs b/async-stripe/src/resources/generated/review.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/scheduled_query_run.rs b/async-stripe/src/resources/generated/scheduled_query_run.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/setup_attempt.rs b/async-stripe/src/resources/generated/setup_attempt.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/setup_intent.rs b/async-stripe/src/resources/generated/setup_intent.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/shipping.rs b/async-stripe/src/resources/generated/shipping.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/shipping_rate.rs b/async-stripe/src/resources/generated/shipping_rate.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/source.rs b/async-stripe/src/resources/generated/source.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/source_mandate_notification.rs b/async-stripe/src/resources/generated/source_mandate_notification.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/source_transaction.rs b/async-stripe/src/resources/generated/source_transaction.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/subscription.rs b/async-stripe/src/resources/generated/subscription.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/subscription_billing_thresholds.rs b/async-stripe/src/resources/generated/subscription_billing_thresholds.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/subscription_item.rs b/async-stripe/src/resources/generated/subscription_item.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/subscription_item_billing_thresholds.rs b/async-stripe/src/resources/generated/subscription_item_billing_thresholds.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/subscription_schedule.rs b/async-stripe/src/resources/generated/subscription_schedule.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/subscription_transfer_data.rs b/async-stripe/src/resources/generated/subscription_transfer_data.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/tax_calculation.rs b/async-stripe/src/resources/generated/tax_calculation.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/tax_calculation_line_item.rs b/async-stripe/src/resources/generated/tax_calculation_line_item.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/tax_code.rs b/async-stripe/src/resources/generated/tax_code.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/tax_deducted_at_source.rs b/async-stripe/src/resources/generated/tax_deducted_at_source.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/tax_id.rs b/async-stripe/src/resources/generated/tax_id.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/tax_product_resource_customer_details.rs b/async-stripe/src/resources/generated/tax_product_resource_customer_details.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/tax_rate.rs b/async-stripe/src/resources/generated/tax_rate.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/tax_settings.rs b/async-stripe/src/resources/generated/tax_settings.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/tax_transaction.rs b/async-stripe/src/resources/generated/tax_transaction.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/tax_transaction_line_item.rs b/async-stripe/src/resources/generated/tax_transaction_line_item.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/terminal_configuration.rs b/async-stripe/src/resources/generated/terminal_configuration.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/terminal_connection_token.rs b/async-stripe/src/resources/generated/terminal_connection_token.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/terminal_location.rs b/async-stripe/src/resources/generated/terminal_location.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/terminal_reader.rs b/async-stripe/src/resources/generated/terminal_reader.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/test_helpers_test_clock.rs b/async-stripe/src/resources/generated/test_helpers_test_clock.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/token.rs b/async-stripe/src/resources/generated/token.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/topup.rs b/async-stripe/src/resources/generated/topup.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/transfer.rs b/async-stripe/src/resources/generated/transfer.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/transfer_reversal.rs b/async-stripe/src/resources/generated/transfer_reversal.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/treasury_credit_reversal.rs b/async-stripe/src/resources/generated/treasury_credit_reversal.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/treasury_debit_reversal.rs b/async-stripe/src/resources/generated/treasury_debit_reversal.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/treasury_financial_account.rs b/async-stripe/src/resources/generated/treasury_financial_account.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/treasury_financial_account_features.rs b/async-stripe/src/resources/generated/treasury_financial_account_features.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/treasury_financial_accounts_resource_ach_toggle_settings.rs b/async-stripe/src/resources/generated/treasury_financial_accounts_resource_ach_toggle_settings.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/treasury_financial_accounts_resource_toggle_settings.rs b/async-stripe/src/resources/generated/treasury_financial_accounts_resource_toggle_settings.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/treasury_inbound_transfer.rs b/async-stripe/src/resources/generated/treasury_inbound_transfer.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/treasury_outbound_payment.rs b/async-stripe/src/resources/generated/treasury_outbound_payment.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/treasury_outbound_transfer.rs b/async-stripe/src/resources/generated/treasury_outbound_transfer.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/treasury_received_credit.rs b/async-stripe/src/resources/generated/treasury_received_credit.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/treasury_received_debit.rs b/async-stripe/src/resources/generated/treasury_received_debit.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/treasury_shared_resource_billing_details.rs b/async-stripe/src/resources/generated/treasury_shared_resource_billing_details.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details.rs b/async-stripe/src/resources/generated/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/treasury_transaction.rs b/async-stripe/src/resources/generated/treasury_transaction.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/treasury_transaction_entry.rs b/async-stripe/src/resources/generated/treasury_transaction_entry.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/treasury_transactions_resource_balance_impact.rs b/async-stripe/src/resources/generated/treasury_transactions_resource_balance_impact.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/treasury_transactions_resource_flow_details.rs b/async-stripe/src/resources/generated/treasury_transactions_resource_flow_details.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/usage_record.rs b/async-stripe/src/resources/generated/usage_record.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/usage_record_summary.rs b/async-stripe/src/resources/generated/usage_record_summary.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/version.rs b/async-stripe/src/resources/generated/version.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/generated/webhook_endpoint.rs b/async-stripe/src/resources/generated/webhook_endpoint.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/types.rs b/async-stripe/src/resources/types.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/usage_record_ext.rs b/async-stripe/src/resources/usage_record_ext.rs new file mode 100644 index 000000000..e69de29bb diff --git a/async-stripe/src/resources/webhook_endpoint_ext.rs b/async-stripe/src/resources/webhook_endpoint_ext.rs new file mode 100644 index 000000000..e69de29bb diff --git a/src/resources/webhook_events.rs b/async-stripe/src/resources/webhook_events.rs similarity index 100% rename from src/resources/webhook_events.rs rename to async-stripe/src/resources/webhook_events.rs diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index 11c03e1d7..000000000 --- a/src/error.rs +++ /dev/null @@ -1,215 +0,0 @@ -use std::num::ParseIntError; - -use serde::{Deserialize, Serialize}; -use thiserror::Error; - -use crate::params::to_snakecase; - -/// An error encountered when communicating with the Stripe API. -#[derive(Debug, Error)] -pub enum StripeError { - #[error("error reported by stripe: {0}")] - Stripe(#[from] RequestError), - #[error("error serializing or deserializing a querystring: {0}")] - QueryStringSerialize(#[from] serde_path_to_error::Error), - #[error("error serializing or deserializing a request")] - JSONSerialize(#[from] serde_path_to_error::Error), - #[error("attempted to access an unsupported version of the api")] - UnsupportedVersion, - #[error("error communicating with stripe: {0}")] - ClientError(String), - #[error("timeout communicating with stripe")] - Timeout, -} - -#[cfg(feature = "hyper")] -impl From for StripeError { - fn from(err: hyper::Error) -> StripeError { - StripeError::ClientError(err.to_string()) - } -} - -impl From for StripeError { - fn from(err: http_types::Error) -> StripeError { - StripeError::ClientError(err.to_string()) - } -} - -/// The list of possible values for a RequestError's type. -#[derive(Debug, PartialEq, Deserialize)] -pub enum ErrorType { - #[serde(skip_deserializing)] - Unknown, - #[serde(rename = "api_error")] - Api, - #[serde(rename = "api_connection_error")] - Connection, - #[serde(rename = "authentication_error")] - Authentication, - #[serde(rename = "card_error")] - Card, - #[serde(rename = "idempotency_error")] - IdempotencyError, - #[serde(rename = "invalid_request_error")] - InvalidRequest, - #[serde(rename = "rate_limit_error")] - RateLimit, - #[serde(rename = "validation_error")] - Validation, -} - -impl Default for ErrorType { - fn default() -> Self { - ErrorType::Unknown - } -} - -impl std::fmt::Display for ErrorType { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", to_snakecase(&format!("{:?}Error", self))) - } -} - -/// The list of possible values for a RequestError's code. -#[derive(Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq, Hash)] -#[serde(rename_all = "snake_case")] -#[non_exhaustive] -pub enum ErrorCode { - AccountAlreadyExists, - AccountCountryInvalidAddress, - AccountInvalid, - AccountNumberInvalid, - AlipayUpgradeRequired, - AmountTooLarge, - AmountTooSmall, - ApiKeyExpired, - BalanceInsufficient, - BankAccountExists, - BankAccountUnusable, - BankAccountUnverified, - BankAccountVerificationFailed, - BitcoinUpgradeRequired, - CardDeclined, - ChargeAlreadyCaptured, - ChargeAlreadyRefunded, - ChargeDisputed, - ChargeExpiredForCapture, - CountryUnsupported, - CouponExpired, - CustomerMaxSubscriptions, - EmailInvalid, - ExpiredCard, - IdempotencyKeyInUse, - IncorrectAddress, - IncorrectCvc, - IncorrectNumber, - IncorrectZip, - InstantPayoutsUnsupported, - InvalidCardType, - InvalidChargeAmount, - InvalidCvc, - InvalidExpiryMonth, - InvalidExpiryYear, - InvalidNumber, - InvalidSourceUsage, - InvoiceNoCustomerLineItems, - InvoiceNoSubscriptionLineItems, - InvoiceNotEditable, - InvoiceUpcomingNone, - LivemodeMismatch, - Missing, - OrderCreationFailed, - OrderRequiredSettings, - OrderStatusInvalid, - OrderUpstreamTimeout, - OutOfInventory, - ParameterInvalidEmpty, - ParameterInvalidInteger, - ParameterInvalidStringBlank, - ParameterInvalidStringEmpty, - ParameterMissing, - ParameterUnknown, - PaymentMethodUnactivated, - PaymentIntentUnexpectedState, - PayoutsNotAllowed, - PlatformApiKeyExpired, - PostalCodeInvalid, - ProcessingError, - ProductInactive, - RateLimit, - ResourceAlreadyExists, - ResourceMissing, - RoutingNumberInvalid, - SecretKeyRequired, - SepaUnsupportedAccount, - ShippingCalculationFailed, - SkuInactive, - StateUnsupported, - TaxIdInvalid, - TaxesCalculationFailed, - TestmodeChargesOnly, - TlsVersionUnsupported, - TokenAlreadyUsed, - TokenInUse, - TransfersNotAllowed, - UpstreamOrderCreationFailed, - UrlInvalid, -} - -impl std::fmt::Display for ErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", to_snakecase(&format!("{:?}", self))) - } -} - -/// An error reported by stripe in a request's response. -/// -/// For more details see . -#[derive(Debug, Default, Deserialize, Error)] -#[error("{error_type} ({http_status}) with message: {message:?}")] -pub struct RequestError { - /// The HTTP status in the response. - #[serde(skip_deserializing)] - pub http_status: u16, - - /// The type of error returned. - #[serde(rename = "type")] - pub error_type: ErrorType, - - /// A human-readable message providing more details about the error. - /// For card errors, these messages can be shown to end users. - #[serde(default)] - pub message: Option, - - /// For card errors, a value describing the kind of card error that occured. - pub code: Option, - - /// For card errors resulting from a bank decline, a string indicating the - /// bank's reason for the decline if they provide one. - pub decline_code: Option, - - /// The ID of the failed charge, if applicable. - pub charge: Option, -} - -/// The structure of the json body when an error is included in -/// the response from Stripe. -#[derive(Deserialize)] -pub struct ErrorResponse { - pub error: RequestError, -} - -/// An error encountered when communicating with the Stripe API webhooks. -#[derive(Debug, Error)] -pub enum WebhookError { - #[error("invalid key length")] - BadKey, - #[error("error parsing timestamp")] - BadHeader(#[from] ParseIntError), - #[error("error comparing signatures")] - BadSignature, - #[error("error comparing timestamps - over tolerance")] - BadTimestamp(i64), - #[error("error parsing event object")] - BadParse(#[from] serde_json::Error), -} diff --git a/src/ids.rs b/src/ids.rs deleted file mode 100644 index 791b3be58..000000000 --- a/src/ids.rs +++ /dev/null @@ -1,757 +0,0 @@ -use smart_default::SmartDefault; - -macro_rules! def_id_serde_impls { - ($struct_name:ident) => { - impl serde::Serialize for $struct_name { - fn serialize(&self, serializer: S) -> Result - where - S: serde::ser::Serializer, - { - self.as_str().serialize(serializer) - } - } - - impl<'de> serde::Deserialize<'de> for $struct_name { - fn deserialize(deserializer: D) -> Result - where - D: serde::de::Deserializer<'de>, - { - let s: String = serde::Deserialize::deserialize(deserializer)?; - s.parse::().map_err(::serde::de::Error::custom) - } - } - }; - ($struct_name:ident, _) => {}; -} - -macro_rules! def_id { - ($struct_name:ident: String) => { - #[derive(Clone, Debug, Default, Eq, PartialEq, Hash)] - pub struct $struct_name(smol_str::SmolStr); - - impl $struct_name { - /// Extracts a string slice containing the entire id. - #[inline(always)] - pub fn as_str(&self) -> &str { - self.0.as_str() - } - } - - impl PartialEq for $struct_name { - fn eq(&self, other: &str) -> bool { - self.as_str() == other - } - } - - impl PartialEq<&str> for $struct_name { - fn eq(&self, other: &&str) -> bool { - self.as_str() == *other - } - } - - impl PartialEq for $struct_name { - fn eq(&self, other: &String) -> bool { - self.as_str() == other - } - } - - impl PartialOrd for $struct_name { - fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) - } - } - - impl Ord for $struct_name { - fn cmp(&self, other: &Self) -> std::cmp::Ordering { - self.as_str().cmp(other.as_str()) - } - } - - impl AsRef for $struct_name { - fn as_ref(&self) -> &str { - self.as_str() - } - } - - impl crate::params::AsCursor for $struct_name {} - - impl std::ops::Deref for $struct_name { - type Target = str; - - fn deref(&self) -> &str { - self.as_str() - } - } - - impl std::fmt::Display for $struct_name { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - self.0.fmt(f) - } - } - - impl std::str::FromStr for $struct_name { - type Err = ParseIdError; - - fn from_str(s: &str) -> Result { - Ok($struct_name(s.into())) - } - } - - impl serde::Serialize for $struct_name { - fn serialize(&self, serializer: S) -> Result - where S: serde::ser::Serializer - { - self.as_str().serialize(serializer) - } - } - - impl<'de> serde::Deserialize<'de> for $struct_name { - fn deserialize(deserializer: D) -> Result - where D: serde::de::Deserializer<'de> - { - let s: String = serde::Deserialize::deserialize(deserializer)?; - s.parse::().map_err(::serde::de::Error::custom) - } - } - }; - ($struct_name:ident, $prefix:literal $(| $alt_prefix:literal)* $(, { $generate_hint:tt })?) => { - /// An id for the corresponding object type. - /// - /// This type _typically_ will not allocate and - /// therefore is usually cheaply clonable. - #[derive(Clone, Debug, Default, Eq, PartialEq, Hash)] - pub struct $struct_name(smol_str::SmolStr); - - impl $struct_name { - /// The prefix of the id type (e.g. `cus_` for a `CustomerId`). - #[inline(always)] - #[deprecated(note = "Please use prefixes or is_valid_prefix")] - pub fn prefix() -> &'static str { - $prefix - } - - /// The valid prefixes of the id type (e.g. [`ch_`, `py_`\ for a `ChargeId`). - #[inline(always)] - pub fn prefixes() -> &'static [&'static str] { - &[$prefix$(, $alt_prefix)*] - } - - /// Extracts a string slice containing the entire id. - #[inline(always)] - pub fn as_str(&self) -> &str { - self.0.as_str() - } - - /// Check is provided prefix would be a valid prefix for id's of this type - pub fn is_valid_prefix(prefix: &str) -> bool { - prefix == $prefix $( || prefix == $alt_prefix )* - } - } - - impl PartialEq for $struct_name { - fn eq(&self, other: &str) -> bool { - self.as_str() == other - } - } - - impl PartialEq<&str> for $struct_name { - fn eq(&self, other: &&str) -> bool { - self.as_str() == *other - } - } - - impl PartialEq for $struct_name { - fn eq(&self, other: &String) -> bool { - self.as_str() == other - } - } - - impl PartialOrd for $struct_name { - fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) - } - } - - impl Ord for $struct_name { - fn cmp(&self, other: &Self) -> std::cmp::Ordering { - self.as_str().cmp(other.as_str()) - } - } - - impl AsRef for $struct_name { - fn as_ref(&self) -> &str { - self.as_str() - } - } - - impl crate::params::AsCursor for $struct_name {} - - impl std::ops::Deref for $struct_name { - type Target = str; - - fn deref(&self) -> &str { - self.as_str() - } - } - - impl std::fmt::Display for $struct_name { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - self.0.fmt(f) - } - } - - impl std::str::FromStr for $struct_name { - type Err = ParseIdError; - - fn from_str(s: &str) -> Result { - if !s.starts_with($prefix) $( - && !s.starts_with($alt_prefix) - )* { - // N.B. For debugging - eprintln!("bad id is: {} (expected: {:?}) for {}", s, $prefix, stringify!($struct_name)); - - Err(ParseIdError { - typename: stringify!($struct_name), - expected: stringify!(id to start with $prefix $(or $alt_prefix)*), - }) - } else { - Ok($struct_name(s.into())) - } - } - } - - def_id_serde_impls!($struct_name $(, $generate_hint )*); - }; - (#[optional] enum $enum_name:ident { $( $variant_name:ident($($variant_type:tt)*) ),* $(,)* }) => { - #[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] - pub enum $enum_name { - None, - $( $variant_name($($variant_type)*), )* - } - - impl $enum_name { - pub fn as_str(&self) -> &str { - match *self { - $enum_name::None => "", - $( $enum_name::$variant_name(ref id) => id.as_str(), )* - } - } - } - - impl PartialEq for $enum_name { - fn eq(&self, other: &str) -> bool { - self.as_str() == other - } - } - - impl PartialEq<&str> for $enum_name { - fn eq(&self, other: &&str) -> bool { - self.as_str() == *other - } - } - - impl PartialEq for $enum_name { - fn eq(&self, other: &String) -> bool { - self.as_str() == other - } - } - - impl AsRef for $enum_name { - fn as_ref(&self) -> &str { - self.as_str() - } - } - - impl crate::params::AsCursor for $enum_name {} - - impl std::ops::Deref for $enum_name { - type Target = str; - - fn deref(&self) -> &str { - self.as_str() - } - } - - impl std::fmt::Display for $enum_name { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match *self { - $enum_name::None => Ok(()), - $( $enum_name::$variant_name(ref id) => id.fmt(f), )* - } - } - } - - impl std::default::Default for $enum_name { - fn default() -> Self { - $enum_name::None - } - } - - impl std::str::FromStr for $enum_name { - type Err = ParseIdError; - - fn from_str(s: &str) -> Result { - let prefix = s.find('_') - .map(|i| &s[0..=i]) - .ok_or_else(|| ParseIdError { - typename: stringify!($enum_name), - expected: "id to start with a prefix (as in 'prefix_')" - })?; - - match prefix { - $(_ if $($variant_type)*::is_valid_prefix(prefix) => { - Ok($enum_name::$variant_name(s.parse()?)) - })* - _ => { - Err(ParseIdError { - typename: stringify!($enum_name), - expected: "unknown id prefix", - }) - } - } - } - } - - impl serde::Serialize for $enum_name { - fn serialize(&self, serializer: S) -> Result - where S: serde::ser::Serializer - { - self.as_str().serialize(serializer) - } - } - - impl<'de> serde::Deserialize<'de> for $enum_name { - fn deserialize(deserializer: D) -> Result - where D: serde::de::Deserializer<'de> - { - let s: String = serde::Deserialize::deserialize(deserializer)?; - s.parse::().map_err(::serde::de::Error::custom) - } - } - - $( - impl From<$($variant_type)*> for $enum_name { - fn from(id: $($variant_type)*) -> Self { - $enum_name::$variant_name(id) - } - } - )* - }; - (enum $enum_name:ident { $( $(#[$test:meta])? $variant_name:ident($($variant_type:tt)*) ),+ $(,)? }) => { - #[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] - #[derive(SmartDefault)] - pub enum $enum_name { - $( $(#[$test])* $variant_name($($variant_type)*), )* - } - - impl $enum_name { - pub fn as_str(&self) -> &str { - match *self { - $( $enum_name::$variant_name(ref id) => id.as_str(), )* - } - } - } - - impl PartialEq for $enum_name { - fn eq(&self, other: &str) -> bool { - self.as_str() == other - } - } - - impl PartialEq<&str> for $enum_name { - fn eq(&self, other: &&str) -> bool { - self.as_str() == *other - } - } - - impl PartialEq for $enum_name { - fn eq(&self, other: &String) -> bool { - self.as_str() == other - } - } - - impl AsRef for $enum_name { - fn as_ref(&self) -> &str { - self.as_str() - } - } - - impl crate::params::AsCursor for $enum_name {} - - impl std::ops::Deref for $enum_name { - type Target = str; - - fn deref(&self) -> &str { - self.as_str() - } - } - - impl std::fmt::Display for $enum_name { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match *self { - $( $enum_name::$variant_name(ref id) => id.fmt(f), )* - } - } - } - - impl std::str::FromStr for $enum_name { - type Err = ParseIdError; - - fn from_str(s: &str) -> Result { - let prefix = s.find('_') - .map(|i| &s[0..=i]) - .ok_or_else(|| ParseIdError { - typename: stringify!($enum_name), - expected: "id to start with a prefix (as in 'prefix_')" - })?; - - match prefix { - $(_ if $($variant_type)*::is_valid_prefix(prefix) => { - Ok($enum_name::$variant_name(s.parse()?)) - })* - _ => { - Err(ParseIdError { - typename: stringify!($enum_name), - expected: "unknown id prefix", - }) - } - } - } - } - - impl serde::Serialize for $enum_name { - fn serialize(&self, serializer: S) -> Result - where S: serde::ser::Serializer - { - self.as_str().serialize(serializer) - } - } - - impl<'de> serde::Deserialize<'de> for $enum_name { - fn deserialize(deserializer: D) -> Result - where D: serde::de::Deserializer<'de> - { - let s: String = serde::Deserialize::deserialize(deserializer)?; - s.parse::().map_err(::serde::de::Error::custom) - } - } - - $( - impl From<$($variant_type)*> for $enum_name { - fn from(id: $($variant_type)*) -> Self { - $enum_name::$variant_name(id) - } - } - )* - }; -} - -#[derive(Clone, Debug)] -pub struct ParseIdError { - typename: &'static str, - expected: &'static str, -} - -impl std::fmt::Display for ParseIdError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "invalid `{}`, expected {}", self.typename, self.expected) - } -} - -impl std::error::Error for ParseIdError { - fn description(&self) -> &str { - "error parsing an id" - } -} - -def_id!(AccountId, "acct_"); -def_id!(AlipayAccountId, "aliacc_"); -def_id!(ApplicationFeeId, "fee_"); -def_id!(ApplicationId, "ca_"); -def_id!(ApplicationFeeRefundId, "fr_"); -def_id!(BalanceTransactionId, "txn_"); -def_id!(BankAccountId, "ba_" | "card_"); -def_id!(BillingPortalSessionId, "bps_"); -def_id!(BillingPortalConfigurationId, "bpc_"); -def_id!(BankTokenId, "btok_"); -def_id!( - #[optional] - enum BalanceTransactionSourceId { - ApplicationFee(ApplicationFeeId), - Charge(ChargeId), - Dispute(DisputeId), - ApplicationFeeRefund(ApplicationFeeRefundId), - IssuingAuthorization(IssuingAuthorizationId), - IssuingDispute(IssuingDisputeId), - IssuingTransaction(IssuingTransactionId), - Payout(PayoutId), - Refund(RefundId), - Topup(TopupId), - Transfer(TransferId), - TransferReversal(TransferReversalId), - } -); -def_id!(CardId, "card_"); -def_id!(CardTokenId, "tok_"); -def_id!(ChargeId, "ch_" | "py_"); // TODO: Understand (and then document) why "py_" is a valid charge id -def_id!(CheckoutSessionId, "cs_"); -def_id!(CheckoutSessionItemId, "li_"); -def_id!(ConnectCollectionTransferId, "connct_"); -def_id!(ConnectTokenId, "ct_"); -def_id!(CouponId: String); // N.B. A coupon id can be user-provided so can be any arbitrary string -def_id!(CreditNoteId, "cn_"); -def_id!(CreditNoteLineItemId, "cnli_"); -def_id!(CustomerBalanceTransactionId, "cbtxn_"); -def_id!(CustomerId, "cus_"); -def_id!(DiscountId, "di_"); -def_id!(DisputeId, "dp_" | "du_"); -def_id!(EphemeralKeyId, "ephkey_"); -def_id!(EventId, "evt_"); -def_id!(FileId, "file_"); -def_id!(FileLinkId, "link_"); -def_id!(InvoiceId, "in_", { _ }); -def_id!(InvoiceItemId, "ii_"); -def_id!(InvoiceLineItemIdWebhook, "il_"); - -def_id!( - enum InvoiceLineItemId { - #[default] - Item(InvoiceItemId), - Subscription(SubscriptionLineId), - InvoiceLineItemIdWebhook(InvoiceLineItemIdWebhook), - } -); -def_id!(IssuingAuthorizationId, "iauth_"); -def_id!(IssuingCardId, "ic_"); -def_id!(IssuingCardholderId, "ich_"); -def_id!(IssuingDisputeId, "idp_"); -def_id!(IssuingTransactionId, "ipi_"); -def_id!(OrderId, "or_"); -def_id!(OrderReturnId, "orret_"); -def_id!(MandateId, "mandate_"); -def_id!(PaymentMethodConfigurationId: String); -def_id!(PaymentIntentId, "pi_"); -def_id!(PaymentLinkId, "plink_"); -def_id!(PaymentMethodId, "pm_" | "card_" | "src_" | "ba_"); -def_id!( - enum PaymentSourceId { - #[default] - Account(AccountId), - AlipayAccount(AlipayAccountId), - BankAccount(BankAccountId), - Card(CardId), - Source(SourceId), - } -); -def_id!(PayoutId, "po_"); -def_id!( - enum PayoutDestinationId { - #[default] - BankAccount(BankAccountId), - Card(CardId), - } -); -def_id!(PersonId, "person_"); -def_id!(PlanId: String); // N.B. A plan id can be user-provided so can be any arbitrary string -def_id!(PlatformTaxFeeId, "ptf"); -def_id!(PriceId, "price_"); -def_id!(ProductId: String); // N.B. A product id can be user-provided so can be any arbitrary string -def_id!(PromotionCodeId, "promo_"); -def_id!(QuoteId, "qt_"); -def_id!(RecipientId: String); // FIXME: This doesn't seem to be documented yet -def_id!(RefundId, "re_" | "pyr_"); -def_id!(ReserveTransactionId, "rtx"); -def_id!(ReviewId, "prv_"); -def_id!(ScheduledQueryRunId, "sqr_"); -def_id!(SetupAttemptId, "setatt_"); -def_id!(SetupIntentId, "seti_"); -def_id!(SkuId, "sku_"); -def_id!(ShippingRateId, "shr_"); -def_id!(SourceId, "src_"); -def_id!(SubscriptionId, "sub_"); -def_id!(SubscriptionItemId, "si_"); -def_id!(SubscriptionLineId, "sli_"); -def_id!(SubscriptionScheduleId, "sub_sched_"); -def_id!(TaxIdId, "txi_"); -def_id!(TaxCalculationId: String); -def_id!(TaxCalculationLineItemId: String); -def_id!(TaxCodeId, "txcd_"); -def_id!(TaxDeductedAtSourceId, "itds"); -def_id!(TaxRateId, "txr_"); -def_id!(TerminalConfigurationId, "tmc_"); -def_id!(TerminalLocationId, "tml_"); -def_id!(TerminalReaderId, "tmr_"); -def_id!(TestHelpersTestClockId, "clock_"); -def_id!( - enum TokenId { - #[default] - Card(CardTokenId), - Bank(BankTokenId), - Connect(ConnectTokenId), - } -); -def_id!(TopupId, "tu_"); -def_id!(TransferId, "tr_"); -def_id!(TransferReversalId, "trr_"); -def_id!(UsageRecordId, "mbur_"); -def_id!(UsageRecordSummaryId, "urs_" | "sis_"); -def_id!(WebhookEndpointId, "we_"); - -impl InvoiceId { - pub(crate) fn none() -> Self { - Self("".into()) - } - - /// An InvoiceId may have a `None` representation when - /// received from Stripe if the Invoice is an upcoming invoice. - pub fn is_none(&self) -> bool { - self.0.is_empty() - } -} -impl serde::Serialize for InvoiceId { - fn serialize(&self, serializer: S) -> Result - where - S: serde::ser::Serializer, - { - if self.0.is_empty() { - let val: Option<&str> = None; - val.serialize(serializer) - } else { - self.as_str().serialize(serializer) - } - } -} -impl<'de> serde::Deserialize<'de> for InvoiceId { - fn deserialize(deserializer: D) -> Result - where - D: serde::de::Deserializer<'de>, - { - let s: Option = serde::Deserialize::deserialize(deserializer)?; - match s { - None => Ok(InvoiceId::none()), - Some(s) => { - if s.is_empty() { - Ok(InvoiceId::none()) - } else { - s.parse::().map_err(::serde::de::Error::custom) - } - } - } - } -} - -#[cfg(test)] -mod tests { - use std::fmt::{Debug, Display}; - use std::str::FromStr; - - use serde::de::DeserializeOwned; - use serde::{Deserialize, Serialize}; - use serde_json::json; - - use super::*; - - fn assert_ser_de_roundtrip(id: &str) - where - T: DeserializeOwned + Serialize + FromStr + Display + Debug, - ::Err: Debug, - { - let parsed_id = T::from_str(id).expect("Could not parse id"); - let ser = serde_json::to_string(&parsed_id).expect("Could not serialize id"); - let deser: T = serde_json::from_str(&ser).expect("Could not deserialize id"); - assert_eq!(deser.to_string(), id.to_string()); - } - - fn assert_deser_err(id: &str) { - let json_str = format!(r#""{}""#, id); - let deser: Result = serde_json::from_str(&json_str); - assert!(deser.is_err(), "Expected error, got {:?}", deser); - } - - #[test] - fn test_empty_invoice_id_default() { - #[derive(Deserialize)] - struct WithInvoiceId { - id: InvoiceId, - } - - for body in [json!({"id": ""}), json!({})] { - let deser: WithInvoiceId = serde_json::from_value(body).expect("Could not deser"); - assert_eq!(deser.id, InvoiceId::none()); - } - } - - #[test] - fn test_ser_de_roundtrip() { - // InvoiceId special cased - for id in ["in_12345", "in_"] { - assert_ser_de_roundtrip::(id); - } - - // Single prefix - assert_ser_de_roundtrip::("price_abc"); - - // Case where multiple possible prefixes - for id in ["re_bcd", "pyr_123"] { - assert_ser_de_roundtrip::(id); - } - - // Case where id can be anything - for id in ["anything", ""] { - assert_ser_de_roundtrip::(id); - } - - // Case where enum id - for id in ["tok_123", "btok_456"] { - assert_ser_de_roundtrip::(id); - } - } - - #[test] - fn test_deser_err() { - // InvoiceId special cased - assert_deser_err::("in"); - - // Single prefix - for id in ["sub", ""] { - assert_deser_err::(id); - } - - // Case where multiple possible prefixes - for id in ["abc_bcd", "pyr_123"] { - assert_deser_err::(id); - } - - // Case where enum id - for id in ["tok_123", "btok_456"] { - assert_deser_err::(id); - } - } - - #[test] - fn test_parse_customer() { - assert!("cus_123".parse::().is_ok()); - let bad_parse = "zzz_123".parse::(); - assert!(bad_parse.is_err()); - if let Err(err) = bad_parse { - assert_eq!( - format!("{}", err), - "invalid `CustomerId`, expected id to start with \"cus_\"" - ); - } - } - - #[test] - fn test_parse_charge() { - assert!("ch_123".parse::().is_ok()); - assert!("py_123".parse::().is_ok()); - let bad_parse = "zz_123".parse::(); - assert!(bad_parse.is_err()); - if let Err(err) = bad_parse { - assert_eq!( - format!("{}", err), - "invalid `ChargeId`, expected id to start with \"ch_\" or \"py_\"" - ); - } - } -} diff --git a/src/params.rs b/src/params.rs deleted file mode 100644 index 1d89de6d5..000000000 --- a/src/params.rs +++ /dev/null @@ -1,694 +0,0 @@ -use std::collections::HashMap; - -use serde::de::DeserializeOwned; -use serde::{Deserialize, Serialize}; - -use crate::error::StripeError; -use crate::resources::{ApiVersion, Currency}; -use crate::{ - client::{ - config::{err, ok}, - Client, Response, - }, - AccountId, ApplicationId, -}; - -#[derive(Clone, Default)] -pub struct AppInfo { - pub name: String, - pub url: Option, - pub version: Option, -} - -impl ToString for AppInfo { - /// Formats a plugin's 'App Info' into a string that can be added to the end of an User-Agent string. - /// - /// This formatting matches that of other libraries, and if changed then it should be changed everywhere. - fn to_string(&self) -> String { - match (&self.version, &self.url) { - (Some(a), Some(b)) => format!("{}/{} ({})", &self.name, a, b), - (Some(a), None) => format!("{}/{}", &self.name, a), - (None, Some(b)) => format!("{} ({})", &self.name, b), - _ => self.name.to_string(), - } - } -} - -#[derive(Clone)] -pub struct Headers { - pub stripe_version: ApiVersion, - pub user_agent: String, - - pub client_id: Option, - pub stripe_account: Option, -} - -impl Headers { - pub fn to_array(&self) -> [(&str, Option<&str>); 4] { - [ - ("Client-Id", self.client_id.as_deref()), - ("Stripe-Account", self.stripe_account.as_deref()), - ("Stripe-Version", Some(self.stripe_version.as_str())), - ("User-Agent", Some(&self.user_agent)), - ] - } -} - -/// Implemented by types which represent stripe objects. -pub trait Object { - /// The canonical id type for this object. - type Id; - /// The id of the object. - fn id(&self) -> Self::Id; - /// The object's type, typically represented in wire format as the `object` property. - fn object(&self) -> &'static str; -} - -/// A deleted object. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Deleted { - /// Unique identifier for the object. - pub id: T, - /// Always true for a deleted object. - pub deleted: bool, -} - -/// The `Expand` struct is used to serialize `expand` arguments in retrieve and list apis. -#[doc(hidden)] -#[derive(Serialize)] -pub struct Expand<'a> { - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], -} - -impl Expand<'_> { - pub(crate) fn is_empty(expand: &[&str]) -> bool { - expand.is_empty() - } -} - -/// An id or object. -/// -/// By default stripe will return an id for most fields, but if more detail is -/// necessary the `expand` parameter can be provided to ask for the id to be -/// loaded as an object instead: -/// -/// ```rust,ignore -/// Charge::retrieve(&client, &charge_id, &["invoice.customer"]) -/// ``` -/// -/// For more details see . -#[derive(Clone, Debug, Serialize, Deserialize)] // TODO: Implement deserialize by hand for better error messages -#[serde(untagged)] -pub enum Expandable { - Id(T::Id), - Object(Box), -} - -impl Expandable -where - T: Object, - T::Id: Clone + Default, -{ - pub fn id(&self) -> T::Id { - match self { - Expandable::Id(id) => id.clone(), - Expandable::Object(obj) => obj.id(), - } - } -} - -impl Default for Expandable -where - T::Id: Default, -{ - fn default() -> Self { - Expandable::Id(Default::default()) - } -} - -impl Expandable { - pub fn is_object(&self) -> bool { - match self { - Expandable::Id(_) => false, - Expandable::Object(_) => true, - } - } - - pub fn as_object(&self) -> Option<&T> { - match self { - Expandable::Id(_) => None, - Expandable::Object(obj) => Some(obj), - } - } - - pub fn into_object(self) -> Option { - match self { - Expandable::Id(_) => None, - Expandable::Object(obj) => Some(*obj), - } - } -} - -/// Implemented by types which support cursor-based pagination, -/// typically with an id, allowing them to be fetched using a `List` -/// returned by the corresponding "list" api request. -pub trait Paginate { - type Cursor: AsCursor; - fn cursor(&self) -> Self::Cursor; -} - -pub trait AsCursor: AsRef {} - -impl<'a> AsCursor for &'a str {} -impl AsCursor for String {} - -impl Paginate for T -where - T: Object, - T::Id: AsCursor, -{ - type Cursor = T::Id; - fn cursor(&self) -> Self::Cursor { - self.id() - } -} - -pub trait Paginable { - type O: Object + Send; - fn set_last(&mut self, item: Self::O); -} - -pub trait PaginableList { - type O: Paginate + DeserializeOwned + Send + Sync + 'static + Clone + std::fmt::Debug; - fn new(data: Vec, url: String, has_more: bool, total_count: Option) -> Self; - fn get_data(&self) -> Vec; - fn get_url(&self) -> String; - fn get_total_count(&self) -> Option; - fn has_more(&self) -> bool; -} - -/// A single page of a cursor-paginated list of a search object. -/// -/// For more details, see -#[derive(Debug, Deserialize, Serialize)] -pub struct SearchList { - pub object: String, - pub url: String, - pub has_more: bool, - pub data: Vec, - pub next_page: Option, - pub total_count: Option, -} - -impl Default for SearchList { - fn default() -> Self { - SearchList { - object: String::new(), - data: Vec::new(), - has_more: false, - total_count: None, - url: String::new(), - next_page: None, - } - } -} - -impl Clone for SearchList { - fn clone(&self) -> Self { - SearchList { - object: self.object.clone(), - data: self.data.clone(), - has_more: self.has_more, - total_count: self.total_count, - url: self.url.clone(), - next_page: self.next_page.clone(), - } - } -} - -impl PaginableList - for SearchList -{ - type O = T; - - fn new( - data: Vec, - url: String, - has_more: bool, - total_count: Option, - ) -> SearchList { - Self { object: "".to_string(), url, has_more, data, next_page: None, total_count } - } - - fn get_data(&self) -> Vec { - self.data.clone() - } - fn get_url(&self) -> String { - self.url.clone() - } - fn get_total_count(&self) -> Option { - self.total_count - } - fn has_more(&self) -> bool { - self.has_more - } -} - -impl PaginableList - for List -{ - type O = T; - - fn new(data: Vec, url: String, has_more: bool, total_count: Option) -> List { - Self { url, has_more, data, total_count } - } - - fn get_data(&self) -> Vec { - self.data.clone() - } - fn get_url(&self) -> String { - self.url.clone() - } - fn get_total_count(&self) -> Option { - self.total_count - } - fn has_more(&self) -> bool { - self.has_more - } -} - -impl SearchList { - pub fn paginate

(self, params: P) -> ListPaginator, P> { - ListPaginator { page: self, params } - } -} - -/// A single page of a cursor-paginated list of an object. -/// -/// For more details, see -#[derive(Debug, Deserialize, Serialize)] -pub struct List { - pub data: Vec, - pub has_more: bool, - pub total_count: Option, - pub url: String, -} - -impl Default for List { - fn default() -> Self { - List { data: Vec::new(), has_more: false, total_count: None, url: String::new() } - } -} - -impl Clone for List { - fn clone(&self) -> Self { - List { - data: self.data.clone(), - has_more: self.has_more, - total_count: self.total_count, - url: self.url.clone(), - } - } -} - -impl List { - pub fn paginate

(self, params: P) -> ListPaginator, P> { - ListPaginator { page: self, params } - } -} - -#[derive(Debug)] -pub struct ListPaginator { - pub page: T, - pub params: P, -} - -impl< - T: PaginableList + Send + DeserializeOwned + 'static, - P: Clone + Serialize + Send + 'static + std::fmt::Debug, - > ListPaginator -where - P: Paginable, -{ - /// Repeatedly queries Stripe for more data until all elements in list are fetched, using - /// Stripe's default page size. - /// - /// Requires `feature = "blocking"`. - #[cfg(feature = "blocking")] - pub fn get_all(self, client: &Client) -> Response> { - let mut data = Vec::with_capacity(self.page.get_total_count().unwrap_or(0) as usize); - let mut paginator = self; - loop { - if !paginator.page.has_more() { - data.extend(paginator.page.get_data().into_iter()); - break; - } - let next_paginator = paginator.next(client)?; - data.extend(paginator.page.get_data().into_iter()); - paginator = next_paginator - } - Ok(data) - } - - /// Get all values in this List, consuming self and lazily paginating until all values are fetched. - /// - /// This function repeatedly queries Stripe for more data until all elements in list are fetched, using - /// the page size specified in params, or Stripe's default page size if none is specified. - /// - /// ```no_run - /// # use stripe::{Customer, ListCustomers, StripeError, Client}; - /// # use futures_util::TryStreamExt; - /// # async fn run() -> Result<(), StripeError> { - /// # let client = Client::new("sk_test_123"); - /// # let params = ListCustomers { ..Default::default() }; - /// - /// let list = Customer::list(&client, ¶ms).await.unwrap().paginate(params); - /// let mut stream = list.stream(&client); - /// - /// // take a value out from the stream - /// if let Some(val) = stream.try_next().await? { - /// println!("GOT = {:?}", val); - /// } - /// - /// // alternatively, you can use stream combinators - /// let all_values = stream.try_collect::>().await?; - /// - /// # Ok(()) - /// # } - /// ``` - /// - /// Requires `feature = ["async", "stream"]`. - #[cfg(all(feature = "async", feature = "stream"))] - pub fn stream( - self, - client: &Client, - ) -> impl futures_util::Stream> + Unpin { - // We are going to be popping items off the end of the list, so we need to reverse it. - self.page.get_data().reverse(); - - Box::pin(futures_util::stream::unfold(Some((self, client.clone())), Self::unfold_stream)) - } - - /// unfold a single item from the stream - #[cfg(all(feature = "async", feature = "stream"))] - async fn unfold_stream( - state: Option<(Self, Client)>, - ) -> Option<(Result, Option<(Self, Client)>)> { - let (paginator, client) = state?; // If none, we sent the last item in the last iteration - - if paginator.page.get_data().len() > 1 { - return Some((Ok(paginator.page.get_data().pop()?), Some((paginator, client)))); - // We have more data on this page - } - - if !paginator.page.has_more() { - return Some((Ok(paginator.page.get_data().pop()?), None)); // Final value of the stream, no errors - } - - match paginator.next(&client).await { - Ok(next_paginator) => { - let data = paginator.page.get_data().pop()?; - next_paginator.page.get_data().reverse(); - - // Yield last value of thimuts page, the next page (and client) becomes the state - Some((Ok(data), Some((next_paginator, client)))) - } - Err(e) => Some((Err(e), None)), // We ran into an error. The last value of the stream will be the error. - } - } - - /// Fetch an additional page of data from stripe. - pub fn next(&self, client: &Client) -> Response { - if let Some(last) = self.page.get_data().last() { - if self.page.get_url().starts_with("/v1/") { - let path = self.page.get_url().trim_start_matches("/v1/").to_string(); // the url we get back is prefixed - - // clone the params and set the cursor - let params_next = { - let mut p = self.params.clone(); - p.set_last(last.clone()); - p - }; - - let page = client.get_query(&path, ¶ms_next); - - ListPaginator::create_paginator(page, params_next) - } else { - err(StripeError::UnsupportedVersion) - } - } else { - ok(ListPaginator { - page: T::new(Vec::new(), self.page.get_url(), false, self.page.get_total_count()), - params: self.params.clone(), - }) - } - } - - /// Pin a new future which maps the result inside the page future into - /// a ListPaginator - #[cfg(feature = "async")] - fn create_paginator(page: Response, params: P) -> Response { - use futures_util::FutureExt; - Box::pin(page.map(|page| page.map(|page| ListPaginator { page, params }))) - } - - #[cfg(feature = "blocking")] - fn create_paginator(page: Response, params: P) -> Response { - page.map(|page| ListPaginator { page, params }) - } -} - -pub type CurrencyMap = HashMap; -pub type Metadata = HashMap; -pub type Timestamp = i64; - -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "lowercase")] -pub struct RangeBounds { - pub gt: Option, - pub gte: Option, - pub lt: Option, - pub lte: Option, -} - -impl Default for RangeBounds { - fn default() -> Self { - RangeBounds { gt: None, gte: None, lt: None, lte: None } - } -} - -/// A set of generic request parameters that can be used on -/// list endpoints to filter their results by some timestamp. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(untagged)] -pub enum RangeQuery { - Exact(T), - Bounds(RangeBounds), -} - -impl RangeQuery { - /// Filter results to exactly match a given value - pub fn eq(value: T) -> RangeQuery { - RangeQuery::Exact(value) - } - - /// Filter results to be after a given value - pub fn gt(value: T) -> RangeQuery { - RangeQuery::Bounds(RangeBounds { gt: Some(value), ..Default::default() }) - } - - /// Filter results to be after or equal to a given value - pub fn gte(value: T) -> RangeQuery { - RangeQuery::Bounds(RangeBounds { gte: Some(value), ..Default::default() }) - } - - /// Filter results to be before to a given value - pub fn lt(value: T) -> RangeQuery { - RangeQuery::Bounds(RangeBounds { lt: Some(value), ..Default::default() }) - } - - /// Filter results to be before or equal to a given value - pub fn lte(value: T) -> RangeQuery { - RangeQuery::Bounds(RangeBounds { lte: Some(value), ..Default::default() }) - } -} - -#[derive(Clone, Debug, Serialize)] -#[serde(untagged)] -pub enum IdOrCreate<'a, T> { - Id(&'a str), - Create(&'a T), -} - -// NOTE: Only intended to handle conversion from ASCII CamelCase to SnakeCase -// This function is used to convert static Rust identifiers to snakecase -// TODO: pub(crate) fn -pub fn to_snakecase(camel: &str) -> String { - let mut i = 0; - let mut snake = String::new(); - let mut chars = camel.chars().peekable(); - while let Some(ch) = chars.next() { - if ch.is_uppercase() { - if i > 0 && !chars.peek().unwrap_or(&'A').is_uppercase() { - snake.push('_'); - } - snake.push(ch.to_lowercase().next().unwrap_or(ch)); - } else { - snake.push(ch); - } - i += 1; - } - - snake -} - -#[cfg(test)] -mod tests { - #[test] - fn to_snakecase() { - use super::to_snakecase; - - assert_eq!(to_snakecase("snake_case").as_str(), "snake_case"); - assert_eq!(to_snakecase("CamelCase").as_str(), "camel_case"); - assert_eq!(to_snakecase("XMLHttpRequest").as_str(), "xml_http_request"); - assert_eq!(to_snakecase("UPPER").as_str(), "upper"); - assert_eq!(to_snakecase("lower").as_str(), "lower"); - } - - #[cfg(feature = "async")] - #[tokio::test] - async fn list() { - use httpmock::Method::GET; - use httpmock::MockServer; - - use crate::Client; - use crate::{Customer, ListCustomers}; - - // Start a lightweight mock server. - let server = MockServer::start_async().await; - - let client = Client::from_url(&*server.url("/"), "fake_key"); - - let next_item = server.mock(|when, then| { - when.method(GET).path("/v1/customers").query_param("starting_after", "cus_1"); - then.status(200).body( - r#"{"object": "list", "data": [{ - "id": "cus_2", - "object": "customer", - "balance": 0, - "created": 1649316731, - "currency": "gbp", - "delinquent": false, - "email": null, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }], "has_more": false, "url": "/v1/customers"}"#, - ); - }); - - let first_item = server.mock(|when, then| { - when.method(GET).path("/v1/customers"); - then.status(200).body( - r#"{"object": "list", "data": [{ - "id": "cus_1", - "object": "customer", - "balance": 0, - "created": 1649316731, - "currency": "gbp", - "delinquent": false, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }], "has_more": true, "url": "/v1/customers"}"#, - ); - }); - - let params = ListCustomers::new(); - let res = Customer::list(&client, ¶ms).await.unwrap().paginate(params); - - println!("{:?}", res); - - let res2 = res.next(&client).await.unwrap(); - - println!("{:?}", res2); - - first_item.assert_hits_async(1).await; - next_item.assert_hits_async(1).await; - } - - #[cfg(all(feature = "async", feature = "stream"))] - #[tokio::test] - async fn stream() { - use futures_util::StreamExt; - use httpmock::Method::GET; - use httpmock::MockServer; - - use crate::Client; - use crate::{Customer, ListCustomers}; - - // Start a lightweight mock server. - let server = MockServer::start_async().await; - - let client = Client::from_url(&*server.url("/"), "fake_key"); - - let next_item = server.mock(|when, then| { - when.method(GET).path("/v1/customers").query_param("starting_after", "cus_1"); - then.status(200).body( - r#"{"object": "list", "data": [{ - "id": "cus_2", - "object": "customer", - "balance": 0, - "created": 1649316731, - "currency": "gbp", - "delinquent": false, - "email": null, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }], "has_more": false, "url": "/v1/customers"}"#, - ); - }); - - let first_item = server.mock(|when, then| { - when.method(GET).path("/v1/customers"); - then.status(200).body( - r#"{"object": "list", "data": [{ - "id": "cus_1", - "object": "customer", - "balance": 0, - "created": 1649316731, - "currency": "gbp", - "delinquent": false, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }], "has_more": true, "url": "/v1/customers"}"#, - ); - }); - - let params = ListCustomers::new(); - let res = Customer::list(&client, ¶ms).await.unwrap().paginate(params); - - let stream = res.stream(&client).collect::>().await; - - println!("{:#?}", stream); - assert_eq!(stream.len(), 2); - - first_item.assert_hits_async(1).await; - next_item.assert_hits_async(1).await; - } -} diff --git a/src/resources.rs b/src/resources.rs deleted file mode 100644 index 062b25890..000000000 --- a/src/resources.rs +++ /dev/null @@ -1,356 +0,0 @@ -//! resources module -//! -//! This module exposes various elements of the -//! stripe api depending on the features exposed. -//! -//! Some of these modules are hand-written, and -//! some are generated. - -mod currency; -pub mod generated; -mod placeholders; -mod types; - -#[path = "resources"] -mod core { - pub mod account_ext; - pub mod balance_ext; - pub mod balance_transaction_ext; - pub mod charge_ext; - pub mod customer_ext; - pub mod payment_intent_ext; - pub mod payment_source; - pub mod payout_ext; - pub mod placeholders; - pub mod setup_intent_ext; - pub mod token_ext; - pub mod transfer_reversal_ext; -} - -#[path = "resources"] -mod payment { - pub mod bank_account_ext; - pub mod card; - pub mod payment_method_ext; - pub mod source_ext; -} - -#[cfg(feature = "events")] -mod webhook_events; - -#[path = "resources"] -#[cfg(feature = "billing")] -mod billing { - pub mod credit_note_ext; - pub mod customer_balance_transaction_ext; - pub mod invoice_ext; - pub mod line_item_ext; - pub mod subscription_ext; - pub mod usage_record_ext; -} - -#[path = "resources"] -#[cfg(feature = "products")] -mod products { - pub mod price_ext; - pub mod product_ext; -} - -#[path = "resources"] -#[cfg(feature = "checkout")] -mod checkout { - pub mod checkout_session_ext; -} - -#[path = "resources"] -#[cfg(feature = "connect")] -mod connect { - pub mod login_links_ext; -} - -#[path = "resources"] -#[cfg(feature = "fraud")] -mod fraud { - pub mod review_ext; -} - -#[path = "resources"] -#[cfg(feature = "issuing")] -mod issuing { - pub mod issuing_authorization_ext; - pub mod issuing_card_ext; - pub mod issuing_dispute_ext; - pub mod issuing_merchant_data; - pub mod issuing_transaction_ext; -} - -#[path = "resources"] -#[cfg(feature = "orders")] -mod orders { - pub mod order_ext; -} - -#[path = "resources"] -#[cfg(feature = "webhook-endpoints")] -mod webhook_endpoints { - pub mod webhook_endpoint_ext; -} - -#[rustfmt::skip] -pub use { - currency::*, - types::*, - - self::core::{ - account_ext::*, - balance_transaction_ext::*, - charge_ext::*, - transfer_reversal_ext::*, - customer_ext::*, - payment_intent_ext::*, - payment_source::*, - placeholders::*, - payout_ext::*, - token_ext::*, - setup_intent_ext::*, - }, - generated::core::{ - address::*, - balance::*, - balance_transaction::*, - billing_details::*, - charge::*, - customer::*, - custom_unit_amount::*, - cash_balance::*, - dispute::*, - ephemeral_key::*, - file::*, - file_link::*, - invoice_setting_rendering_options::*, - mandate::*, - payment_intent::*, - payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code::*, - linked_account_options_us_bank_account::*, - payment_method_details_card_checks::*, - payment_method_details_card_wallet_apple_pay::*, - payment_method_details_card_wallet_google_pay::*, - payment_method_options_customer_balance_eu_bank_account::*, - payment_method_config_biz_payment_method_configuration_details::*, - payout::*, - platform_tax_fee::*, - price::*, - product::*, - radar_radar_options::*, - refund::*, - reserve_transaction::*, - setup_attempt::*, - setup_intent::*, - shipping::*, - shipping_rate::*, - tax_code::*, - tax_deducted_at_source::*, - test_helpers_test_clock::*, - token::*, - api_errors::*, - }, - - payment::{ - bank_account_ext::*, - card::*, - payment_method_ext::*, - source_ext::* - }, - generated::payment::{ - card::*, - bank_account::*, - payment_method::*, - payment_method_card_present_networks::*, - source::*, - }, -}; - -#[rustfmt::skip] -#[cfg(feature = "events")] -pub use { - webhook_events::*, - webhook_events::NotificationEventData, - generated::event::*, -}; - -#[rustfmt::skip] -#[cfg(feature = "checkout")] -pub use { - checkout::checkout_session_ext::*, - generated::checkout::{ - checkout_session::*, - payment_link::*, - item::* - }, -}; - -#[rustfmt::skip] -#[cfg(feature = "billing")] -pub use { - billing::{ - customer_balance_transaction_ext::*, - invoice_ext::*, - line_item_ext::*, - subscription_ext::*, - usage_record_ext::*, - }, - generated::billing::{ - billing_portal_session::*, - billing_portal_configuration::*, - coupon::*, - credit_note::*, - credit_note_line_item::*, - customer_balance_transaction::*, - discount::*, - invoice::*, - invoice_payment_method_options_acss_debit::*, - invoice_payment_method_options_bancontact::*, - invoice_payment_method_options_konbini::*, - invoice_payment_method_options_customer_balance::*, - invoice_payment_method_options_us_bank_account::*, - invoiceitem::*, - invoices_shipping_cost::*, - line_item::*, - plan::*, - plan::PlanInterval, - promotion_code::*, - quote::*, - quotes_resource_total_details::*, - subscription_item::*, - subscription_item::PlanInterval as SubscriptionItemInterval, - subscription_item::SubscriptionItemPriceDataRecurring as SubscriptionItemPriceDataRecurring, - subscription_item::SubscriptionItemPriceData as SubscriptionItemPriceData, - subscription_item::SubscriptionPaymentBehavior as SubscriptionItemPaymentBehavior, - // need to import this afterwards so that the SubscriptionItemPriceDataRecurring - // isn't silently ignored - subscription::*, - subscription::PlanInterval as SubscriptionInterval, - subscription::SubscriptionItemPriceDataRecurring as SubscriptionPriceDataRecurring, - subscription::SubscriptionItemPriceData as SubscriptionPriceData, - subscription::SubscriptionPaymentBehavior as SubscriptionPaymentBehavior, - subscription_schedule::*, - subscription_billing_thresholds::*, - subscription_item_billing_thresholds::*, - tax_id::*, - tax_rate::*, - usage_record::*, - usage_record_summary::*, - }, -}; - -#[rustfmt::skip] -#[cfg(feature = "tax-calculation")] -pub use { - generated::tax_calculation::{ - tax_calculation::*, - tax_calculation_line_item::*, - tax_product_resource_customer_details::*, - } -}; - -#[rustfmt::skip] -#[cfg(feature = "connect")] -pub use { - connect::{ - login_links_ext::*, - }, - generated::connect::{ - account_link::*, - account::*, - application::*, - application_fee::*, - connect_collection_transfer::*, - fee_refund::*, - login_link::*, - person::*, - topup::*, - transfer::*, - transfer_reversal::*, - } -}; - -#[rustfmt::skip] -#[cfg(feature = "fraud")] -pub use { - fraud::review_ext::*, - generated::fraud::review::* -}; - -#[rustfmt::skip] -#[cfg(feature = "issuing")] -pub use { - issuing::{ - issuing_authorization_ext::*, - issuing_card_ext::*, - issuing_dispute_ext::*, - issuing_merchant_data::*, - issuing_transaction_ext::*, - }, - generated::issuing::{ - issuing_authorization::*, - issuing_card::*, - issuing_cardholder::*, - issuing_dispute::*, - issuing_transaction::*, - }, -}; - -#[rustfmt::skip] -#[cfg(feature = "orders")] -pub use { - orders::order_ext::*, -}; - -#[rustfmt::skip] -#[cfg(feature = "sigma")] -pub use { - generated::scheduled_query_run::*, -}; - -#[rustfmt::skip] -#[cfg(feature = "terminal")] -pub use { - generated::terminal::{ - terminal_configuration::*, - terminal_connection_token::*, - terminal_location::*, - terminal_reader::*, - }, -}; - -#[rustfmt::skip] -#[cfg(feature = "webhook-endpoints")] -pub use { - webhook_endpoints::webhook_endpoint_ext::*, - generated::webhook_endpoints::webhook_endpoint::*, -}; - -#[cfg(not(feature = "full"))] -pub use generated::placeholders::*; - -/// this struct is just a stub for code not using the "connect" feature -/// see https://github.com/arlyon/async-stripe/issues/49 for more context -/// if there are more features that requires a fully fledged CompanyParams -/// we probably need to update the code generation and move to a shared place -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] -pub struct CompanyParams { - #[serde(default)] - pub metadata: crate::params::Metadata, -} - -/// this struct is just a stub for code not using the "connect" feature -/// see https://github.com/arlyon/async-stripe/issues/49 for more context -/// if there are more features that requires a fully fledged PersonParams -/// we probably need to update the code generation and move to a shared place -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] -pub struct PersonParams { - #[serde(default)] - pub metadata: crate::params::Metadata, -} diff --git a/src/resources/account_ext.rs b/src/resources/account_ext.rs deleted file mode 100644 index 24ccfe3ee..000000000 --- a/src/resources/account_ext.rs +++ /dev/null @@ -1,15 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::resources::{BankAccount, Card}; - -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(untagged, rename_all = "snake_case")] -pub enum ExternalAccount { - BankAccount(BankAccount), - Card(Card), -} -impl std::default::Default for ExternalAccount { - fn default() -> Self { - Self::BankAccount(Default::default()) - } -} diff --git a/src/resources/balance_ext.rs b/src/resources/balance_ext.rs deleted file mode 100644 index 28345fc4e..000000000 --- a/src/resources/balance_ext.rs +++ /dev/null @@ -1,15 +0,0 @@ -use crate::client::{Client, Response}; -use crate::ids::AccountId; -use crate::resources::Balance; - -impl Balance { - /// Retrieves balance object by AccountId. Does not change stripe_account of the client. - /// - /// For more details see . - pub fn retrieve(client: &Client, account_id: Option) -> Response { - match account_id { - Some(account_id) => client.clone().with_stripe_account(account_id).get("/balance"), - None => client.get("/balance"), - } - } -} diff --git a/src/resources/balance_transaction_ext.rs b/src/resources/balance_transaction_ext.rs deleted file mode 100644 index 31450aef2..000000000 --- a/src/resources/balance_transaction_ext.rs +++ /dev/null @@ -1,159 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::ids::BalanceTransactionSourceId; -use crate::params::Object; -use crate::resources::{ - ApplicationFee, ApplicationFeeRefund, Charge, ConnectCollectionTransfer, Dispute, - IssuingAuthorization, IssuingDispute, IssuingTransaction, Payout, PlatformTaxFee, Refund, - ReserveTransaction, TaxDeductedAtSource, Topup, Transfer, TransferReversal, -}; - -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(untagged, rename_all = "snake_case")] -pub enum BalanceTransactionSourceUnion { - ApplicationFee(ApplicationFee), - Charge(Charge), - ConnectCollectionTransfer(ConnectCollectionTransfer), - Dispute(Dispute), - #[serde(rename = "fee_refund")] - ApplicationFeeRefund(ApplicationFeeRefund), - #[serde(rename = "issuing.authorization")] - IssuingAuthorization(IssuingAuthorization), - #[serde(rename = "issuing.dispute")] - IssuingDispute(IssuingDispute), - #[serde(rename = "issuing.transaction")] - IssuingTransaction(IssuingTransaction), - Payout(Payout), - PlatformTaxFee(PlatformTaxFee), - Refund(Refund), - ReserveTransaction(ReserveTransaction), - TaxDeductedAtSource(TaxDeductedAtSource), - Topup(Topup), - Transfer(Transfer), - TransferReversal(TransferReversal), -} -impl std::default::Default for BalanceTransactionSourceUnion { - fn default() -> Self { - Self::ApplicationFee(Default::default()) - } -} -impl Object for BalanceTransactionSourceUnion { - type Id = BalanceTransactionSourceId; - fn id(&self) -> Self::Id { - use BalanceTransactionSourceId as Id; - use BalanceTransactionSourceUnion as Source; - - match self { - Source::ApplicationFee(x) => Id::ApplicationFee(x.id()), - Source::ApplicationFeeRefund(x) => Id::ApplicationFeeRefund(x.id()), - Source::Charge(x) => Id::Charge(x.id()), - Source::ConnectCollectionTransfer(_) => Id::None, - Source::Dispute(x) => Id::Dispute(x.id()), - Source::IssuingAuthorization(x) => Id::IssuingAuthorization(x.id()), - Source::IssuingDispute(x) => Id::IssuingDispute(x.id()), - Source::IssuingTransaction(x) => Id::IssuingTransaction(x.id()), - Source::PlatformTaxFee(_) => Id::None, - Source::Payout(x) => Id::Payout(x.id()), - Source::Refund(x) => Id::Refund(x.id()), - Source::ReserveTransaction(_) => Id::None, - Source::TaxDeductedAtSource(_) => Id::None, - Source::Topup(x) => Id::Topup(x.id()), - Source::Transfer(x) => Id::Transfer(x.id()), - Source::TransferReversal(x) => Id::TransferReversal(x.id()), - } - } - fn object(&self) -> &'static str { - use BalanceTransactionSourceUnion as Source; - - match self { - Source::ApplicationFee(x) => x.object(), - Source::ApplicationFeeRefund(x) => x.object(), - Source::Charge(x) => x.object(), - Source::ConnectCollectionTransfer(x) => x.object(), - Source::Dispute(x) => x.object(), - Source::IssuingAuthorization(x) => x.object(), - Source::IssuingDispute(x) => x.object(), - Source::IssuingTransaction(x) => x.object(), - Source::PlatformTaxFee(x) => x.object(), - Source::Payout(x) => x.object(), - Source::Refund(x) => x.object(), - Source::ReserveTransaction(x) => x.object(), - Source::TaxDeductedAtSource(x) => x.object(), - Source::Topup(x) => x.object(), - Source::Transfer(x) => x.object(), - Source::TransferReversal(x) => x.object(), - } - } -} - -/// An enum representing the possible values of an `BalanceTransaction`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BalanceTransactionStatus { - Available, - Pending, -} - -impl BalanceTransactionStatus { - pub fn as_str(self) -> &'static str { - match self { - BalanceTransactionStatus::Available => "available", - BalanceTransactionStatus::Pending => "pending", - } - } -} - -impl AsRef for BalanceTransactionStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BalanceTransactionStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for BalanceTransactionStatus { - fn default() -> Self { - Self::Pending - } -} - -/// An enum representing the possible values of an `Fee`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FeeType { - ApplicationFee, - StripeFee, - Tax, -} - -impl FeeType { - pub fn as_str(self) -> &'static str { - match self { - FeeType::ApplicationFee => "application_fee", - FeeType::StripeFee => "stripe_fee", - FeeType::Tax => "tax", - } - } -} - -impl AsRef for FeeType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FeeType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for FeeType { - fn default() -> Self { - FeeType::ApplicationFee - } -} diff --git a/src/resources/bank_account_ext.rs b/src/resources/bank_account_ext.rs deleted file mode 100644 index 0da15346d..000000000 --- a/src/resources/bank_account_ext.rs +++ /dev/null @@ -1,36 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `BankAccount`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BankAccountStatus { - Errored, - New, - Validated, - VerificationFailed, - Verified, -} - -impl BankAccountStatus { - pub fn as_str(self) -> &'static str { - match self { - BankAccountStatus::Errored => "errored", - BankAccountStatus::New => "new", - BankAccountStatus::Validated => "validated", - BankAccountStatus::VerificationFailed => "verification_failed", - BankAccountStatus::Verified => "verified", - } - } -} - -impl AsRef for BankAccountStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BankAccountStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} diff --git a/src/resources/card.rs b/src/resources/card.rs deleted file mode 100644 index f8f40a652..000000000 --- a/src/resources/card.rs +++ /dev/null @@ -1,55 +0,0 @@ -use serde::{Deserialize, Serialize}; - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -pub enum CardBrand { - #[serde(rename = "American Express")] - AmericanExpress, - #[serde(rename = "Diners Club")] - DinersClub, - #[serde(rename = "Discover")] - Discover, - #[serde(rename = "JCB")] - JCB, - #[serde(rename = "Visa")] - Visa, - #[serde(rename = "MasterCard")] - MasterCard, - #[serde(rename = "UnionPay")] - UnionPay, - - /// An unknown card brand. - /// - /// May also be a variant not yet supported by the library. - #[serde(other)] - #[serde(rename = "Unknown")] - Unknown, -} - -impl std::default::Default for CardBrand { - fn default() -> Self { - Self::Unknown - } -} - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -pub enum CardType { - #[serde(rename = "credit")] - Credit, - #[serde(rename = "debit")] - Debit, - #[serde(rename = "prepaid")] - Prepaid, - - /// An unknown card type. - /// - /// May also be a variant not yet supported by the library. - #[serde(other)] - #[serde(rename = "unknown")] - Unknown, -} - -impl std::default::Default for CardType { - fn default() -> Self { - Self::Unknown - } -} diff --git a/src/resources/charge_ext.rs b/src/resources/charge_ext.rs deleted file mode 100644 index f6669b46c..000000000 --- a/src/resources/charge_ext.rs +++ /dev/null @@ -1,80 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{AccountId, BankAccountId, CardId, ChargeId, SourceId, TokenId}; -use crate::params::{Object, SearchList}; -use crate::resources::{Charge, Rule}; - -/// The set of PaymentSource parameters that can be used to create a charge. -/// -/// For more details see . -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(untagged)] -pub enum ChargeSourceParams { - Token(TokenId), - Source(SourceId), - Card(CardId), - BankAccount(BankAccountId), - Account(AccountId), -} - -/// The set of parameters that can be used when capturing a charge object. -/// -/// For more details see . -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CaptureCharge<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_email: Option<&'a str>, - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option<&'a str>, -} - -impl Charge { - /// Capture captures a previously created charge with capture set to false. - /// - /// For more details see . - pub fn capture( - client: &Client, - charge_id: &ChargeId, - params: CaptureCharge<'_>, - ) -> Response { - client.post_form(&format!("/charges/{}/capture", charge_id), params) - } - - /// Searches for a charge. - /// - /// For more details see . - pub fn search(client: &Client, params: ChargeSearchParams) -> Response> { - client.get_query("/charges/search", params) - } -} - -impl Object for Rule { - type Id = String; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "" - } -} - -#[derive(Clone, Debug, Default, Serialize)] -pub struct ChargeSearchParams<'a> { - pub query: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub page: Option, - pub expand: &'a [&'a str], -} - -impl<'a> ChargeSearchParams<'a> { - pub fn new() -> ChargeSearchParams<'a> { - ChargeSearchParams { query: String::new(), limit: None, page: None, expand: &[] } - } -} diff --git a/src/resources/checkout_session_ext.rs b/src/resources/checkout_session_ext.rs deleted file mode 100644 index 9d6d00e78..000000000 --- a/src/resources/checkout_session_ext.rs +++ /dev/null @@ -1,24 +0,0 @@ -use crate::client::{Client, Response}; -use crate::ids::CheckoutSessionId; -use crate::params::Expand; -use crate::resources::CheckoutSession; - -impl CheckoutSession { - /// Retrieves a Session object. - /// - /// For more details see . - pub fn retrieve( - client: &Client, - id: &CheckoutSessionId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/checkout/sessions/{}", id), &Expand { expand }) - } - - /// Expires a checkout session. - /// - /// For more details see . - pub fn expire(client: &Client, id: &CheckoutSessionId) -> Response { - client.post(&format!("/checkout/sessions/{}/expire", id)) - } -} diff --git a/src/resources/credit_note_ext.rs b/src/resources/credit_note_ext.rs deleted file mode 100644 index 48c85d573..000000000 --- a/src/resources/credit_note_ext.rs +++ /dev/null @@ -1,12 +0,0 @@ -use crate::client::{Client, Response}; -use crate::ids::CreditNoteId; -use crate::resources::CreditNote; - -impl CreditNote { - /// Marks a credit note as void. - /// - /// You can only void a credit note if the associated invoice is open. - pub fn void(client: &Client, id: &CreditNoteId) -> Response { - client.post(&format!("/credit_notes/{}/void", id)) - } -} diff --git a/src/resources/customer_balance_transaction_ext.rs b/src/resources/customer_balance_transaction_ext.rs deleted file mode 100644 index 0b5a4875a..000000000 --- a/src/resources/customer_balance_transaction_ext.rs +++ /dev/null @@ -1,137 +0,0 @@ -use serde::Serialize; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerBalanceTransactionId, CustomerId}; -use crate::params::{Expand, List, Metadata, Paginable}; -use crate::resources::{Currency, Customer, CustomerBalanceTransaction}; - -/// The parameters for `CustomerBalanceTransaction::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListCustomerBalanceTransactions<'a> { - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, - /// starting with `obj_bar`, your subsequent call can include - /// `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, - /// ending with `obj_foo`, your subsequent call can include - /// `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl Paginable for ListCustomerBalanceTransactions<'_> { - type O = CustomerBalanceTransaction; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id); - } -} - -/// The parameters that can be used when creating or updating a [`CustomerBalanceTransaction`]. -#[derive(Clone, Debug, Serialize)] -pub struct CreateCustomerBalanceTransaction<'a> { - /// The integer amount in cents to apply to the customer’s credit balance. - pub amount: i64, - /// Three-letter ISO currency code, in lowercase. - /// - /// Must be a supported currency. Specifies the invoice_credit_balance that this - /// transaction will apply to. If the customer’s currency is not set, it will be - /// updated to this value. - pub currency: Currency, - /// An arbitrary string attached to the object. Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - /// Set of key-value pairs that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a - /// structured format. Individual keys can be unset by posting an empty value to - /// them. All keys can be unset by posting an empty value to metadata. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl CreateCustomerBalanceTransaction<'_> { - pub fn new(amount: i64, currency: Currency) -> Self { - Self { amount, currency, description: Default::default(), metadata: Default::default() } - } -} - -/// The parameters that can be used when creating or updating a [`CustomerBalanceTransaction`]. -/// -/// Only the description and metadata fields can be updated. -#[derive(Clone, Debug, Default, Serialize)] -pub struct UpdateCustomerBalanceTransaction<'a> { - /// An arbitrary string attached to the object. Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - /// Set of key-value pairs that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a - /// structured format. Individual keys can be unset by posting an empty value to - /// them. All keys can be unset by posting an empty value to metadata. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl Customer { - /// List all of a customer's balance transactions. - pub fn list_balance_transactions( - client: &Client, - customer_id: &CustomerId, - params: ListCustomerBalanceTransactions<'_>, - ) -> Response> { - client.get_query(&format!("/customers/{}/balance_transactions", customer_id), ¶ms) - } - - /// Create a new customer balance transaction. - pub fn create_balance_transaction( - client: &Client, - customer_id: &CustomerId, - params: CreateCustomerBalanceTransaction<'_>, - ) -> Response { - client.post_form(&format!("/customers/{}/balance_transactions", customer_id), ¶ms) - } - - /// Retrieve a customer balance transaction. - pub fn retrieve_balance_transaction( - client: &Client, - customer_id: &CustomerId, - id: &CustomerBalanceTransactionId, - expand: &[&str], - ) -> Response { - client.get_query( - &format!("/customers/{}/balance_transactions/{}", customer_id, id), - &Expand { expand }, - ) - } - - /// Update a customer balance transaction. - /// - /// Only the description and metadata fields can be updated. - pub fn update_balance_transaction( - client: &Client, - customer_id: &CustomerId, - id: &CustomerBalanceTransactionId, - params: UpdateCustomerBalanceTransaction<'_>, - ) -> Response { - client - .post_form(&format!("/customers/{}/balance_transactions/{}", customer_id, id), ¶ms) - } -} diff --git a/src/resources/customer_ext.rs b/src/resources/customer_ext.rs deleted file mode 100644 index 5e1b03215..000000000 --- a/src/resources/customer_ext.rs +++ /dev/null @@ -1,183 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{BankAccountId, CardId, CustomerId, PaymentSourceId}; -use crate::params::{Deleted, Expand, List, SearchList}; -use crate::resources::{ - BankAccount, Customer, PaymentMethod, PaymentSource, PaymentSourceParams, Source, -}; - -#[derive(Clone, Debug, Serialize, Eq, PartialEq)] -pub struct CustomerPaymentMethodRetrieval<'a> { - ///A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. - ///For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, - ///your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - ///Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - ///A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - ///A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. - ///For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, - ///your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - ///A required filter on the list, based on the object `type` field. - #[serde(rename = "type")] - pub type_: CustomerPaymentMethodRetrievalType, -} - -impl<'a> CustomerPaymentMethodRetrieval<'a> { - pub fn new(the_type: CustomerPaymentMethodRetrievalType) -> Self { - CustomerPaymentMethodRetrieval { - ending_before: None, - expand: &[], - limit: None, - starting_after: None, - type_: the_type, - } - } -} - -#[derive(Copy, Clone, Debug, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerPaymentMethodRetrievalType { - AcssDebit, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Boleto, - Card, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Oxxo, - P24, - SepaDebit, - Sofort, - WechatPay, -} - -#[derive(Clone, Debug, Default, Serialize)] -pub struct CustomerSearchParams<'a> { - pub query: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub page: Option, - pub expand: &'a [&'a str], -} - -impl<'a> CustomerSearchParams<'a> { - pub fn new() -> CustomerSearchParams<'a> { - CustomerSearchParams { query: String::new(), limit: None, page: None, expand: &[] } - } -} - -impl Customer { - /// Attaches a source to a customer, does not change default Source for the Customer - /// - /// For more details see . - pub fn attach_source( - client: &Client, - customer_id: &CustomerId, - source: PaymentSourceParams, - ) -> Response { - #[derive(Serialize)] - struct AttachSource { - source: PaymentSourceParams, - } - let params = AttachSource { source }; - client.post_form(&format!("/customers/{}/sources", customer_id), params) - } - - /// Detaches a source from a customer - /// - /// For more details see . - pub fn detach_source( - client: &Client, - customer_id: &CustomerId, - source_id: &PaymentSourceId, - ) -> Response { - client.delete(&format!("/customers/{}/sources/{}", customer_id, source_id)) - } - - /// Retrieves a Card, BankAccount, or Source for a Customer - pub fn retrieve_source( - client: &Client, - customer_id: &CustomerId, - source_id: &PaymentSourceId, - ) -> Response { - client.get(&format!("/customers/{}/sources/{}", customer_id, source_id)) - } - - /// Verifies a Bank Account for a Customer. - /// - /// For more details see . - pub fn verify_bank_account( - client: &Client, - customer_id: &CustomerId, - bank_account_id: &BankAccountId, - params: VerifyBankAccount<'_>, - ) -> Response { - client.post_form( - &format!("/customers/{}/sources/{}/verify", customer_id, bank_account_id), - params, - ) - } - - ///Returns a list of PaymentMethods for a given Customer - /// - ///For more details see - pub fn retrieve_payment_methods( - client: &Client, - customer_id: &CustomerId, - params: CustomerPaymentMethodRetrieval<'_>, - ) -> Response> { - client.get_query(&format!("/customers/{}/payment_methods", customer_id), ¶ms) - } - - /// Searches for a customer. - /// - /// For more details see . - pub fn search(client: &Client, params: CustomerSearchParams) -> Response> { - client.get_query("/customers/search", params) - } -} - -/// The set of parameters that can be used when verifying a Bank Account. -/// -/// For more details see . -#[derive(Clone, Debug, Default, Serialize)] -pub struct VerifyBankAccount<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub amounts: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option<&'a str>, -} - -impl VerifyBankAccount<'_> { - pub fn new() -> Self { - VerifyBankAccount { amounts: None, verification_method: None } - } -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(tag = "object", rename_all = "snake_case")] -pub enum DetachedSource { - BankAccount(Deleted), - Card(Deleted), - Source(Source), -} diff --git a/src/resources/generated.rs b/src/resources/generated.rs deleted file mode 100644 index 4c516ca61..000000000 --- a/src/resources/generated.rs +++ /dev/null @@ -1,168 +0,0 @@ -//! generated module -//! -//! Contains the generated impls we use. This code -//! is automatically generated from the openapi spec -//! and should not be changed manually. To update the -//! spec, use cargo make. -//! -//! It is possible more files are generated than are -//! listed as modules here. These are modules that -//! have not yet been exposed by the client. - -#[path = "generated"] -pub mod core { - pub mod address; - pub mod api_errors; - pub mod balance; - pub mod balance_transaction; - pub mod billing_details; - pub mod cash_balance; - pub mod charge; - pub mod custom_unit_amount; - pub mod customer; - pub mod dispute; - pub mod ephemeral_key; - pub mod file; - pub mod file_link; - pub mod invoice_setting_rendering_options; - pub mod linked_account_options_us_bank_account; - pub mod mandate; - pub mod payment_intent; - pub mod payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code; - pub mod payment_method_config_biz_payment_method_configuration_details; - pub mod payment_method_details_card_checks; - pub mod payment_method_details_card_wallet_apple_pay; - pub mod payment_method_details_card_wallet_google_pay; - pub mod payment_method_options_customer_balance_eu_bank_account; - pub mod payout; - pub mod platform_tax_fee; - pub mod price; - pub mod product; - pub mod radar_radar_options; - pub mod refund; - pub mod reserve_transaction; - pub mod setup_attempt; - pub mod setup_intent; - pub mod shipping; - pub mod shipping_rate; - pub mod tax_code; - pub mod tax_deducted_at_source; - pub mod test_helpers_test_clock; - pub mod token; - pub mod version; -} - -#[path = "generated"] -pub mod payment { - pub mod bank_account; - pub mod card; - pub mod payment_method; - pub mod payment_method_card_present_networks; - pub mod source; -} - -#[path = "generated"] -#[cfg(feature = "checkout")] -pub mod checkout { - pub mod checkout_session; - pub mod item; - pub mod payment_link; -} - -#[path = "generated"] -#[cfg(feature = "tax-calculation")] -pub mod tax_calculation { - pub mod tax_calculation; - pub mod tax_calculation_line_item; - pub mod tax_product_resource_customer_details; -} - -#[path = "generated"] -#[cfg(feature = "billing")] -pub mod billing { - pub mod billing_portal_configuration; - pub mod billing_portal_session; - pub mod coupon; - pub mod credit_note; - pub mod credit_note_line_item; - pub mod customer_balance_transaction; - pub mod discount; - pub mod invoice; - pub mod invoice_payment_method_options_acss_debit; - pub mod invoice_payment_method_options_bancontact; - pub mod invoice_payment_method_options_customer_balance; - pub mod invoice_payment_method_options_konbini; - pub mod invoice_payment_method_options_us_bank_account; - pub mod invoiceitem; - pub mod invoices_shipping_cost; - pub mod line_item; - pub mod plan; - pub mod promotion_code; - pub mod quote; - pub mod quotes_resource_total_details; - pub mod subscription; - pub mod subscription_billing_thresholds; - pub mod subscription_item; - pub mod subscription_item_billing_thresholds; - pub mod subscription_schedule; - pub mod tax_id; - pub mod tax_rate; - pub mod usage_record; - pub mod usage_record_summary; -} - -#[path = "generated"] -#[cfg(feature = "connect")] -pub mod connect { - pub mod account; - pub mod account_link; - pub mod application; - pub mod application_fee; - pub mod connect_collection_transfer; - pub mod fee_refund; - pub mod login_link; - pub mod person; - pub mod topup; - pub mod transfer; - pub mod transfer_reversal; -} - -#[path = "generated"] -#[cfg(feature = "fraud")] -pub mod fraud { - pub mod review; -} - -#[path = "generated"] -#[cfg(feature = "issuing")] -pub mod issuing { - pub mod issuing_authorization; - pub mod issuing_card; - pub mod issuing_cardholder; - pub mod issuing_dispute; - pub mod issuing_transaction; -} - -#[cfg(feature = "sigma")] -pub mod scheduled_query_run; - -#[path = "generated"] -#[cfg(feature = "terminal")] -pub mod terminal { - pub mod terminal_configuration; - pub mod terminal_connection_token; - pub mod terminal_location; - pub mod terminal_reader; -} - -#[cfg(feature = "events")] -pub mod event; - -#[path = "generated"] -#[cfg(feature = "webhook-endpoints")] -pub mod webhook_endpoints { - pub mod webhook_endpoint; -} - -#[cfg(not(feature = "full"))] -pub mod placeholders; diff --git a/src/resources/generated/account.rs b/src/resources/generated/account.rs deleted file mode 100644 index 661c7cf96..000000000 --- a/src/resources/generated/account.rs +++ /dev/null @@ -1,4321 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::AccountId; -use crate::params::{ - Deleted, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp, -}; -use crate::resources::{ - Address, Currency, DelayDays, ExternalAccount, File, Person, PersonVerificationParams, - VerificationDocumentParams, -}; - -/// The resource representing a Stripe "Account". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Account { - /// Unique identifier for the object. - pub id: AccountId, - - /// Business information about the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub business_profile: Option, - - /// The business type. - #[serde(skip_serializing_if = "Option::is_none")] - pub business_type: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub capabilities: Option, - - /// Whether the account can create live charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub charges_enabled: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub company: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub controller: Option, - - /// The account's country. - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Time at which the account was connected. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// Three-letter ISO currency code representing the default currency for the account. - /// - /// This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). - #[serde(skip_serializing_if = "Option::is_none")] - pub default_currency: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// Whether account details have been submitted. - /// - /// Standard accounts cannot receive payouts before this is true. - #[serde(skip_serializing_if = "Option::is_none")] - pub details_submitted: Option, - - /// An email address associated with the account. - /// - /// It's not used for authentication and Stripe doesn't market to this field without explicit approval from the platform. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// External accounts (bank accounts and debit cards) currently attached to this account. - #[serde(default)] - pub external_accounts: List, - - #[serde(skip_serializing_if = "Option::is_none")] - pub future_requirements: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub individual: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Whether Stripe can send payouts to this account. - #[serde(skip_serializing_if = "Option::is_none")] - pub payouts_enabled: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub requirements: Option, - - /// Options for customizing how the account functions within Stripe. - #[serde(skip_serializing_if = "Option::is_none")] - pub settings: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_acceptance: Option, - - /// The Stripe account type. - /// - /// Can be `standard`, `express`, or `custom`. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -impl Account { - /// Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). - /// - /// If you’re not a platform, the list is empty. - pub fn list(client: &Client, params: &ListAccounts<'_>) -> Response> { - client.get_query("/accounts", ¶ms) - } - - /// With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. - /// To do this, you’ll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). - /// - /// If you’ve already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when - /// creating the account. - /// - /// Connect Onboarding won’t ask for the prefilled information during account onboarding. You can prefill any information on the account. - pub fn create(client: &Client, params: CreateAccount<'_>) -> Response { - client.post_form("/accounts", ¶ms) - } - - /// Retrieves the details of an account. - pub fn retrieve(client: &Client, id: &AccountId, expand: &[&str]) -> Response { - client.get_query(&format!("/accounts/{}", id), &Expand { expand }) - } - - /// Updates a [connected account](https://stripe.com/docs/connect/accounts) by setting the values of the parameters passed. - /// - /// 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/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 { - client.post_form(&format!("/accounts/{}", id), ¶ms) - } - - /// With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. - /// - /// 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/settings/account) instead. - pub fn delete(client: &Client, id: &AccountId) -> Response> { - client.delete(&format!("/accounts/{}", id)) - } -} - -impl Object for Account { - type Id = AccountId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "account" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BusinessProfile { - /// [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). - /// - /// MCCs are used to classify businesses based on the goods or services they provide. - pub mcc: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub monthly_estimated_revenue: Option, - - /// The customer-facing business name. - pub name: Option, - - /// Internal-only description of the product sold or service provided by the business. - /// - /// It's used by Stripe for risk and underwriting purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub product_description: Option, - - /// A publicly available mailing address for sending support issues to. - pub support_address: Option

, - - /// A publicly available email address for sending support issues to. - pub support_email: Option, - - /// A publicly available phone number to call with support issues. - pub support_phone: Option, - - /// A publicly available website for handling support issues. - pub support_url: Option, - - /// The business's publicly available website. - pub url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountCapabilities { - /// The status of the Canadian pre-authorized debits payments capability of the account, or whether the account can directly process Canadian pre-authorized debits charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit_payments: Option, - - /// The status of the Affirm capability of the account, or whether the account can directly process Affirm charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm_payments: Option, - - /// The status of the Afterpay Clearpay capability of the account, or whether the account can directly process Afterpay Clearpay charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay_payments: Option, - - /// The status of the BECS Direct Debit (AU) payments capability of the account, or whether the account can directly process BECS Direct Debit (AU) charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit_payments: Option, - - /// The status of the Bacs Direct Debits payments capability of the account, or whether the account can directly process Bacs Direct Debits charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit_payments: Option, - - /// The status of the Bancontact payments capability of the account, or whether the account can directly process Bancontact charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact_payments: Option, - - /// The status of the customer_balance payments capability of the account, or whether the account can directly process customer_balance charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer_payments: Option, - - /// The status of the blik payments capability of the account, or whether the account can directly process blik charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik_payments: Option, - - /// The status of the boleto payments capability of the account, or whether the account can directly process boleto charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto_payments: Option, - - /// The status of the card issuing capability of the account, or whether you can use Issuing to distribute funds on cards. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_issuing: Option, - - /// The status of the card payments capability of the account, or whether the account can directly process credit and debit card charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_payments: Option, - - /// The status of the Cartes Bancaires payments capability of the account, or whether the account can directly process Cartes Bancaires card charges in EUR currency. - #[serde(skip_serializing_if = "Option::is_none")] - pub cartes_bancaires_payments: Option, - - /// The status of the Cash App Pay capability of the account, or whether the account can directly process Cash App Pay payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp_payments: Option, - - /// The status of the EPS payments capability of the account, or whether the account can directly process EPS charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps_payments: Option, - - /// The status of the FPX payments capability of the account, or whether the account can directly process FPX charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx_payments: Option, - - /// The status of the giropay payments capability of the account, or whether the account can directly process giropay charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay_payments: Option, - - /// The status of the GrabPay payments capability of the account, or whether the account can directly process GrabPay charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay_payments: Option, - - /// The status of the iDEAL payments capability of the account, or whether the account can directly process iDEAL charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal_payments: Option, - - /// The status of the india_international_payments capability of the account, or whether the account can process international charges (non INR) in India. - #[serde(skip_serializing_if = "Option::is_none")] - pub india_international_payments: Option, - - /// The status of the JCB payments capability of the account, or whether the account (Japan only) can directly process JCB credit card charges in JPY currency. - #[serde(skip_serializing_if = "Option::is_none")] - pub jcb_payments: Option, - - /// The status of the Klarna payments capability of the account, or whether the account can directly process Klarna charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna_payments: Option, - - /// The status of the konbini payments capability of the account, or whether the account can directly process konbini charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini_payments: Option, - - /// The status of the legacy payments capability of the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub legacy_payments: Option, - - /// The status of the link_payments capability of the account, or whether the account can directly process Link charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub link_payments: Option, - - /// The status of the OXXO payments capability of the account, or whether the account can directly process OXXO charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo_payments: Option, - - /// The status of the P24 payments capability of the account, or whether the account can directly process P24 charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24_payments: Option, - - /// The status of the paynow payments capability of the account, or whether the account can directly process paynow charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow_payments: Option, - - /// The status of the promptpay payments capability of the account, or whether the account can directly process promptpay charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay_payments: Option, - - /// The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit_payments: Option, - - /// The status of the Sofort payments capability of the account, or whether the account can directly process Sofort charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort_payments: Option, - - /// The status of the tax reporting 1099-K (US) capability of the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_reporting_us_1099_k: Option, - - /// The status of the tax reporting 1099-MISC (US) capability of the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_reporting_us_1099_misc: Option, - - /// The status of the transfers capability of the account, or whether your platform can transfer funds to the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfers: Option, - - /// The status of the banking capability, or whether the account can have bank accounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub treasury: Option, - - /// The status of the US bank account ACH payments capability of the account, or whether the account can directly process US bank account charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account_ach_payments: Option, - - /// The status of the Zip capability of the account, or whether the account can directly process Zip charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip_payments: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountFutureRequirements { - /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. - pub alternatives: Option>, - - /// Date on which `future_requirements` merges with the main `requirements` hash and `future_requirements` becomes empty. - /// - /// After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on its enablement state prior to transitioning. - pub current_deadline: Option, - - /// Fields that need to be collected to keep the account enabled. - /// - /// If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. - pub currently_due: Option>, - - /// This is typed as a string for consistency with `requirements.disabled_reason`, but it safe to assume `future_requirements.disabled_reason` is empty because fields in `future_requirements` will never disable the account. - pub disabled_reason: Option, - - /// Fields that are `currently_due` and need to be collected again because validation or verification failed. - pub errors: Option>, - - /// Fields that need to be collected assuming all volume thresholds are reached. - /// - /// As they become required, they appear in `currently_due` as well. - pub eventually_due: Option>, - - /// Fields that weren't collected by `requirements.current_deadline`. - /// - /// These fields need to be collected to enable the capability on the account. - /// New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. - pub past_due: Option>, - - /// Fields that may become required depending on the results of verification or review. - /// - /// Will be an empty array unless an asynchronous verification is pending. - /// If verification fails, these fields move to `eventually_due` or `currently_due`. - pub pending_verification: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountMonthlyEstimatedRevenue { - /// A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountRequirements { - /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. - pub alternatives: Option>, - - /// Date by which the fields in `currently_due` must be collected to keep the account enabled. - /// - /// These fields may disable the account sooner if the next threshold is reached before they are collected. - pub current_deadline: Option, - - /// Fields that need to be collected to keep the account enabled. - /// - /// If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. - pub currently_due: Option>, - - /// If the account is disabled, this string describes why. - /// - /// Can be `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.listed`, `rejected.terms_of_service`, `rejected.other`, `under_review`, or `other`. - pub disabled_reason: Option, - - /// Fields that are `currently_due` and need to be collected again because validation or verification failed. - pub errors: Option>, - - /// Fields that need to be collected assuming all volume thresholds are reached. - /// - /// As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. - pub eventually_due: Option>, - - /// Fields that weren't collected by `current_deadline`. - /// - /// These fields need to be collected to enable the account. - pub past_due: Option>, - - /// Fields that may become required depending on the results of verification or review. - /// - /// Will be an empty array unless an asynchronous verification is pending. - /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. - pub pending_verification: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountRequirementsAlternative { - /// Fields that can be provided to satisfy all fields in `original_fields_due`. - pub alternative_fields_due: Vec, - - /// Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. - pub original_fields_due: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountRequirementsError { - /// The code for the type of error. - pub code: AccountRequirementsErrorCode, - - /// An informative message that indicates the error type and provides additional details about the error. - pub reason: String, - - /// The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. - pub requirement: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountSettings { - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit_payments: Option, - - pub branding: BrandingSettings, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card_issuing: Option, - - pub card_payments: CardPaymentsSettings, - - pub dashboard: DashboardSettings, - - pub payments: PaymentsSettings, - - #[serde(skip_serializing_if = "Option::is_none")] - pub payouts: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit_payments: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub treasury: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountBacsDebitPaymentsSettings { - /// The Bacs Direct Debit Display Name for this account. - /// - /// For payments made with Bacs Direct Debit, this will appear on the mandate, and as the statement descriptor. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BrandingSettings { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. - /// - /// Must be square and at least 128px x 128px. - pub icon: Option>, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. - /// - /// Must be at least 128px x 128px. - pub logo: Option>, - - /// A CSS hex color value representing the primary branding color for this account. - pub primary_color: Option, - - /// A CSS hex color value representing the secondary branding color for this account. - pub secondary_color: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountCardIssuingSettings { - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CardPaymentsSettings { - #[serde(skip_serializing_if = "Option::is_none")] - pub decline_on: Option, - - /// The default text that appears on credit card statements when a charge is made. - /// - /// This field prefixes any dynamic `statement_descriptor` specified on the charge. - /// `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. - pub statement_descriptor_prefix: Option, - - /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). - /// - /// This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. - /// `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. - pub statement_descriptor_prefix_kana: Option, - - /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). - /// - /// This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. - /// `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. - pub statement_descriptor_prefix_kanji: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DashboardSettings { - /// The display name for this account. - /// - /// This is used on the Stripe Dashboard to differentiate between accounts. - pub display_name: Option, - - /// The timezone used in the Stripe Dashboard for this account. - /// - /// A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). - pub timezone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DeclineChargeOn { - /// Whether Stripe automatically declines charges with an incorrect ZIP or postal code. - /// - /// This setting only applies when a ZIP or postal code is provided and they fail bank verification. - pub avs_failure: bool, - - /// Whether Stripe automatically declines charges with an incorrect CVC. - /// - /// This setting only applies when a CVC is provided and it fails bank verification. - pub cvc_failure: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentsSettings { - /// The default text that appears on credit card statements when a charge is made. - /// - /// This field prefixes any dynamic `statement_descriptor` specified on the charge. - pub statement_descriptor: Option, - - /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). - pub statement_descriptor_kana: Option, - - /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). - pub statement_descriptor_kanji: Option, - - /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). - /// - /// This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. - /// `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. - pub statement_descriptor_prefix_kana: Option, - - /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). - /// - /// This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. - /// `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. - pub statement_descriptor_prefix_kanji: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PayoutSettings { - /// A Boolean indicating if Stripe should try to reclaim negative balances from an attached bank account. - /// - /// See our [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances) documentation for details. - /// Default value is `false` for Custom accounts, otherwise `true`. - pub debit_negative_balances: bool, - - pub schedule: TransferSchedule, - - /// The text that appears on the bank account statement for payouts. - /// - /// If not set, this defaults to the platform's bank descriptor as set in the Dashboard. - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountSepaDebitPaymentsSettings { - /// SEPA creditor identifier that identifies the company making the payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub creditor_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TosAcceptance { - /// The Unix timestamp marking when the account representative accepted their service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub date: Option, - - /// The IP address from which the account representative accepted their service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip: Option, - - /// The user's service agreement type. - #[serde(skip_serializing_if = "Option::is_none")] - pub service_agreement: Option, - - /// The user agent of the browser from which the account representative accepted their service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountTreasurySettings { - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountTermsOfService { - /// The Unix timestamp marking when the account representative accepted the service agreement. - pub date: Option, - - /// The IP address from which the account representative accepted the service agreement. - pub ip: Option, - - /// The user agent of the browser from which the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountUnificationAccountController { - /// `true` if the Connect application retrieving the resource controls the account and can therefore exercise [platform controls](https://stripe.com/docs/connect/platform-controls-for-standard-accounts). - /// - /// Otherwise, this field is null. - #[serde(skip_serializing_if = "Option::is_none")] - pub is_controller: Option, - - /// The controller type. - /// - /// Can be `application`, if a Connect application controls the account, or `account`, if the account controls itself. - #[serde(rename = "type")] - pub type_: AccountUnificationAccountControllerType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CardIssuingAccountTermsOfService { - /// The Unix timestamp marking when the account representative accepted the service agreement. - pub date: Option, - - /// The IP address from which the account representative accepted the service agreement. - pub ip: Option, - - /// The user agent of the browser from which the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Company { - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// The Kana variation of the company's primary address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kana: Option
, - - /// The Kanji variation of the company's primary address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kanji: Option
, - - /// Whether the company's directors have been provided. - /// - /// This Boolean will be `true` if you've manually indicated that all directors are provided via [the `directors_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-directors_provided). - #[serde(skip_serializing_if = "Option::is_none")] - pub directors_provided: Option, - - /// Whether the company's executives have been provided. - /// - /// This Boolean will be `true` if you've manually indicated that all executives are provided via [the `executives_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-executives_provided), or if Stripe determined that sufficient executives were provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub executives_provided: Option, - - /// The export license ID number of the company, also referred as Import Export Code (India only). - #[serde(skip_serializing_if = "Option::is_none")] - pub export_license_id: Option, - - /// The purpose code to use for export transactions (India only). - #[serde(skip_serializing_if = "Option::is_none")] - pub export_purpose_code: Option, - - /// The company's legal name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// The Kana variation of the company's legal name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub name_kana: Option, - - /// The Kanji variation of the company's legal name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub name_kanji: Option, - - /// Whether the company's owners have been provided. - /// - /// This Boolean will be `true` if you've manually indicated that all owners are provided via [the `owners_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-owners_provided), or if Stripe determined that sufficient owners were provided. - /// Stripe determines ownership requirements using both the number of owners provided and their total percent ownership (calculated by adding the `percent_ownership` of each owner together). - #[serde(skip_serializing_if = "Option::is_none")] - pub owners_provided: Option, - - /// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. - #[serde(skip_serializing_if = "Option::is_none")] - pub ownership_declaration: Option, - - /// The company's phone number (used for verification). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// The category identifying the legal structure of the company or legal entity. - /// - /// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub structure: Option, - - /// Whether the company's business ID number was provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_id_provided: Option, - - /// The jurisdiction in which the `tax_id` is registered (Germany-based companies only). - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_id_registrar: Option, - - /// Whether the company's business VAT number was provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub vat_id_provided: Option, - - /// Information on the verification state of the company. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CompanyVerification { - pub document: CompanyVerificationDocument, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CompanyVerificationDocument { - /// The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. - pub back: Option>, - - /// A user-displayable string describing the verification state of this document. - pub details: Option, - - /// One of `document_corrupt`, `document_expired`, `document_failed_copy`, `document_failed_greyscale`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_not_readable`, `document_not_uploaded`, `document_type_not_supported`, or `document_too_large`. - /// - /// A machine-readable code specifying the verification state for this document. - pub details_code: Option, - - /// The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. - pub front: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LegalEntityUboDeclaration { - /// The Unix timestamp marking when the beneficial owner attestation was made. - pub date: Option, - - /// The IP address from which the beneficial owner attestation was made. - pub ip: Option, - - /// The user-agent string from the browser where the beneficial owner attestation was made. - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransferSchedule { - /// The number of days charges for the account will be held before being paid out. - pub delay_days: u32, - - /// How frequently funds will be paid out. - /// - /// One of `manual` (payouts only created via API call), `daily`, `weekly`, or `monthly`. - pub interval: String, - - /// The day of the month funds will be paid out. - /// - /// Only shown if `interval` is monthly. - /// Payouts scheduled between the 29th and 31st of the month are sent on the last day of shorter months. - #[serde(skip_serializing_if = "Option::is_none")] - pub monthly_anchor: Option, - - /// The day of the week funds will be paid out, of the style 'monday', 'tuesday', etc. - /// - /// Only shown if `interval` is weekly. - #[serde(skip_serializing_if = "Option::is_none")] - pub weekly_anchor: Option, -} - -/// The parameters for `Account::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateAccount<'a> { - /// An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_token: Option<&'a str>, - - /// Business information about the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub business_profile: Option, - - /// The business type. - #[serde(skip_serializing_if = "Option::is_none")] - pub business_type: Option, - - /// Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. - /// - /// whether it has been requested or not). - /// Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. - /// An account may have some of its requested capabilities be active and some be inactive. - #[serde(skip_serializing_if = "Option::is_none")] - pub capabilities: Option, - - /// Information about the company or business. - /// - /// This field is available for any `business_type`. - #[serde(skip_serializing_if = "Option::is_none")] - pub company: Option, - - /// The country in which the account holder resides, or in which the business is legally established. - /// - /// This should be an ISO 3166-1 alpha-2 country code. - /// For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. - /// Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported. - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option<&'a str>, - - /// Three-letter ISO currency code representing the default currency for the account. - /// - /// This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). - #[serde(skip_serializing_if = "Option::is_none")] - pub default_currency: Option, - - /// Documents that may be submitted to satisfy various informational requests. - #[serde(skip_serializing_if = "Option::is_none")] - pub documents: Option, - - /// The email address of the account holder. - /// - /// This is only to make the account easier to identify to you. - /// Stripe only emails Custom accounts with your consent. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won’t be able to use it for top-ups). - /// - /// You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. - /// By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. - /// To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. - #[serde(skip_serializing_if = "Option::is_none")] - pub external_account: Option<&'a str>, - - /// Information about the person represented by the account. - /// - /// This field is null unless `business_type` is set to `individual`. - #[serde(skip_serializing_if = "Option::is_none")] - pub individual: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Options for customizing how the account functions within Stripe. - #[serde(skip_serializing_if = "Option::is_none")] - pub settings: Option, - - /// Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_acceptance: Option, - - /// The type of Stripe account to create. - /// - /// May be one of `custom`, `express` or `standard`. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -impl<'a> CreateAccount<'a> { - pub fn new() -> Self { - CreateAccount { - account_token: Default::default(), - business_profile: Default::default(), - business_type: Default::default(), - capabilities: Default::default(), - company: Default::default(), - country: Default::default(), - default_currency: Default::default(), - documents: Default::default(), - email: Default::default(), - expand: Default::default(), - external_account: Default::default(), - individual: Default::default(), - metadata: Default::default(), - settings: Default::default(), - tos_acceptance: Default::default(), - type_: Default::default(), - } - } -} - -/// The parameters for `Account::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListAccounts<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListAccounts<'a> { - pub fn new() -> Self { - ListAccounts { - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListAccounts<'_> { - type O = Account; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Account::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateAccount<'a> { - /// An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_token: Option<&'a str>, - - /// Business information about the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub business_profile: Option, - - /// The business type. - #[serde(skip_serializing_if = "Option::is_none")] - pub business_type: Option, - - /// Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. - /// - /// whether it has been requested or not). - /// Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. - /// An account may have some of its requested capabilities be active and some be inactive. - #[serde(skip_serializing_if = "Option::is_none")] - pub capabilities: Option, - - /// Information about the company or business. - /// - /// This field is available for any `business_type`. - #[serde(skip_serializing_if = "Option::is_none")] - pub company: Option, - - /// Three-letter ISO currency code representing the default currency for the account. - /// - /// This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). - #[serde(skip_serializing_if = "Option::is_none")] - pub default_currency: Option, - - /// Documents that may be submitted to satisfy various informational requests. - #[serde(skip_serializing_if = "Option::is_none")] - pub documents: Option, - - /// The email address of the account holder. - /// - /// This is only to make the account easier to identify to you. - /// Stripe only emails Custom accounts with your consent. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won’t be able to use it for top-ups). - /// - /// You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. - /// By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. - /// To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. - #[serde(skip_serializing_if = "Option::is_none")] - pub external_account: Option<&'a str>, - - /// Information about the person represented by the account. - /// - /// This field is null unless `business_type` is set to `individual`. - #[serde(skip_serializing_if = "Option::is_none")] - pub individual: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Options for customizing how the account functions within Stripe. - #[serde(skip_serializing_if = "Option::is_none")] - pub settings: Option, - - /// Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance). - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_acceptance: Option, -} - -impl<'a> UpdateAccount<'a> { - pub fn new() -> Self { - UpdateAccount { - account_token: Default::default(), - business_profile: Default::default(), - business_type: Default::default(), - capabilities: Default::default(), - company: Default::default(), - default_currency: Default::default(), - documents: Default::default(), - email: Default::default(), - expand: Default::default(), - external_account: Default::default(), - individual: Default::default(), - metadata: Default::default(), - settings: Default::default(), - tos_acceptance: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AcceptTos { - /// The Unix timestamp marking when the account representative accepted their service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub date: Option, - - /// The IP address from which the account representative accepted their service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip: Option, - - /// The user's service agreement type. - #[serde(skip_serializing_if = "Option::is_none")] - pub service_agreement: Option, - - /// The user agent of the browser from which the account representative accepted their service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountSettingsParams { - /// Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. - #[serde(skip_serializing_if = "Option::is_none")] - pub branding: Option, - - /// Settings specific to the account's use of the Card Issuing product. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_issuing: Option, - - /// Settings specific to card charging on the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_payments: Option, - - /// Settings that apply across payment methods for charging on the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub payments: Option, - - /// Settings specific to the account's payouts. - #[serde(skip_serializing_if = "Option::is_none")] - pub payouts: Option, - - /// Settings specific to the account's Treasury FinancialAccounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub treasury: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CompanyParams { - /// The company's primary address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// The Kana variation of the company's primary address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kana: Option
, - - /// The Kanji variation of the company's primary address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kanji: Option
, - - /// Whether the company's directors have been provided. - /// - /// Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. - /// This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub directors_provided: Option, - - /// Whether the company's executives have been provided. - /// - /// Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. - #[serde(skip_serializing_if = "Option::is_none")] - pub executives_provided: Option, - - /// The export license ID number of the company, also referred as Import Export Code (India only). - #[serde(skip_serializing_if = "Option::is_none")] - pub export_license_id: Option, - - /// The purpose code to use for export transactions (India only). - #[serde(skip_serializing_if = "Option::is_none")] - pub export_purpose_code: Option, - - /// The company's legal name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// The Kana variation of the company's legal name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub name_kana: Option, - - /// The Kanji variation of the company's legal name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub name_kanji: Option, - - /// Whether the company's owners have been provided. - /// - /// Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. - #[serde(skip_serializing_if = "Option::is_none")] - pub owners_provided: Option, - - /// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. - #[serde(skip_serializing_if = "Option::is_none")] - pub ownership_declaration: Option, - - /// The company's phone number (used for verification). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. - /// - /// (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). - #[serde(skip_serializing_if = "Option::is_none")] - pub registration_number: Option, - - /// The category identifying the legal structure of the company or legal entity. - /// - /// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub structure: Option, - - /// The business ID number of the company, as appropriate for the company’s country. - /// - /// (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.). - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_id: Option, - - /// The jurisdiction in which the `tax_id` is registered (Germany-based companies only). - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_id_registrar: Option, - - /// The VAT number of the company. - #[serde(skip_serializing_if = "Option::is_none")] - pub vat_id: Option, - - /// Information on the verification state of the company. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilities { - /// The acss_debit_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit_payments: Option, - - /// The affirm_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm_payments: Option, - - /// The afterpay_clearpay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay_payments: Option, - - /// The au_becs_debit_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit_payments: Option, - - /// The bacs_debit_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit_payments: Option, - - /// The bancontact_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact_payments: Option, - - /// The bank_transfer_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer_payments: Option, - - /// The blik_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik_payments: Option, - - /// The boleto_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto_payments: Option, - - /// The card_issuing capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_issuing: Option, - - /// The card_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_payments: Option, - - /// The cartes_bancaires_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub cartes_bancaires_payments: Option, - - /// The cashapp_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp_payments: Option, - - /// The eps_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps_payments: Option, - - /// The fpx_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx_payments: Option, - - /// The giropay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay_payments: Option, - - /// The grabpay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay_payments: Option, - - /// The ideal_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal_payments: Option, - - /// The india_international_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub india_international_payments: Option, - - /// The jcb_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub jcb_payments: Option, - - /// The klarna_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna_payments: Option, - - /// The konbini_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini_payments: Option, - - /// The legacy_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub legacy_payments: Option, - - /// The link_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub link_payments: Option, - - /// The oxxo_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo_payments: Option, - - /// The p24_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24_payments: Option, - - /// The paynow_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow_payments: Option, - - /// The promptpay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay_payments: Option, - - /// The sepa_debit_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit_payments: Option, - - /// The sofort_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort_payments: Option, - - /// The tax_reporting_us_1099_k capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_reporting_us_1099_k: Option, - - /// The tax_reporting_us_1099_misc capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_reporting_us_1099_misc: Option, - - /// The transfers capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfers: Option, - - /// The treasury capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub treasury: Option, - - /// The us_bank_account_ach_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account_ach_payments: Option, - - /// The zip_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip_payments: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountDocuments { - /// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. - /// - /// Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_account_ownership_verification: - Option, - - /// One or more documents that demonstrate proof of a company's license to operate. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_license: Option, - - /// One or more documents showing the company's Memorandum of Association. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_memorandum_of_association: - Option, - - /// (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_ministerial_decree: Option, - - /// One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_registration_verification: - Option, - - /// One or more documents that demonstrate proof of a company's tax ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_tax_id_verification: Option, - - /// One or more documents showing the company’s proof of registration with the national business registry. - #[serde(skip_serializing_if = "Option::is_none")] - pub proof_of_registration: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonParams { - /// The individual's primary address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// The Kana variation of the the individual's primary address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kana: Option
, - - /// The Kanji variation of the the individual's primary address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kanji: Option
, - - /// The individual's date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub dob: Option, - - /// The individual's email address. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// The individual's first name. - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name: Option, - - /// The Kana variation of the the individual's first name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name_kana: Option, - - /// The Kanji variation of the individual's first name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name_kanji: Option, - - /// A list of alternate names or aliases that the individual is known by. - #[serde(skip_serializing_if = "Option::is_none")] - pub full_name_aliases: Option>, - - /// The individual's gender (International regulations require either "male" or "female"). - #[serde(skip_serializing_if = "Option::is_none")] - pub gender: Option, - - /// 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/create_token?type=pii). - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number: Option, - - /// The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. - /// - /// In Thailand, this would be the laser code found on the back of an ID card. - /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number_secondary: Option, - - /// The individual's last name. - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name: Option, - - /// The Kana variation of the individual's last name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name_kana: Option, - - /// The Kanji variation of the individual's last name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name_kanji: Option, - - /// The individual's maiden name. - #[serde(skip_serializing_if = "Option::is_none")] - pub maiden_name: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The individual's phone number. - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - #[serde(skip_serializing_if = "Option::is_none")] - pub political_exposure: Option, - - /// The individual's registered address. - #[serde(skip_serializing_if = "Option::is_none")] - pub registered_address: Option, - - /// The last four digits of the individual's Social Security Number (U.S. - /// - /// only). - #[serde(skip_serializing_if = "Option::is_none")] - pub ssn_last_4: Option, - - /// The individual's verification document information. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilities { - /// The acss_debit_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit_payments: Option, - - /// The affirm_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm_payments: Option, - - /// The afterpay_clearpay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay_payments: Option, - - /// The au_becs_debit_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit_payments: Option, - - /// The bacs_debit_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit_payments: Option, - - /// The bancontact_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact_payments: Option, - - /// The bank_transfer_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer_payments: Option, - - /// The blik_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik_payments: Option, - - /// The boleto_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto_payments: Option, - - /// The card_issuing capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_issuing: Option, - - /// The card_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_payments: Option, - - /// The cartes_bancaires_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub cartes_bancaires_payments: Option, - - /// The cashapp_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp_payments: Option, - - /// The eps_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps_payments: Option, - - /// The fpx_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx_payments: Option, - - /// The giropay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay_payments: Option, - - /// The grabpay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay_payments: Option, - - /// The ideal_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal_payments: Option, - - /// The india_international_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub india_international_payments: Option, - - /// The jcb_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub jcb_payments: Option, - - /// The klarna_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna_payments: Option, - - /// The konbini_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini_payments: Option, - - /// The legacy_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub legacy_payments: Option, - - /// The link_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub link_payments: Option, - - /// The oxxo_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo_payments: Option, - - /// The p24_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24_payments: Option, - - /// The paynow_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow_payments: Option, - - /// The promptpay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay_payments: Option, - - /// The sepa_debit_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit_payments: Option, - - /// The sofort_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort_payments: Option, - - /// The tax_reporting_us_1099_k capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_reporting_us_1099_k: Option, - - /// The tax_reporting_us_1099_misc capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_reporting_us_1099_misc: Option, - - /// The transfers capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfers: Option, - - /// The treasury capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub treasury: Option, - - /// The us_bank_account_ach_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account_ach_payments: Option, - - /// The zip_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip_payments: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountDocuments { - /// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. - /// - /// Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_account_ownership_verification: - Option, - - /// One or more documents that demonstrate proof of a company's license to operate. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_license: Option, - - /// One or more documents showing the company's Memorandum of Association. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_memorandum_of_association: - Option, - - /// (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_ministerial_decree: Option, - - /// One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_registration_verification: - Option, - - /// One or more documents that demonstrate proof of a company's tax ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_tax_id_verification: Option, - - /// One or more documents showing the company’s proof of registration with the national business registry. - #[serde(skip_serializing_if = "Option::is_none")] - pub proof_of_registration: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountSettingsParamsCardIssuing { - /// Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountSettingsParamsTreasury { - /// Details on the account's acceptance of the Stripe Treasury Services Agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BrandingSettingsParams { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. - /// - /// Must be square and at least 128px x 128px. - #[serde(skip_serializing_if = "Option::is_none")] - pub icon: Option, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. - /// - /// Must be at least 128px x 128px. - #[serde(skip_serializing_if = "Option::is_none")] - pub logo: Option, - - /// A CSS hex color value representing the primary branding color for this account. - #[serde(skip_serializing_if = "Option::is_none")] - pub primary_color: Option, - - /// A CSS hex color value representing the secondary branding color for this account. - #[serde(skip_serializing_if = "Option::is_none")] - pub secondary_color: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CardPaymentsSettingsParams { - /// Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub decline_on: Option, - - /// The default text that appears on credit card statements when a charge is made. - /// - /// This field prefixes any dynamic `statement_descriptor` specified on the charge. - /// `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_prefix: Option, - - /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). - /// - /// This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. - /// `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_prefix_kana: Option, - - /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). - /// - /// This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. - /// `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_prefix_kanji: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CompanyParamsOwnershipDeclaration { - /// The Unix timestamp marking when the beneficial owner attestation was made. - #[serde(skip_serializing_if = "Option::is_none")] - pub date: Option, - - /// The IP address from which the beneficial owner attestation was made. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip: Option, - - /// The user agent of the browser from which the beneficial owner attestation was made. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CompanyVerificationParams { - /// A document verifying the business. - #[serde(skip_serializing_if = "Option::is_none")] - pub document: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesAcssDebitPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesAffirmPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesAfterpayClearpayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesAuBecsDebitPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesBacsDebitPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesBancontactPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesBankTransferPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesBlikPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesBoletoPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesCardIssuing { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesCardPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesCartesBancairesPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesCashappPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesEpsPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesFpxPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesGiropayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesGrabpayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesIdealPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesIndiaInternationalPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesJcbPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesKlarnaPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesKonbiniPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesLegacyPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesLinkPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesOxxoPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesP24Payments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesPaynowPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesPromptpayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesSepaDebitPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesSofortPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesTaxReportingUs1099K { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesTaxReportingUs1099Misc { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesTransfers { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesTreasury { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesUsBankAccountAchPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesZipPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountDocumentsBankAccountOwnershipVerification { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountDocumentsCompanyLicense { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountDocumentsCompanyMemorandumOfAssociation { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountDocumentsCompanyMinisterialDecree { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountDocumentsCompanyRegistrationVerification { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountDocumentsCompanyTaxIdVerification { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountDocumentsProofOfRegistration { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentsSettingsParams { - /// The default text that appears on credit card statements when a charge is made. - /// - /// This field prefixes any dynamic `statement_descriptor` specified on the charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, - - /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_kana: Option, - - /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_kanji: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PayoutSettingsParams { - /// A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. - /// - /// For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). - #[serde(skip_serializing_if = "Option::is_none")] - pub debit_negative_balances: Option, - - /// Details on when funds from charges are available, and when they are paid out to an external account. - /// - /// For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. - #[serde(skip_serializing_if = "Option::is_none")] - pub schedule: Option, - - /// The text that appears on the bank account statement for payouts. - /// - /// If not set, this defaults to the platform's bank descriptor as set in the Dashboard. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonParamsDob { - /// The day of birth, between 1 and 31. - pub day: i64, - - /// The month of birth, between 1 and 12. - pub month: i64, - - /// The four-digit year of birth. - pub year: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonParamsRegisteredAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesAcssDebitPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesAffirmPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesAfterpayClearpayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesAuBecsDebitPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesBacsDebitPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesBancontactPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesBankTransferPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesBlikPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesBoletoPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesCardIssuing { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesCardPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesCartesBancairesPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesCashappPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesEpsPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesFpxPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesGiropayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesGrabpayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesIdealPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesIndiaInternationalPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesJcbPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesKlarnaPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesKonbiniPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesLegacyPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesLinkPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesOxxoPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesP24Payments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesPaynowPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesPromptpayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesSepaDebitPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesSofortPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesTaxReportingUs1099K { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesTaxReportingUs1099Misc { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesTransfers { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesTreasury { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesUsBankAccountAchPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesZipPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountDocumentsBankAccountOwnershipVerification { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountDocumentsCompanyLicense { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountDocumentsCompanyMemorandumOfAssociation { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountDocumentsCompanyMinisterialDecree { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountDocumentsCompanyRegistrationVerification { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountDocumentsCompanyTaxIdVerification { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountDocumentsProofOfRegistration { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountSettingsParamsCardIssuingTosAcceptance { - /// The Unix timestamp marking when the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub date: Option, - - /// The IP address from which the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip: Option, - - /// The user agent of the browser from which the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountSettingsParamsTreasuryTosAcceptance { - /// The Unix timestamp marking when the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub date: Option, - - /// The IP address from which the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip: Option, - - /// The user agent of the browser from which the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DeclineChargeOnParams { - /// Whether Stripe automatically declines charges with an incorrect ZIP or postal code. - /// - /// This setting only applies when a ZIP or postal code is provided and they fail bank verification. - #[serde(skip_serializing_if = "Option::is_none")] - pub avs_failure: Option, - - /// Whether Stripe automatically declines charges with an incorrect CVC. - /// - /// This setting only applies when a CVC is provided and it fails bank verification. - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc_failure: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransferScheduleParams { - /// The number of days charge funds are held before being paid out. - /// - /// May also be set to `minimum`, representing the lowest available value for the account country. - /// Default is `minimum`. - /// The `delay_days` parameter remains at the last configured value if `interval` is `manual`. - /// [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule). - #[serde(skip_serializing_if = "Option::is_none")] - pub delay_days: Option, - - /// How frequently available funds are paid out. - /// - /// One of: `daily`, `manual`, `weekly`, or `monthly`. - /// Default is `daily`. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval: Option, - - /// The day of the month when available funds are paid out, specified as a number between 1--31. - /// - /// Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. - /// Required and applicable only if `interval` is `monthly`. - #[serde(skip_serializing_if = "Option::is_none")] - pub monthly_anchor: Option, - - /// The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. - /// - /// (required and applicable only if `interval` is `weekly`.). - #[serde(skip_serializing_if = "Option::is_none")] - pub weekly_anchor: Option, -} - -/// An enum representing the possible values of an `Account`'s `business_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountBusinessType { - Company, - GovernmentEntity, - Individual, - NonProfit, -} - -impl AccountBusinessType { - pub fn as_str(self) -> &'static str { - match self { - AccountBusinessType::Company => "company", - AccountBusinessType::GovernmentEntity => "government_entity", - AccountBusinessType::Individual => "individual", - AccountBusinessType::NonProfit => "non_profit", - } - } -} - -impl AsRef for AccountBusinessType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountBusinessType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountBusinessType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `acss_debit_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesAcssDebitPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesAcssDebitPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesAcssDebitPayments::Active => "active", - AccountCapabilitiesAcssDebitPayments::Inactive => "inactive", - AccountCapabilitiesAcssDebitPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesAcssDebitPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesAcssDebitPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesAcssDebitPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `affirm_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesAffirmPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesAffirmPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesAffirmPayments::Active => "active", - AccountCapabilitiesAffirmPayments::Inactive => "inactive", - AccountCapabilitiesAffirmPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesAffirmPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesAffirmPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesAffirmPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `afterpay_clearpay_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesAfterpayClearpayPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesAfterpayClearpayPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesAfterpayClearpayPayments::Active => "active", - AccountCapabilitiesAfterpayClearpayPayments::Inactive => "inactive", - AccountCapabilitiesAfterpayClearpayPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesAfterpayClearpayPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesAfterpayClearpayPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesAfterpayClearpayPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `bacs_debit_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesBacsDebitPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesBacsDebitPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesBacsDebitPayments::Active => "active", - AccountCapabilitiesBacsDebitPayments::Inactive => "inactive", - AccountCapabilitiesBacsDebitPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesBacsDebitPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesBacsDebitPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesBacsDebitPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `bancontact_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesBancontactPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesBancontactPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesBancontactPayments::Active => "active", - AccountCapabilitiesBancontactPayments::Inactive => "inactive", - AccountCapabilitiesBancontactPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesBancontactPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesBancontactPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesBancontactPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `bank_transfer_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesBankTransferPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesBankTransferPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesBankTransferPayments::Active => "active", - AccountCapabilitiesBankTransferPayments::Inactive => "inactive", - AccountCapabilitiesBankTransferPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesBankTransferPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesBankTransferPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesBankTransferPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `blik_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesBlikPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesBlikPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesBlikPayments::Active => "active", - AccountCapabilitiesBlikPayments::Inactive => "inactive", - AccountCapabilitiesBlikPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesBlikPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesBlikPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesBlikPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `boleto_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesBoletoPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesBoletoPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesBoletoPayments::Active => "active", - AccountCapabilitiesBoletoPayments::Inactive => "inactive", - AccountCapabilitiesBoletoPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesBoletoPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesBoletoPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesBoletoPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `cartes_bancaires_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesCartesBancairesPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesCartesBancairesPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesCartesBancairesPayments::Active => "active", - AccountCapabilitiesCartesBancairesPayments::Inactive => "inactive", - AccountCapabilitiesCartesBancairesPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesCartesBancairesPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesCartesBancairesPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesCartesBancairesPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `cashapp_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesCashappPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesCashappPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesCashappPayments::Active => "active", - AccountCapabilitiesCashappPayments::Inactive => "inactive", - AccountCapabilitiesCashappPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesCashappPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesCashappPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesCashappPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `eps_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesEpsPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesEpsPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesEpsPayments::Active => "active", - AccountCapabilitiesEpsPayments::Inactive => "inactive", - AccountCapabilitiesEpsPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesEpsPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesEpsPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesEpsPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `fpx_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesFpxPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesFpxPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesFpxPayments::Active => "active", - AccountCapabilitiesFpxPayments::Inactive => "inactive", - AccountCapabilitiesFpxPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesFpxPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesFpxPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesFpxPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `giropay_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesGiropayPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesGiropayPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesGiropayPayments::Active => "active", - AccountCapabilitiesGiropayPayments::Inactive => "inactive", - AccountCapabilitiesGiropayPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesGiropayPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesGiropayPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesGiropayPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `grabpay_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesGrabpayPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesGrabpayPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesGrabpayPayments::Active => "active", - AccountCapabilitiesGrabpayPayments::Inactive => "inactive", - AccountCapabilitiesGrabpayPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesGrabpayPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesGrabpayPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesGrabpayPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `ideal_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesIdealPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesIdealPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesIdealPayments::Active => "active", - AccountCapabilitiesIdealPayments::Inactive => "inactive", - AccountCapabilitiesIdealPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesIdealPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesIdealPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesIdealPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `india_international_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesIndiaInternationalPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesIndiaInternationalPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesIndiaInternationalPayments::Active => "active", - AccountCapabilitiesIndiaInternationalPayments::Inactive => "inactive", - AccountCapabilitiesIndiaInternationalPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesIndiaInternationalPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesIndiaInternationalPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesIndiaInternationalPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `klarna_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesKlarnaPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesKlarnaPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesKlarnaPayments::Active => "active", - AccountCapabilitiesKlarnaPayments::Inactive => "inactive", - AccountCapabilitiesKlarnaPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesKlarnaPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesKlarnaPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesKlarnaPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `konbini_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesKonbiniPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesKonbiniPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesKonbiniPayments::Active => "active", - AccountCapabilitiesKonbiniPayments::Inactive => "inactive", - AccountCapabilitiesKonbiniPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesKonbiniPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesKonbiniPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesKonbiniPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `link_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesLinkPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesLinkPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesLinkPayments::Active => "active", - AccountCapabilitiesLinkPayments::Inactive => "inactive", - AccountCapabilitiesLinkPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesLinkPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesLinkPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesLinkPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `oxxo_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesOxxoPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesOxxoPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesOxxoPayments::Active => "active", - AccountCapabilitiesOxxoPayments::Inactive => "inactive", - AccountCapabilitiesOxxoPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesOxxoPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesOxxoPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesOxxoPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `p24_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesP24Payments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesP24Payments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesP24Payments::Active => "active", - AccountCapabilitiesP24Payments::Inactive => "inactive", - AccountCapabilitiesP24Payments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesP24Payments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesP24Payments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesP24Payments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `paynow_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesPaynowPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesPaynowPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesPaynowPayments::Active => "active", - AccountCapabilitiesPaynowPayments::Inactive => "inactive", - AccountCapabilitiesPaynowPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesPaynowPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesPaynowPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesPaynowPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `promptpay_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesPromptpayPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesPromptpayPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesPromptpayPayments::Active => "active", - AccountCapabilitiesPromptpayPayments::Inactive => "inactive", - AccountCapabilitiesPromptpayPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesPromptpayPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesPromptpayPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesPromptpayPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `sepa_debit_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesSepaDebitPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesSepaDebitPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesSepaDebitPayments::Active => "active", - AccountCapabilitiesSepaDebitPayments::Inactive => "inactive", - AccountCapabilitiesSepaDebitPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesSepaDebitPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesSepaDebitPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesSepaDebitPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `sofort_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesSofortPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesSofortPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesSofortPayments::Active => "active", - AccountCapabilitiesSofortPayments::Inactive => "inactive", - AccountCapabilitiesSofortPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesSofortPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesSofortPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesSofortPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `treasury` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesTreasury { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesTreasury { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesTreasury::Active => "active", - AccountCapabilitiesTreasury::Inactive => "inactive", - AccountCapabilitiesTreasury::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesTreasury { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesTreasury { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesTreasury { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `us_bank_account_ach_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesUsBankAccountAchPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesUsBankAccountAchPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesUsBankAccountAchPayments::Active => "active", - AccountCapabilitiesUsBankAccountAchPayments::Inactive => "inactive", - AccountCapabilitiesUsBankAccountAchPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesUsBankAccountAchPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesUsBankAccountAchPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesUsBankAccountAchPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `zip_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesZipPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesZipPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesZipPayments::Active => "active", - AccountCapabilitiesZipPayments::Inactive => "inactive", - AccountCapabilitiesZipPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesZipPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesZipPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesZipPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountRequirementsError`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountRequirementsErrorCode { - InvalidAddressCityStatePostalCode, - #[serde(rename = "invalid_dob_age_under_18")] - InvalidDobAgeUnder18, - InvalidRepresentativeCountry, - InvalidStreetAddress, - InvalidTosAcceptance, - InvalidValueOther, - VerificationDirectorsMismatch, - VerificationDocumentAddressMismatch, - VerificationDocumentAddressMissing, - VerificationDocumentCorrupt, - VerificationDocumentCountryNotSupported, - VerificationDocumentDirectorsMismatch, - VerificationDocumentDobMismatch, - VerificationDocumentDuplicateType, - VerificationDocumentExpired, - VerificationDocumentFailedCopy, - VerificationDocumentFailedGreyscale, - VerificationDocumentFailedOther, - VerificationDocumentFailedTestMode, - VerificationDocumentFraudulent, - VerificationDocumentIdNumberMismatch, - VerificationDocumentIdNumberMissing, - VerificationDocumentIncomplete, - VerificationDocumentInvalid, - VerificationDocumentIssueOrExpiryDateMissing, - VerificationDocumentManipulated, - VerificationDocumentMissingBack, - VerificationDocumentMissingFront, - VerificationDocumentNameMismatch, - VerificationDocumentNameMissing, - VerificationDocumentNationalityMismatch, - VerificationDocumentNotReadable, - VerificationDocumentNotSigned, - VerificationDocumentNotUploaded, - VerificationDocumentPhotoMismatch, - VerificationDocumentTooLarge, - VerificationDocumentTypeNotSupported, - VerificationExtraneousDirectors, - VerificationFailedAddressMatch, - VerificationFailedBusinessIecNumber, - VerificationFailedDocumentMatch, - VerificationFailedIdNumberMatch, - VerificationFailedKeyedIdentity, - VerificationFailedKeyedMatch, - VerificationFailedNameMatch, - VerificationFailedOther, - VerificationFailedResidentialAddress, - VerificationFailedTaxIdMatch, - VerificationFailedTaxIdNotIssued, - VerificationMissingDirectors, - VerificationMissingExecutives, - VerificationMissingOwners, - VerificationRequiresAdditionalMemorandumOfAssociations, -} - -impl AccountRequirementsErrorCode { - pub fn as_str(self) -> &'static str { - match self { - AccountRequirementsErrorCode::InvalidAddressCityStatePostalCode => "invalid_address_city_state_postal_code", - AccountRequirementsErrorCode::InvalidDobAgeUnder18 => "invalid_dob_age_under_18", - AccountRequirementsErrorCode::InvalidRepresentativeCountry => "invalid_representative_country", - 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", - AccountRequirementsErrorCode::VerificationDocumentFailedCopy => "verification_document_failed_copy", - AccountRequirementsErrorCode::VerificationDocumentFailedGreyscale => "verification_document_failed_greyscale", - AccountRequirementsErrorCode::VerificationDocumentFailedOther => "verification_document_failed_other", - AccountRequirementsErrorCode::VerificationDocumentFailedTestMode => "verification_document_failed_test_mode", - AccountRequirementsErrorCode::VerificationDocumentFraudulent => "verification_document_fraudulent", - AccountRequirementsErrorCode::VerificationDocumentIdNumberMismatch => "verification_document_id_number_mismatch", - AccountRequirementsErrorCode::VerificationDocumentIdNumberMissing => "verification_document_id_number_missing", - AccountRequirementsErrorCode::VerificationDocumentIncomplete => "verification_document_incomplete", - AccountRequirementsErrorCode::VerificationDocumentInvalid => "verification_document_invalid", - AccountRequirementsErrorCode::VerificationDocumentIssueOrExpiryDateMissing => "verification_document_issue_or_expiry_date_missing", - AccountRequirementsErrorCode::VerificationDocumentManipulated => "verification_document_manipulated", - AccountRequirementsErrorCode::VerificationDocumentMissingBack => "verification_document_missing_back", - AccountRequirementsErrorCode::VerificationDocumentMissingFront => "verification_document_missing_front", - AccountRequirementsErrorCode::VerificationDocumentNameMismatch => "verification_document_name_mismatch", - AccountRequirementsErrorCode::VerificationDocumentNameMissing => "verification_document_name_missing", - AccountRequirementsErrorCode::VerificationDocumentNationalityMismatch => "verification_document_nationality_mismatch", - AccountRequirementsErrorCode::VerificationDocumentNotReadable => "verification_document_not_readable", - AccountRequirementsErrorCode::VerificationDocumentNotSigned => "verification_document_not_signed", - AccountRequirementsErrorCode::VerificationDocumentNotUploaded => "verification_document_not_uploaded", - 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", - AccountRequirementsErrorCode::VerificationFailedIdNumberMatch => "verification_failed_id_number_match", - AccountRequirementsErrorCode::VerificationFailedKeyedIdentity => "verification_failed_keyed_identity", - AccountRequirementsErrorCode::VerificationFailedKeyedMatch => "verification_failed_keyed_match", - AccountRequirementsErrorCode::VerificationFailedNameMatch => "verification_failed_name_match", - AccountRequirementsErrorCode::VerificationFailedOther => "verification_failed_other", - 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", - } - } -} - -impl AsRef for AccountRequirementsErrorCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountRequirementsErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountRequirementsErrorCode { - fn default() -> Self { - Self::InvalidAddressCityStatePostalCode - } -} - -/// An enum representing the possible values of an `CreateAccount`'s `type_` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountType { - Custom, - Express, - Standard, -} - -impl AccountType { - pub fn as_str(self) -> &'static str { - match self { - AccountType::Custom => "custom", - AccountType::Express => "express", - AccountType::Standard => "standard", - } - } -} - -impl AsRef for AccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountType { - fn default() -> Self { - Self::Custom - } -} - -/// An enum representing the possible values of an `AccountUnificationAccountController`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountUnificationAccountControllerType { - Account, - Application, -} - -impl AccountUnificationAccountControllerType { - pub fn as_str(self) -> &'static str { - match self { - AccountUnificationAccountControllerType::Account => "account", - AccountUnificationAccountControllerType::Application => "application", - } - } -} - -impl AsRef for AccountUnificationAccountControllerType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountUnificationAccountControllerType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountUnificationAccountControllerType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `au_becs_debit_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CapabilityStatus { - Active, - Inactive, - Pending, -} - -impl CapabilityStatus { - pub fn as_str(self) -> &'static str { - match self { - CapabilityStatus::Active => "active", - CapabilityStatus::Inactive => "inactive", - CapabilityStatus::Pending => "pending", - } - } -} - -impl AsRef for CapabilityStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CapabilityStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CapabilityStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `CompanyParams`'s `structure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CompanyParamsStructure { - FreeZoneEstablishment, - FreeZoneLlc, - GovernmentInstrumentality, - GovernmentalUnit, - IncorporatedNonProfit, - IncorporatedPartnership, - LimitedLiabilityPartnership, - Llc, - MultiMemberLlc, - PrivateCompany, - PrivateCorporation, - PrivatePartnership, - PublicCompany, - PublicCorporation, - PublicPartnership, - SingleMemberLlc, - SoleEstablishment, - SoleProprietorship, - TaxExemptGovernmentInstrumentality, - UnincorporatedAssociation, - UnincorporatedNonProfit, - UnincorporatedPartnership, -} - -impl CompanyParamsStructure { - pub fn as_str(self) -> &'static str { - match self { - CompanyParamsStructure::FreeZoneEstablishment => "free_zone_establishment", - CompanyParamsStructure::FreeZoneLlc => "free_zone_llc", - 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", - CompanyParamsStructure::PrivateCompany => "private_company", - CompanyParamsStructure::PrivateCorporation => "private_corporation", - CompanyParamsStructure::PrivatePartnership => "private_partnership", - CompanyParamsStructure::PublicCompany => "public_company", - CompanyParamsStructure::PublicCorporation => "public_corporation", - CompanyParamsStructure::PublicPartnership => "public_partnership", - CompanyParamsStructure::SingleMemberLlc => "single_member_llc", - CompanyParamsStructure::SoleEstablishment => "sole_establishment", - CompanyParamsStructure::SoleProprietorship => "sole_proprietorship", - CompanyParamsStructure::TaxExemptGovernmentInstrumentality => { - "tax_exempt_government_instrumentality" - } - CompanyParamsStructure::UnincorporatedAssociation => "unincorporated_association", - CompanyParamsStructure::UnincorporatedNonProfit => "unincorporated_non_profit", - CompanyParamsStructure::UnincorporatedPartnership => "unincorporated_partnership", - } - } -} - -impl AsRef for CompanyParamsStructure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CompanyParamsStructure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CompanyParamsStructure { - fn default() -> Self { - Self::FreeZoneEstablishment - } -} - -/// An enum representing the possible values of an `Company`'s `structure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CompanyStructure { - FreeZoneEstablishment, - FreeZoneLlc, - GovernmentInstrumentality, - GovernmentalUnit, - IncorporatedNonProfit, - IncorporatedPartnership, - LimitedLiabilityPartnership, - Llc, - MultiMemberLlc, - PrivateCompany, - PrivateCorporation, - PrivatePartnership, - PublicCompany, - PublicCorporation, - PublicPartnership, - SingleMemberLlc, - SoleEstablishment, - SoleProprietorship, - TaxExemptGovernmentInstrumentality, - UnincorporatedAssociation, - UnincorporatedNonProfit, - UnincorporatedPartnership, -} - -impl CompanyStructure { - pub fn as_str(self) -> &'static str { - match self { - CompanyStructure::FreeZoneEstablishment => "free_zone_establishment", - CompanyStructure::FreeZoneLlc => "free_zone_llc", - 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", - CompanyStructure::PrivateCompany => "private_company", - CompanyStructure::PrivateCorporation => "private_corporation", - CompanyStructure::PrivatePartnership => "private_partnership", - CompanyStructure::PublicCompany => "public_company", - CompanyStructure::PublicCorporation => "public_corporation", - CompanyStructure::PublicPartnership => "public_partnership", - CompanyStructure::SingleMemberLlc => "single_member_llc", - CompanyStructure::SoleEstablishment => "sole_establishment", - CompanyStructure::SoleProprietorship => "sole_proprietorship", - CompanyStructure::TaxExemptGovernmentInstrumentality => { - "tax_exempt_government_instrumentality" - } - CompanyStructure::UnincorporatedAssociation => "unincorporated_association", - CompanyStructure::UnincorporatedNonProfit => "unincorporated_non_profit", - CompanyStructure::UnincorporatedPartnership => "unincorporated_partnership", - } - } -} - -impl AsRef for CompanyStructure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CompanyStructure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CompanyStructure { - fn default() -> Self { - Self::FreeZoneEstablishment - } -} - -/// An enum representing the possible values of an `PersonParams`'s `political_exposure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PersonParamsPoliticalExposure { - Existing, - None, -} - -impl PersonParamsPoliticalExposure { - pub fn as_str(self) -> &'static str { - match self { - PersonParamsPoliticalExposure::Existing => "existing", - PersonParamsPoliticalExposure::None => "none", - } - } -} - -impl AsRef for PersonParamsPoliticalExposure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PersonParamsPoliticalExposure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PersonParamsPoliticalExposure { - fn default() -> Self { - Self::Existing - } -} - -/// An enum representing the possible values of an `TransferScheduleParams`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TransferScheduleInterval { - Daily, - Manual, - Monthly, - Weekly, -} - -impl TransferScheduleInterval { - pub fn as_str(self) -> &'static str { - match self { - TransferScheduleInterval::Daily => "daily", - TransferScheduleInterval::Manual => "manual", - TransferScheduleInterval::Monthly => "monthly", - TransferScheduleInterval::Weekly => "weekly", - } - } -} - -impl AsRef for TransferScheduleInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TransferScheduleInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TransferScheduleInterval { - fn default() -> Self { - Self::Daily - } -} - -/// An enum representing the possible values of an `TransferScheduleParams`'s `weekly_anchor` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TransferScheduleParamsWeeklyAnchor { - Friday, - Monday, - Saturday, - Sunday, - Thursday, - Tuesday, - Wednesday, -} - -impl TransferScheduleParamsWeeklyAnchor { - pub fn as_str(self) -> &'static str { - match self { - TransferScheduleParamsWeeklyAnchor::Friday => "friday", - TransferScheduleParamsWeeklyAnchor::Monday => "monday", - TransferScheduleParamsWeeklyAnchor::Saturday => "saturday", - TransferScheduleParamsWeeklyAnchor::Sunday => "sunday", - TransferScheduleParamsWeeklyAnchor::Thursday => "thursday", - TransferScheduleParamsWeeklyAnchor::Tuesday => "tuesday", - TransferScheduleParamsWeeklyAnchor::Wednesday => "wednesday", - } - } -} - -impl AsRef for TransferScheduleParamsWeeklyAnchor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TransferScheduleParamsWeeklyAnchor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TransferScheduleParamsWeeklyAnchor { - fn default() -> Self { - Self::Friday - } -} diff --git a/src/resources/generated/account_link.rs b/src/resources/generated/account_link.rs deleted file mode 100644 index def9a7e3e..000000000 --- a/src/resources/generated/account_link.rs +++ /dev/null @@ -1,157 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::AccountId; -use crate::params::{Expand, Object, Timestamp}; - -/// The resource representing a Stripe "AccountLink". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountLink { - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The timestamp at which this account link will expire. - pub expires_at: Timestamp, - - /// The URL for the account link. - pub url: String, -} - -impl AccountLink { - /// Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. - pub fn create(client: &Client, params: CreateAccountLink<'_>) -> Response { - client.post_form("/account_links", ¶ms) - } -} - -impl Object for AccountLink { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "account_link" - } -} - -/// The parameters for `AccountLink::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateAccountLink<'a> { - /// The identifier of the account to create an account link for. - pub account: AccountId, - - /// Which information the platform needs to collect from the user. - /// - /// One of `currently_due` or `eventually_due`. - /// Default is `currently_due`. - #[serde(skip_serializing_if = "Option::is_none")] - pub collect: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. - /// - /// The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link's URL so they can continue with Connect Onboarding. - /// If a new account link cannot be generated or the redirect fails you should display a useful error to the user. - #[serde(skip_serializing_if = "Option::is_none")] - pub refresh_url: Option<&'a str>, - - /// The URL that the user will be redirected to upon leaving or completing the linked flow. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option<&'a str>, - - /// The type of account link the user is requesting. - /// - /// Possible values are `account_onboarding` or `account_update`. - #[serde(rename = "type")] - pub type_: AccountLinkType, -} - -impl<'a> CreateAccountLink<'a> { - pub fn new(account: AccountId, type_: AccountLinkType) -> Self { - CreateAccountLink { - account, - collect: Default::default(), - expand: Default::default(), - refresh_url: Default::default(), - return_url: Default::default(), - type_, - } - } -} - -/// An enum representing the possible values of an `CreateAccountLink`'s `collect` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountLinkCollect { - CurrentlyDue, - EventuallyDue, -} - -impl AccountLinkCollect { - pub fn as_str(self) -> &'static str { - match self { - AccountLinkCollect::CurrentlyDue => "currently_due", - AccountLinkCollect::EventuallyDue => "eventually_due", - } - } -} - -impl AsRef for AccountLinkCollect { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountLinkCollect { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountLinkCollect { - fn default() -> Self { - Self::CurrentlyDue - } -} - -/// An enum representing the possible values of an `CreateAccountLink`'s `type_` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountLinkType { - AccountOnboarding, - AccountUpdate, -} - -impl AccountLinkType { - pub fn as_str(self) -> &'static str { - match self { - AccountLinkType::AccountOnboarding => "account_onboarding", - AccountLinkType::AccountUpdate => "account_update", - } - } -} - -impl AsRef for AccountLinkType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountLinkType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountLinkType { - fn default() -> Self { - Self::AccountOnboarding - } -} diff --git a/src/resources/generated/account_session.rs b/src/resources/generated/account_session.rs deleted file mode 100644 index f93f9600d..000000000 --- a/src/resources/generated/account_session.rs +++ /dev/null @@ -1,104 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::client::{Client, Response}; -use crate::ids::{AccountId}; -use crate::params::{Expand, Object, Timestamp}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "ConnectEmbeddedMethodAccountSessionCreateMethodAccountSession". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountSession { - - /// The ID of the account the AccountSession was created for. - pub account: String, - - /// The client secret of this AccountSession. - /// - /// Used on the client to set up secure access to the given `account`. The client secret can be used to provide access to `account` from your frontend. - /// It should not be stored, logged, or exposed to anyone other than the connected account. - /// Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs to [setup Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components) and learn about how `client_secret` should be handled. - pub client_secret: String, - - pub components: ConnectEmbeddedAccountSessionCreateComponents, - - /// The timestamp at which this AccountSession will expire. - pub expires_at: Timestamp, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, -} - -impl AccountSession { - - /// Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. - pub fn create(client: &Client, params: CreateAccountSession<'_>) -> Response { - client.post_form("/account_sessions", ¶ms) - } -} - -impl Object for AccountSession { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "account_session" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ConnectEmbeddedAccountSessionCreateComponents { - - pub account_onboarding: ConnectEmbeddedBaseConfig, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ConnectEmbeddedBaseConfig { - - /// Whether the embedded component is enabled. - pub enabled: bool, -} - -/// The parameters for `AccountSession::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateAccountSession<'a> { - - /// The identifier of the account to create an Account Session for. - pub account: AccountId, - - /// Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. - /// - /// whether it has been enabled or not). - pub components: CreateAccountSessionComponents, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], -} - -impl<'a> CreateAccountSession<'a> { - pub fn new(account: AccountId, components: CreateAccountSessionComponents) -> Self { - CreateAccountSession { - account, - components, - expand: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountSessionComponents { - - /// Configuration for the account onboarding embedded component. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_onboarding: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountSessionComponentsAccountOnboarding { - - /// Whether the embedded component is enabled. - pub enabled: bool, -} diff --git a/src/resources/generated/address.rs b/src/resources/generated/address.rs deleted file mode 100644 index 0bb574529..000000000 --- a/src/resources/generated/address.rs +++ /dev/null @@ -1,27 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "Address". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Address { - /// City, district, suburb, town, or village. - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - pub line2: Option, - - /// ZIP or postal code. - pub postal_code: Option, - - /// State, county, province, or region. - pub state: Option, -} diff --git a/src/resources/generated/api_errors.rs b/src/resources/generated/api_errors.rs deleted file mode 100644 index f88ec543f..000000000 --- a/src/resources/generated/api_errors.rs +++ /dev/null @@ -1,491 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::resources::{PaymentIntent, PaymentMethod, PaymentSource, SetupIntent}; - -/// The resource representing a Stripe "APIErrors". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ApiErrors { - /// For card errors, the ID of the failed charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub charge: Option, - - /// For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. - #[serde(skip_serializing_if = "Option::is_none")] - pub code: Option, - - /// For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. - #[serde(skip_serializing_if = "Option::is_none")] - pub decline_code: Option, - - /// A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. - #[serde(skip_serializing_if = "Option::is_none")] - pub doc_url: Option, - - /// A human-readable message providing more details about the error. - /// - /// For card errors, these messages can be shown to your users. - #[serde(skip_serializing_if = "Option::is_none")] - pub message: Option, - - /// If the error is parameter-specific, the parameter related to the error. - /// - /// For example, you can use this to display a message near the correct form field. - #[serde(skip_serializing_if = "Option::is_none")] - pub param: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - /// If the error is specific to the type of payment method, the payment method type that had a problem. - /// - /// This field is only populated for invoice-related errors. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_type: Option, - - /// A URL to the request log entry in your dashboard. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_log_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_intent: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub source: Option, - - /// The type of error returned. - /// - /// One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`. - #[serde(rename = "type")] - pub type_: ApiErrorsType, -} - -/// An enum representing the possible values of an `ApiErrors`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ApiErrorsCode { - AccountClosed, - AccountCountryInvalidAddress, - AccountErrorCountryChangeRequiresAdditionalSteps, - AccountInformationMismatch, - AccountInvalid, - AccountNumberInvalid, - AcssDebitSessionIncomplete, - AlipayUpgradeRequired, - AmountTooLarge, - AmountTooSmall, - ApiKeyExpired, - ApplicationFeesNotAllowed, - AuthenticationRequired, - BalanceInsufficient, - BankAccountBadRoutingNumbers, - BankAccountDeclined, - BankAccountExists, - BankAccountRestricted, - BankAccountUnusable, - BankAccountUnverified, - BankAccountVerificationFailed, - BillingInvalidMandate, - BitcoinUpgradeRequired, - CaptureChargeAuthorizationExpired, - CaptureUnauthorizedPayment, - CardDeclineRateLimitExceeded, - CardDeclined, - CardholderPhoneNumberRequired, - ChargeAlreadyCaptured, - ChargeAlreadyRefunded, - ChargeDisputed, - ChargeExceedsSourceLimit, - ChargeExpiredForCapture, - ChargeInvalidParameter, - ChargeNotRefundable, - ClearingCodeUnsupported, - CountryCodeInvalid, - CountryUnsupported, - CouponExpired, - CustomerMaxPaymentMethods, - CustomerMaxSubscriptions, - DebitNotAuthorized, - EmailInvalid, - ExpiredCard, - IdempotencyKeyInUse, - IncorrectAddress, - IncorrectCvc, - IncorrectNumber, - IncorrectZip, - InstantPayoutsConfigDisabled, - InstantPayoutsCurrencyDisabled, - InstantPayoutsLimitExceeded, - InstantPayoutsUnsupported, - InsufficientFunds, - IntentInvalidState, - IntentVerificationMethodMissing, - InvalidCardType, - InvalidCharacters, - InvalidChargeAmount, - InvalidCvc, - InvalidExpiryMonth, - InvalidExpiryYear, - InvalidNumber, - InvalidSourceUsage, - InvalidTaxLocation, - InvoiceNoCustomerLineItems, - InvoiceNoPaymentMethodTypes, - InvoiceNoSubscriptionLineItems, - InvoiceNotEditable, - InvoiceOnBehalfOfNotEditable, - InvoicePaymentIntentRequiresAction, - InvoiceUpcomingNone, - LivemodeMismatch, - LockTimeout, - Missing, - NoAccount, - NotAllowedOnStandardAccount, - OutOfInventory, - OwnershipDeclarationNotAllowed, - ParameterInvalidEmpty, - ParameterInvalidInteger, - ParameterInvalidStringBlank, - ParameterInvalidStringEmpty, - ParameterMissing, - ParameterUnknown, - ParametersExclusive, - PaymentIntentActionRequired, - PaymentIntentAuthenticationFailure, - PaymentIntentIncompatiblePaymentMethod, - PaymentIntentInvalidParameter, - PaymentIntentKonbiniRejectedConfirmationNumber, - PaymentIntentMandateInvalid, - PaymentIntentPaymentAttemptExpired, - PaymentIntentPaymentAttemptFailed, - PaymentIntentUnexpectedState, - PaymentMethodBankAccountAlreadyVerified, - PaymentMethodBankAccountBlocked, - PaymentMethodBillingDetailsAddressMissing, - PaymentMethodConfigurationFailures, - PaymentMethodCurrencyMismatch, - PaymentMethodCustomerDecline, - PaymentMethodInvalidParameter, - PaymentMethodInvalidParameterTestmode, - PaymentMethodMicrodepositFailed, - PaymentMethodMicrodepositVerificationAmountsInvalid, - PaymentMethodMicrodepositVerificationAmountsMismatch, - PaymentMethodMicrodepositVerificationAttemptsExceeded, - PaymentMethodMicrodepositVerificationDescriptorCodeMismatch, - PaymentMethodMicrodepositVerificationTimeout, - PaymentMethodNotAvailable, - PaymentMethodProviderDecline, - PaymentMethodProviderTimeout, - PaymentMethodUnactivated, - PaymentMethodUnexpectedState, - PaymentMethodUnsupportedType, - PayoutReconciliationNotReady, - PayoutsLimitExceeded, - PayoutsNotAllowed, - PlatformAccountRequired, - PlatformApiKeyExpired, - PostalCodeInvalid, - ProcessingError, - ProductInactive, - ProgressiveOnboardingLimitExceeded, - RateLimit, - ReferToCustomer, - RefundDisputedPayment, - ResourceAlreadyExists, - ResourceMissing, - ReturnIntentAlreadyProcessed, - RoutingNumberInvalid, - SecretKeyRequired, - SepaUnsupportedAccount, - SetupAttemptFailed, - SetupIntentAuthenticationFailure, - SetupIntentInvalidParameter, - SetupIntentMandateInvalid, - SetupIntentSetupAttemptExpired, - SetupIntentUnexpectedState, - ShippingCalculationFailed, - SkuInactive, - StateUnsupported, - StatusTransitionInvalid, - StripeTaxInactive, - TaxIdInvalid, - TaxesCalculationFailed, - TerminalLocationCountryUnsupported, - TerminalReaderBusy, - TerminalReaderOffline, - TerminalReaderTimeout, - TestmodeChargesOnly, - TlsVersionUnsupported, - TokenAlreadyUsed, - TokenInUse, - TransferSourceBalanceParametersMismatch, - TransfersNotAllowed, - UrlInvalid, -} - -impl ApiErrorsCode { - pub fn as_str(self) -> &'static str { - match self { - ApiErrorsCode::AccountClosed => "account_closed", - ApiErrorsCode::AccountCountryInvalidAddress => "account_country_invalid_address", - ApiErrorsCode::AccountErrorCountryChangeRequiresAdditionalSteps => { - "account_error_country_change_requires_additional_steps" - } - ApiErrorsCode::AccountInformationMismatch => "account_information_mismatch", - ApiErrorsCode::AccountInvalid => "account_invalid", - ApiErrorsCode::AccountNumberInvalid => "account_number_invalid", - ApiErrorsCode::AcssDebitSessionIncomplete => "acss_debit_session_incomplete", - ApiErrorsCode::AlipayUpgradeRequired => "alipay_upgrade_required", - ApiErrorsCode::AmountTooLarge => "amount_too_large", - ApiErrorsCode::AmountTooSmall => "amount_too_small", - ApiErrorsCode::ApiKeyExpired => "api_key_expired", - ApiErrorsCode::ApplicationFeesNotAllowed => "application_fees_not_allowed", - ApiErrorsCode::AuthenticationRequired => "authentication_required", - ApiErrorsCode::BalanceInsufficient => "balance_insufficient", - ApiErrorsCode::BankAccountBadRoutingNumbers => "bank_account_bad_routing_numbers", - ApiErrorsCode::BankAccountDeclined => "bank_account_declined", - ApiErrorsCode::BankAccountExists => "bank_account_exists", - ApiErrorsCode::BankAccountRestricted => "bank_account_restricted", - ApiErrorsCode::BankAccountUnusable => "bank_account_unusable", - ApiErrorsCode::BankAccountUnverified => "bank_account_unverified", - ApiErrorsCode::BankAccountVerificationFailed => "bank_account_verification_failed", - ApiErrorsCode::BillingInvalidMandate => "billing_invalid_mandate", - ApiErrorsCode::BitcoinUpgradeRequired => "bitcoin_upgrade_required", - ApiErrorsCode::CaptureChargeAuthorizationExpired => { - "capture_charge_authorization_expired" - } - ApiErrorsCode::CaptureUnauthorizedPayment => "capture_unauthorized_payment", - ApiErrorsCode::CardDeclineRateLimitExceeded => "card_decline_rate_limit_exceeded", - ApiErrorsCode::CardDeclined => "card_declined", - ApiErrorsCode::CardholderPhoneNumberRequired => "cardholder_phone_number_required", - ApiErrorsCode::ChargeAlreadyCaptured => "charge_already_captured", - ApiErrorsCode::ChargeAlreadyRefunded => "charge_already_refunded", - ApiErrorsCode::ChargeDisputed => "charge_disputed", - ApiErrorsCode::ChargeExceedsSourceLimit => "charge_exceeds_source_limit", - ApiErrorsCode::ChargeExpiredForCapture => "charge_expired_for_capture", - ApiErrorsCode::ChargeInvalidParameter => "charge_invalid_parameter", - ApiErrorsCode::ChargeNotRefundable => "charge_not_refundable", - ApiErrorsCode::ClearingCodeUnsupported => "clearing_code_unsupported", - ApiErrorsCode::CountryCodeInvalid => "country_code_invalid", - ApiErrorsCode::CountryUnsupported => "country_unsupported", - ApiErrorsCode::CouponExpired => "coupon_expired", - ApiErrorsCode::CustomerMaxPaymentMethods => "customer_max_payment_methods", - ApiErrorsCode::CustomerMaxSubscriptions => "customer_max_subscriptions", - ApiErrorsCode::DebitNotAuthorized => "debit_not_authorized", - ApiErrorsCode::EmailInvalid => "email_invalid", - ApiErrorsCode::ExpiredCard => "expired_card", - ApiErrorsCode::IdempotencyKeyInUse => "idempotency_key_in_use", - ApiErrorsCode::IncorrectAddress => "incorrect_address", - ApiErrorsCode::IncorrectCvc => "incorrect_cvc", - ApiErrorsCode::IncorrectNumber => "incorrect_number", - ApiErrorsCode::IncorrectZip => "incorrect_zip", - ApiErrorsCode::InstantPayoutsConfigDisabled => "instant_payouts_config_disabled", - ApiErrorsCode::InstantPayoutsCurrencyDisabled => "instant_payouts_currency_disabled", - ApiErrorsCode::InstantPayoutsLimitExceeded => "instant_payouts_limit_exceeded", - ApiErrorsCode::InstantPayoutsUnsupported => "instant_payouts_unsupported", - ApiErrorsCode::InsufficientFunds => "insufficient_funds", - ApiErrorsCode::IntentInvalidState => "intent_invalid_state", - ApiErrorsCode::IntentVerificationMethodMissing => "intent_verification_method_missing", - ApiErrorsCode::InvalidCardType => "invalid_card_type", - ApiErrorsCode::InvalidCharacters => "invalid_characters", - ApiErrorsCode::InvalidChargeAmount => "invalid_charge_amount", - ApiErrorsCode::InvalidCvc => "invalid_cvc", - ApiErrorsCode::InvalidExpiryMonth => "invalid_expiry_month", - ApiErrorsCode::InvalidExpiryYear => "invalid_expiry_year", - ApiErrorsCode::InvalidNumber => "invalid_number", - ApiErrorsCode::InvalidSourceUsage => "invalid_source_usage", - ApiErrorsCode::InvalidTaxLocation => "invalid_tax_location", - ApiErrorsCode::InvoiceNoCustomerLineItems => "invoice_no_customer_line_items", - ApiErrorsCode::InvoiceNoPaymentMethodTypes => "invoice_no_payment_method_types", - ApiErrorsCode::InvoiceNoSubscriptionLineItems => "invoice_no_subscription_line_items", - ApiErrorsCode::InvoiceNotEditable => "invoice_not_editable", - ApiErrorsCode::InvoiceOnBehalfOfNotEditable => "invoice_on_behalf_of_not_editable", - ApiErrorsCode::InvoicePaymentIntentRequiresAction => { - "invoice_payment_intent_requires_action" - } - ApiErrorsCode::InvoiceUpcomingNone => "invoice_upcoming_none", - ApiErrorsCode::LivemodeMismatch => "livemode_mismatch", - ApiErrorsCode::LockTimeout => "lock_timeout", - ApiErrorsCode::Missing => "missing", - ApiErrorsCode::NoAccount => "no_account", - ApiErrorsCode::NotAllowedOnStandardAccount => "not_allowed_on_standard_account", - ApiErrorsCode::OutOfInventory => "out_of_inventory", - ApiErrorsCode::OwnershipDeclarationNotAllowed => "ownership_declaration_not_allowed", - ApiErrorsCode::ParameterInvalidEmpty => "parameter_invalid_empty", - ApiErrorsCode::ParameterInvalidInteger => "parameter_invalid_integer", - ApiErrorsCode::ParameterInvalidStringBlank => "parameter_invalid_string_blank", - ApiErrorsCode::ParameterInvalidStringEmpty => "parameter_invalid_string_empty", - ApiErrorsCode::ParameterMissing => "parameter_missing", - ApiErrorsCode::ParameterUnknown => "parameter_unknown", - ApiErrorsCode::ParametersExclusive => "parameters_exclusive", - ApiErrorsCode::PaymentIntentActionRequired => "payment_intent_action_required", - ApiErrorsCode::PaymentIntentAuthenticationFailure => { - "payment_intent_authentication_failure" - } - ApiErrorsCode::PaymentIntentIncompatiblePaymentMethod => { - "payment_intent_incompatible_payment_method" - } - ApiErrorsCode::PaymentIntentInvalidParameter => "payment_intent_invalid_parameter", - ApiErrorsCode::PaymentIntentKonbiniRejectedConfirmationNumber => { - "payment_intent_konbini_rejected_confirmation_number" - } - ApiErrorsCode::PaymentIntentMandateInvalid => "payment_intent_mandate_invalid", - ApiErrorsCode::PaymentIntentPaymentAttemptExpired => { - "payment_intent_payment_attempt_expired" - } - ApiErrorsCode::PaymentIntentPaymentAttemptFailed => { - "payment_intent_payment_attempt_failed" - } - ApiErrorsCode::PaymentIntentUnexpectedState => "payment_intent_unexpected_state", - ApiErrorsCode::PaymentMethodBankAccountAlreadyVerified => { - "payment_method_bank_account_already_verified" - } - ApiErrorsCode::PaymentMethodBankAccountBlocked => "payment_method_bank_account_blocked", - ApiErrorsCode::PaymentMethodBillingDetailsAddressMissing => { - "payment_method_billing_details_address_missing" - } - ApiErrorsCode::PaymentMethodConfigurationFailures => { - "payment_method_configuration_failures" - } - ApiErrorsCode::PaymentMethodCurrencyMismatch => "payment_method_currency_mismatch", - ApiErrorsCode::PaymentMethodCustomerDecline => "payment_method_customer_decline", - ApiErrorsCode::PaymentMethodInvalidParameter => "payment_method_invalid_parameter", - ApiErrorsCode::PaymentMethodInvalidParameterTestmode => { - "payment_method_invalid_parameter_testmode" - } - ApiErrorsCode::PaymentMethodMicrodepositFailed => "payment_method_microdeposit_failed", - ApiErrorsCode::PaymentMethodMicrodepositVerificationAmountsInvalid => { - "payment_method_microdeposit_verification_amounts_invalid" - } - ApiErrorsCode::PaymentMethodMicrodepositVerificationAmountsMismatch => { - "payment_method_microdeposit_verification_amounts_mismatch" - } - ApiErrorsCode::PaymentMethodMicrodepositVerificationAttemptsExceeded => { - "payment_method_microdeposit_verification_attempts_exceeded" - } - ApiErrorsCode::PaymentMethodMicrodepositVerificationDescriptorCodeMismatch => { - "payment_method_microdeposit_verification_descriptor_code_mismatch" - } - ApiErrorsCode::PaymentMethodMicrodepositVerificationTimeout => { - "payment_method_microdeposit_verification_timeout" - } - ApiErrorsCode::PaymentMethodNotAvailable => "payment_method_not_available", - ApiErrorsCode::PaymentMethodProviderDecline => "payment_method_provider_decline", - ApiErrorsCode::PaymentMethodProviderTimeout => "payment_method_provider_timeout", - ApiErrorsCode::PaymentMethodUnactivated => "payment_method_unactivated", - ApiErrorsCode::PaymentMethodUnexpectedState => "payment_method_unexpected_state", - ApiErrorsCode::PaymentMethodUnsupportedType => "payment_method_unsupported_type", - ApiErrorsCode::PayoutReconciliationNotReady => "payout_reconciliation_not_ready", - ApiErrorsCode::PayoutsLimitExceeded => "payouts_limit_exceeded", - ApiErrorsCode::PayoutsNotAllowed => "payouts_not_allowed", - ApiErrorsCode::PlatformAccountRequired => "platform_account_required", - ApiErrorsCode::PlatformApiKeyExpired => "platform_api_key_expired", - ApiErrorsCode::PostalCodeInvalid => "postal_code_invalid", - ApiErrorsCode::ProcessingError => "processing_error", - ApiErrorsCode::ProductInactive => "product_inactive", - ApiErrorsCode::ProgressiveOnboardingLimitExceeded => { - "progressive_onboarding_limit_exceeded" - } - ApiErrorsCode::RateLimit => "rate_limit", - ApiErrorsCode::ReferToCustomer => "refer_to_customer", - ApiErrorsCode::RefundDisputedPayment => "refund_disputed_payment", - ApiErrorsCode::ResourceAlreadyExists => "resource_already_exists", - ApiErrorsCode::ResourceMissing => "resource_missing", - ApiErrorsCode::ReturnIntentAlreadyProcessed => "return_intent_already_processed", - ApiErrorsCode::RoutingNumberInvalid => "routing_number_invalid", - ApiErrorsCode::SecretKeyRequired => "secret_key_required", - ApiErrorsCode::SepaUnsupportedAccount => "sepa_unsupported_account", - ApiErrorsCode::SetupAttemptFailed => "setup_attempt_failed", - ApiErrorsCode::SetupIntentAuthenticationFailure => { - "setup_intent_authentication_failure" - } - ApiErrorsCode::SetupIntentInvalidParameter => "setup_intent_invalid_parameter", - ApiErrorsCode::SetupIntentMandateInvalid => "setup_intent_mandate_invalid", - ApiErrorsCode::SetupIntentSetupAttemptExpired => "setup_intent_setup_attempt_expired", - ApiErrorsCode::SetupIntentUnexpectedState => "setup_intent_unexpected_state", - ApiErrorsCode::ShippingCalculationFailed => "shipping_calculation_failed", - ApiErrorsCode::SkuInactive => "sku_inactive", - ApiErrorsCode::StateUnsupported => "state_unsupported", - ApiErrorsCode::StatusTransitionInvalid => "status_transition_invalid", - ApiErrorsCode::StripeTaxInactive => "stripe_tax_inactive", - ApiErrorsCode::TaxIdInvalid => "tax_id_invalid", - ApiErrorsCode::TaxesCalculationFailed => "taxes_calculation_failed", - ApiErrorsCode::TerminalLocationCountryUnsupported => { - "terminal_location_country_unsupported" - } - ApiErrorsCode::TerminalReaderBusy => "terminal_reader_busy", - ApiErrorsCode::TerminalReaderOffline => "terminal_reader_offline", - ApiErrorsCode::TerminalReaderTimeout => "terminal_reader_timeout", - ApiErrorsCode::TestmodeChargesOnly => "testmode_charges_only", - ApiErrorsCode::TlsVersionUnsupported => "tls_version_unsupported", - ApiErrorsCode::TokenAlreadyUsed => "token_already_used", - ApiErrorsCode::TokenInUse => "token_in_use", - ApiErrorsCode::TransferSourceBalanceParametersMismatch => { - "transfer_source_balance_parameters_mismatch" - } - ApiErrorsCode::TransfersNotAllowed => "transfers_not_allowed", - ApiErrorsCode::UrlInvalid => "url_invalid", - } - } -} - -impl AsRef for ApiErrorsCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ApiErrorsCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ApiErrorsCode { - fn default() -> Self { - Self::AccountClosed - } -} - -/// An enum representing the possible values of an `ApiErrors`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ApiErrorsType { - ApiError, - CardError, - IdempotencyError, - InvalidRequestError, -} - -impl ApiErrorsType { - pub fn as_str(self) -> &'static str { - match self { - ApiErrorsType::ApiError => "api_error", - ApiErrorsType::CardError => "card_error", - ApiErrorsType::IdempotencyError => "idempotency_error", - ApiErrorsType::InvalidRequestError => "invalid_request_error", - } - } -} - -impl AsRef for ApiErrorsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ApiErrorsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ApiErrorsType { - fn default() -> Self { - Self::ApiError - } -} diff --git a/src/resources/generated/apple_pay_domain.rs b/src/resources/generated/apple_pay_domain.rs deleted file mode 100644 index 4c5dd9344..000000000 --- a/src/resources/generated/apple_pay_domain.rs +++ /dev/null @@ -1,41 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{ApplePayDomainId}; -use crate::params::{Object, Timestamp}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "ApplePayDomain". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ApplePayDomain { - /// Unique identifier for the object. - pub id: ApplePayDomainId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - #[serde(skip_serializing_if = "Option::is_none")] - pub domain_name: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, -} - -impl Object for ApplePayDomain { - type Id = ApplePayDomainId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "apple_pay_domain" - } -} diff --git a/src/resources/generated/application.rs b/src/resources/generated/application.rs deleted file mode 100644 index 1ce12ce2c..000000000 --- a/src/resources/generated/application.rs +++ /dev/null @@ -1,32 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::ApplicationId; -use crate::params::Object; - -/// The resource representing a Stripe "Application". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Application { - /// Unique identifier for the object. - pub id: ApplicationId, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// The name of the application. - pub name: Option, -} - -impl Object for Application { - type Id = ApplicationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "application" - } -} diff --git a/src/resources/generated/application_fee.rs b/src/resources/generated/application_fee.rs deleted file mode 100644 index 507ba112d..000000000 --- a/src/resources/generated/application_fee.rs +++ /dev/null @@ -1,150 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ApplicationFeeId, ChargeId}; -use crate::params::{Expand, Expandable, List, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{ - Account, Application, ApplicationFeeRefund, BalanceTransaction, Charge, Currency, -}; - -/// The resource representing a Stripe "PlatformFee". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ApplicationFee { - /// Unique identifier for the object. - pub id: ApplicationFeeId, - - /// ID of the Stripe account this fee was taken from. - pub account: Expandable, - - /// Amount earned, in cents (or local equivalent). - pub amount: i64, - - /// Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the fee if a partial refund was issued). - pub amount_refunded: i64, - - /// ID of the Connect application that earned the fee. - pub application: Expandable, - - /// Balance transaction that describes the impact of this collected application fee on your account balance (not including refunds). - pub balance_transaction: Option>, - - /// ID of the charge that the application fee was taken from. - pub charge: Expandable, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// ID of the corresponding charge on the platform account, if this fee was the result of a charge using the `destination` parameter. - pub originating_transaction: Option>, - - /// Whether the fee has been fully refunded. - /// - /// If the fee is only partially refunded, this attribute will still be false. - pub refunded: bool, - - /// A list of refunds that have been applied to the fee. - pub refunds: List, -} - -impl ApplicationFee { - /// Returns a list of application fees you’ve previously collected. - /// - /// The application fees are returned in sorted order, with the most recent fees appearing first. - pub fn list( - client: &Client, - params: &ListApplicationFees<'_>, - ) -> Response> { - client.get_query("/application_fees", ¶ms) - } - - /// Retrieves the details of an application fee that your account has collected. - /// - /// The same information is returned when refunding the application fee. - pub fn retrieve( - client: &Client, - id: &ApplicationFeeId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/application_fees/{}", id), &Expand { expand }) - } -} - -impl Object for ApplicationFee { - type Id = ApplicationFeeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "application_fee" - } -} - -/// The parameters for `ApplicationFee::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListApplicationFees<'a> { - /// Only return application fees for the charge specified by this charge ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub charge: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListApplicationFees<'a> { - pub fn new() -> Self { - ListApplicationFees { - charge: Default::default(), - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListApplicationFees<'_> { - type O = ApplicationFee; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} diff --git a/src/resources/generated/apps_secret.rs b/src/resources/generated/apps_secret.rs deleted file mode 100644 index 41af70203..000000000 --- a/src/resources/generated/apps_secret.rs +++ /dev/null @@ -1,93 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{AppsSecretId}; -use crate::params::{Object, Timestamp}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "SecretServiceResourceSecret". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AppsSecret { - /// Unique identifier for the object. - pub id: AppsSecretId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// If true, indicates that this secret has been deleted. - #[serde(skip_serializing_if = "Option::is_none")] - pub deleted: Option, - - /// The Unix timestamp for the expiry time of the secret, after which the secret deletes. - pub expires_at: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// A name for the secret that's unique within the scope. - pub name: String, - - /// The plaintext secret value to be stored. - pub payload: Option, - - pub scope: SecretServiceResourceScope, -} - -impl Object for AppsSecret { - type Id = AppsSecretId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "apps.secret" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SecretServiceResourceScope { - - /// The secret scope type. - #[serde(rename = "type")] - pub type_: SecretServiceResourceScopeType, - - /// The user ID, if type is set to "user". - #[serde(skip_serializing_if = "Option::is_none")] - pub user: Option, -} - -/// An enum representing the possible values of an `SecretServiceResourceScope`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SecretServiceResourceScopeType { - Account, - User, -} - -impl SecretServiceResourceScopeType { - pub fn as_str(self) -> &'static str { - match self { - SecretServiceResourceScopeType::Account => "account", - SecretServiceResourceScopeType::User => "user", - } - } -} - -impl AsRef for SecretServiceResourceScopeType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SecretServiceResourceScopeType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SecretServiceResourceScopeType { - fn default() -> Self { - Self::Account - } -} diff --git a/src/resources/generated/balance.rs b/src/resources/generated/balance.rs deleted file mode 100644 index d1a4232e8..000000000 --- a/src/resources/generated/balance.rs +++ /dev/null @@ -1,83 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::params::Object; -use crate::resources::Currency; - -/// The resource representing a Stripe "Balance". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Balance { - /// Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). - /// - /// You can find the available balance for each currency and payment type in the `source_types` property. - pub available: Vec, - - /// Funds held due to negative balances on connected Custom accounts. - /// - /// You can find the connect reserve balance for each currency and payment type in the `source_types` property. - #[serde(skip_serializing_if = "Option::is_none")] - pub connect_reserved: Option>, - - /// Funds that you can pay out using Instant Payouts. - #[serde(skip_serializing_if = "Option::is_none")] - pub instant_available: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub issuing: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Funds that aren't available in the balance yet. - /// - /// You can find the pending balance for each currency and each payment type in the `source_types` property. - pub pending: Vec, -} - -impl Object for Balance { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "balance" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BalanceAmount { - /// Balance amount. - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - #[serde(skip_serializing_if = "Option::is_none")] - pub source_types: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BalanceAmountBySourceType { - /// Amount for bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_account: Option, - - /// Amount for card. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// Amount for FPX. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BalanceDetail { - /// Funds that are available for use. - pub available: Vec, -} diff --git a/src/resources/generated/balance_transaction.rs b/src/resources/generated/balance_transaction.rs deleted file mode 100644 index 24ea5ba91..000000000 --- a/src/resources/generated/balance_transaction.rs +++ /dev/null @@ -1,312 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{BalanceTransactionId, PayoutId, SourceId}; -use crate::params::{Expand, Expandable, List, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{ - BalanceTransactionSourceUnion, BalanceTransactionStatus, Currency, FeeType, -}; - -/// The resource representing a Stripe "BalanceTransaction". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BalanceTransaction { - /// Unique identifier for the object. - pub id: BalanceTransactionId, - - /// Gross amount of the transaction (in cents (or local equivalent)). - pub amount: i64, - - /// The date that the transaction's net funds become available in the Stripe balance. - pub available_on: Timestamp, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// If applicable, this transaction uses an exchange rate. - /// - /// If money converts from currency A to currency B, then the `amount` in currency A, multipled by the `exchange_rate`, equals the `amount` in currency B. - /// For example, if you charge a customer 10.00 EUR, the PaymentIntent's `amount` is `1000` and `currency` is `eur`. - /// If this converts to 12.34 USD in your Stripe account, the BalanceTransaction's `amount` is `1234`, its `currency` is `usd`, and the `exchange_rate` is `1.234`. - pub exchange_rate: Option, - - /// Fees (in cents (or local equivalent)) paid for this transaction. - pub fee: i64, - - /// Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction. - pub fee_details: Vec, - - /// Net amount of the transaction (in cents (or local equivalent)). - pub net: i64, - - /// Learn more about how [reporting categories] (https://stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective. - pub reporting_category: String, - - /// This transaction relates to the Stripe object. - pub source: Option>, - - /// The transaction's net funds status in the Stripe balance, which are 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`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `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 about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). - /// To classify transactions for accounting purposes, consider `reporting_category` instead. - #[serde(rename = "type")] - pub type_: BalanceTransactionType, -} - -impl BalanceTransaction { - /// Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). - /// - /// The transactions are returned in sorted order, with the most recent transactions appearing first. Note that this endpoint was previously called “Balance history” and used the path `/v1/balance/history`. - pub fn list( - client: &Client, - params: &ListBalanceTransactions<'_>, - ) -> Response> { - client.get_query("/balance_transactions", ¶ms) - } - - /// Retrieves the balance transaction with the given ID. - /// - /// Note that this endpoint previously used the path `/v1/balance/history/:id`. - pub fn retrieve( - client: &Client, - id: &BalanceTransactionId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/balance_transactions/{}", id), &Expand { expand }) - } -} - -impl Object for BalanceTransaction { - type Id = BalanceTransactionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "balance_transaction" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Fee { - /// Amount of the fee, in cents. - pub amount: i64, - - /// ID of the Connect application that earned the fee. - pub application: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// Type of the fee, one of: `application_fee`, `stripe_fee` or `tax`. - #[serde(rename = "type")] - pub type_: FeeType, -} - -/// The parameters for `BalanceTransaction::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListBalanceTransactions<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return transactions in a certain currency. - /// - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// For automatic Stripe payouts only, only returns transactions that were paid out on the specified payout ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub payout: Option, - - /// Only returns the original transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub source: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// 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`, `obligation_inbound`, `obligation_outbound`, `obligation_reversal_inbound`, `obligation_reversal_outbound`, `obligation_payout`, `obligation_payout_failure`, `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>, -} - -impl<'a> ListBalanceTransactions<'a> { - pub fn new() -> Self { - ListBalanceTransactions { - created: Default::default(), - currency: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - payout: Default::default(), - source: Default::default(), - starting_after: Default::default(), - type_: Default::default(), - } - } -} -impl Paginable for ListBalanceTransactions<'_> { - type O = BalanceTransaction; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// An enum representing the possible values of an `BalanceTransaction`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BalanceTransactionType { - Adjustment, - Advance, - AdvanceFunding, - AnticipationRepayment, - ApplicationFee, - ApplicationFeeRefund, - Charge, - ConnectCollectionTransfer, - Contribution, - IssuingAuthorizationHold, - IssuingAuthorizationRelease, - IssuingDispute, - IssuingTransaction, - ObligationInbound, - ObligationOutbound, - ObligationPayout, - ObligationPayoutFailure, - ObligationReversalInbound, - ObligationReversalOutbound, - Payment, - PaymentFailureRefund, - PaymentRefund, - PaymentReversal, - Payout, - PayoutCancel, - PayoutFailure, - Refund, - RefundFailure, - ReserveTransaction, - ReservedFunds, - StripeFee, - StripeFxFee, - TaxFee, - Topup, - TopupReversal, - Transfer, - TransferCancel, - TransferFailure, - TransferRefund, -} - -impl BalanceTransactionType { - pub fn as_str(self) -> &'static str { - match self { - BalanceTransactionType::Adjustment => "adjustment", - BalanceTransactionType::Advance => "advance", - BalanceTransactionType::AdvanceFunding => "advance_funding", - BalanceTransactionType::AnticipationRepayment => "anticipation_repayment", - BalanceTransactionType::ApplicationFee => "application_fee", - BalanceTransactionType::ApplicationFeeRefund => "application_fee_refund", - BalanceTransactionType::Charge => "charge", - BalanceTransactionType::ConnectCollectionTransfer => "connect_collection_transfer", - BalanceTransactionType::Contribution => "contribution", - BalanceTransactionType::IssuingAuthorizationHold => "issuing_authorization_hold", - BalanceTransactionType::IssuingAuthorizationRelease => "issuing_authorization_release", - BalanceTransactionType::IssuingDispute => "issuing_dispute", - BalanceTransactionType::IssuingTransaction => "issuing_transaction", - BalanceTransactionType::ObligationInbound => "obligation_inbound", - BalanceTransactionType::ObligationOutbound => "obligation_outbound", - BalanceTransactionType::ObligationPayout => "obligation_payout", - BalanceTransactionType::ObligationPayoutFailure => "obligation_payout_failure", - BalanceTransactionType::ObligationReversalInbound => "obligation_reversal_inbound", - BalanceTransactionType::ObligationReversalOutbound => "obligation_reversal_outbound", - 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", - BalanceTransactionType::Refund => "refund", - BalanceTransactionType::RefundFailure => "refund_failure", - BalanceTransactionType::ReserveTransaction => "reserve_transaction", - BalanceTransactionType::ReservedFunds => "reserved_funds", - BalanceTransactionType::StripeFee => "stripe_fee", - BalanceTransactionType::StripeFxFee => "stripe_fx_fee", - BalanceTransactionType::TaxFee => "tax_fee", - BalanceTransactionType::Topup => "topup", - BalanceTransactionType::TopupReversal => "topup_reversal", - BalanceTransactionType::Transfer => "transfer", - BalanceTransactionType::TransferCancel => "transfer_cancel", - BalanceTransactionType::TransferFailure => "transfer_failure", - BalanceTransactionType::TransferRefund => "transfer_refund", - } - } -} - -impl AsRef for BalanceTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BalanceTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for BalanceTransactionType { - fn default() -> Self { - Self::Adjustment - } -} diff --git a/src/resources/generated/bank_account.rs b/src/resources/generated/bank_account.rs deleted file mode 100644 index 8a4223af3..000000000 --- a/src/resources/generated/bank_account.rs +++ /dev/null @@ -1,324 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::BankAccountId; -use crate::params::{Expandable, Metadata, Object}; -use crate::resources::{Account, BankAccountStatus, Currency, Customer}; - -/// The resource representing a Stripe "BankAccount". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankAccount { - /// Unique identifier for the object. - pub id: BankAccountId, - - /// The ID of the account that the bank account is associated with. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option>, - - /// The name of the person or business that owns the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_name: Option, - - /// The type of entity that holds the account. - /// - /// This can be either `individual` or `company`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: Option, - - /// The bank account type. - /// - /// This can only be `checking` or `savings` in most countries. - /// In Japan, this can only be `futsu` or `toza`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_type: Option, - - /// A set of available payout methods for this bank account. - /// - /// Only values from this set should be passed as the `method` when creating a payout. - #[serde(skip_serializing_if = "Option::is_none")] - pub available_payout_methods: Option>, - - /// Name of the bank associated with the routing number (e.g., `WELLS FARGO`). - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_name: Option, - - /// Two-letter ISO code representing the country the bank account is located in. - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account. - pub currency: Currency, - - /// The ID of the customer that the bank account is associated with. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option>, - - /// Whether this bank account is the default external account for its currency. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_for_currency: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - /// Information about the [upcoming new requirements for the bank account](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when. - #[serde(skip_serializing_if = "Option::is_none")] - pub future_requirements: Option, - - /// The last four digits of the bank account number. - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Information about the requirements for the bank account, including what information needs to be collected. - #[serde(skip_serializing_if = "Option::is_none")] - pub requirements: Option, - - /// The routing transit number for the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, - - /// For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, or `errored`. - /// - /// A bank account that hasn't had any activity or validation performed is `new`. - /// If Stripe can determine that the bank account exists, its status will be `validated`. - /// Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. - /// If customer bank account verification has succeeded, the bank account status will be `verified`. - /// If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. - /// If a transfer sent to this bank account fails, we'll set the status to `errored` and will not continue to send transfers until the bank details are updated. For external accounts, possible values are `new`, `errored` and `verification_failed`. - /// If a transfer fails, the status is set to `errored` and transfers are stopped until account details are updated. - /// In India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. - /// Other validations aren't run against external accounts because they're only used for payouts. - /// This means the other statuses don't apply. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, -} - -impl Object for BankAccount { - type Id = BankAccountId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "bank_account" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ExternalAccountRequirements { - /// Fields that need to be collected to keep the external account enabled. - /// - /// If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. - pub currently_due: Option>, - - /// Fields that are `currently_due` and need to be collected again because validation or verification failed. - pub errors: Option>, - - /// Fields that weren't collected by `current_deadline`. - /// - /// These fields need to be collected to enable the external account. - pub past_due: Option>, - - /// Fields that may become required depending on the results of verification or review. - /// - /// Will be an empty array unless an asynchronous verification is pending. - /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. - pub pending_verification: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountRequirementsError { - /// The code for the type of error. - pub code: AccountRequirementsErrorCode, - - /// An informative message that indicates the error type and provides additional details about the error. - pub reason: String, - - /// The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. - pub requirement: String, -} - -/// An enum representing the possible values of an `AccountRequirementsError`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountRequirementsErrorCode { - InvalidAddressCityStatePostalCode, - #[serde(rename = "invalid_dob_age_under_18")] - InvalidDobAgeUnder18, - InvalidRepresentativeCountry, - InvalidStreetAddress, - InvalidTosAcceptance, - InvalidValueOther, - VerificationDirectorsMismatch, - VerificationDocumentAddressMismatch, - VerificationDocumentAddressMissing, - VerificationDocumentCorrupt, - VerificationDocumentCountryNotSupported, - VerificationDocumentDirectorsMismatch, - VerificationDocumentDobMismatch, - VerificationDocumentDuplicateType, - VerificationDocumentExpired, - VerificationDocumentFailedCopy, - VerificationDocumentFailedGreyscale, - VerificationDocumentFailedOther, - VerificationDocumentFailedTestMode, - VerificationDocumentFraudulent, - VerificationDocumentIdNumberMismatch, - VerificationDocumentIdNumberMissing, - VerificationDocumentIncomplete, - VerificationDocumentInvalid, - VerificationDocumentIssueOrExpiryDateMissing, - VerificationDocumentManipulated, - VerificationDocumentMissingBack, - VerificationDocumentMissingFront, - VerificationDocumentNameMismatch, - VerificationDocumentNameMissing, - VerificationDocumentNationalityMismatch, - VerificationDocumentNotReadable, - VerificationDocumentNotSigned, - VerificationDocumentNotUploaded, - VerificationDocumentPhotoMismatch, - VerificationDocumentTooLarge, - VerificationDocumentTypeNotSupported, - VerificationExtraneousDirectors, - VerificationFailedAddressMatch, - VerificationFailedBusinessIecNumber, - VerificationFailedDocumentMatch, - VerificationFailedIdNumberMatch, - VerificationFailedKeyedIdentity, - VerificationFailedKeyedMatch, - VerificationFailedNameMatch, - VerificationFailedOther, - VerificationFailedResidentialAddress, - VerificationFailedTaxIdMatch, - VerificationFailedTaxIdNotIssued, - VerificationMissingDirectors, - VerificationMissingExecutives, - VerificationMissingOwners, - VerificationRequiresAdditionalMemorandumOfAssociations, -} - -impl AccountRequirementsErrorCode { - pub fn as_str(self) -> &'static str { - match self { - AccountRequirementsErrorCode::InvalidAddressCityStatePostalCode => "invalid_address_city_state_postal_code", - AccountRequirementsErrorCode::InvalidDobAgeUnder18 => "invalid_dob_age_under_18", - AccountRequirementsErrorCode::InvalidRepresentativeCountry => "invalid_representative_country", - 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", - AccountRequirementsErrorCode::VerificationDocumentFailedCopy => "verification_document_failed_copy", - AccountRequirementsErrorCode::VerificationDocumentFailedGreyscale => "verification_document_failed_greyscale", - AccountRequirementsErrorCode::VerificationDocumentFailedOther => "verification_document_failed_other", - AccountRequirementsErrorCode::VerificationDocumentFailedTestMode => "verification_document_failed_test_mode", - AccountRequirementsErrorCode::VerificationDocumentFraudulent => "verification_document_fraudulent", - AccountRequirementsErrorCode::VerificationDocumentIdNumberMismatch => "verification_document_id_number_mismatch", - AccountRequirementsErrorCode::VerificationDocumentIdNumberMissing => "verification_document_id_number_missing", - AccountRequirementsErrorCode::VerificationDocumentIncomplete => "verification_document_incomplete", - AccountRequirementsErrorCode::VerificationDocumentInvalid => "verification_document_invalid", - AccountRequirementsErrorCode::VerificationDocumentIssueOrExpiryDateMissing => "verification_document_issue_or_expiry_date_missing", - AccountRequirementsErrorCode::VerificationDocumentManipulated => "verification_document_manipulated", - AccountRequirementsErrorCode::VerificationDocumentMissingBack => "verification_document_missing_back", - AccountRequirementsErrorCode::VerificationDocumentMissingFront => "verification_document_missing_front", - AccountRequirementsErrorCode::VerificationDocumentNameMismatch => "verification_document_name_mismatch", - AccountRequirementsErrorCode::VerificationDocumentNameMissing => "verification_document_name_missing", - AccountRequirementsErrorCode::VerificationDocumentNationalityMismatch => "verification_document_nationality_mismatch", - AccountRequirementsErrorCode::VerificationDocumentNotReadable => "verification_document_not_readable", - AccountRequirementsErrorCode::VerificationDocumentNotSigned => "verification_document_not_signed", - AccountRequirementsErrorCode::VerificationDocumentNotUploaded => "verification_document_not_uploaded", - 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", - AccountRequirementsErrorCode::VerificationFailedIdNumberMatch => "verification_failed_id_number_match", - AccountRequirementsErrorCode::VerificationFailedKeyedIdentity => "verification_failed_keyed_identity", - AccountRequirementsErrorCode::VerificationFailedKeyedMatch => "verification_failed_keyed_match", - AccountRequirementsErrorCode::VerificationFailedNameMatch => "verification_failed_name_match", - AccountRequirementsErrorCode::VerificationFailedOther => "verification_failed_other", - 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", - } - } -} - -impl AsRef for AccountRequirementsErrorCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountRequirementsErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountRequirementsErrorCode { - fn default() -> Self { - Self::InvalidAddressCityStatePostalCode - } -} - -/// An enum representing the possible values of an `BankAccount`'s `available_payout_methods` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BankAccountAvailablePayoutMethods { - Instant, - Standard, -} - -impl BankAccountAvailablePayoutMethods { - pub fn as_str(self) -> &'static str { - match self { - BankAccountAvailablePayoutMethods::Instant => "instant", - BankAccountAvailablePayoutMethods::Standard => "standard", - } - } -} - -impl AsRef for BankAccountAvailablePayoutMethods { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BankAccountAvailablePayoutMethods { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for BankAccountAvailablePayoutMethods { - fn default() -> Self { - Self::Instant - } -} diff --git a/src/resources/generated/bank_connections_resource_accountholder.rs b/src/resources/generated/bank_connections_resource_accountholder.rs deleted file mode 100644 index 35f3ac826..000000000 --- a/src/resources/generated/bank_connections_resource_accountholder.rs +++ /dev/null @@ -1,62 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::params::{Expandable}; -use crate::resources::{Account, Customer}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "BankConnectionsResourceAccountholder". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankConnectionsResourceAccountholder { - - /// The ID of the Stripe account this account belongs to. - /// - /// Should only be present if `account_holder.type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option>, - - /// ID of the Stripe customer this account belongs to. - /// - /// Present if and only if `account_holder.type` is `customer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option>, - - /// Type of account holder that this account belongs to. - #[serde(rename = "type")] - pub type_: BankConnectionsResourceAccountholderType, -} - -/// An enum representing the possible values of an `BankConnectionsResourceAccountholder`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BankConnectionsResourceAccountholderType { - Account, - Customer, -} - -impl BankConnectionsResourceAccountholderType { - pub fn as_str(self) -> &'static str { - match self { - BankConnectionsResourceAccountholderType::Account => "account", - BankConnectionsResourceAccountholderType::Customer => "customer", - } - } -} - -impl AsRef for BankConnectionsResourceAccountholderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BankConnectionsResourceAccountholderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for BankConnectionsResourceAccountholderType { - fn default() -> Self { - Self::Account - } -} diff --git a/src/resources/generated/billing_details.rs b/src/resources/generated/billing_details.rs deleted file mode 100644 index 76f9626cb..000000000 --- a/src/resources/generated/billing_details.rs +++ /dev/null @@ -1,23 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::resources::Address; - -/// The resource representing a Stripe "billing_details". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BillingDetails { - /// Billing address. - pub address: Option
, - - /// Email address. - pub email: Option, - - /// Full name. - pub name: Option, - - /// Billing phone number (including extension). - pub phone: Option, -} diff --git a/src/resources/generated/billing_portal_configuration.rs b/src/resources/generated/billing_portal_configuration.rs deleted file mode 100644 index cd7719569..000000000 --- a/src/resources/generated/billing_portal_configuration.rs +++ /dev/null @@ -1,418 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::BillingPortalConfigurationId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::Application; - -/// The resource representing a Stripe "PortalConfiguration". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BillingPortalConfiguration { - /// Unique identifier for the object. - pub id: BillingPortalConfigurationId, - - /// Whether the configuration is active and can be used to create portal sessions. - pub active: bool, - - /// ID of the Connect Application that created the configuration. - pub application: Option>, - - pub business_profile: PortalBusinessProfile, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The default URL to redirect customers to when they click on the portal's link to return to your website. - /// - /// This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. - pub default_return_url: Option, - - pub features: PortalFeatures, - - /// Whether the configuration is the default. - /// - /// If `true`, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session. - pub is_default: bool, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - pub login_page: PortalLoginPage, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// Time at which the object was last updated. - /// - /// Measured in seconds since the Unix epoch. - pub updated: Timestamp, -} - -impl Object for BillingPortalConfiguration { - type Id = BillingPortalConfigurationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "billing_portal.configuration" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalBusinessProfile { - /// The messaging shown to customers in the portal. - pub headline: Option, - - /// A link to the business’s publicly available privacy policy. - pub privacy_policy_url: Option, - - /// A link to the business’s publicly available terms of service. - pub terms_of_service_url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFeatures { - pub customer_update: PortalCustomerUpdate, - - pub invoice_history: PortalInvoiceList, - - pub payment_method_update: PortalPaymentMethodUpdate, - - pub subscription_cancel: PortalSubscriptionCancel, - - pub subscription_pause: PortalSubscriptionPause, - - pub subscription_update: PortalSubscriptionUpdate, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalCustomerUpdate { - /// The types of customer updates that are supported. - /// - /// When empty, customers are not updateable. - pub allowed_updates: Vec, - - /// Whether the feature is enabled. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalInvoiceList { - /// Whether the feature is enabled. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalLoginPage { - /// If `true`, a shareable `url` will be generated that will take your customers to a hosted login page for the customer portal. - /// - /// If `false`, the previously generated `url`, if any, will be deactivated. - pub enabled: bool, - - /// A shareable URL to the hosted portal login page. - /// - /// Your customers will be able to log in with their [email](https://stripe.com/docs/api/customers/object#customer_object-email) and receive a link to their customer portal. - pub url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalPaymentMethodUpdate { - /// Whether the feature is enabled. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalSubscriptionCancel { - pub cancellation_reason: PortalSubscriptionCancellationReason, - - /// Whether the feature is enabled. - pub enabled: bool, - - /// Whether to cancel subscriptions immediately or at the end of the billing period. - pub mode: PortalSubscriptionCancelMode, - - /// Whether to create prorations when canceling subscriptions. - /// - /// Possible values are `none` and `create_prorations`. - pub proration_behavior: PortalSubscriptionCancelProrationBehavior, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalSubscriptionCancellationReason { - /// Whether the feature is enabled. - pub enabled: bool, - - /// Which cancellation reasons will be given as options to the customer. - pub options: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalSubscriptionPause { - /// Whether the feature is enabled. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalSubscriptionUpdate { - /// The types of subscription updates that are supported for items listed in the `products` attribute. - /// - /// When empty, subscriptions are not updateable. - pub default_allowed_updates: Vec, - - /// Whether the feature is enabled. - pub enabled: bool, - - /// The list of products that support subscription updates. - pub products: Option>, - - /// Determines how to handle prorations resulting from subscription updates. - /// - /// Valid values are `none`, `create_prorations`, and `always_invoice`. - pub proration_behavior: PortalSubscriptionUpdateProrationBehavior, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalSubscriptionUpdateProduct { - /// The list of price IDs which, when subscribed to, a subscription can be updated. - pub prices: Vec, - - /// The product ID. - pub product: String, -} - -/// An enum representing the possible values of an `PortalCustomerUpdate`'s `allowed_updates` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalCustomerUpdateAllowedUpdates { - Address, - Email, - Name, - Phone, - Shipping, - TaxId, -} - -impl PortalCustomerUpdateAllowedUpdates { - pub fn as_str(self) -> &'static str { - match self { - PortalCustomerUpdateAllowedUpdates::Address => "address", - PortalCustomerUpdateAllowedUpdates::Email => "email", - PortalCustomerUpdateAllowedUpdates::Name => "name", - PortalCustomerUpdateAllowedUpdates::Phone => "phone", - PortalCustomerUpdateAllowedUpdates::Shipping => "shipping", - PortalCustomerUpdateAllowedUpdates::TaxId => "tax_id", - } - } -} - -impl AsRef for PortalCustomerUpdateAllowedUpdates { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalCustomerUpdateAllowedUpdates { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalCustomerUpdateAllowedUpdates { - fn default() -> Self { - Self::Address - } -} - -/// An enum representing the possible values of an `PortalSubscriptionCancel`'s `mode` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalSubscriptionCancelMode { - AtPeriodEnd, - Immediately, -} - -impl PortalSubscriptionCancelMode { - pub fn as_str(self) -> &'static str { - match self { - PortalSubscriptionCancelMode::AtPeriodEnd => "at_period_end", - PortalSubscriptionCancelMode::Immediately => "immediately", - } - } -} - -impl AsRef for PortalSubscriptionCancelMode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalSubscriptionCancelMode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalSubscriptionCancelMode { - fn default() -> Self { - Self::AtPeriodEnd - } -} - -/// An enum representing the possible values of an `PortalSubscriptionCancel`'s `proration_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalSubscriptionCancelProrationBehavior { - AlwaysInvoice, - CreateProrations, - None, -} - -impl PortalSubscriptionCancelProrationBehavior { - pub fn as_str(self) -> &'static str { - match self { - PortalSubscriptionCancelProrationBehavior::AlwaysInvoice => "always_invoice", - PortalSubscriptionCancelProrationBehavior::CreateProrations => "create_prorations", - PortalSubscriptionCancelProrationBehavior::None => "none", - } - } -} - -impl AsRef for PortalSubscriptionCancelProrationBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalSubscriptionCancelProrationBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalSubscriptionCancelProrationBehavior { - fn default() -> Self { - Self::AlwaysInvoice - } -} - -/// An enum representing the possible values of an `PortalSubscriptionCancellationReason`'s `options` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalSubscriptionCancellationReasonOptions { - CustomerService, - LowQuality, - MissingFeatures, - Other, - SwitchedService, - TooComplex, - TooExpensive, - Unused, -} - -impl PortalSubscriptionCancellationReasonOptions { - pub fn as_str(self) -> &'static str { - match self { - PortalSubscriptionCancellationReasonOptions::CustomerService => "customer_service", - PortalSubscriptionCancellationReasonOptions::LowQuality => "low_quality", - PortalSubscriptionCancellationReasonOptions::MissingFeatures => "missing_features", - PortalSubscriptionCancellationReasonOptions::Other => "other", - PortalSubscriptionCancellationReasonOptions::SwitchedService => "switched_service", - PortalSubscriptionCancellationReasonOptions::TooComplex => "too_complex", - PortalSubscriptionCancellationReasonOptions::TooExpensive => "too_expensive", - PortalSubscriptionCancellationReasonOptions::Unused => "unused", - } - } -} - -impl AsRef for PortalSubscriptionCancellationReasonOptions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalSubscriptionCancellationReasonOptions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalSubscriptionCancellationReasonOptions { - fn default() -> Self { - Self::CustomerService - } -} - -/// An enum representing the possible values of an `PortalSubscriptionUpdate`'s `default_allowed_updates` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalSubscriptionUpdateDefaultAllowedUpdates { - Price, - PromotionCode, - Quantity, -} - -impl PortalSubscriptionUpdateDefaultAllowedUpdates { - pub fn as_str(self) -> &'static str { - match self { - PortalSubscriptionUpdateDefaultAllowedUpdates::Price => "price", - PortalSubscriptionUpdateDefaultAllowedUpdates::PromotionCode => "promotion_code", - PortalSubscriptionUpdateDefaultAllowedUpdates::Quantity => "quantity", - } - } -} - -impl AsRef for PortalSubscriptionUpdateDefaultAllowedUpdates { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalSubscriptionUpdateDefaultAllowedUpdates { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalSubscriptionUpdateDefaultAllowedUpdates { - fn default() -> Self { - Self::Price - } -} - -/// An enum representing the possible values of an `PortalSubscriptionUpdate`'s `proration_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalSubscriptionUpdateProrationBehavior { - AlwaysInvoice, - CreateProrations, - None, -} - -impl PortalSubscriptionUpdateProrationBehavior { - pub fn as_str(self) -> &'static str { - match self { - PortalSubscriptionUpdateProrationBehavior::AlwaysInvoice => "always_invoice", - PortalSubscriptionUpdateProrationBehavior::CreateProrations => "create_prorations", - PortalSubscriptionUpdateProrationBehavior::None => "none", - } - } -} - -impl AsRef for PortalSubscriptionUpdateProrationBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalSubscriptionUpdateProrationBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalSubscriptionUpdateProrationBehavior { - fn default() -> Self { - Self::AlwaysInvoice - } -} diff --git a/src/resources/generated/billing_portal_session.rs b/src/resources/generated/billing_portal_session.rs deleted file mode 100644 index b02591320..000000000 --- a/src/resources/generated/billing_portal_session.rs +++ /dev/null @@ -1,729 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{BillingPortalSessionId, CustomerId}; -use crate::params::{Expand, Expandable, Object, Timestamp}; -use crate::resources::BillingPortalConfiguration; - -/// The resource representing a Stripe "PortalSession". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BillingPortalSession { - /// Unique identifier for the object. - pub id: BillingPortalSessionId, - - /// The configuration used by this session, describing the features available. - pub configuration: Expandable, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The ID of the customer for this session. - pub customer: String, - - /// Information about a specific flow for the customer to go through. - /// - /// See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. - pub flow: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The IETF language tag of the locale Customer Portal is displayed in. - /// - /// If blank or auto, the customer’s `preferred_locales` or browser’s locale is used. - pub locale: Option, - - /// The account for which the session was created on behalf of. - /// - /// When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. - /// For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). - /// Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. - pub on_behalf_of: Option, - - /// The URL to redirect customers to when they click on the portal's link to return to your website. - pub return_url: Option, - - /// The short-lived URL of the session that gives customers access to the customer portal. - pub url: String, -} - -impl BillingPortalSession { - /// Creates a session of the customer portal. - pub fn create( - client: &Client, - params: CreateBillingPortalSession<'_>, - ) -> Response { - client.post_form("/billing_portal/sessions", ¶ms) - } -} - -impl Object for BillingPortalSession { - type Id = BillingPortalSessionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "billing_portal.session" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsFlow { - pub after_completion: PortalFlowsFlowAfterCompletion, - - /// Configuration when `flow.type=subscription_cancel`. - pub subscription_cancel: Option, - - /// Configuration when `flow.type=subscription_update`. - pub subscription_update: Option, - - /// Configuration when `flow.type=subscription_update_confirm`. - pub subscription_update_confirm: Option, - - /// Type of flow that the customer will go through. - #[serde(rename = "type")] - pub type_: PortalFlowsFlowType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsFlowAfterCompletion { - /// Configuration when `after_completion.type=hosted_confirmation`. - pub hosted_confirmation: Option, - - /// Configuration when `after_completion.type=redirect`. - pub redirect: Option, - - /// The specified type of behavior after the flow is completed. - #[serde(rename = "type")] - pub type_: PortalFlowsFlowAfterCompletionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsAfterCompletionHostedConfirmation { - /// A custom message to display to the customer after the flow is completed. - pub custom_message: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsAfterCompletionRedirect { - /// The URL the customer will be redirected to after the flow is completed. - pub return_url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsFlowSubscriptionCancel { - /// Specify a retention strategy to be used in the cancellation flow. - pub retention: Option, - - /// The ID of the subscription to be canceled. - pub subscription: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsFlowSubscriptionUpdate { - /// The ID of the subscription to be updated. - pub subscription: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsFlowSubscriptionUpdateConfirm { - /// The coupon or promotion code to apply to this subscription update. - /// - /// Currently, only up to one may be specified. - pub discounts: Option>, - - /// The [subscription item](https://stripe.com/docs/api/subscription_items) to be updated through this flow. - /// - /// Currently, only up to one may be specified and subscriptions with multiple items are not updatable. - pub items: Vec, - - /// The ID of the subscription to be updated. - pub subscription: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsRetention { - /// Configuration when `retention.type=coupon_offer`. - pub coupon_offer: Option, - - /// Type of retention strategy that will be used. - #[serde(rename = "type")] - pub type_: PortalFlowsRetentionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsCouponOffer { - /// The ID of the coupon to be offered. - pub coupon: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsSubscriptionUpdateConfirmDiscount { - /// The ID of the coupon to apply to this subscription update. - pub coupon: Option, - - /// The ID of a promotion code to apply to this subscription update. - pub promotion_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsSubscriptionUpdateConfirmItem { - /// The ID of the [subscription item](https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-id) to be updated. - pub id: Option, - - /// The price the customer should subscribe to through this flow. - /// - /// The price must also be included in the configuration's [`features.subscription_update.products`](docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products). - pub price: Option, - - /// [Quantity](https://stripe.com/docs/subscriptions/quantities) for this item that the customer should subscribe to through this flow. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, -} - -/// The parameters for `BillingPortalSession::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateBillingPortalSession<'a> { - /// The ID of an existing [configuration](https://stripe.com/docs/api/customer_portal/configuration) to use for this session, describing its functionality and features. - /// - /// If not specified, the session uses the default configuration. - #[serde(skip_serializing_if = "Option::is_none")] - pub configuration: Option<&'a str>, - - /// The ID of an existing customer. - pub customer: CustomerId, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Information about a specific flow for the customer to go through. - /// - /// See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. - #[serde(skip_serializing_if = "Option::is_none")] - pub flow_data: Option, - - /// The IETF language tag of the locale customer portal is displayed in. - /// - /// If blank or auto, the customer’s `preferred_locales` or browser’s locale is used. - #[serde(skip_serializing_if = "Option::is_none")] - pub locale: Option, - - /// The `on_behalf_of` account to use for this session. - /// - /// When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. - /// For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). - /// Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option<&'a str>, - - /// The default URL to redirect customers to when they click on the portal's link to return to your website. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option<&'a str>, -} - -impl<'a> CreateBillingPortalSession<'a> { - pub fn new(customer: CustomerId) -> Self { - CreateBillingPortalSession { - configuration: Default::default(), - customer, - expand: Default::default(), - flow_data: Default::default(), - locale: Default::default(), - on_behalf_of: Default::default(), - return_url: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowData { - /// Behavior after the flow is completed. - #[serde(skip_serializing_if = "Option::is_none")] - pub after_completion: Option, - - /// Configuration when `flow_data.type=subscription_cancel`. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_cancel: Option, - - /// Configuration when `flow_data.type=subscription_update`. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_update: Option, - - /// Configuration when `flow_data.type=subscription_update_confirm`. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_update_confirm: - Option, - - /// Type of flow that the customer will go through. - #[serde(rename = "type")] - pub type_: CreateBillingPortalSessionFlowDataType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataAfterCompletion { - /// Configuration when `after_completion.type=hosted_confirmation`. - #[serde(skip_serializing_if = "Option::is_none")] - pub hosted_confirmation: - Option, - - /// Configuration when `after_completion.type=redirect`. - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect: Option, - - /// The specified behavior after the flow is completed. - #[serde(rename = "type")] - pub type_: CreateBillingPortalSessionFlowDataAfterCompletionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataSubscriptionCancel { - /// Specify a retention strategy to be used in the cancellation flow. - #[serde(skip_serializing_if = "Option::is_none")] - pub retention: Option, - - /// The ID of the subscription to be canceled. - pub subscription: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataSubscriptionUpdate { - /// The ID of the subscription to be updated. - pub subscription: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataSubscriptionUpdateConfirm { - /// The coupon or promotion code to apply to this subscription update. - /// - /// Currently, only up to one may be specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub discounts: - Option>, - - /// The [subscription item](https://stripe.com/docs/api/subscription_items) to be updated through this flow. - /// - /// Currently, only up to one may be specified and subscriptions with multiple items are not updatable. - pub items: Vec, - - /// The ID of the subscription to be updated. - pub subscription: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataAfterCompletionHostedConfirmation { - /// A custom message to display to the customer after the flow is completed. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_message: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataAfterCompletionRedirect { - /// The URL the customer will be redirected to after the flow is completed. - pub return_url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataSubscriptionCancelRetention { - /// Configuration when `retention.type=coupon_offer`. - pub coupon_offer: CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionCouponOffer, - - /// Type of retention strategy to use with the customer. - #[serde(rename = "type")] - pub type_: CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataSubscriptionUpdateConfirmDiscounts { - /// The ID of the coupon to apply to this subscription update. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// The ID of a promotion code to apply to this subscription update. - #[serde(skip_serializing_if = "Option::is_none")] - pub promotion_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataSubscriptionUpdateConfirmItems { - /// The ID of the [subscription item](https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-id) to be updated. - pub id: String, - - /// The price the customer should subscribe to through this flow. - /// - /// The price must also be included in the configuration's [`features.subscription_update.products`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products). - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// [Quantity](https://stripe.com/docs/subscriptions/quantities) for this item that the customer should subscribe to through this flow. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionCouponOffer { - /// The ID of the coupon to be offered. - pub coupon: String, -} - -/// An enum representing the possible values of an `BillingPortalSession`'s `locale` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BillingPortalSessionLocale { - Auto, - Bg, - Cs, - Da, - De, - El, - En, - #[serde(rename = "en-AU")] - EnAu, - #[serde(rename = "en-CA")] - EnCa, - #[serde(rename = "en-GB")] - EnGb, - #[serde(rename = "en-IE")] - EnIe, - #[serde(rename = "en-IN")] - EnIn, - #[serde(rename = "en-NZ")] - EnNz, - #[serde(rename = "en-SG")] - EnSg, - Es, - #[serde(rename = "es-419")] - Es419, - Et, - Fi, - Fil, - Fr, - #[serde(rename = "fr-CA")] - FrCa, - Hr, - Hu, - Id, - It, - Ja, - Ko, - Lt, - Lv, - Ms, - Mt, - Nb, - Nl, - Pl, - Pt, - #[serde(rename = "pt-BR")] - PtBr, - Ro, - Ru, - Sk, - Sl, - Sv, - Th, - Tr, - Vi, - Zh, - #[serde(rename = "zh-HK")] - ZhHk, - #[serde(rename = "zh-TW")] - ZhTw, -} - -impl BillingPortalSessionLocale { - pub fn as_str(self) -> &'static str { - match self { - BillingPortalSessionLocale::Auto => "auto", - BillingPortalSessionLocale::Bg => "bg", - BillingPortalSessionLocale::Cs => "cs", - BillingPortalSessionLocale::Da => "da", - BillingPortalSessionLocale::De => "de", - BillingPortalSessionLocale::El => "el", - BillingPortalSessionLocale::En => "en", - BillingPortalSessionLocale::EnAu => "en-AU", - BillingPortalSessionLocale::EnCa => "en-CA", - BillingPortalSessionLocale::EnGb => "en-GB", - BillingPortalSessionLocale::EnIe => "en-IE", - BillingPortalSessionLocale::EnIn => "en-IN", - BillingPortalSessionLocale::EnNz => "en-NZ", - BillingPortalSessionLocale::EnSg => "en-SG", - BillingPortalSessionLocale::Es => "es", - BillingPortalSessionLocale::Es419 => "es-419", - BillingPortalSessionLocale::Et => "et", - BillingPortalSessionLocale::Fi => "fi", - BillingPortalSessionLocale::Fil => "fil", - BillingPortalSessionLocale::Fr => "fr", - BillingPortalSessionLocale::FrCa => "fr-CA", - BillingPortalSessionLocale::Hr => "hr", - BillingPortalSessionLocale::Hu => "hu", - BillingPortalSessionLocale::Id => "id", - BillingPortalSessionLocale::It => "it", - BillingPortalSessionLocale::Ja => "ja", - BillingPortalSessionLocale::Ko => "ko", - BillingPortalSessionLocale::Lt => "lt", - BillingPortalSessionLocale::Lv => "lv", - BillingPortalSessionLocale::Ms => "ms", - BillingPortalSessionLocale::Mt => "mt", - BillingPortalSessionLocale::Nb => "nb", - BillingPortalSessionLocale::Nl => "nl", - BillingPortalSessionLocale::Pl => "pl", - BillingPortalSessionLocale::Pt => "pt", - BillingPortalSessionLocale::PtBr => "pt-BR", - BillingPortalSessionLocale::Ro => "ro", - BillingPortalSessionLocale::Ru => "ru", - BillingPortalSessionLocale::Sk => "sk", - BillingPortalSessionLocale::Sl => "sl", - BillingPortalSessionLocale::Sv => "sv", - BillingPortalSessionLocale::Th => "th", - BillingPortalSessionLocale::Tr => "tr", - BillingPortalSessionLocale::Vi => "vi", - BillingPortalSessionLocale::Zh => "zh", - BillingPortalSessionLocale::ZhHk => "zh-HK", - BillingPortalSessionLocale::ZhTw => "zh-TW", - } - } -} - -impl AsRef for BillingPortalSessionLocale { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BillingPortalSessionLocale { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for BillingPortalSessionLocale { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CreateBillingPortalSessionFlowDataAfterCompletion`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateBillingPortalSessionFlowDataAfterCompletionType { - HostedConfirmation, - PortalHomepage, - Redirect, -} - -impl CreateBillingPortalSessionFlowDataAfterCompletionType { - pub fn as_str(self) -> &'static str { - match self { - CreateBillingPortalSessionFlowDataAfterCompletionType::HostedConfirmation => { - "hosted_confirmation" - } - CreateBillingPortalSessionFlowDataAfterCompletionType::PortalHomepage => { - "portal_homepage" - } - CreateBillingPortalSessionFlowDataAfterCompletionType::Redirect => "redirect", - } - } -} - -impl AsRef for CreateBillingPortalSessionFlowDataAfterCompletionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateBillingPortalSessionFlowDataAfterCompletionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateBillingPortalSessionFlowDataAfterCompletionType { - fn default() -> Self { - Self::HostedConfirmation - } -} - -/// An enum representing the possible values of an `CreateBillingPortalSessionFlowDataSubscriptionCancelRetention`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType { - CouponOffer, -} - -impl CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType { - pub fn as_str(self) -> &'static str { - match self { - CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType::CouponOffer => { - "coupon_offer" - } - } - } -} - -impl AsRef for CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType { - fn default() -> Self { - Self::CouponOffer - } -} - -/// An enum representing the possible values of an `CreateBillingPortalSessionFlowData`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateBillingPortalSessionFlowDataType { - PaymentMethodUpdate, - SubscriptionCancel, - SubscriptionUpdate, - SubscriptionUpdateConfirm, -} - -impl CreateBillingPortalSessionFlowDataType { - pub fn as_str(self) -> &'static str { - match self { - CreateBillingPortalSessionFlowDataType::PaymentMethodUpdate => "payment_method_update", - CreateBillingPortalSessionFlowDataType::SubscriptionCancel => "subscription_cancel", - CreateBillingPortalSessionFlowDataType::SubscriptionUpdate => "subscription_update", - CreateBillingPortalSessionFlowDataType::SubscriptionUpdateConfirm => { - "subscription_update_confirm" - } - } - } -} - -impl AsRef for CreateBillingPortalSessionFlowDataType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateBillingPortalSessionFlowDataType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateBillingPortalSessionFlowDataType { - fn default() -> Self { - Self::PaymentMethodUpdate - } -} - -/// An enum representing the possible values of an `PortalFlowsFlowAfterCompletion`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalFlowsFlowAfterCompletionType { - HostedConfirmation, - PortalHomepage, - Redirect, -} - -impl PortalFlowsFlowAfterCompletionType { - pub fn as_str(self) -> &'static str { - match self { - PortalFlowsFlowAfterCompletionType::HostedConfirmation => "hosted_confirmation", - PortalFlowsFlowAfterCompletionType::PortalHomepage => "portal_homepage", - PortalFlowsFlowAfterCompletionType::Redirect => "redirect", - } - } -} - -impl AsRef for PortalFlowsFlowAfterCompletionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalFlowsFlowAfterCompletionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalFlowsFlowAfterCompletionType { - fn default() -> Self { - Self::HostedConfirmation - } -} - -/// An enum representing the possible values of an `PortalFlowsFlow`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalFlowsFlowType { - PaymentMethodUpdate, - SubscriptionCancel, - SubscriptionUpdate, - SubscriptionUpdateConfirm, -} - -impl PortalFlowsFlowType { - pub fn as_str(self) -> &'static str { - match self { - PortalFlowsFlowType::PaymentMethodUpdate => "payment_method_update", - PortalFlowsFlowType::SubscriptionCancel => "subscription_cancel", - PortalFlowsFlowType::SubscriptionUpdate => "subscription_update", - PortalFlowsFlowType::SubscriptionUpdateConfirm => "subscription_update_confirm", - } - } -} - -impl AsRef for PortalFlowsFlowType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalFlowsFlowType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalFlowsFlowType { - fn default() -> Self { - Self::PaymentMethodUpdate - } -} - -/// An enum representing the possible values of an `PortalFlowsRetention`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalFlowsRetentionType { - CouponOffer, -} - -impl PortalFlowsRetentionType { - pub fn as_str(self) -> &'static str { - match self { - PortalFlowsRetentionType::CouponOffer => "coupon_offer", - } - } -} - -impl AsRef for PortalFlowsRetentionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalFlowsRetentionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalFlowsRetentionType { - fn default() -> Self { - Self::CouponOffer - } -} diff --git a/src/resources/generated/capability.rs b/src/resources/generated/capability.rs deleted file mode 100644 index 3041ebbd1..000000000 --- a/src/resources/generated/capability.rs +++ /dev/null @@ -1,331 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{CapabilityId}; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::{Account}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "AccountCapability". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Capability { - /// The identifier for the capability. - pub id: CapabilityId, - - /// The account for which the capability enables functionality. - pub account: Expandable, - - #[serde(skip_serializing_if = "Option::is_none")] - pub future_requirements: Option, - - /// Whether the capability has been requested. - pub requested: bool, - - /// Time at which the capability was requested. - /// - /// Measured in seconds since the Unix epoch. - pub requested_at: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub requirements: Option, - - /// The status of the capability. - /// - /// Can be `active`, `inactive`, `pending`, or `unrequested`. - pub status: CapabilityStatus, -} - -impl Object for Capability { - type Id = CapabilityId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "capability" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountCapabilityFutureRequirements { - - /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. - pub alternatives: Option>, - - /// Date on which `future_requirements` merges with the main `requirements` hash and `future_requirements` becomes empty. - /// - /// After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on the capability's enablement state prior to transitioning. - pub current_deadline: Option, - - /// Fields that need to be collected to keep the capability enabled. - /// - /// If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. - pub currently_due: Vec, - - /// This is typed as a string for consistency with `requirements.disabled_reason`, but it safe to assume `future_requirements.disabled_reason` is empty because fields in `future_requirements` will never disable the account. - pub disabled_reason: Option, - - /// Fields that are `currently_due` and need to be collected again because validation or verification failed. - pub errors: Vec, - - /// Fields that need to be collected assuming all volume thresholds are reached. - /// - /// As they become required, they appear in `currently_due` as well. - pub eventually_due: Vec, - - /// Fields that weren't collected by `requirements.current_deadline`. - /// - /// These fields need to be collected to enable the capability on the account. - /// New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. - pub past_due: Vec, - - /// Fields that may become required depending on the results of verification or review. - /// - /// Will be an empty array unless an asynchronous verification is pending. - /// If verification fails, these fields move to `eventually_due` or `currently_due`. - pub pending_verification: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountCapabilityRequirements { - - /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. - pub alternatives: Option>, - - /// Date by which the fields in `currently_due` must be collected to keep the capability enabled for the account. - /// - /// These fields may disable the capability sooner if the next threshold is reached before they are collected. - pub current_deadline: Option, - - /// Fields that need to be collected to keep the capability enabled. - /// - /// If not collected by `current_deadline`, these fields appear in `past_due` as well, and the capability is disabled. - pub currently_due: Vec, - - /// If the capability is disabled, this string describes why. - /// - /// Can be `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.listed`, `rejected.terms_of_service`, `rejected.other`, `under_review`, or `other`. `rejected.unsupported_business` means that the account's business is not supported by the capability. - /// For example, payment methods may restrict the businesses they support in their terms of service: - [Afterpay Clearpay's terms of service](/afterpay-clearpay/legal#restricted-businesses) If you believe that the rejection is in error, please contact support at for assistance. - pub disabled_reason: Option, - - /// Fields that are `currently_due` and need to be collected again because validation or verification failed. - pub errors: Vec, - - /// Fields that need to be collected assuming all volume thresholds are reached. - /// - /// As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. - pub eventually_due: Vec, - - /// Fields that weren't collected by `current_deadline`. - /// - /// These fields need to be collected to enable the capability on the account. - pub past_due: Vec, - - /// Fields that may become required depending on the results of verification or review. - /// - /// Will be an empty array unless an asynchronous verification is pending. - /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. - pub pending_verification: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountRequirementsAlternative { - - /// Fields that can be provided to satisfy all fields in `original_fields_due`. - pub alternative_fields_due: Vec, - - /// Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. - pub original_fields_due: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountRequirementsError { - - /// The code for the type of error. - pub code: AccountRequirementsErrorCode, - - /// An informative message that indicates the error type and provides additional details about the error. - pub reason: String, - - /// The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. - pub requirement: String, -} - -/// An enum representing the possible values of an `AccountRequirementsError`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountRequirementsErrorCode { - InvalidAddressCityStatePostalCode, - #[serde(rename = "invalid_dob_age_under_18")] - InvalidDobAgeUnder18, - InvalidRepresentativeCountry, - InvalidStreetAddress, - InvalidTosAcceptance, - InvalidValueOther, - VerificationDirectorsMismatch, - VerificationDocumentAddressMismatch, - VerificationDocumentAddressMissing, - VerificationDocumentCorrupt, - VerificationDocumentCountryNotSupported, - VerificationDocumentDirectorsMismatch, - VerificationDocumentDobMismatch, - VerificationDocumentDuplicateType, - VerificationDocumentExpired, - VerificationDocumentFailedCopy, - VerificationDocumentFailedGreyscale, - VerificationDocumentFailedOther, - VerificationDocumentFailedTestMode, - VerificationDocumentFraudulent, - VerificationDocumentIdNumberMismatch, - VerificationDocumentIdNumberMissing, - VerificationDocumentIncomplete, - VerificationDocumentInvalid, - VerificationDocumentIssueOrExpiryDateMissing, - VerificationDocumentManipulated, - VerificationDocumentMissingBack, - VerificationDocumentMissingFront, - VerificationDocumentNameMismatch, - VerificationDocumentNameMissing, - VerificationDocumentNationalityMismatch, - VerificationDocumentNotReadable, - VerificationDocumentNotSigned, - VerificationDocumentNotUploaded, - VerificationDocumentPhotoMismatch, - VerificationDocumentTooLarge, - VerificationDocumentTypeNotSupported, - VerificationExtraneousDirectors, - VerificationFailedAddressMatch, - VerificationFailedBusinessIecNumber, - VerificationFailedDocumentMatch, - VerificationFailedIdNumberMatch, - VerificationFailedKeyedIdentity, - VerificationFailedKeyedMatch, - VerificationFailedNameMatch, - VerificationFailedOther, - VerificationFailedResidentialAddress, - VerificationFailedTaxIdMatch, - VerificationFailedTaxIdNotIssued, - VerificationMissingDirectors, - VerificationMissingExecutives, - VerificationMissingOwners, - VerificationRequiresAdditionalMemorandumOfAssociations, -} - -impl AccountRequirementsErrorCode { - pub fn as_str(self) -> &'static str { - match self { - AccountRequirementsErrorCode::InvalidAddressCityStatePostalCode => "invalid_address_city_state_postal_code", - AccountRequirementsErrorCode::InvalidDobAgeUnder18 => "invalid_dob_age_under_18", - AccountRequirementsErrorCode::InvalidRepresentativeCountry => "invalid_representative_country", - 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", - AccountRequirementsErrorCode::VerificationDocumentFailedCopy => "verification_document_failed_copy", - AccountRequirementsErrorCode::VerificationDocumentFailedGreyscale => "verification_document_failed_greyscale", - AccountRequirementsErrorCode::VerificationDocumentFailedOther => "verification_document_failed_other", - AccountRequirementsErrorCode::VerificationDocumentFailedTestMode => "verification_document_failed_test_mode", - AccountRequirementsErrorCode::VerificationDocumentFraudulent => "verification_document_fraudulent", - AccountRequirementsErrorCode::VerificationDocumentIdNumberMismatch => "verification_document_id_number_mismatch", - AccountRequirementsErrorCode::VerificationDocumentIdNumberMissing => "verification_document_id_number_missing", - AccountRequirementsErrorCode::VerificationDocumentIncomplete => "verification_document_incomplete", - AccountRequirementsErrorCode::VerificationDocumentInvalid => "verification_document_invalid", - AccountRequirementsErrorCode::VerificationDocumentIssueOrExpiryDateMissing => "verification_document_issue_or_expiry_date_missing", - AccountRequirementsErrorCode::VerificationDocumentManipulated => "verification_document_manipulated", - AccountRequirementsErrorCode::VerificationDocumentMissingBack => "verification_document_missing_back", - AccountRequirementsErrorCode::VerificationDocumentMissingFront => "verification_document_missing_front", - AccountRequirementsErrorCode::VerificationDocumentNameMismatch => "verification_document_name_mismatch", - AccountRequirementsErrorCode::VerificationDocumentNameMissing => "verification_document_name_missing", - AccountRequirementsErrorCode::VerificationDocumentNationalityMismatch => "verification_document_nationality_mismatch", - AccountRequirementsErrorCode::VerificationDocumentNotReadable => "verification_document_not_readable", - AccountRequirementsErrorCode::VerificationDocumentNotSigned => "verification_document_not_signed", - AccountRequirementsErrorCode::VerificationDocumentNotUploaded => "verification_document_not_uploaded", - 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", - AccountRequirementsErrorCode::VerificationFailedIdNumberMatch => "verification_failed_id_number_match", - AccountRequirementsErrorCode::VerificationFailedKeyedIdentity => "verification_failed_keyed_identity", - AccountRequirementsErrorCode::VerificationFailedKeyedMatch => "verification_failed_keyed_match", - AccountRequirementsErrorCode::VerificationFailedNameMatch => "verification_failed_name_match", - AccountRequirementsErrorCode::VerificationFailedOther => "verification_failed_other", - 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", - } - } -} - -impl AsRef for AccountRequirementsErrorCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountRequirementsErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountRequirementsErrorCode { - fn default() -> Self { - Self::InvalidAddressCityStatePostalCode - } -} - -/// An enum representing the possible values of an `Capability`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CapabilityStatus { - Active, - Disabled, - Inactive, - Pending, - Unrequested, -} - -impl CapabilityStatus { - pub fn as_str(self) -> &'static str { - match self { - CapabilityStatus::Active => "active", - CapabilityStatus::Disabled => "disabled", - CapabilityStatus::Inactive => "inactive", - CapabilityStatus::Pending => "pending", - CapabilityStatus::Unrequested => "unrequested", - } - } -} - -impl AsRef for CapabilityStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CapabilityStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CapabilityStatus { - fn default() -> Self { - Self::Active - } -} diff --git a/src/resources/generated/card.rs b/src/resources/generated/card.rs deleted file mode 100644 index f698fe52d..000000000 --- a/src/resources/generated/card.rs +++ /dev/null @@ -1,216 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::CardId; -use crate::params::{Expandable, Metadata, Object}; -use crate::resources::{Account, Currency, Customer}; - -/// The resource representing a Stripe "Card". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Card { - /// Unique identifier for the object. - pub id: CardId, - - /// The account this card belongs to. - /// - /// This attribute will not be in the card object if the card belongs to a customer or recipient instead. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option>, - - /// City/District/Suburb/Town/Village. - #[serde(skip_serializing_if = "Option::is_none")] - pub address_city: Option, - - /// Billing address country, if provided when creating card. - #[serde(skip_serializing_if = "Option::is_none")] - pub address_country: Option, - - /// Address line 1 (Street address/PO Box/Company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_line1: Option, - - /// If `address_line1` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. - #[serde(skip_serializing_if = "Option::is_none")] - pub address_line1_check: Option, - - /// Address line 2 (Apartment/Suite/Unit/Building). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_line2: Option, - - /// State/County/Province/Region. - #[serde(skip_serializing_if = "Option::is_none")] - pub address_state: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub address_zip: Option, - - /// If `address_zip` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. - #[serde(skip_serializing_if = "Option::is_none")] - pub address_zip_check: Option, - - /// A set of available payout methods for this card. - /// - /// Only values from this set should be passed as the `method` when creating a payout. - #[serde(skip_serializing_if = "Option::is_none")] - pub available_payout_methods: Option>, - - /// Card brand. - /// - /// Can be `American Express`, `Diners Club`, `Discover`, `Eftpos Australia`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. - #[serde(skip_serializing_if = "Option::is_none")] - pub brand: Option, - - /// Two-letter ISO code representing the country of the card. - /// - /// You could use this attribute to get a sense of the international breakdown of cards you've collected. - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Three-letter [ISO code for currency](https://stripe.com/docs/payouts). - /// - /// Only applicable on accounts (not customers or recipients). - /// The card can be used as a transfer destination for funds in this currency. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// The customer that this card belongs to. - /// - /// This attribute will not be in the card object if the card belongs to an account or recipient instead. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option>, - - /// If a CVC was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. - /// - /// A result of unchecked indicates that CVC was provided but hasn't been checked yet. - /// Checks are typically performed when attaching a card to a Customer object, or when creating a charge. - /// For more details, see [Check if a card is valid without a charge](https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge). - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc_check: Option, - - /// Whether this card is the default external account for its currency. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_for_currency: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// A high-level description of the type of cards issued in this range. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// (For tokenized numbers only.) The last four digits of the device account number. - #[serde(skip_serializing_if = "Option::is_none")] - pub dynamic_last4: Option, - - /// Two-digit number representing the card's expiration month. - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_month: Option, - - /// Four-digit number representing the card's expiration year. - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_year: Option, - - /// Uniquely identifies this particular card number. - /// - /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - /// Card funding type. - /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - #[serde(skip_serializing_if = "Option::is_none")] - pub funding: Option, - - /// Issuer identification number of the card. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - /// The name of the card's issuing bank. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// The last four digits of the card. - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Cardholder name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// For external accounts, possible values are `new` and `errored`. - /// - /// If a transfer fails, the status is set to `errored` and transfers are stopped until account details are updated. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, - - /// If the card number is tokenized, this is the method that was used. - /// - /// Can be `android_pay` (includes Google Pay), `apple_pay`, `masterpass`, `visa_checkout`, or null. - #[serde(skip_serializing_if = "Option::is_none")] - pub tokenization_method: Option, -} - -impl Object for Card { - type Id = CardId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "card" - } -} - -/// An enum representing the possible values of an `Card`'s `available_payout_methods` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CardAvailablePayoutMethods { - Instant, - Standard, -} - -impl CardAvailablePayoutMethods { - pub fn as_str(self) -> &'static str { - match self { - CardAvailablePayoutMethods::Instant => "instant", - CardAvailablePayoutMethods::Standard => "standard", - } - } -} - -impl AsRef for CardAvailablePayoutMethods { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CardAvailablePayoutMethods { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CardAvailablePayoutMethods { - fn default() -> Self { - Self::Instant - } -} diff --git a/src/resources/generated/cash_balance.rs b/src/resources/generated/cash_balance.rs deleted file mode 100644 index d92f14760..000000000 --- a/src/resources/generated/cash_balance.rs +++ /dev/null @@ -1,78 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::params::Object; - -/// The resource representing a Stripe "cash_balance". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CashBalance { - /// A hash of all cash balances available to this customer. - /// - /// You cannot delete a customer with any cash balances, even if the balance is 0. - /// Amounts are represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub available: Option, - - /// The ID of the customer whose cash balance this object represents. - pub customer: String, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - pub settings: CustomerBalanceCustomerBalanceSettings, -} - -impl Object for CashBalance { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "cash_balance" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceCustomerBalanceSettings { - /// The configuration for how funds that land in the customer cash balance are reconciled. - pub reconciliation_mode: CustomerBalanceCustomerBalanceSettingsReconciliationMode, - - /// A flag to indicate if reconciliation mode returned is the user's default or is specific to this customer cash balance. - pub using_merchant_default: bool, -} - -/// An enum representing the possible values of an `CustomerBalanceCustomerBalanceSettings`'s `reconciliation_mode` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerBalanceCustomerBalanceSettingsReconciliationMode { - Automatic, - Manual, -} - -impl CustomerBalanceCustomerBalanceSettingsReconciliationMode { - pub fn as_str(self) -> &'static str { - match self { - CustomerBalanceCustomerBalanceSettingsReconciliationMode::Automatic => "automatic", - CustomerBalanceCustomerBalanceSettingsReconciliationMode::Manual => "manual", - } - } -} - -impl AsRef for CustomerBalanceCustomerBalanceSettingsReconciliationMode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerBalanceCustomerBalanceSettingsReconciliationMode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerBalanceCustomerBalanceSettingsReconciliationMode { - fn default() -> Self { - Self::Automatic - } -} diff --git a/src/resources/generated/charge.rs b/src/resources/generated/charge.rs deleted file mode 100644 index dfbb6f459..000000000 --- a/src/resources/generated/charge.rs +++ /dev/null @@ -1,2923 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ChargeId, CustomerId, PaymentIntentId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{ - Account, Address, Application, ApplicationFee, BalanceTransaction, BillingDetails, - ChargeSourceParams, Currency, Customer, Invoice, Mandate, PaymentIntent, PaymentMethod, - PaymentMethodDetailsCardChecks, PaymentMethodDetailsCardInstallmentsPlan, - PaymentMethodDetailsCardWalletApplePay, PaymentMethodDetailsCardWalletGooglePay, PaymentSource, - RadarRadarOptions, Refund, Review, Shipping, Transfer, -}; - -/// The resource representing a Stripe "Charge". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Charge { - /// Unique identifier for the object. - pub id: ChargeId, - - /// Amount intended to be collected by this payment. - /// - /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - pub amount: i64, - - /// Amount in cents (or local equivalent) captured (can be less than the amount attribute on the charge if a partial capture was made). - pub amount_captured: i64, - - /// Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the charge if a partial refund was issued). - pub amount_refunded: i64, - - /// ID of the Connect application that created the charge. - pub application: Option>, - - /// The application fee (if any) for the charge. - /// - /// [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees) for details. - pub application_fee: Option>, - - /// The amount of the application fee (if any) requested for the charge. - /// - /// [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees) for details. - pub application_fee_amount: Option, - - /// Authorization code on the charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub authorization_code: Option, - - /// ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). - pub balance_transaction: Option>, - - pub billing_details: BillingDetails, - - /// The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. - /// - /// Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. - pub calculated_statement_descriptor: Option, - - /// If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured. - pub captured: bool, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// ID of the customer this charge is for if one exists. - pub customer: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// Whether the charge has been disputed. - pub disputed: bool, - - /// ID of the balance transaction that describes the reversal of the balance on your account due to payment failure. - pub failure_balance_transaction: Option>, - - /// Error code explaining reason for charge failure if available (see [the errors section](https://stripe.com/docs/error-codes) for a list of codes). - pub failure_code: Option, - - /// Message to user further explaining reason for charge failure if available. - pub failure_message: Option, - - /// Information on fraud assessments for the charge. - pub fraud_details: Option, - - /// ID of the invoice this charge is for if one exists. - pub invoice: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub level3: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// The account (if any) the charge was made on behalf of without triggering an automatic transfer. - /// - /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. - pub on_behalf_of: Option>, - - /// Details about whether the payment was accepted, and why. - /// - /// See [understanding declines](https://stripe.com/docs/declines) for details. - pub outcome: Option, - - /// `true` if the charge succeeded, or was successfully authorized for later capture. - pub paid: bool, - - /// ID of the PaymentIntent associated with this charge, if one exists. - pub payment_intent: Option>, - - /// ID of the payment method used in this charge. - pub payment_method: Option, - - /// Details about the payment method at the time of the transaction. - pub payment_method_details: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - /// This is the email address that the receipt for this charge was sent to. - pub receipt_email: Option, - - /// This is the transaction number that appears on email receipts sent for this charge. - /// - /// This attribute will be `null` until a receipt has been sent. - pub receipt_number: Option, - - /// This is the URL to view the receipt for this charge. - /// - /// The receipt is kept up-to-date to the latest state of the charge, including any refunds. - /// If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt. - pub receipt_url: Option, - - /// Whether the charge has been fully refunded. - /// - /// If the charge is only partially refunded, this attribute will still be false. - pub refunded: bool, - - /// A list of refunds that have been applied to the charge. - pub refunds: List, - - /// ID of the review associated with this charge if one exists. - pub review: Option>, - - /// Shipping information for the charge. - pub shipping: Option, - - /// This is a legacy field that will be removed in the future. - /// - /// It contains the Source, Card, or BankAccount object used for the charge. - /// For details about the payment method used for this charge, refer to `payment_method` or `payment_method_details` instead. - pub source: Option, - - /// The transfer ID which created this charge. - /// - /// Only present if the charge came from another Stripe account. - /// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. - pub source_transfer: Option>, - - /// For card charges, use `statement_descriptor_suffix` instead. - /// - /// Otherwise, you can use this value as the complete description of a charge on your customers’ statements. - /// Must contain at least one letter, maximum 22 characters. - pub statement_descriptor: Option, - - /// Provides information about the charge that customers see on their statements. - /// - /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters for the concatenated descriptor. - pub statement_descriptor_suffix: Option, - - /// The status of the payment is either `succeeded`, `pending`, or `failed`. - pub status: ChargeStatus, - - /// ID of the transfer to the `destination` account (only applicable if the charge was created using the `destination` parameter). - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer: Option>, - - /// An optional dictionary including the account to automatically transfer to as part of a destination charge. - /// - /// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. - pub transfer_data: Option, - - /// A string that identifies this transaction as part of a group. - /// - /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. - pub transfer_group: Option, -} - -impl Charge { - /// Returns a list of charges you’ve previously created. - /// - /// The charges are returned in sorted order, with the most recent charges appearing first. - pub fn list(client: &Client, params: &ListCharges<'_>) -> Response> { - client.get_query("/charges", ¶ms) - } - - /// Use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) to initiate a new payment instead - /// of using this method. - /// - /// Confirmation of the PaymentIntent creates the `Charge` object used to request payment, so this method is limited to legacy integrations. - pub fn create(client: &Client, params: CreateCharge<'_>) -> Response { - client.post_form("/charges", ¶ms) - } - - /// Retrieves the details of a charge that has previously been created. - /// - /// Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. - /// The same information is returned when creating or refunding the charge. - pub fn retrieve(client: &Client, id: &ChargeId, expand: &[&str]) -> Response { - client.get_query(&format!("/charges/{}", id), &Expand { expand }) - } - - /// Updates the specified charge by setting the values of the parameters passed. - /// - /// Any parameters not provided will be left unchanged. - pub fn update(client: &Client, id: &ChargeId, params: UpdateCharge<'_>) -> Response { - client.post_form(&format!("/charges/{}", id), ¶ms) - } -} - -impl Object for Charge { - type Id = ChargeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "charge" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FraudDetails { - /// Assessments from Stripe. - /// - /// If set, the value is `fraudulent`. - #[serde(skip_serializing_if = "Option::is_none")] - pub stripe_report: Option, - - /// Assessments reported by you. - /// - /// If set, possible values of are `safe` and `fraudulent`. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_report: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ChargeOutcome { - /// Possible values are `approved_by_network`, `declined_by_network`, `not_sent_to_network`, and `reversed_after_approval`. - /// - /// The value `reversed_after_approval` indicates the payment was [blocked by Stripe](https://stripe.com/docs/declines#blocked-payments) after bank authorization, and may temporarily appear as "pending" on a cardholder's statement. - pub network_status: Option, - - /// An enumerated value providing a more detailed explanation of the outcome's `type`. - /// - /// Charges blocked by Radar's default block rule have the value `highest_risk_level`. - /// Charges placed in review by Radar's default review rule have the value `elevated_risk_level`. - /// Charges authorized, blocked, or placed in review by custom rules have the value `rule`. - /// See [understanding declines](https://stripe.com/docs/declines) for more details. - pub reason: Option, - - /// Stripe Radar's evaluation of the riskiness of the payment. - /// - /// Possible values for evaluated payments are `normal`, `elevated`, `highest`. - /// For non-card payments, and card-based payments predating the public assignment of risk levels, this field will have the value `not_assessed`. - /// In the event of an error in the evaluation, this field will have the value `unknown`. - /// This field is only available with Radar. - #[serde(skip_serializing_if = "Option::is_none")] - pub risk_level: Option, - - /// Stripe Radar's evaluation of the riskiness of the payment. - /// - /// Possible values for evaluated payments are between 0 and 100. - /// For non-card payments, card-based payments predating the public assignment of risk scores, or in the event of an error during evaluation, this field will not be present. - /// This field is only available with Radar for Fraud Teams. - #[serde(skip_serializing_if = "Option::is_none")] - pub risk_score: Option, - - /// The ID of the Radar rule that matched the payment, if applicable. - #[serde(skip_serializing_if = "Option::is_none")] - pub rule: Option>, - - /// A human-readable description of the outcome type and reason, designed for you (the recipient of the payment), not your customer. - pub seller_message: Option, - - /// Possible values are `authorized`, `manual_review`, `issuer_declined`, `blocked`, and `invalid`. - /// - /// See [understanding declines](https://stripe.com/docs/declines) and [Radar reviews](https://stripe.com/docs/radar/reviews) for details. - #[serde(rename = "type")] - pub type_: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransferData { - /// The amount transferred to the destination account, if specified. - /// - /// By default, the entire charge amount is transferred to the destination account. - pub amount: Option, - - /// ID of an existing, connected Stripe account to transfer funds to if `transfer_data` was specified in the charge request. - pub destination: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Level3 { - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_reference: Option, - - pub line_items: Vec, - - pub merchant_reference: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_address_zip: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_amount: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_from_zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Level3LineItems { - pub discount_amount: Option, - - pub product_code: String, - - pub product_description: String, - - pub quantity: Option, - - pub tax_amount: Option, - - pub unit_cost: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetails { - #[serde(skip_serializing_if = "Option::is_none")] - pub ach_credit_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ach_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card_present: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub multibanco: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_credit_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub stripe_account: Option, - - /// The type of transaction-specific details of the payment method used in the payment, one of `ach_credit_transfer`, `ach_debit`, `acss_debit`, `alipay`, `au_becs_debit`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `klarna`, `multibanco`, `p24`, `sepa_debit`, `sofort`, `stripe_account`, or `wechat`. - /// An additional hash is included on `payment_method_details` with a name matching this value. - /// It contains information specific to the payment method. - #[serde(rename = "type")] - pub type_: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsPrivatePaymentMethodsAlipayDetails { - /// Uniquely identifies this particular Alipay account. - /// - /// You can use this attribute to check whether two Alipay accounts are the same. - #[serde(skip_serializing_if = "Option::is_none")] - pub buyer_id: Option, - - /// Uniquely identifies this particular Alipay account. - /// - /// You can use this attribute to check whether two Alipay accounts are the same. - pub fingerprint: Option, - - /// Transaction ID of this particular Alipay transaction. - pub transaction_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsAchCreditTransfer { - /// Account number to transfer funds to. - pub account_number: Option, - - /// Name of the bank associated with the routing number. - pub bank_name: Option, - - /// Routing transit number for the bank account to transfer funds to. - pub routing_number: Option, - - /// SWIFT code of the bank associated with the routing number. - pub swift_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsAchDebit { - /// Type of entity that holds the account. - /// - /// This can be either `individual` or `company`. - pub account_holder_type: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Two-letter ISO code representing the country the bank account is located in. - pub country: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// Routing transit number of the bank account. - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsAcssDebit { - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Institution number of the bank account. - pub institution_number: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// ID of the mandate used to make this payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate: Option, - - /// Transit number of the bank account. - pub transit_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsAffirm {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsAfterpayClearpay { - /// The Afterpay order ID associated with this payment intent. - pub order_id: Option, - - /// Order identifier shown to the merchant in Afterpay’s online portal. - pub reference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsAuBecsDebit { - /// Bank-State-Branch number of the bank account. - pub bsb_number: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// ID of the mandate used to make this payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsBacsDebit { - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// ID of the mandate used to make this payment. - pub mandate: Option, - - /// Sort code of the bank account. - /// - /// (e.g., `10-20-30`). - pub sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsBancontact { - /// Bank code of bank associated with the bank account. - pub bank_code: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Bank Identifier Code of the bank associated with the bank account. - pub bic: Option, - - /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. - pub generated_sepa_debit: Option>, - - /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. - pub generated_sepa_debit_mandate: Option>, - - /// Last four characters of the IBAN. - pub iban_last4: Option, - - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - /// Can be one of `en`, `de`, `fr`, or `nl`. - pub preferred_language: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by Bancontact directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsBlik {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsBoleto { - /// The tax ID of the customer (CPF for individuals consumers or CNPJ for businesses consumers). - pub tax_id: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCard { - /// Card brand. - /// - /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub brand: Option, - - /// Check results by Card networks on Card address and CVC at time of payment. - pub checks: Option, - - /// Two-letter ISO code representing the country of the card. - /// - /// You could use this attribute to get a sense of the international breakdown of cards you've collected. - pub country: Option, - - /// A high-level description of the type of cards issued in this range. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Two-digit number representing the card's expiration month. - pub exp_month: i64, - - /// Four-digit number representing the card's expiration year. - pub exp_year: i64, - - /// Uniquely identifies this particular card number. - /// - /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - /// Card funding type. - /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - pub funding: Option, - - /// Issuer identification number of the card. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - /// Installment details for this payment (Mexico only). - /// - /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). - pub installments: Option, - - /// The name of the card's issuing bank. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// The last four digits of the card. - pub last4: Option, - - /// ID of the mandate used to make this payment or created by it. - pub mandate: Option, - - /// True if this payment was marked as MOTO and out of scope for SCA. - #[serde(skip_serializing_if = "Option::is_none")] - pub moto: Option, - - /// Identifies which network this charge was processed on. - /// - /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub network: Option, - - /// If this card has network token credentials, this contains the details of the network token credentials. - #[serde(skip_serializing_if = "Option::is_none")] - pub network_token: Option, - - /// Populated if this transaction used 3D Secure authentication. - pub three_d_secure: Option, - - /// If this Card is part of a card wallet, this contains the details of the card wallet. - pub wallet: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardInstallments { - /// Installment plan selected for the payment. - pub plan: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardNetworkToken { - /// Indicates if Stripe used a network token, either user provided or Stripe managed when processing the transaction. - pub used: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardPresent { - /// The authorized amount. - pub amount_authorized: Option, - - /// Card brand. - /// - /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub brand: Option, - - /// When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_before: Option, - - /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. - /// - /// May include alphanumeric characters, special characters and first/last name separator (`/`). - /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card. - /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. - pub cardholder_name: Option, - - /// Two-letter ISO code representing the country of the card. - /// - /// You could use this attribute to get a sense of the international breakdown of cards you've collected. - pub country: Option, - - /// A high-level description of the type of cards issued in this range. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Authorization response cryptogram. - pub emv_auth_data: Option, - - /// Two-digit number representing the card's expiration month. - pub exp_month: i64, - - /// Four-digit number representing the card's expiration year. - pub exp_year: i64, - - /// Uniquely identifies this particular card number. - /// - /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. - pub fingerprint: Option, - - /// Card funding type. - /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - pub funding: Option, - - /// ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. - /// - /// Only present if it was possible to generate a card PaymentMethod. - pub generated_card: Option, - - /// Issuer identification number of the card. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - /// Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. - /// - /// Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support). - pub incremental_authorization_supported: bool, - - /// The name of the card's issuing bank. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// The last four digits of the card. - pub last4: Option, - - /// Identifies which network this charge was processed on. - /// - /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub network: Option, - - /// Defines whether the authorized amount can be over-captured or not. - pub overcapture_supported: bool, - - /// How card details were read in this transaction. - pub read_method: Option, - - /// A collection of fields required to be displayed on receipts. - /// - /// Only required for EMV transactions. - pub receipt: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardPresentReceipt { - /// The type of account being debited or credited. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_type: Option, - - /// EMV tag 9F26, cryptogram generated by the integrated circuit chip. - pub application_cryptogram: Option, - - /// Mnenomic of the Application Identifier. - pub application_preferred_name: Option, - - /// Identifier for this transaction. - pub authorization_code: Option, - - /// EMV tag 8A. - /// - /// A code returned by the card issuer. - pub authorization_response_code: Option, - - /// How the cardholder verified ownership of the card. - pub cardholder_verification_method: Option, - - /// EMV tag 84. - /// - /// Similar to the application identifier stored on the integrated circuit chip. - pub dedicated_file_name: Option, - - /// The outcome of a series of EMV functions performed by the card reader. - pub terminal_verification_results: Option, - - /// An indication of various EMV functions performed during the transaction. - pub transaction_status_information: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWallet { - #[serde(skip_serializing_if = "Option::is_none")] - pub amex_express_checkout: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub apple_pay: Option, - - /// (For tokenized numbers only.) The last four digits of the device account number. - pub dynamic_last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub google_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub masterpass: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub samsung_pay: Option, - - /// The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. - /// - /// An additional hash is included on the Wallet subhash with a name matching this value. - /// It contains additional information specific to the card wallet type. - #[serde(rename = "type")] - pub type_: PaymentMethodDetailsCardWalletType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub visa_checkout: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWalletAmexExpressCheckout {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWalletLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWalletMasterpass { - /// Owner's verified billing address. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub billing_address: Option
, - - /// Owner's verified email. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub email: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub name: Option, - - /// Owner's verified shipping address. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub shipping_address: Option
, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWalletSamsungPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWalletVisaCheckout { - /// Owner's verified billing address. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub billing_address: Option
, - - /// Owner's verified email. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub email: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub name: Option, - - /// Owner's verified shipping address. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub shipping_address: Option
, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCashapp { - /// A unique and immutable identifier assigned by Cash App to every buyer. - pub buyer_id: Option, - - /// A public identifier for buyers using Cash App. - pub cashtag: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCustomerBalance {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsEps { - /// The customer's bank. - /// - /// Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. - pub bank: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by EPS directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. EPS rarely provides this information so the attribute is usually empty. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsFpx { - /// Account holder type, if provided. - /// - /// Can be one of `individual` or `company`. - pub account_holder_type: Option, - - /// The customer's bank. - /// - /// Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. - pub bank: PaymentMethodDetailsFpxBank, - - /// Unique transaction id generated by FPX for every request from the merchant. - pub transaction_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsGiropay { - /// Bank code of bank associated with the bank account. - pub bank_code: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Bank Identifier Code of the bank associated with the bank account. - pub bic: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by Giropay directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. Giropay rarely provides this information so the attribute is usually empty. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsGrabpay { - /// Unique transaction id generated by GrabPay. - pub transaction_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsIdeal { - /// The customer's bank. - /// - /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. - pub bank: Option, - - /// The Bank Identifier Code of the customer's bank. - pub bic: Option, - - /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. - pub generated_sepa_debit: Option>, - - /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. - pub generated_sepa_debit_mandate: Option>, - - /// Last four characters of the IBAN. - pub iban_last4: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by iDEAL directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsInteracPresent { - /// Card brand. - /// - /// Can be `interac`, `mastercard` or `visa`. - pub brand: Option, - - /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. - /// - /// May include alphanumeric characters, special characters and first/last name separator (`/`). - /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card. - /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. - pub cardholder_name: Option, - - /// Two-letter ISO code representing the country of the card. - /// - /// You could use this attribute to get a sense of the international breakdown of cards you've collected. - pub country: Option, - - /// A high-level description of the type of cards issued in this range. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Authorization response cryptogram. - pub emv_auth_data: Option, - - /// Two-digit number representing the card's expiration month. - pub exp_month: i64, - - /// Four-digit number representing the card's expiration year. - pub exp_year: i64, - - /// Uniquely identifies this particular card number. - /// - /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. - pub fingerprint: Option, - - /// Card funding type. - /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - pub funding: Option, - - /// ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. - /// - /// Only present if it was possible to generate a card PaymentMethod. - pub generated_card: Option, - - /// Issuer identification number of the card. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - /// The name of the card's issuing bank. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// The last four digits of the card. - pub last4: Option, - - /// Identifies which network this charge was processed on. - /// - /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub network: Option, - - /// EMV tag 5F2D. - /// - /// Preferred languages specified by the integrated circuit chip. - pub preferred_locales: Option>, - - /// How card details were read in this transaction. - pub read_method: Option, - - /// A collection of fields required to be displayed on receipts. - /// - /// Only required for EMV transactions. - pub receipt: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsInteracPresentReceipt { - /// The type of account being debited or credited. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_type: Option, - - /// EMV tag 9F26, cryptogram generated by the integrated circuit chip. - pub application_cryptogram: Option, - - /// Mnenomic of the Application Identifier. - pub application_preferred_name: Option, - - /// Identifier for this transaction. - pub authorization_code: Option, - - /// EMV tag 8A. - /// - /// A code returned by the card issuer. - pub authorization_response_code: Option, - - /// How the cardholder verified ownership of the card. - pub cardholder_verification_method: Option, - - /// EMV tag 84. - /// - /// Similar to the application identifier stored on the integrated circuit chip. - pub dedicated_file_name: Option, - - /// The outcome of a series of EMV functions performed by the card reader. - pub terminal_verification_results: Option, - - /// An indication of various EMV functions performed during the transaction. - pub transaction_status_information: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsKlarna { - /// The Klarna payment method used for this transaction. - /// Can be one of `pay_later`, `pay_now`, `pay_with_financing`, or `pay_in_installments`. - pub payment_method_category: Option, - - /// Preferred language of the Klarna authorization page that the customer is redirected to. - /// Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, `en-FR`, `cs-CZ`, `en-CZ`, `el-GR`, `en-GR`, `en-AU`, `en-NZ`, `en-CA`, `fr-CA`, `pl-PL`, `en-PL`, `pt-PT`, `en-PT`, `de-CH`, `fr-CH`, `it-CH`, or `en-CH`. - pub preferred_locale: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsKonbini { - /// If the payment succeeded, this contains the details of the convenience store where the payment was completed. - pub store: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsKonbiniStore { - /// The name of the convenience store chain where the payment was completed. - pub chain: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsLink { - /// Two-letter ISO code representing the funding source country beneath the Link payment. - /// You could use this attribute to get a sense of international fees. - pub country: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsMultibanco { - /// Entity number associated with this Multibanco payment. - pub entity: Option, - - /// Reference number associated with this Multibanco payment. - pub reference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsOxxo { - /// OXXO reference number. - pub number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsP24 { - /// The customer's bank. - /// - /// Can be one of `ing`, `citi_handlowy`, `tmobile_usbugi_bankowe`, `plus_bank`, `etransfer_pocztowy24`, `banki_spbdzielcze`, `bank_nowy_bfg_sa`, `getin_bank`, `blik`, `noble_pay`, `ideabank`, `envelobank`, `santander_przelew24`, `nest_przelew`, `mbank_mtransfer`, `inteligo`, `pbac_z_ipko`, `bnp_paribas`, `credit_agricole`, `toyota_bank`, `bank_pekao_sa`, `volkswagen_bank`, `bank_millennium`, `alior_bank`, or `boz`. - pub bank: Option, - - /// Unique reference for this Przelewy24 payment. - pub reference: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by Przelewy24 directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. Przelewy24 rarely provides this information so the attribute is usually empty. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsPaynow { - /// Reference number associated with this PayNow payment. - pub reference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsPaypal { - /// Owner's email. - /// - /// Values are provided by PayPal directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - #[serde(skip_serializing_if = "Option::is_none")] - pub payer_email: Option, - - /// PayPal account PayerID. - /// - /// This identifier uniquely identifies the PayPal customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub payer_id: Option, - - /// Owner's full name. - /// - /// Values provided by PayPal directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - #[serde(skip_serializing_if = "Option::is_none")] - pub payer_name: Option, - - /// The level of protection offered as defined by PayPal Seller Protection for Merchants, for this transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub seller_protection: Option, - - /// A unique ID generated by PayPal for this transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsPix { - /// Unique transaction id generated by BCB. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transaction_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsPromptpay { - /// Bill reference generated by PromptPay. - pub reference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsSepaCreditTransfer { - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Bank Identifier Code of the bank associated with the bank account. - pub bic: Option, - - /// IBAN of the bank account to transfer funds to. - pub iban: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsSepaDebit { - /// Bank code of bank associated with the bank account. - pub bank_code: Option, - - /// Branch code of bank associated with the bank account. - pub branch_code: Option, - - /// Two-letter ISO code representing the country the bank account is located in. - pub country: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four characters of the IBAN. - pub last4: Option, - - /// ID of the mandate used to make this payment. - pub mandate: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsSofort { - /// Bank code of bank associated with the bank account. - pub bank_code: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Bank Identifier Code of the bank associated with the bank account. - pub bic: Option, - - /// Two-letter ISO code representing the country the bank account is located in. - pub country: Option, - - /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. - pub generated_sepa_debit: Option>, - - /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. - pub generated_sepa_debit_mandate: Option>, - - /// Last four characters of the IBAN. - pub iban_last4: Option, - - /// Preferred language of the SOFORT authorization page that the customer is redirected to. - /// Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl`. - pub preferred_language: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by SOFORT directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsStripeAccount {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsUsBankAccount { - /// Account holder type: individual or company. - pub account_holder_type: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - pub account_type: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// Routing number of the bank account. - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsWechat {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsWechatPay { - /// Uniquely identifies this particular WeChat Pay account. - /// - /// You can use this attribute to check whether two WeChat accounts are the same. - pub fingerprint: Option, - - /// Transaction ID of this particular WeChat Pay transaction. - pub transaction_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsZip {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaypalSellerProtection { - /// An array of conditions that are covered for the transaction, if applicable. - pub dispute_categories: Option>, - - /// Indicates whether the transaction is eligible for PayPal's seller protection. - pub status: PaypalSellerProtectionStatus, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Rule { - /// The action taken on the payment. - pub action: String, - - /// Unique identifier for the object. - pub id: String, - - /// The predicate to evaluate the payment against. - pub predicate: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ThreeDSecureDetailsCharge { - /// For authenticated transactions: how the customer was authenticated by - /// the issuing bank. - pub authentication_flow: Option, - - /// Indicates the outcome of 3D Secure authentication. - pub result: Option, - - /// Additional information about why 3D Secure succeeded or failed based - /// on the `result`. - pub result_reason: Option, - - /// The version of 3D Secure that was used. - pub version: Option, -} - -/// The parameters for `Charge::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateCharge<'a> { - /// Amount intended to be collected by this payment. - /// - /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee: Option, - - /// A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. - /// - /// The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. - /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, - - /// Whether to immediately capture the charge. - /// - /// Defaults to `true`. - /// When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://stripe.com/docs/api#capture_charge) later. - /// Uncaptured charges expire after a set number of days (7 by default). - /// For more information, see the [authorizing charges and settling later](https://stripe.com/docs/charges/placing-a-hold) documentation. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// The ID of an existing customer that will be charged in this request. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// An arbitrary string which you can attach to a `Charge` object. - /// - /// It is displayed when in the web interface alongside the charge. - /// Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub destination: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The Stripe account ID for which these funds are intended. - /// - /// Automatically set if you use the `destination` parameter. - /// For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option<&'a str>, - - /// Options to configure Radar. - /// - /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - /// The email address to which this charge's [receipt](https://stripe.com/docs/dashboard/receipts) will be sent. - /// - /// The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. - /// If this charge is for a [Customer](https://stripe.com/docs/api/customers/object), the email address specified here will override the customer's email address. - /// If `receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_email: Option<&'a str>, - - /// Shipping information for the charge. - /// - /// Helps prevent fraud on charges for physical goods. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - - /// A payment source to be charged. - /// - /// This can be the ID of a [card](https://stripe.com/docs/api#cards) (i.e., credit or debit card), a [bank account](https://stripe.com/docs/api#bank_accounts), a [source](https://stripe.com/docs/api#sources), a [token](https://stripe.com/docs/api#tokens), or a [connected account](https://stripe.com/docs/connect/account-debits#charging-a-connected-account). - /// For certain sources---namely, [cards](https://stripe.com/docs/api#cards), [bank accounts](https://stripe.com/docs/api#bank_accounts), and attached [sources](https://stripe.com/docs/api#sources)---you must also pass the ID of the associated customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub source: Option, - - /// For card charges, use `statement_descriptor_suffix` instead. - /// - /// Otherwise, you can use this value as the complete description of a charge on your customers’ statements. - /// Must contain at least one letter, maximum 22 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option<&'a str>, - - /// Provides information about the charge that customers see on their statements. - /// - /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters for the concatenated descriptor. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix: Option<&'a str>, - - /// An optional dictionary including the account to automatically transfer to as part of a destination charge. - /// - /// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// A string that identifies this transaction as part of a group. - /// - /// For details, see [Grouping transactions](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options). - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option<&'a str>, -} - -impl<'a> CreateCharge<'a> { - pub fn new() -> Self { - CreateCharge { - amount: Default::default(), - application_fee: Default::default(), - application_fee_amount: Default::default(), - capture: Default::default(), - currency: Default::default(), - customer: Default::default(), - description: Default::default(), - destination: Default::default(), - expand: Default::default(), - metadata: Default::default(), - on_behalf_of: Default::default(), - radar_options: Default::default(), - receipt_email: Default::default(), - shipping: Default::default(), - source: Default::default(), - statement_descriptor: Default::default(), - statement_descriptor_suffix: Default::default(), - transfer_data: Default::default(), - transfer_group: Default::default(), - } - } -} - -/// The parameters for `Charge::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListCharges<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return charges for the customer specified by this customer ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// Only return charges for this transfer group. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option<&'a str>, -} - -impl<'a> ListCharges<'a> { - pub fn new() -> Self { - ListCharges { - created: Default::default(), - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - payment_intent: Default::default(), - starting_after: Default::default(), - transfer_group: Default::default(), - } - } -} -impl Paginable for ListCharges<'_> { - type O = Charge; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Charge::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateCharge<'a> { - /// The ID of an existing customer that will be associated with this request. - /// - /// This field may only be updated if there is no existing associated customer with this charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// An arbitrary string which you can attach to a charge object. - /// - /// It is displayed when in the web interface alongside the charge. - /// Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A set of key-value pairs you can attach to a charge giving information about its riskiness. - /// - /// If you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`. - /// If you believe a charge is safe, include a `user_report` key with a value of `safe`. - /// Stripe will use the information you send to improve our fraud detection algorithms. - #[serde(skip_serializing_if = "Option::is_none")] - pub fraud_details: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// This is the email address that the receipt for this charge will be sent to. - /// - /// If this field is updated, then a new email receipt will be sent to the updated address. - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_email: Option<&'a str>, - - /// Shipping information for the charge. - /// - /// Helps prevent fraud on charges for physical goods. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - - /// A string that identifies this transaction as part of a group. - /// - /// `transfer_group` may only be provided if it has not been set. - /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option<&'a str>, -} - -impl<'a> UpdateCharge<'a> { - pub fn new() -> Self { - UpdateCharge { - customer: Default::default(), - description: Default::default(), - expand: Default::default(), - fraud_details: Default::default(), - metadata: Default::default(), - receipt_email: Default::default(), - shipping: Default::default(), - transfer_group: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateChargeRadarOptions { - /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub session: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FraudDetailsParams { - /// Either `safe` or `fraudulent`. - pub user_report: FraudDetailsParamsUserReport, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransferDataParams { - /// The amount transferred to the destination account, if specified. - /// - /// By default, the entire charge amount is transferred to the destination account. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// ID of an existing, connected Stripe account. - pub destination: String, -} - -/// An enum representing the possible values of an `Charge`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ChargeStatus { - Failed, - Pending, - Succeeded, -} - -impl ChargeStatus { - pub fn as_str(self) -> &'static str { - match self { - ChargeStatus::Failed => "failed", - ChargeStatus::Pending => "pending", - ChargeStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for ChargeStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ChargeStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ChargeStatus { - fn default() -> Self { - Self::Failed - } -} - -/// An enum representing the possible values of an `FraudDetailsParams`'s `user_report` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FraudDetailsParamsUserReport { - Fraudulent, - Safe, -} - -impl FraudDetailsParamsUserReport { - pub fn as_str(self) -> &'static str { - match self { - FraudDetailsParamsUserReport::Fraudulent => "fraudulent", - FraudDetailsParamsUserReport::Safe => "safe", - } - } -} - -impl AsRef for FraudDetailsParamsUserReport { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FraudDetailsParamsUserReport { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FraudDetailsParamsUserReport { - fn default() -> Self { - Self::Fraudulent - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsAchDebit`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsAchDebitAccountHolderType { - Company, - Individual, -} - -impl PaymentMethodDetailsAchDebitAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsAchDebitAccountHolderType::Company => "company", - PaymentMethodDetailsAchDebitAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for PaymentMethodDetailsAchDebitAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsAchDebitAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsAchDebitAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl PaymentMethodDetailsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsBancontactPreferredLanguage::De => "de", - PaymentMethodDetailsBancontactPreferredLanguage::En => "en", - PaymentMethodDetailsBancontactPreferredLanguage::Fr => "fr", - PaymentMethodDetailsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef for PaymentMethodDetailsBancontactPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsBancontactPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsBancontactPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsCardPresent`'s `read_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsCardPresentReadMethod { - ContactEmv, - ContactlessEmv, - ContactlessMagstripeMode, - MagneticStripeFallback, - MagneticStripeTrack2, -} - -impl PaymentMethodDetailsCardPresentReadMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsCardPresentReadMethod::ContactEmv => "contact_emv", - PaymentMethodDetailsCardPresentReadMethod::ContactlessEmv => "contactless_emv", - PaymentMethodDetailsCardPresentReadMethod::ContactlessMagstripeMode => { - "contactless_magstripe_mode" - } - PaymentMethodDetailsCardPresentReadMethod::MagneticStripeFallback => { - "magnetic_stripe_fallback" - } - PaymentMethodDetailsCardPresentReadMethod::MagneticStripeTrack2 => { - "magnetic_stripe_track2" - } - } - } -} - -impl AsRef for PaymentMethodDetailsCardPresentReadMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsCardPresentReadMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsCardPresentReadMethod { - fn default() -> Self { - Self::ContactEmv - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsCardPresentReceipt`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsCardPresentReceiptAccountType { - Checking, - Credit, - Prepaid, - Unknown, -} - -impl PaymentMethodDetailsCardPresentReceiptAccountType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsCardPresentReceiptAccountType::Checking => "checking", - PaymentMethodDetailsCardPresentReceiptAccountType::Credit => "credit", - PaymentMethodDetailsCardPresentReceiptAccountType::Prepaid => "prepaid", - PaymentMethodDetailsCardPresentReceiptAccountType::Unknown => "unknown", - } - } -} - -impl AsRef for PaymentMethodDetailsCardPresentReceiptAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsCardPresentReceiptAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsCardPresentReceiptAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsCardWallet`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsCardWalletType { - AmexExpressCheckout, - ApplePay, - GooglePay, - Link, - Masterpass, - SamsungPay, - VisaCheckout, -} - -impl PaymentMethodDetailsCardWalletType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsCardWalletType::AmexExpressCheckout => "amex_express_checkout", - PaymentMethodDetailsCardWalletType::ApplePay => "apple_pay", - PaymentMethodDetailsCardWalletType::GooglePay => "google_pay", - PaymentMethodDetailsCardWalletType::Link => "link", - PaymentMethodDetailsCardWalletType::Masterpass => "masterpass", - PaymentMethodDetailsCardWalletType::SamsungPay => "samsung_pay", - PaymentMethodDetailsCardWalletType::VisaCheckout => "visa_checkout", - } - } -} - -impl AsRef for PaymentMethodDetailsCardWalletType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsCardWalletType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsCardWalletType { - fn default() -> Self { - Self::AmexExpressCheckout - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsEps`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsEpsBank { - ArzteUndApothekerBank, - AustrianAnadiBankAg, - BankAustria, - BankhausCarlSpangler, - BankhausSchelhammerUndSchatteraAg, - BawagPskAg, - BksBankAg, - BrullKallmusBankAg, - BtvVierLanderBank, - CapitalBankGraweGruppeAg, - DeutscheBankAg, - Dolomitenbank, - EasybankAg, - ErsteBankUndSparkassen, - HypoAlpeadriabankInternationalAg, - HypoBankBurgenlandAktiengesellschaft, - HypoNoeLbFurNiederosterreichUWien, - HypoOberosterreichSalzburgSteiermark, - HypoTirolBankAg, - HypoVorarlbergBankAg, - MarchfelderBank, - OberbankAg, - RaiffeisenBankengruppeOsterreich, - SchoellerbankAg, - SpardaBankWien, - VolksbankGruppe, - VolkskreditbankAg, - VrBankBraunau, -} - -impl PaymentMethodDetailsEpsBank { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsEpsBank::ArzteUndApothekerBank => "arzte_und_apotheker_bank", - PaymentMethodDetailsEpsBank::AustrianAnadiBankAg => "austrian_anadi_bank_ag", - PaymentMethodDetailsEpsBank::BankAustria => "bank_austria", - PaymentMethodDetailsEpsBank::BankhausCarlSpangler => "bankhaus_carl_spangler", - PaymentMethodDetailsEpsBank::BankhausSchelhammerUndSchatteraAg => { - "bankhaus_schelhammer_und_schattera_ag" - } - PaymentMethodDetailsEpsBank::BawagPskAg => "bawag_psk_ag", - PaymentMethodDetailsEpsBank::BksBankAg => "bks_bank_ag", - PaymentMethodDetailsEpsBank::BrullKallmusBankAg => "brull_kallmus_bank_ag", - PaymentMethodDetailsEpsBank::BtvVierLanderBank => "btv_vier_lander_bank", - PaymentMethodDetailsEpsBank::CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", - PaymentMethodDetailsEpsBank::DeutscheBankAg => "deutsche_bank_ag", - PaymentMethodDetailsEpsBank::Dolomitenbank => "dolomitenbank", - PaymentMethodDetailsEpsBank::EasybankAg => "easybank_ag", - PaymentMethodDetailsEpsBank::ErsteBankUndSparkassen => "erste_bank_und_sparkassen", - PaymentMethodDetailsEpsBank::HypoAlpeadriabankInternationalAg => { - "hypo_alpeadriabank_international_ag" - } - PaymentMethodDetailsEpsBank::HypoBankBurgenlandAktiengesellschaft => { - "hypo_bank_burgenland_aktiengesellschaft" - } - PaymentMethodDetailsEpsBank::HypoNoeLbFurNiederosterreichUWien => { - "hypo_noe_lb_fur_niederosterreich_u_wien" - } - PaymentMethodDetailsEpsBank::HypoOberosterreichSalzburgSteiermark => { - "hypo_oberosterreich_salzburg_steiermark" - } - PaymentMethodDetailsEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag", - PaymentMethodDetailsEpsBank::HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", - PaymentMethodDetailsEpsBank::MarchfelderBank => "marchfelder_bank", - PaymentMethodDetailsEpsBank::OberbankAg => "oberbank_ag", - PaymentMethodDetailsEpsBank::RaiffeisenBankengruppeOsterreich => { - "raiffeisen_bankengruppe_osterreich" - } - PaymentMethodDetailsEpsBank::SchoellerbankAg => "schoellerbank_ag", - PaymentMethodDetailsEpsBank::SpardaBankWien => "sparda_bank_wien", - PaymentMethodDetailsEpsBank::VolksbankGruppe => "volksbank_gruppe", - PaymentMethodDetailsEpsBank::VolkskreditbankAg => "volkskreditbank_ag", - PaymentMethodDetailsEpsBank::VrBankBraunau => "vr_bank_braunau", - } - } -} - -impl AsRef for PaymentMethodDetailsEpsBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsEpsBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsEpsBank { - fn default() -> Self { - Self::ArzteUndApothekerBank - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsFpx`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsFpxAccountHolderType { - Company, - Individual, -} - -impl PaymentMethodDetailsFpxAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsFpxAccountHolderType::Company => "company", - PaymentMethodDetailsFpxAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for PaymentMethodDetailsFpxAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsFpxAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsFpxAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsFpx`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsFpxBank { - AffinBank, - Agrobank, - AllianceBank, - Ambank, - BankIslam, - BankMuamalat, - BankOfChina, - BankRakyat, - Bsn, - Cimb, - DeutscheBank, - HongLeongBank, - Hsbc, - Kfh, - Maybank2e, - Maybank2u, - Ocbc, - PbEnterprise, - PublicBank, - Rhb, - StandardChartered, - Uob, -} - -impl PaymentMethodDetailsFpxBank { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsFpxBank::AffinBank => "affin_bank", - PaymentMethodDetailsFpxBank::Agrobank => "agrobank", - PaymentMethodDetailsFpxBank::AllianceBank => "alliance_bank", - PaymentMethodDetailsFpxBank::Ambank => "ambank", - PaymentMethodDetailsFpxBank::BankIslam => "bank_islam", - PaymentMethodDetailsFpxBank::BankMuamalat => "bank_muamalat", - PaymentMethodDetailsFpxBank::BankOfChina => "bank_of_china", - PaymentMethodDetailsFpxBank::BankRakyat => "bank_rakyat", - PaymentMethodDetailsFpxBank::Bsn => "bsn", - PaymentMethodDetailsFpxBank::Cimb => "cimb", - PaymentMethodDetailsFpxBank::DeutscheBank => "deutsche_bank", - PaymentMethodDetailsFpxBank::HongLeongBank => "hong_leong_bank", - PaymentMethodDetailsFpxBank::Hsbc => "hsbc", - PaymentMethodDetailsFpxBank::Kfh => "kfh", - PaymentMethodDetailsFpxBank::Maybank2e => "maybank2e", - PaymentMethodDetailsFpxBank::Maybank2u => "maybank2u", - PaymentMethodDetailsFpxBank::Ocbc => "ocbc", - PaymentMethodDetailsFpxBank::PbEnterprise => "pb_enterprise", - PaymentMethodDetailsFpxBank::PublicBank => "public_bank", - PaymentMethodDetailsFpxBank::Rhb => "rhb", - PaymentMethodDetailsFpxBank::StandardChartered => "standard_chartered", - PaymentMethodDetailsFpxBank::Uob => "uob", - } - } -} - -impl AsRef for PaymentMethodDetailsFpxBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsFpxBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsFpxBank { - fn default() -> Self { - Self::AffinBank - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsIdeal`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsIdealBank { - AbnAmro, - AsnBank, - Bunq, - Handelsbanken, - Ing, - Knab, - Moneyou, - N26, - Rabobank, - Regiobank, - Revolut, - SnsBank, - TriodosBank, - VanLanschot, - Yoursafe, -} - -impl PaymentMethodDetailsIdealBank { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsIdealBank::AbnAmro => "abn_amro", - PaymentMethodDetailsIdealBank::AsnBank => "asn_bank", - PaymentMethodDetailsIdealBank::Bunq => "bunq", - PaymentMethodDetailsIdealBank::Handelsbanken => "handelsbanken", - PaymentMethodDetailsIdealBank::Ing => "ing", - PaymentMethodDetailsIdealBank::Knab => "knab", - PaymentMethodDetailsIdealBank::Moneyou => "moneyou", - PaymentMethodDetailsIdealBank::N26 => "n26", - PaymentMethodDetailsIdealBank::Rabobank => "rabobank", - PaymentMethodDetailsIdealBank::Regiobank => "regiobank", - PaymentMethodDetailsIdealBank::Revolut => "revolut", - PaymentMethodDetailsIdealBank::SnsBank => "sns_bank", - PaymentMethodDetailsIdealBank::TriodosBank => "triodos_bank", - PaymentMethodDetailsIdealBank::VanLanschot => "van_lanschot", - PaymentMethodDetailsIdealBank::Yoursafe => "yoursafe", - } - } -} - -impl AsRef for PaymentMethodDetailsIdealBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsIdealBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsIdealBank { - fn default() -> Self { - Self::AbnAmro - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsIdeal`'s `bic` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsIdealBic { - #[serde(rename = "ABNANL2A")] - Abnanl2a, - #[serde(rename = "ASNBNL21")] - Asnbnl21, - #[serde(rename = "BITSNL2A")] - Bitsnl2a, - #[serde(rename = "BUNQNL2A")] - Bunqnl2a, - #[serde(rename = "FVLBNL22")] - Fvlbnl22, - #[serde(rename = "HANDNL2A")] - Handnl2a, - #[serde(rename = "INGBNL2A")] - Ingbnl2a, - #[serde(rename = "KNABNL2H")] - Knabnl2h, - #[serde(rename = "MOYONL21")] - Moyonl21, - #[serde(rename = "NTSBDEB1")] - Ntsbdeb1, - #[serde(rename = "RABONL2U")] - Rabonl2u, - #[serde(rename = "RBRBNL21")] - Rbrbnl21, - #[serde(rename = "REVOIE23")] - Revoie23, - #[serde(rename = "REVOLT21")] - Revolt21, - #[serde(rename = "SNSBNL2A")] - Snsbnl2a, - #[serde(rename = "TRIONL2U")] - Trionl2u, -} - -impl PaymentMethodDetailsIdealBic { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsIdealBic::Abnanl2a => "ABNANL2A", - PaymentMethodDetailsIdealBic::Asnbnl21 => "ASNBNL21", - PaymentMethodDetailsIdealBic::Bitsnl2a => "BITSNL2A", - PaymentMethodDetailsIdealBic::Bunqnl2a => "BUNQNL2A", - PaymentMethodDetailsIdealBic::Fvlbnl22 => "FVLBNL22", - PaymentMethodDetailsIdealBic::Handnl2a => "HANDNL2A", - PaymentMethodDetailsIdealBic::Ingbnl2a => "INGBNL2A", - PaymentMethodDetailsIdealBic::Knabnl2h => "KNABNL2H", - PaymentMethodDetailsIdealBic::Moyonl21 => "MOYONL21", - PaymentMethodDetailsIdealBic::Ntsbdeb1 => "NTSBDEB1", - PaymentMethodDetailsIdealBic::Rabonl2u => "RABONL2U", - PaymentMethodDetailsIdealBic::Rbrbnl21 => "RBRBNL21", - PaymentMethodDetailsIdealBic::Revoie23 => "REVOIE23", - PaymentMethodDetailsIdealBic::Revolt21 => "REVOLT21", - PaymentMethodDetailsIdealBic::Snsbnl2a => "SNSBNL2A", - PaymentMethodDetailsIdealBic::Trionl2u => "TRIONL2U", - } - } -} - -impl AsRef for PaymentMethodDetailsIdealBic { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsIdealBic { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsIdealBic { - fn default() -> Self { - Self::Abnanl2a - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsInteracPresent`'s `read_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsInteracPresentReadMethod { - ContactEmv, - ContactlessEmv, - ContactlessMagstripeMode, - MagneticStripeFallback, - MagneticStripeTrack2, -} - -impl PaymentMethodDetailsInteracPresentReadMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsInteracPresentReadMethod::ContactEmv => "contact_emv", - PaymentMethodDetailsInteracPresentReadMethod::ContactlessEmv => "contactless_emv", - PaymentMethodDetailsInteracPresentReadMethod::ContactlessMagstripeMode => { - "contactless_magstripe_mode" - } - PaymentMethodDetailsInteracPresentReadMethod::MagneticStripeFallback => { - "magnetic_stripe_fallback" - } - PaymentMethodDetailsInteracPresentReadMethod::MagneticStripeTrack2 => { - "magnetic_stripe_track2" - } - } - } -} - -impl AsRef for PaymentMethodDetailsInteracPresentReadMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsInteracPresentReadMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsInteracPresentReadMethod { - fn default() -> Self { - Self::ContactEmv - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsInteracPresentReceipt`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsInteracPresentReceiptAccountType { - Checking, - Savings, - Unknown, -} - -impl PaymentMethodDetailsInteracPresentReceiptAccountType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsInteracPresentReceiptAccountType::Checking => "checking", - PaymentMethodDetailsInteracPresentReceiptAccountType::Savings => "savings", - PaymentMethodDetailsInteracPresentReceiptAccountType::Unknown => "unknown", - } - } -} - -impl AsRef for PaymentMethodDetailsInteracPresentReceiptAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsInteracPresentReceiptAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsInteracPresentReceiptAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsKonbiniStore`'s `chain` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsKonbiniStoreChain { - Familymart, - Lawson, - Ministop, - Seicomart, -} - -impl PaymentMethodDetailsKonbiniStoreChain { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsKonbiniStoreChain::Familymart => "familymart", - PaymentMethodDetailsKonbiniStoreChain::Lawson => "lawson", - PaymentMethodDetailsKonbiniStoreChain::Ministop => "ministop", - PaymentMethodDetailsKonbiniStoreChain::Seicomart => "seicomart", - } - } -} - -impl AsRef for PaymentMethodDetailsKonbiniStoreChain { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsKonbiniStoreChain { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsKonbiniStoreChain { - fn default() -> Self { - Self::Familymart - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsP24`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsP24Bank { - AliorBank, - BankMillennium, - BankNowyBfgSa, - BankPekaoSa, - BankiSpbdzielcze, - Blik, - BnpParibas, - Boz, - CitiHandlowy, - CreditAgricole, - Envelobank, - EtransferPocztowy24, - GetinBank, - Ideabank, - Ing, - Inteligo, - MbankMtransfer, - NestPrzelew, - NoblePay, - PbacZIpko, - PlusBank, - SantanderPrzelew24, - TmobileUsbugiBankowe, - ToyotaBank, - VolkswagenBank, -} - -impl PaymentMethodDetailsP24Bank { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsP24Bank::AliorBank => "alior_bank", - PaymentMethodDetailsP24Bank::BankMillennium => "bank_millennium", - PaymentMethodDetailsP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa", - PaymentMethodDetailsP24Bank::BankPekaoSa => "bank_pekao_sa", - PaymentMethodDetailsP24Bank::BankiSpbdzielcze => "banki_spbdzielcze", - PaymentMethodDetailsP24Bank::Blik => "blik", - PaymentMethodDetailsP24Bank::BnpParibas => "bnp_paribas", - PaymentMethodDetailsP24Bank::Boz => "boz", - PaymentMethodDetailsP24Bank::CitiHandlowy => "citi_handlowy", - PaymentMethodDetailsP24Bank::CreditAgricole => "credit_agricole", - PaymentMethodDetailsP24Bank::Envelobank => "envelobank", - PaymentMethodDetailsP24Bank::EtransferPocztowy24 => "etransfer_pocztowy24", - PaymentMethodDetailsP24Bank::GetinBank => "getin_bank", - PaymentMethodDetailsP24Bank::Ideabank => "ideabank", - PaymentMethodDetailsP24Bank::Ing => "ing", - PaymentMethodDetailsP24Bank::Inteligo => "inteligo", - PaymentMethodDetailsP24Bank::MbankMtransfer => "mbank_mtransfer", - PaymentMethodDetailsP24Bank::NestPrzelew => "nest_przelew", - PaymentMethodDetailsP24Bank::NoblePay => "noble_pay", - PaymentMethodDetailsP24Bank::PbacZIpko => "pbac_z_ipko", - PaymentMethodDetailsP24Bank::PlusBank => "plus_bank", - PaymentMethodDetailsP24Bank::SantanderPrzelew24 => "santander_przelew24", - PaymentMethodDetailsP24Bank::TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", - PaymentMethodDetailsP24Bank::ToyotaBank => "toyota_bank", - PaymentMethodDetailsP24Bank::VolkswagenBank => "volkswagen_bank", - } - } -} - -impl AsRef for PaymentMethodDetailsP24Bank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsP24Bank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsP24Bank { - fn default() -> Self { - Self::AliorBank - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsSofort`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsSofortPreferredLanguage { - De, - En, - Es, - Fr, - It, - Nl, - Pl, -} - -impl PaymentMethodDetailsSofortPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsSofortPreferredLanguage::De => "de", - PaymentMethodDetailsSofortPreferredLanguage::En => "en", - PaymentMethodDetailsSofortPreferredLanguage::Es => "es", - PaymentMethodDetailsSofortPreferredLanguage::Fr => "fr", - PaymentMethodDetailsSofortPreferredLanguage::It => "it", - PaymentMethodDetailsSofortPreferredLanguage::Nl => "nl", - PaymentMethodDetailsSofortPreferredLanguage::Pl => "pl", - } - } -} - -impl AsRef for PaymentMethodDetailsSofortPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsSofortPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsSofortPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl PaymentMethodDetailsUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsUsBankAccountAccountHolderType::Company => "company", - PaymentMethodDetailsUsBankAccountAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for PaymentMethodDetailsUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsUsBankAccountAccountType { - Checking, - Savings, -} - -impl PaymentMethodDetailsUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsUsBankAccountAccountType::Checking => "checking", - PaymentMethodDetailsUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for PaymentMethodDetailsUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `PaypalSellerProtection`'s `dispute_categories` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaypalSellerProtectionDisputeCategories { - Fraudulent, - ProductNotReceived, -} - -impl PaypalSellerProtectionDisputeCategories { - pub fn as_str(self) -> &'static str { - match self { - PaypalSellerProtectionDisputeCategories::Fraudulent => "fraudulent", - PaypalSellerProtectionDisputeCategories::ProductNotReceived => "product_not_received", - } - } -} - -impl AsRef for PaypalSellerProtectionDisputeCategories { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaypalSellerProtectionDisputeCategories { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaypalSellerProtectionDisputeCategories { - fn default() -> Self { - Self::Fraudulent - } -} - -/// An enum representing the possible values of an `PaypalSellerProtection`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaypalSellerProtectionStatus { - Eligible, - NotEligible, - PartiallyEligible, -} - -impl PaypalSellerProtectionStatus { - pub fn as_str(self) -> &'static str { - match self { - PaypalSellerProtectionStatus::Eligible => "eligible", - PaypalSellerProtectionStatus::NotEligible => "not_eligible", - PaypalSellerProtectionStatus::PartiallyEligible => "partially_eligible", - } - } -} - -impl AsRef for PaypalSellerProtectionStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaypalSellerProtectionStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaypalSellerProtectionStatus { - fn default() -> Self { - Self::Eligible - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetailsCharge`'s `authentication_flow` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsChargeAuthenticationFlow { - Challenge, - Frictionless, -} - -impl ThreeDSecureDetailsChargeAuthenticationFlow { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsChargeAuthenticationFlow::Challenge => "challenge", - ThreeDSecureDetailsChargeAuthenticationFlow::Frictionless => "frictionless", - } - } -} - -impl AsRef for ThreeDSecureDetailsChargeAuthenticationFlow { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsChargeAuthenticationFlow { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsChargeAuthenticationFlow { - fn default() -> Self { - Self::Challenge - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetailsCharge`'s `result` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsChargeResult { - AttemptAcknowledged, - Authenticated, - Exempted, - Failed, - NotSupported, - ProcessingError, -} - -impl ThreeDSecureDetailsChargeResult { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsChargeResult::AttemptAcknowledged => "attempt_acknowledged", - ThreeDSecureDetailsChargeResult::Authenticated => "authenticated", - ThreeDSecureDetailsChargeResult::Exempted => "exempted", - ThreeDSecureDetailsChargeResult::Failed => "failed", - ThreeDSecureDetailsChargeResult::NotSupported => "not_supported", - ThreeDSecureDetailsChargeResult::ProcessingError => "processing_error", - } - } -} - -impl AsRef for ThreeDSecureDetailsChargeResult { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsChargeResult { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsChargeResult { - fn default() -> Self { - Self::AttemptAcknowledged - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetailsCharge`'s `result_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsChargeResultReason { - Abandoned, - Bypassed, - Canceled, - CardNotEnrolled, - NetworkNotSupported, - ProtocolError, - Rejected, -} - -impl ThreeDSecureDetailsChargeResultReason { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsChargeResultReason::Abandoned => "abandoned", - ThreeDSecureDetailsChargeResultReason::Bypassed => "bypassed", - ThreeDSecureDetailsChargeResultReason::Canceled => "canceled", - ThreeDSecureDetailsChargeResultReason::CardNotEnrolled => "card_not_enrolled", - ThreeDSecureDetailsChargeResultReason::NetworkNotSupported => "network_not_supported", - ThreeDSecureDetailsChargeResultReason::ProtocolError => "protocol_error", - ThreeDSecureDetailsChargeResultReason::Rejected => "rejected", - } - } -} - -impl AsRef for ThreeDSecureDetailsChargeResultReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsChargeResultReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsChargeResultReason { - fn default() -> Self { - Self::Abandoned - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetailsCharge`'s `version` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsChargeVersion { - #[serde(rename = "1.0.2")] - V1_0_2, - #[serde(rename = "2.1.0")] - V2_1_0, - #[serde(rename = "2.2.0")] - V2_2_0, -} - -impl ThreeDSecureDetailsChargeVersion { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsChargeVersion::V1_0_2 => "1.0.2", - ThreeDSecureDetailsChargeVersion::V2_1_0 => "2.1.0", - ThreeDSecureDetailsChargeVersion::V2_2_0 => "2.2.0", - } - } -} - -impl AsRef for ThreeDSecureDetailsChargeVersion { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsChargeVersion { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsChargeVersion { - fn default() -> Self { - Self::V1_0_2 - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DestinationSpecs { - /// ID of an existing, connected Stripe account. - pub account: String, - /// The amount to transfer to the destination account without creating an `Application Fee` object. - /// - /// Cannot be combined with the `application_fee` parameter. - /// Must be less than or equal to the charge amount. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, -} diff --git a/src/resources/generated/checkout_session.rs b/src/resources/generated/checkout_session.rs deleted file mode 100644 index 5b03d95e5..000000000 --- a/src/resources/generated/checkout_session.rs +++ /dev/null @@ -1,8645 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ - CheckoutSessionId, CustomerId, PaymentIntentId, PaymentLinkId, PaymentMethodConfigurationId, - SubscriptionId, -}; -use crate::params::{ - CurrencyMap, Expand, Expandable, List, Metadata, Object, Paginable, Timestamp, -}; -use crate::resources::{ - Address, CheckoutSessionItem, Currency, Customer, Discount, Invoice, - InvoiceSettingRenderingOptions, LinkedAccountOptionsUsBankAccount, PaymentIntent, PaymentLink, - PaymentMethodConfigBizPaymentMethodConfigurationDetails, - PaymentMethodOptionsCustomerBalanceEuBankAccount, SetupIntent, Shipping, ShippingRate, - Subscription, TaxId, TaxRate, -}; - -/// The resource representing a Stripe "Session". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutSession { - /// Unique identifier for the object. - pub id: CheckoutSessionId, - - /// When set, provides configuration for actions to take if this Checkout Session expires. - pub after_expiration: Option, - - /// Enables user redeemable promotion codes. - pub allow_promotion_codes: Option, - - /// Total of all items before discounts or taxes are applied. - pub amount_subtotal: Option, - - /// Total of all items after discounts and taxes are applied. - pub amount_total: Option, - - pub automatic_tax: PaymentPagesCheckoutSessionAutomaticTax, - - /// Describes whether Checkout should collect the customer's billing address. - pub billing_address_collection: Option, - - /// If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. - pub cancel_url: Option, - - /// A unique string to reference the Checkout Session. - /// - /// This can be a customer ID, a cart ID, or similar, and can be used to reconcile the Session with your internal systems. - pub client_reference_id: Option, - - /// Results of `consent_collection` for this session. - pub consent: Option, - - /// When set, provides configuration for the Checkout Session to gather active consent from customers. - pub consent_collection: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Option, - - /// Currency conversion details for automatic currency conversion sessions. - pub currency_conversion: Option, - - /// Collect additional information from your customer using custom fields. - /// - /// Up to 2 fields are supported. - pub custom_fields: Vec, - - pub custom_text: PaymentPagesCheckoutSessionCustomText, - - /// The ID of the customer for this Session. - /// For Checkout Sessions in `subscription` mode or Checkout Sessions with `customer_creation` set as `always` in `payment` mode, Checkout - /// will create a new customer object based on information provided - /// during the payment flow unless an existing customer was provided when - /// the Session was created. - pub customer: Option>, - - /// Configure whether a Checkout Session creates a Customer when the Checkout Session completes. - pub customer_creation: Option, - - /// The customer details including the customer's tax exempt status and the customer's tax IDs. - /// - /// Only the customer's email is present on Sessions in `setup` mode. - pub customer_details: Option, - - /// If provided, this value will be used when the Customer object is created. - /// If not provided, customers will be asked to enter their email address. - /// Use this parameter to prefill customer data if you already have an email - /// on file. - /// - /// To access information about the customer once the payment flow is complete, use the `customer` attribute. - pub customer_email: Option, - - /// The timestamp at which the Checkout Session will expire. - pub expires_at: Timestamp, - - /// ID of the invoice created by the Checkout Session, if it exists. - pub invoice: Option>, - - /// Details on the state of invoice creation for the Checkout Session. - pub invoice_creation: Option, - - /// The line items purchased by the customer. - #[serde(default)] - pub line_items: List, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The IETF language tag of the locale Checkout is displayed in. - /// - /// If blank or `auto`, the browser's locale is used. - pub locale: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// The mode of the Checkout Session. - pub mode: CheckoutSessionMode, - - /// The ID of the PaymentIntent for Checkout Sessions in `payment` mode. - pub payment_intent: Option>, - - /// The ID of the Payment Link that created this Session. - pub payment_link: Option>, - - /// Configure whether a Checkout Session should collect a payment method. - pub payment_method_collection: Option, - - /// Information about the payment method configuration used for this Checkout session if using dynamic payment methods. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_configuration_details: - Option, - - /// Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. - pub payment_method_options: Option, - - /// A list of the types of payment methods (e.g. - /// - /// card) this Checkout Session is allowed to accept. - pub payment_method_types: Vec, - - /// The payment status of the Checkout Session, one of `paid`, `unpaid`, or `no_payment_required`. - /// You can use this value to decide when to fulfill your customer's order. - pub payment_status: CheckoutSessionPaymentStatus, - - #[serde(skip_serializing_if = "Option::is_none")] - pub phone_number_collection: Option, - - /// The ID of the original expired Checkout Session that triggered the recovery flow. - pub recovered_from: Option, - - /// The ID of the SetupIntent for Checkout Sessions in `setup` mode. - pub setup_intent: Option>, - - /// When set, provides configuration for Checkout to collect a shipping address from a customer. - pub shipping_address_collection: Option, - - /// The details of the customer cost of shipping, including the customer chosen ShippingRate. - pub shipping_cost: Option, - - /// Shipping information for this Checkout Session. - pub shipping_details: Option, - - /// The shipping rate options applied to this Session. - pub shipping_options: Vec, - - /// The status of the Checkout Session, one of `open`, `complete`, or `expired`. - pub status: Option, - - /// Describes the type of transaction being performed by Checkout in order to customize - /// relevant text on the page, such as the submit button. - /// - /// `submit_type` can only be specified on Checkout Sessions in `payment` mode, but not Checkout Sessions in `subscription` or `setup` mode. - pub submit_type: Option, - - /// The ID of the subscription for Checkout Sessions in `subscription` mode. - pub subscription: Option>, - - /// The URL the customer will be directed to after the payment or - /// subscription creation is successful. - pub success_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_id_collection: Option, - - /// Tax and discount details for the computed total amount. - pub total_details: Option, - - /// The URL to the Checkout Session. - /// - /// Redirect customers to this URL to take them to Checkout. - /// If you’re using [Custom Domains](https://stripe.com/docs/payments/checkout/custom-domains), the URL will use your subdomain. - /// Otherwise, it’ll use `checkout.stripe.com.` This value is only present when the session is active. - pub url: Option, -} - -impl CheckoutSession { - /// Returns a list of Checkout Sessions. - pub fn list( - client: &Client, - params: &ListCheckoutSessions<'_>, - ) -> Response> { - client.get_query("/checkout/sessions", ¶ms) - } - - /// Creates a Session object. - pub fn create(client: &Client, params: CreateCheckoutSession<'_>) -> Response { - client.post_form("/checkout/sessions", ¶ms) - } -} - -impl Object for CheckoutSession { - type Id = CheckoutSessionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "checkout.session" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutSessionPaymentMethodOptions { - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutAcssDebitPaymentMethodOptions { - /// Currency supported by the bank account. - /// - /// Returned when the Session is in `setup` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutAcssDebitMandateOptions { - /// A URL for custom mandate text. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_mandate_url: Option, - - /// List of Stripe products where this mandate can be selected automatically. - /// - /// Returned when the Session is in `setup` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_for: Option>, - - /// Description of the interval. - /// - /// Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. - pub interval_description: Option, - - /// Payment schedule for the mandate. - pub payment_schedule: Option, - - /// Transaction type of the mandate. - pub transaction_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutAffirmPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutAfterpayClearpayPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutAlipayPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutAuBecsDebitPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutBacsDebitPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutBancontactPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutBoletoPaymentMethodOptions { - /// The number of calendar days before a Boleto voucher expires. - /// - /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time. - pub expires_after_days: u32, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutCardPaymentMethodOptions { - #[serde(skip_serializing_if = "Option::is_none")] - pub installments: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kana: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 17 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kanji: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutCardInstallmentsOptions { - /// Indicates if installments are enabled. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutCashappPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutCustomerBalancePaymentMethodOptions { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - pub funding_type: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutCustomerBalanceBankTransferPaymentMethodOptions { - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: Option, - - /// List of address types that should be returned in the financial_addresses response. - /// - /// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested_address_types: - Option>, - - /// The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutEpsPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutFpxPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutGiropayPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutGrabPayPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutIdealPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutKlarnaPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutKonbiniPaymentMethodOptions { - /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. - /// - /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. - pub expires_after_days: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutLinkPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutOxxoPaymentMethodOptions { - /// The number of calendar days before an OXXO invoice expires. - /// - /// For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - pub expires_after_days: u32, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutP24PaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutPaynowPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutPixPaymentMethodOptions { - /// The number of seconds after which Pix payment will expire. - pub expires_after_seconds: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutSepaDebitPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutSofortPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutUsBankAccountPaymentMethodOptions { - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionAfterExpiration { - /// When set, configuration used to recover the Checkout Session on expiry. - pub recovery: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionAfterExpirationRecovery { - /// Enables user redeemable promotion codes on the recovered Checkout Sessions. - /// - /// Defaults to `false`. - pub allow_promotion_codes: bool, - - /// If `true`, a recovery url will be generated to recover this Checkout Session if it - /// expires before a transaction is completed. - /// - /// It will be attached to the Checkout Session object upon expiration. - pub enabled: bool, - - /// The timestamp at which the recovery URL will expire. - pub expires_at: Option, - - /// URL that creates a new Checkout Session when clicked that is a copy of this expired Checkout Session. - pub url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionAutomaticTax { - /// Indicates whether automatic tax is enabled for the session. - pub enabled: bool, - - /// The status of the most recent automated tax calculation for this session. - pub status: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionConsent { - /// If `opt_in`, the customer consents to receiving promotional communications - /// from the merchant about this Checkout Session. - pub promotions: Option, - - /// If `accepted`, the customer in this Checkout Session has agreed to the merchant's terms of service. - pub terms_of_service: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionConsentCollection { - /// If set to `auto`, enables the collection of customer consent for promotional communications. - /// - /// The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. - /// Only available to US merchants. - pub promotions: Option, - - /// If set to `required`, it requires customers to accept the terms of service before being able to pay. - pub terms_of_service: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCurrencyConversion { - /// Total of all items in source currency before discounts or taxes are applied. - pub amount_subtotal: i64, - - /// Total of all items in source currency after discounts and taxes are applied. - pub amount_total: i64, - - /// Exchange rate used to convert source currency amounts to customer currency amounts. - pub fx_rate: String, - - /// Creation currency of the CheckoutSession before localization. - pub source_currency: Currency, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomFields { - /// Configuration for `type=dropdown` fields. - pub dropdown: Option, - - /// String of your choice that your integration can use to reconcile this field. - /// - /// Must be unique to this field, alphanumeric, and up to 200 characters. - pub key: String, - - pub label: PaymentPagesCheckoutSessionCustomFieldsLabel, - - /// Configuration for `type=numeric` fields. - pub numeric: Option, - - /// Whether the customer is required to complete the field before completing the Checkout Session. - /// - /// Defaults to `false`. - pub optional: bool, - - /// Configuration for `type=text` fields. - pub text: Option, - - /// The type of the field. - #[serde(rename = "type")] - pub type_: PaymentPagesCheckoutSessionCustomFieldsType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomFieldsDropdown { - /// The options available for the customer to select. - /// - /// Up to 200 options allowed. - pub options: Vec, - - /// The option selected by the customer. - /// - /// This will be the `value` for the option. - pub value: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomFieldsLabel { - /// Custom text for the label, displayed to the customer. - /// - /// Up to 50 characters. - pub custom: Option, - - /// The type of the label. - #[serde(rename = "type")] - pub type_: PaymentPagesCheckoutSessionCustomFieldsLabelType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomFieldsNumeric { - /// The maximum character length constraint for the customer's input. - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - pub minimum_length: Option, - - /// The value entered by the customer, containing only digits. - pub value: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomFieldsOption { - /// The label for the option, displayed to the customer. - /// - /// Up to 100 characters. - pub label: String, - - /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. - /// - /// Must be unique to this option, alphanumeric, and up to 100 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomFieldsText { - /// The maximum character length constraint for the customer's input. - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - pub minimum_length: Option, - - /// The value entered by the customer. - pub value: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomText { - /// Custom text that should be displayed alongside shipping address collection. - pub shipping_address: Option, - - /// Custom text that should be displayed alongside the payment confirmation button. - pub submit: Option, - - /// Custom text that should be displayed in place of the default terms of service agreement text. - pub terms_of_service_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomTextPosition { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomerDetails { - /// The customer's address after a completed Checkout Session. - /// - /// Note: This property is populated only for sessions on or after March 30, 2022. - pub address: Option
, - - /// The email associated with the Customer, if one exists, on the Checkout Session after a completed Checkout Session or at time of session expiry. - /// Otherwise, if the customer has consented to promotional content, this value is the most recent valid email provided by the customer on the Checkout form. - pub email: Option, - - /// The customer's name after a completed Checkout Session. - /// - /// Note: This property is populated only for sessions on or after March 30, 2022. - pub name: Option, - - /// The customer's phone number after a completed Checkout Session. - pub phone: Option, - - /// The customer’s tax exempt status after a completed Checkout Session. - pub tax_exempt: Option, - - /// The customer’s tax IDs after a completed Checkout Session. - pub tax_ids: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionInvoiceCreation { - /// Indicates whether invoice creation is enabled for the Checkout Session. - pub enabled: bool, - - pub invoice_data: PaymentPagesCheckoutSessionInvoiceSettings, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionInvoiceSettings { - /// The account tax IDs associated with the invoice. - pub account_tax_ids: Option>>, - - /// Custom fields displayed on the invoice. - pub custom_fields: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// Footer displayed on the invoice. - pub footer: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// Options for invoice PDF rendering. - pub rendering_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceSettingCustomField { - /// The name of the custom field. - pub name: String, - - /// The value of the custom field. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionPhoneNumberCollection { - /// Indicates whether phone number collection is enabled for the session. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionShippingAddressCollection { - /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for - /// shipping locations. - /// - /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. - pub allowed_countries: - Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionShippingCost { - /// Total shipping cost before any discounts or taxes are applied. - pub amount_subtotal: i64, - - /// Total tax amount applied due to shipping costs. - /// - /// If no tax was applied, defaults to 0. - pub amount_tax: i64, - - /// Total shipping cost after discounts and taxes are applied. - pub amount_total: i64, - - /// The ID of the ShippingRate for this order. - pub shipping_rate: Option>, - - /// The taxes applied to the shipping rate. - #[serde(skip_serializing_if = "Option::is_none")] - pub taxes: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LineItemsTaxAmount { - /// Amount of tax applied for this rate. - pub amount: i64, - - pub rate: TaxRate, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: Option, - - /// The amount on which tax is calculated, in cents (or local equivalent). - pub taxable_amount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionShippingOption { - /// A non-negative integer in cents representing how much to charge. - pub shipping_amount: i64, - - /// The shipping rate. - pub shipping_rate: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionTaxId { - /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. - #[serde(rename = "type")] - pub type_: PaymentPagesCheckoutSessionTaxIdType, - - /// The value of the tax ID. - pub value: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionTaxIdCollection { - /// Indicates whether tax ID collection is enabled for the session. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionTotalDetails { - /// This is the sum of all the discounts. - pub amount_discount: i64, - - /// This is the sum of all the shipping amounts. - pub amount_shipping: Option, - - /// This is the sum of all the tax amounts. - pub amount_tax: i64, - - #[serde(skip_serializing_if = "Option::is_none")] - pub breakdown: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionTotalDetailsResourceBreakdown { - /// The aggregated discounts. - pub discounts: Vec, - - /// The aggregated tax amounts by rate. - pub taxes: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LineItemsDiscountAmount { - /// The amount discounted. - pub amount: i64, - - pub discount: Discount, -} - -/// The parameters for `CheckoutSession::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateCheckoutSession<'a> { - /// Configure actions after a Checkout Session has expired. - #[serde(skip_serializing_if = "Option::is_none")] - pub after_expiration: Option, - - /// Enables user redeemable promotion codes. - #[serde(skip_serializing_if = "Option::is_none")] - pub allow_promotion_codes: Option, - - /// Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Specify whether Checkout should collect the customer's billing address. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_address_collection: Option, - - /// If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. - #[serde(skip_serializing_if = "Option::is_none")] - pub cancel_url: Option<&'a str>, - - /// A unique string to reference the Checkout Session. - /// - /// This can be a customer ID, a cart ID, or similar, and can be used to reconcile the session with your internal systems. - #[serde(skip_serializing_if = "Option::is_none")] - pub client_reference_id: Option<&'a str>, - - /// Configure fields for the Checkout Session to gather active consent from customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub consent_collection: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Collect additional information from your customer using custom fields. - /// - /// Up to 2 fields are supported. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// Display additional text for your customers using custom text. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_text: Option, - - /// ID of an existing Customer, if one exists. - /// - /// In `payment` mode, the customer’s most recent card payment method will be used to prefill the email, name, card details, and billing address on the Checkout page. - /// In `subscription` mode, the customer’s [default payment method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) will be used if it’s a card, and otherwise the most recent card will be used. - /// A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details. If the Customer already has a valid [email](https://stripe.com/docs/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout. If the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer. If blank for Checkout Sessions in `subscription` mode or with `customer_creation` set as `always` in `payment` mode, Checkout will create a new Customer object based on information provided during the payment flow. You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation. - /// - /// When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout - /// with [customer_details](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_details). - /// - /// Sessions that don't create Customers instead are grouped by [guest customers](https://stripe.com/docs/payments/checkout/guest-customers) - /// in the Dashboard. - /// - /// Promotion codes limited to first time customers will return invalid for these Sessions. Can only be set in `payment` and `setup` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_creation: Option, - - /// If provided, this value will be used when the Customer object is created. - /// If not provided, customers will be asked to enter their email address. - /// Use this parameter to prefill customer data if you already have an email - /// on file. - /// - /// To access information about the customer once a session is complete, use the `customer` field. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_email: Option<&'a str>, - - /// Controls what fields on Customer can be updated by the Checkout Session. - /// - /// Can only be provided when `customer` is provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_update: Option, - - /// The coupon or promotion code to apply to this Session. - /// - /// Currently, only up to one may be specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub discounts: Option>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The Epoch time in seconds at which the Checkout Session will expire. - /// - /// It can be anywhere from 30 minutes to 24 hours after Checkout Session creation. - /// By default, this value is 24 hours from creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option, - - /// Generate a post-purchase Invoice for one-time payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_creation: Option, - - /// A list of items the customer is purchasing. - /// - /// Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). For `payment` mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen. For `subscription` mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. - /// Line items with one-time Prices will be on the initial invoice only. - #[serde(skip_serializing_if = "Option::is_none")] - pub line_items: Option>, - - /// The IETF language tag of the locale Checkout is displayed in. - /// - /// If blank or `auto`, the browser's locale is used. - #[serde(skip_serializing_if = "Option::is_none")] - pub locale: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The mode of the Checkout Session. - /// - /// Pass `subscription` if the Checkout Session includes at least one recurring item. - #[serde(skip_serializing_if = "Option::is_none")] - pub mode: Option, - - /// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent_data: Option, - - /// Specify whether Checkout should collect a payment method. - /// - /// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. If you'd like information on how to collect a payment method outside of Checkout, read the guide on configuring [subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_collection: Option, - - /// The ID of the payment method configuration to use with this Checkout session. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_configuration: Option, - - /// Payment-method-specific configuration. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_options: Option, - - /// A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. - /// - /// In `payment` and `subscription` mode, you can omit this attribute to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - /// It is required in `setup` mode. - /// - /// Read more about the supported payment methods and their requirements in our [payment - /// method details guide](/docs/payments/checkout/payment-methods). - /// - /// If multiple payment methods are passed, Checkout will dynamically reorder them to - /// prioritize the most relevant payment methods based on the customer's location and - /// other characteristics. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, - - /// Controls phone number collection settings for the session. - /// - /// We recommend that you review your privacy policy and check with your legal contacts - /// before using this feature. - /// - /// Learn more about [collecting phone numbers with Checkout](https://stripe.com/docs/payments/checkout/phone-numbers). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone_number_collection: Option, - - /// A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_intent_data: Option, - - /// When set, provides configuration for Checkout to collect a shipping address from a customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_address_collection: Option, - - /// The shipping rate options to apply to this Session. - /// - /// Up to a maximum of 5. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_options: Option>, - - /// Describes the type of transaction being performed by Checkout in order to customize - /// relevant text on the page, such as the submit button. - /// - /// `submit_type` can only be specified on Checkout Sessions in `payment` mode, but not Checkout Sessions in `subscription` or `setup` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub submit_type: Option, - - /// A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_data: Option, - - /// The URL to which Stripe should send customers when payment or setup - /// is complete. - /// If you’d like to use information from the successful Checkout Session on your page, - /// read the guide on [customizing your success page](https://stripe.com/docs/payments/checkout/custom-success-page). - pub success_url: &'a str, - - /// Controls tax ID collection settings for the session. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_id_collection: Option, -} - -impl<'a> CreateCheckoutSession<'a> { - pub fn new(success_url: &'a str) -> Self { - CreateCheckoutSession { - after_expiration: Default::default(), - allow_promotion_codes: Default::default(), - automatic_tax: Default::default(), - billing_address_collection: Default::default(), - cancel_url: Default::default(), - client_reference_id: Default::default(), - consent_collection: Default::default(), - currency: Default::default(), - custom_fields: Default::default(), - custom_text: Default::default(), - customer: Default::default(), - customer_creation: Default::default(), - customer_email: Default::default(), - customer_update: Default::default(), - discounts: Default::default(), - expand: Default::default(), - expires_at: Default::default(), - invoice_creation: Default::default(), - line_items: Default::default(), - locale: Default::default(), - metadata: Default::default(), - mode: Default::default(), - payment_intent_data: Default::default(), - payment_method_collection: Default::default(), - payment_method_configuration: Default::default(), - payment_method_options: Default::default(), - payment_method_types: Default::default(), - phone_number_collection: Default::default(), - setup_intent_data: Default::default(), - shipping_address_collection: Default::default(), - shipping_options: Default::default(), - submit_type: Default::default(), - subscription_data: Default::default(), - success_url, - tax_id_collection: Default::default(), - } - } -} - -/// The parameters for `CheckoutSession::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListCheckoutSessions<'a> { - /// Only return the Checkout Sessions for the Customer specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// Only return the Checkout Sessions for the Customer details specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_details: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return the Checkout Session for the PaymentIntent specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option, - - /// Only return the Checkout Sessions for the Payment Link specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_link: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// Only return the Checkout Session for the subscription specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option, -} - -impl<'a> ListCheckoutSessions<'a> { - pub fn new() -> Self { - ListCheckoutSessions { - customer: Default::default(), - customer_details: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - payment_intent: Default::default(), - payment_link: Default::default(), - starting_after: Default::default(), - subscription: Default::default(), - } - } -} -impl Paginable for ListCheckoutSessions<'_> { - type O = CheckoutSession; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionAfterExpiration { - /// Configure a Checkout Session that can be used to recover an expired session. - #[serde(skip_serializing_if = "Option::is_none")] - pub recovery: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionAutomaticTax { - /// Set to true to enable automatic taxes. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionConsentCollection { - /// If set to `auto`, enables the collection of customer consent for promotional communications. - /// - /// The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. - /// Only available to US merchants. - #[serde(skip_serializing_if = "Option::is_none")] - pub promotions: Option, - - /// If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. - /// There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). - #[serde(skip_serializing_if = "Option::is_none")] - pub terms_of_service: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomFields { - /// Configuration for `type=dropdown` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub dropdown: Option, - - /// String of your choice that your integration can use to reconcile this field. - /// - /// Must be unique to this field, alphanumeric, and up to 200 characters. - pub key: String, - - /// The label for the field, displayed to the customer. - pub label: CreateCheckoutSessionCustomFieldsLabel, - - /// Configuration for `type=numeric` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub numeric: Option, - - /// Whether the customer is required to complete the field before completing the Checkout Session. - /// - /// Defaults to `false`. - #[serde(skip_serializing_if = "Option::is_none")] - pub optional: Option, - - /// Configuration for `type=text` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub text: Option, - - /// The type of the field. - #[serde(rename = "type")] - pub type_: CreateCheckoutSessionCustomFieldsType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomText { - /// Custom text that should be displayed alongside shipping address collection. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_address: Option, - - /// Custom text that should be displayed alongside the payment confirmation button. - #[serde(skip_serializing_if = "Option::is_none")] - pub submit: Option, - - /// Custom text that should be displayed in place of the default terms of service agreement text. - #[serde(skip_serializing_if = "Option::is_none")] - pub terms_of_service_acceptance: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomerUpdate { - /// Describes whether Checkout saves the billing address onto `customer.address`. - /// To always collect a full billing address, use `billing_address_collection`. - /// - /// Defaults to `never`. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option, - - /// Describes whether Checkout saves the name onto `customer.name`. - /// - /// Defaults to `never`. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Describes whether Checkout saves shipping information onto `customer.shipping`. - /// To collect shipping information, use `shipping_address_collection`. - /// - /// Defaults to `never`. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionDiscounts { - /// The ID of the coupon to apply to this Session. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// The ID of a promotion code to apply to this Session. - #[serde(skip_serializing_if = "Option::is_none")] - pub promotion_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionInvoiceCreation { - /// Set to `true` to enable invoice creation. - pub enabled: bool, - - /// Parameters passed when creating invoices for payment-mode Checkout Sessions. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_data: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionLineItems { - /// When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout. - #[serde(skip_serializing_if = "Option::is_none")] - pub adjustable_quantity: Option, - - /// The [tax rates](https://stripe.com/docs/api/tax_rates) that will be applied to this line item depending on the customer's billing/shipping address. - /// - /// We currently support the following countries: US, GB, AU, and all countries in the EU. - #[serde(skip_serializing_if = "Option::is_none")] - pub dynamic_tax_rates: Option>, - - /// The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. - /// - /// One of `price` or `price_data` is required. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - /// - /// One of `price` or `price_data` is required. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// The quantity of the line item being purchased. - /// - /// Quantity should not be defined when `recurring.usage_type=metered`. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The [tax rates](https://stripe.com/docs/api/tax_rates) which apply to this line item. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentIntentData { - /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - /// - /// The amount of the application fee collected will be capped at the total payment amount. - /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, - - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The Stripe account ID for which these funds are intended. - /// - /// For details, see the PaymentIntents [use case for connected accounts](/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, - - /// Email address that the receipt for the resulting payment will be sent to. - /// - /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_email: Option, - - /// Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment - /// method collected by this Checkout Session. - /// - /// When setting this to `on_session`, Checkout will show a notice to the - /// customer that their payment details will be saved. - /// - /// When setting this to `off_session`, Checkout will show a notice to the - /// customer that their payment details will be saved and used for future - /// payments. - /// - /// If a Customer has been provided or Checkout creates a new Customer, - /// Checkout will attach the payment method to the Customer. - /// - /// If Checkout does not create a Customer, the payment method is not attached - /// to a Customer. - /// - /// To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Shipping information for this payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - - /// Extra information about the payment. - /// - /// This will appear on your customer's statement when this payment succeeds in creating a charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, - - /// Provides information about the charge that customers see on their statements. - /// - /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters for the concatenated descriptor. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix: Option, - - /// The parameters used to automatically create a Transfer when the payment succeeds. - /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// A string that identifies the resulting payment as part of a group. - /// - /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptions { - /// contains details about the ACSS Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// contains details about the Affirm payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// contains details about the Afterpay Clearpay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// contains details about the Alipay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// contains details about the AU Becs Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// contains details about the Bacs Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// contains details about the Bancontact payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// contains details about the Boleto payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// contains details about the Card payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// contains details about the Cashapp Pay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// contains details about the Customer Balance payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// contains details about the EPS payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// contains details about the FPX payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// contains details about the Giropay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// contains details about the Grabpay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// contains details about the Ideal payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// contains details about the Klarna payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// contains details about the Konbini payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// contains details about the Link payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// contains details about the OXXO payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// contains details about the P24 payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// contains details about the PayNow payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// contains details about the PayPal payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// contains details about the Pix payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - /// contains details about the Sepa Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// contains details about the Sofort payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// contains details about the Us Bank Account payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// contains details about the WeChat Pay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPhoneNumberCollection { - /// Set to `true` to enable phone number collection. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionSetupIntentData { - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The Stripe account for which the setup is intended. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionShippingAddressCollection { - /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for - /// shipping locations. - /// - /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. - pub allowed_countries: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionShippingOptions { - /// The ID of the Shipping Rate to use for this shipping option. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_rate: Option, - - /// Parameters to be passed to Shipping Rate creation for this shipping option. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_rate_data: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionSubscriptionData { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - /// To use an application fee percent, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. - /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_percent: Option, - - /// A future timestamp to anchor the subscription's billing cycle for new subscriptions. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_cycle_anchor: Option, - - /// The tax rates that will apply to any subscription item that does not have - /// `tax_rates` set. - /// - /// Invoices created will have their `default_tax_rates` populated from the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - /// The subscription's description, meant to be displayable to the customer. - /// Use this field to optionally store an explanation of the subscription - /// for rendering in the [customer portal](https://stripe.com/docs/customer-management). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The account on behalf of which to charge, for each of the subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, - - /// Determines how to handle prorations resulting from the `billing_cycle_anchor`. - /// - /// If no value is passed, the default is `create_prorations`. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_behavior: Option, - - /// If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// Unix timestamp representing the end of the trial period the customer - /// will get before being charged for the first time. - /// - /// Has to be at least 48 hours in the future. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_end: Option, - - /// Integer representing the number of trial period days before the - /// customer is charged for the first time. - /// - /// Has to be at least 1. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_period_days: Option, - - /// Settings related to subscription trials. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_settings: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionTaxIdCollection { - /// Set to true to enable Tax ID collection. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ListCheckoutSessionsCustomerDetails { - /// Customer's email address. - pub email: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionAfterExpirationRecovery { - /// Enables user redeemable promotion codes on the recovered Checkout Sessions. - /// - /// Defaults to `false`. - #[serde(skip_serializing_if = "Option::is_none")] - pub allow_promotion_codes: Option, - - /// If `true`, a recovery URL will be generated to recover this Checkout Session if it - /// expires before a successful transaction is completed. - /// - /// It will be attached to the Checkout Session object upon expiration. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomFieldsDropdown { - /// The options available for the customer to select. - /// - /// Up to 200 options allowed. - pub options: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomFieldsLabel { - /// Custom text for the label, displayed to the customer. - /// - /// Up to 50 characters. - pub custom: String, - - /// The type of the label. - #[serde(rename = "type")] - pub type_: CreateCheckoutSessionCustomFieldsLabelType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomFieldsNumeric { - /// The maximum character length constraint for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum_length: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomFieldsText { - /// The maximum character length constraint for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum_length: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomTextShippingAddress { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomTextSubmit { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomTextTermsOfServiceAcceptance { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionInvoiceCreationInvoiceData { - /// The account tax IDs associated with the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_tax_ids: Option>, - - /// Default custom fields to be displayed on invoices for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Default footer to be displayed on invoices for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub footer: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Default options for invoice PDF rendering for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub rendering_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionLineItemsAdjustableQuantity { - /// Set to true if the quantity can be adjusted to any non-negative integer. - /// - /// By default customers will be able to remove the line item by setting the quantity to 0. - pub enabled: bool, - - /// The maximum quantity the customer can purchase for the Checkout Session. - /// - /// By default this value is 99. - /// You can specify a value up to 999999. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: Option, - - /// The minimum quantity the customer must purchase for the Checkout Session. - /// - /// By default this value is 0. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionLineItemsPriceData { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of the product that this price will belong to. - /// - /// One of `product` or `product_data` is required. - #[serde(skip_serializing_if = "Option::is_none")] - pub product: Option, - - /// Data used to generate a new product object inline. - /// - /// One of `product` or `product_data` is required. - #[serde(skip_serializing_if = "Option::is_none")] - pub product_data: Option, - - /// The recurring components of a price such as `interval` and `interval_count`. - #[serde(skip_serializing_if = "Option::is_none")] - pub recurring: Option, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A non-negative integer in cents (or local equivalent) representing how much to charge. - /// - /// One of `unit_amount` or `unit_amount_decimal` is required. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentIntentDataShipping { - /// Shipping address. - pub address: CreateCheckoutSessionPaymentIntentDataShippingAddress, - - /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - #[serde(skip_serializing_if = "Option::is_none")] - pub carrier: Option, - - /// Recipient name. - pub name: String, - - /// Recipient phone (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// The tracking number for a physical product, obtained from the delivery service. - /// - /// If multiple tracking numbers were generated for this purchase, please separate them with commas. - #[serde(skip_serializing_if = "Option::is_none")] - pub tracking_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentIntentDataTransferData { - /// The amount that will be transferred automatically when a charge succeeds. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// If specified, successful charges will be attributed to the destination - /// account for tax reporting, and the funds from charges will be transferred - /// to the destination account. - /// - /// The ID of the resulting transfer will be returned on the successful charge's `transfer` field. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsAcssDebit { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - /// This is only accepted for Checkout Sessions in `setup` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsAffirm { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsAlipay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsAuBecsDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsBacsDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsBancontact { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsBoleto { - /// The number of calendar days before a Boleto voucher expires. - /// - /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsCard { - /// Installment options for card payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub installments: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kana: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 17 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kanji: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsCashapp { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalance { - /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub funding_type: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsEps { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsFpx { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsGiropay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsGrabpay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsIdeal { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsKlarna { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsKonbini { - /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. - /// - /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. - /// Defaults to 3 days. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsLink { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsOxxo { - /// The number of calendar days before an OXXO voucher expires. - /// - /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsP24 { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Confirm that the payer has accepted the P24 terms and conditions. - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_shown_and_accepted: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsPaynow { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsPaypal { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locale: Option, - - /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. - /// - /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// The risk correlation ID for an on-session payment using a saved PayPal payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub risk_correlation_id: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsPix { - /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. - /// - /// Defaults to 86400 seconds. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_seconds: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsSepaDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsSofort { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsUsBankAccount { - /// Additional fields for Financial Connections Session creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: - Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsWechatPay { - /// The app ID registered with WeChat Pay. - /// - /// Only required when client is ios or android. - #[serde(skip_serializing_if = "Option::is_none")] - pub app_id: Option, - - /// The client type that the end customer will pay from. - pub client: CreateCheckoutSessionPaymentMethodOptionsWechatPayClient, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionShippingOptionsShippingRateData { - /// The estimated range for how long shipping will take, meant to be displayable to the customer. - /// - /// This will appear on CheckoutSessions. - #[serde(skip_serializing_if = "Option::is_none")] - pub delivery_estimate: - Option, - - /// The name of the shipping rate, meant to be displayable to the customer. - /// - /// This will appear on CheckoutSessions. - pub display_name: String, - - /// Describes a fixed amount to charge for shipping. - /// - /// Must be present if type is `fixed_amount`. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amount: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - /// - /// The Shipping tax code is `txcd_92010001`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, - - /// The type of calculation to use on the shipping rate. - /// - /// Can only be `fixed_amount` for now. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionSubscriptionDataTransferData { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. - /// By default, the entire amount is transferred to the destination. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_percent: Option, - - /// ID of an existing, connected Stripe account. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionSubscriptionDataTrialSettings { - /// Defines how the subscription should behave when the user's free trial ends. - pub end_behavior: CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomFieldsDropdownOptions { - /// The label for the option, displayed to the customer. - /// - /// Up to 100 characters. - pub label: String, - - /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. - /// - /// Must be unique to this option, alphanumeric, and up to 100 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionInvoiceCreationInvoiceDataCustomFields { - /// The name of the custom field. - /// - /// This may be up to 30 characters. - pub name: String, - - /// The value of the custom field. - /// - /// This may be up to 30 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptions { - /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. - /// - /// One of `exclude_tax` or `include_inclusive_tax`. - /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. - /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_tax_display: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionLineItemsPriceDataProductData { - /// The product's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub images: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The product's name, meant to be displayable to the customer. - pub name: String, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionLineItemsPriceDataRecurring { - /// Specifies billing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: CreateCheckoutSessionLineItemsPriceDataRecurringInterval, - - /// The number of intervals between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentIntentDataShippingAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - pub line1: String, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptions { - /// A URL for custom mandate text to render during confirmation step. - /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_mandate_url: Option, - - /// List of Stripe products where this mandate can be selected automatically. - /// - /// Only usable in `setup` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_for: - Option>, - - /// Description of the mandate interval. - /// - /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_description: Option, - - /// Payment schedule for the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_schedule: - Option, - - /// Transaction type of the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_type: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsCardInstallments { - /// Setting to true enables installments for this Checkout Session. - /// Setting to false will prevent any installment plan from applying to a payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransfer { - - /// Configuration for eu_bank_transfer funding type. - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: Option, - - /// List of address types that should be returned in the financial_addresses response. - /// - /// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested_address_types: Option>, - - /// The list of bank transfer types that this PaymentIntent is allowed to use for funding. - #[serde(rename = "type")] - pub type_: CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnections { - /// The list of permissions to request. - /// - /// If this parameter is passed, the `payment_method` permission must be included. - /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option< - Vec, - >, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: Option< - Vec, - >, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimate { - /// The upper bound of the estimated range. - /// - /// If empty, represents no upper bound i.e., infinite. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: - Option, - - /// The lower bound of the estimated range. - /// - /// If empty, represents no lower bound. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmount { - /// A non-negative integer in cents representing how much to charge. - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Shipping rates defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option< - CurrencyMap, - >, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior { - /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. - pub missing_payment_method: - CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer { - /// The desired country code of the bank account information. - /// - /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. - pub country: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum { - /// A unit of time. - pub unit: CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit, - - /// Must be greater than 0. - pub value: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum { - /// A unit of time. - pub unit: CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit, - - /// Must be greater than 0. - pub value: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions { - /// A non-negative integer in cents representing how much to charge. - pub amount: i64, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option< - CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior, - >, -} - -/// An enum representing the possible values of an `CheckoutAcssDebitMandateOptions`'s `default_for` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAcssDebitMandateOptionsDefaultFor { - Invoice, - Subscription, -} - -impl CheckoutAcssDebitMandateOptionsDefaultFor { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAcssDebitMandateOptionsDefaultFor::Invoice => "invoice", - CheckoutAcssDebitMandateOptionsDefaultFor::Subscription => "subscription", - } - } -} - -impl AsRef for CheckoutAcssDebitMandateOptionsDefaultFor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAcssDebitMandateOptionsDefaultFor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAcssDebitMandateOptionsDefaultFor { - fn default() -> Self { - Self::Invoice - } -} - -/// An enum representing the possible values of an `CheckoutAcssDebitMandateOptions`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAcssDebitMandateOptionsPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl CheckoutAcssDebitMandateOptionsPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAcssDebitMandateOptionsPaymentSchedule::Combined => "combined", - CheckoutAcssDebitMandateOptionsPaymentSchedule::Interval => "interval", - CheckoutAcssDebitMandateOptionsPaymentSchedule::Sporadic => "sporadic", - } - } -} - -impl AsRef for CheckoutAcssDebitMandateOptionsPaymentSchedule { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAcssDebitMandateOptionsPaymentSchedule { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAcssDebitMandateOptionsPaymentSchedule { - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `CheckoutAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAcssDebitMandateOptionsTransactionType { - Business, - Personal, -} - -impl CheckoutAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAcssDebitMandateOptionsTransactionType::Business => "business", - CheckoutAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef for CheckoutAcssDebitMandateOptionsTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAcssDebitMandateOptionsTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAcssDebitMandateOptionsTransactionType { - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `CheckoutAcssDebitPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutAcssDebitPaymentMethodOptions`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAcssDebitPaymentMethodOptionsVerificationMethod::Automatic => "automatic", - CheckoutAcssDebitPaymentMethodOptionsVerificationMethod::Instant => "instant", - CheckoutAcssDebitPaymentMethodOptionsVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CheckoutAffirmPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAffirmPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutAfterpayClearpayPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutAlipayPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAlipayPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutAuBecsDebitPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutBacsDebitPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutBancontactPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutBancontactPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutBoletoPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutBoletoPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutBoletoPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - CheckoutBoletoPaymentMethodOptionsSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutCardPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutCardPaymentMethodOptionsSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CheckoutCardPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutCardPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutCardPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - CheckoutCardPaymentMethodOptionsSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CheckoutCardPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutCardPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutCardPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutCashappPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutCashappPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutCashappPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutCashappPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutCustomerBalanceBankTransferPaymentMethodOptions`'s `requested_address_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes { - Aba, - Iban, - Sepa, - SortCode, - Spei, - Swift, - Zengin, -} - -impl CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes { - pub fn as_str(self) -> &'static str { - match self { - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::Aba => "aba", - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::Iban => "iban", - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::Sepa => "sepa", - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::SortCode => "sort_code", - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::Spei => "spei", - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::Swift => "swift", - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::Zengin => "zengin", - } - } -} - -impl AsRef for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes -{ - fn default() -> Self { - Self::Aba - } -} - -/// An enum representing the possible values of an `CheckoutCustomerBalanceBankTransferPaymentMethodOptions`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { - EuBankTransfer, - GbBankTransfer, - JpBankTransfer, - MxBankTransfer, - UsBankTransfer, -} - -impl CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { - pub fn as_str(self) -> &'static str { - match self { - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType::EuBankTransfer => { - "eu_bank_transfer" - } - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType::GbBankTransfer => { - "gb_bank_transfer" - } - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType::JpBankTransfer => { - "jp_bank_transfer" - } - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType::MxBankTransfer => { - "mx_bank_transfer" - } - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType::UsBankTransfer => { - "us_bank_transfer" - } - } - } -} - -impl AsRef for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { - fn default() -> Self { - Self::EuBankTransfer - } -} - -/// An enum representing the possible values of an `CheckoutCustomerBalancePaymentMethodOptions`'s `funding_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutCustomerBalancePaymentMethodOptionsFundingType { - BankTransfer, -} - -impl CheckoutCustomerBalancePaymentMethodOptionsFundingType { - pub fn as_str(self) -> &'static str { - match self { - CheckoutCustomerBalancePaymentMethodOptionsFundingType::BankTransfer => "bank_transfer", - } - } -} - -impl AsRef for CheckoutCustomerBalancePaymentMethodOptionsFundingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutCustomerBalancePaymentMethodOptionsFundingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutCustomerBalancePaymentMethodOptionsFundingType { - fn default() -> Self { - Self::BankTransfer - } -} - -/// An enum representing the possible values of an `CheckoutCustomerBalancePaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutEpsPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutEpsPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutEpsPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutEpsPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutEpsPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutEpsPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutEpsPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutFpxPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutFpxPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutFpxPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutFpxPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutFpxPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutFpxPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutFpxPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutGiropayPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutGiropayPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutGrabPayPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutIdealPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutIdealPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutIdealPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutIdealPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutIdealPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutIdealPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutIdealPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutKlarnaPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutKonbiniPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutLinkPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutLinkPaymentMethodOptionsSetupFutureUsage { - None, - OffSession, -} - -impl CheckoutLinkPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutLinkPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutLinkPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - } - } -} - -impl AsRef for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutOxxoPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutOxxoPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutP24PaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutP24PaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutP24PaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutP24PaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutP24PaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutP24PaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutP24PaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutPaynowPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutPaynowPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutSepaDebitPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `billing_address_collection` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionBillingAddressCollection { - Auto, - Required, -} - -impl CheckoutSessionBillingAddressCollection { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionBillingAddressCollection::Auto => "auto", - CheckoutSessionBillingAddressCollection::Required => "required", - } - } -} - -impl AsRef for CheckoutSessionBillingAddressCollection { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionBillingAddressCollection { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionBillingAddressCollection { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `customer_creation` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionCustomerCreation { - Always, - IfRequired, -} - -impl CheckoutSessionCustomerCreation { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionCustomerCreation::Always => "always", - CheckoutSessionCustomerCreation::IfRequired => "if_required", - } - } -} - -impl AsRef for CheckoutSessionCustomerCreation { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionCustomerCreation { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionCustomerCreation { - fn default() -> Self { - Self::Always - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `locale` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionLocale { - Auto, - Bg, - Cs, - Da, - De, - El, - En, - #[serde(rename = "en-GB")] - EnGb, - Es, - #[serde(rename = "es-419")] - Es419, - Et, - Fi, - Fil, - Fr, - #[serde(rename = "fr-CA")] - FrCa, - Hr, - Hu, - Id, - It, - Ja, - Ko, - Lt, - Lv, - Ms, - Mt, - Nb, - Nl, - Pl, - Pt, - #[serde(rename = "pt-BR")] - PtBr, - Ro, - Ru, - Sk, - Sl, - Sv, - Th, - Tr, - Vi, - Zh, - #[serde(rename = "zh-HK")] - ZhHk, - #[serde(rename = "zh-TW")] - ZhTw, -} - -impl CheckoutSessionLocale { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionLocale::Auto => "auto", - CheckoutSessionLocale::Bg => "bg", - CheckoutSessionLocale::Cs => "cs", - CheckoutSessionLocale::Da => "da", - CheckoutSessionLocale::De => "de", - CheckoutSessionLocale::El => "el", - CheckoutSessionLocale::En => "en", - CheckoutSessionLocale::EnGb => "en-GB", - CheckoutSessionLocale::Es => "es", - CheckoutSessionLocale::Es419 => "es-419", - CheckoutSessionLocale::Et => "et", - CheckoutSessionLocale::Fi => "fi", - CheckoutSessionLocale::Fil => "fil", - CheckoutSessionLocale::Fr => "fr", - CheckoutSessionLocale::FrCa => "fr-CA", - CheckoutSessionLocale::Hr => "hr", - CheckoutSessionLocale::Hu => "hu", - CheckoutSessionLocale::Id => "id", - CheckoutSessionLocale::It => "it", - CheckoutSessionLocale::Ja => "ja", - CheckoutSessionLocale::Ko => "ko", - CheckoutSessionLocale::Lt => "lt", - CheckoutSessionLocale::Lv => "lv", - CheckoutSessionLocale::Ms => "ms", - CheckoutSessionLocale::Mt => "mt", - CheckoutSessionLocale::Nb => "nb", - CheckoutSessionLocale::Nl => "nl", - CheckoutSessionLocale::Pl => "pl", - CheckoutSessionLocale::Pt => "pt", - CheckoutSessionLocale::PtBr => "pt-BR", - CheckoutSessionLocale::Ro => "ro", - CheckoutSessionLocale::Ru => "ru", - CheckoutSessionLocale::Sk => "sk", - CheckoutSessionLocale::Sl => "sl", - CheckoutSessionLocale::Sv => "sv", - CheckoutSessionLocale::Th => "th", - CheckoutSessionLocale::Tr => "tr", - CheckoutSessionLocale::Vi => "vi", - CheckoutSessionLocale::Zh => "zh", - CheckoutSessionLocale::ZhHk => "zh-HK", - CheckoutSessionLocale::ZhTw => "zh-TW", - } - } -} - -impl AsRef for CheckoutSessionLocale { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionLocale { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionLocale { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `mode` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionMode { - Payment, - Setup, - Subscription, -} - -impl CheckoutSessionMode { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionMode::Payment => "payment", - CheckoutSessionMode::Setup => "setup", - CheckoutSessionMode::Subscription => "subscription", - } - } -} - -impl AsRef for CheckoutSessionMode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionMode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionMode { - fn default() -> Self { - Self::Payment - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `payment_method_collection` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionPaymentMethodCollection { - Always, - IfRequired, -} - -impl CheckoutSessionPaymentMethodCollection { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionPaymentMethodCollection::Always => "always", - CheckoutSessionPaymentMethodCollection::IfRequired => "if_required", - } - } -} - -impl AsRef for CheckoutSessionPaymentMethodCollection { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionPaymentMethodCollection { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionPaymentMethodCollection { - fn default() -> Self { - Self::Always - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `payment_status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionPaymentStatus { - NoPaymentRequired, - Paid, - Unpaid, -} - -impl CheckoutSessionPaymentStatus { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionPaymentStatus::NoPaymentRequired => "no_payment_required", - CheckoutSessionPaymentStatus::Paid => "paid", - CheckoutSessionPaymentStatus::Unpaid => "unpaid", - } - } -} - -impl AsRef for CheckoutSessionPaymentStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionPaymentStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionPaymentStatus { - fn default() -> Self { - Self::NoPaymentRequired - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionStatus { - Complete, - Expired, - Open, -} - -impl CheckoutSessionStatus { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionStatus::Complete => "complete", - CheckoutSessionStatus::Expired => "expired", - CheckoutSessionStatus::Open => "open", - } - } -} - -impl AsRef for CheckoutSessionStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionStatus { - fn default() -> Self { - Self::Complete - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `submit_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionSubmitType { - Auto, - Book, - Donate, - Pay, -} - -impl CheckoutSessionSubmitType { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionSubmitType::Auto => "auto", - CheckoutSessionSubmitType::Book => "book", - CheckoutSessionSubmitType::Donate => "donate", - CheckoutSessionSubmitType::Pay => "pay", - } - } -} - -impl AsRef for CheckoutSessionSubmitType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionSubmitType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionSubmitType { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CheckoutSofortPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSofortPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutSofortPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSofortPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutSofortPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSofortPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSofortPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutUsBankAccountPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutUsBankAccountPaymentMethodOptions`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { - Automatic, - Instant, -} - -impl CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod::Automatic => "automatic", - CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod::Instant => "instant", - } - } -} - -impl AsRef for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionConsentCollection`'s `promotions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionConsentCollectionPromotions { - Auto, - None, -} - -impl CreateCheckoutSessionConsentCollectionPromotions { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionConsentCollectionPromotions::Auto => "auto", - CreateCheckoutSessionConsentCollectionPromotions::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionConsentCollectionPromotions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionConsentCollectionPromotions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionConsentCollectionPromotions { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionConsentCollection`'s `terms_of_service` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionConsentCollectionTermsOfService { - None, - Required, -} - -impl CreateCheckoutSessionConsentCollectionTermsOfService { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionConsentCollectionTermsOfService::None => "none", - CreateCheckoutSessionConsentCollectionTermsOfService::Required => "required", - } - } -} - -impl AsRef for CreateCheckoutSessionConsentCollectionTermsOfService { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionConsentCollectionTermsOfService { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionConsentCollectionTermsOfService { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionCustomFieldsLabel`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionCustomFieldsLabelType { - Custom, -} - -impl CreateCheckoutSessionCustomFieldsLabelType { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionCustomFieldsLabelType::Custom => "custom", - } - } -} - -impl AsRef for CreateCheckoutSessionCustomFieldsLabelType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionCustomFieldsLabelType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionCustomFieldsLabelType { - fn default() -> Self { - Self::Custom - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionCustomFields`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionCustomFieldsType { - Dropdown, - Numeric, - Text, -} - -impl CreateCheckoutSessionCustomFieldsType { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionCustomFieldsType::Dropdown => "dropdown", - CreateCheckoutSessionCustomFieldsType::Numeric => "numeric", - CreateCheckoutSessionCustomFieldsType::Text => "text", - } - } -} - -impl AsRef for CreateCheckoutSessionCustomFieldsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionCustomFieldsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionCustomFieldsType { - fn default() -> Self { - Self::Dropdown - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionCustomerUpdate`'s `address` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionCustomerUpdateAddress { - Auto, - Never, -} - -impl CreateCheckoutSessionCustomerUpdateAddress { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionCustomerUpdateAddress::Auto => "auto", - CreateCheckoutSessionCustomerUpdateAddress::Never => "never", - } - } -} - -impl AsRef for CreateCheckoutSessionCustomerUpdateAddress { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionCustomerUpdateAddress { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionCustomerUpdateAddress { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionCustomerUpdate`'s `name` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionCustomerUpdateName { - Auto, - Never, -} - -impl CreateCheckoutSessionCustomerUpdateName { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionCustomerUpdateName::Auto => "auto", - CreateCheckoutSessionCustomerUpdateName::Never => "never", - } - } -} - -impl AsRef for CreateCheckoutSessionCustomerUpdateName { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionCustomerUpdateName { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionCustomerUpdateName { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionCustomerUpdate`'s `shipping` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionCustomerUpdateShipping { - Auto, - Never, -} - -impl CreateCheckoutSessionCustomerUpdateShipping { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionCustomerUpdateShipping::Auto => "auto", - CreateCheckoutSessionCustomerUpdateShipping::Never => "never", - } - } -} - -impl AsRef for CreateCheckoutSessionCustomerUpdateShipping { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionCustomerUpdateShipping { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionCustomerUpdateShipping { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptions`'s `amount_tax_display` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { - ExcludeTax, - IncludeInclusiveTax, -} - -impl CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::ExcludeTax => "exclude_tax", - CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::IncludeInclusiveTax => "include_inclusive_tax", - } - } -} - -impl AsRef - for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay -{ - fn default() -> Self { - Self::ExcludeTax - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionLineItemsPriceDataRecurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionLineItemsPriceDataRecurringInterval { - Day, - Month, - Week, - Year, -} - -impl CreateCheckoutSessionLineItemsPriceDataRecurringInterval { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionLineItemsPriceDataRecurringInterval::Day => "day", - CreateCheckoutSessionLineItemsPriceDataRecurringInterval::Month => "month", - CreateCheckoutSessionLineItemsPriceDataRecurringInterval::Week => "week", - CreateCheckoutSessionLineItemsPriceDataRecurringInterval::Year => "year", - } - } -} - -impl AsRef for CreateCheckoutSessionLineItemsPriceDataRecurringInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionLineItemsPriceDataRecurringInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionLineItemsPriceDataRecurringInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionLineItemsPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionLineItemsPriceDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreateCheckoutSessionLineItemsPriceDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionLineItemsPriceDataTaxBehavior::Exclusive => "exclusive", - CreateCheckoutSessionLineItemsPriceDataTaxBehavior::Inclusive => "inclusive", - CreateCheckoutSessionLineItemsPriceDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for CreateCheckoutSessionLineItemsPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionLineItemsPriceDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionLineItemsPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentIntentData`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentIntentDataCaptureMethod { - Automatic, - AutomaticAsync, - Manual, -} - -impl CreateCheckoutSessionPaymentIntentDataCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentIntentDataCaptureMethod::Automatic => "automatic", - CreateCheckoutSessionPaymentIntentDataCaptureMethod::AutomaticAsync => { - "automatic_async" - } - CreateCheckoutSessionPaymentIntentDataCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentIntentDataCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentIntentDataCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentIntentDataCaptureMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentIntentData`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentIntentDataSetupFutureUsage { - OffSession, - OnSession, -} - -impl CreateCheckoutSessionPaymentIntentDataSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentIntentDataSetupFutureUsage::OffSession => "off_session", - CreateCheckoutSessionPaymentIntentDataSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentIntentDataSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentIntentDataSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentIntentDataSetupFutureUsage { - fn default() -> Self { - Self::OffSession - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptions`'s `default_for` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - Invoice, - Subscription, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::Invoice => "invoice", - CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::Subscription => "subscription", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor -{ - fn default() -> Self { - Self::Invoice - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptions`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Combined => "combined", - CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Interval => "interval", - CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Sporadic => "sporadic", - } - } -} - -impl AsRef - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - Business, - Personal, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business", - CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAcssDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage::None => "none", - CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage::OffSession => { - "off_session" - } - CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => { - "automatic" - } - CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod::Instant => { - "instant" - } - CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAffirm`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::None => { - "none" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAlipay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAuBecsDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsBacsDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage::None => "none", - CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage::OffSession => { - "off_session" - } - CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsBancontact`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsBoleto`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage::None => "none", - CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage::OffSession => { - "off_session" - } - CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCard`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage { - OffSession, - OnSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage::OffSession => { - "off_session" - } - CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage { - fn default() -> Self { - Self::OffSession - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCashapp`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage::None => "none", - CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage::OffSession => { - "off_session" - } - CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransfer`'s `requested_address_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - Aba, - Iban, - Sepa, - SortCode, - Spei, - Swift, - Zengin, -} - -impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Aba => "aba", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Iban => "iban", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Sepa => "sepa", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::SortCode => "sort_code", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Spei => "spei", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Swift => "swift", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Zengin => "zengin", - } - } -} - -impl AsRef - for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn default() -> Self { - Self::Aba - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransfer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType { - EuBankTransfer, - GbBankTransfer, - JpBankTransfer, - MxBankTransfer, - UsBankTransfer, -} - -impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType::EuBankTransfer => "eu_bank_transfer", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType::GbBankTransfer => "gb_bank_transfer", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType::JpBankTransfer => "jp_bank_transfer", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType::MxBankTransfer => "mx_bank_transfer", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType::UsBankTransfer => "us_bank_transfer", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType -{ - fn default() -> Self { - Self::EuBankTransfer - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCustomerBalance`'s `funding_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType { - BankTransfer, -} - -impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType::BankTransfer => { - "bank_transfer" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType { - fn default() -> Self { - Self::BankTransfer - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCustomerBalance`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage::None => { - "none" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsEps`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsFpx`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsGiropay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsGrabpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsIdeal`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsKlarna`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsKonbini`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsLink`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { - None, - OffSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage::None => "none", - CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsOxxo`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsP24`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsPaynow`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsPaypal`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod { - Manual, -} - -impl CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsPaypal`'s `preferred_locale` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale { - #[serde(rename = "cs-CZ")] - CsCz, - #[serde(rename = "da-DK")] - DaDk, - #[serde(rename = "de-AT")] - DeAt, - #[serde(rename = "de-DE")] - DeDe, - #[serde(rename = "de-LU")] - DeLu, - #[serde(rename = "el-GR")] - ElGr, - #[serde(rename = "en-GB")] - EnGb, - #[serde(rename = "en-US")] - EnUs, - #[serde(rename = "es-ES")] - EsEs, - #[serde(rename = "fi-FI")] - FiFi, - #[serde(rename = "fr-BE")] - FrBe, - #[serde(rename = "fr-FR")] - FrFr, - #[serde(rename = "fr-LU")] - FrLu, - #[serde(rename = "hu-HU")] - HuHu, - #[serde(rename = "it-IT")] - ItIt, - #[serde(rename = "nl-BE")] - NlBe, - #[serde(rename = "nl-NL")] - NlNl, - #[serde(rename = "pl-PL")] - PlPl, - #[serde(rename = "pt-PT")] - PtPt, - #[serde(rename = "sk-SK")] - SkSk, - #[serde(rename = "sv-SE")] - SvSe, -} - -impl CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::CsCz => "cs-CZ", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::DaDk => "da-DK", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::DeAt => "de-AT", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::DeDe => "de-DE", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::DeLu => "de-LU", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::ElGr => "el-GR", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::EnGb => "en-GB", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::EnUs => "en-US", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::EsEs => "es-ES", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::FiFi => "fi-FI", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::FrBe => "fr-BE", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::FrFr => "fr-FR", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::FrLu => "fr-LU", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::HuHu => "hu-HU", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::ItIt => "it-IT", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::NlBe => "nl-BE", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::NlNl => "nl-NL", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::PlPl => "pl-PL", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::PtPt => "pt-PT", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::SkSk => "sk-SK", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::SvSe => "sv-SE", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale { - fn default() -> Self { - Self::CsCz - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsPaypal`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage { - None, - OffSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage::None => "none", - CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsSepaDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage::None => "none", - CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage::OffSession => { - "off_session" - } - CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsSofort`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances", - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership", - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method", - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - Balances, -} - -impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", - } - } -} - -impl AsRef - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsUsBankAccount`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage::None => "none", - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage::OffSession => { - "off_session" - } - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, -} - -impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => { - "automatic" - } - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => { - "instant" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsWechatPay`'s `client` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsWechatPayClient { - Android, - Ios, - Web, -} - -impl CreateCheckoutSessionPaymentMethodOptionsWechatPayClient { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsWechatPayClient::Android => "android", - CreateCheckoutSessionPaymentMethodOptionsWechatPayClient::Ios => "ios", - CreateCheckoutSessionPaymentMethodOptionsWechatPayClient::Web => "web", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsWechatPayClient { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsWechatPayClient { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsWechatPayClient { - fn default() -> Self { - Self::Android - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsWechatPay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSession`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodTypes { - AcssDebit, - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Card, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, - Zip, -} - -impl CreateCheckoutSessionPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodTypes::AcssDebit => "acss_debit", - CreateCheckoutSessionPaymentMethodTypes::Affirm => "affirm", - CreateCheckoutSessionPaymentMethodTypes::AfterpayClearpay => "afterpay_clearpay", - CreateCheckoutSessionPaymentMethodTypes::Alipay => "alipay", - CreateCheckoutSessionPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - CreateCheckoutSessionPaymentMethodTypes::BacsDebit => "bacs_debit", - CreateCheckoutSessionPaymentMethodTypes::Bancontact => "bancontact", - CreateCheckoutSessionPaymentMethodTypes::Blik => "blik", - CreateCheckoutSessionPaymentMethodTypes::Boleto => "boleto", - CreateCheckoutSessionPaymentMethodTypes::Card => "card", - CreateCheckoutSessionPaymentMethodTypes::Cashapp => "cashapp", - CreateCheckoutSessionPaymentMethodTypes::CustomerBalance => "customer_balance", - CreateCheckoutSessionPaymentMethodTypes::Eps => "eps", - CreateCheckoutSessionPaymentMethodTypes::Fpx => "fpx", - CreateCheckoutSessionPaymentMethodTypes::Giropay => "giropay", - CreateCheckoutSessionPaymentMethodTypes::Grabpay => "grabpay", - CreateCheckoutSessionPaymentMethodTypes::Ideal => "ideal", - CreateCheckoutSessionPaymentMethodTypes::Klarna => "klarna", - CreateCheckoutSessionPaymentMethodTypes::Konbini => "konbini", - CreateCheckoutSessionPaymentMethodTypes::Link => "link", - CreateCheckoutSessionPaymentMethodTypes::Oxxo => "oxxo", - CreateCheckoutSessionPaymentMethodTypes::P24 => "p24", - CreateCheckoutSessionPaymentMethodTypes::Paynow => "paynow", - CreateCheckoutSessionPaymentMethodTypes::Paypal => "paypal", - CreateCheckoutSessionPaymentMethodTypes::Pix => "pix", - CreateCheckoutSessionPaymentMethodTypes::Promptpay => "promptpay", - CreateCheckoutSessionPaymentMethodTypes::SepaDebit => "sepa_debit", - CreateCheckoutSessionPaymentMethodTypes::Sofort => "sofort", - CreateCheckoutSessionPaymentMethodTypes::UsBankAccount => "us_bank_account", - CreateCheckoutSessionPaymentMethodTypes::WechatPay => "wechat_pay", - CreateCheckoutSessionPaymentMethodTypes::Zip => "zip", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodTypes { - fn default() -> Self { - Self::AcssDebit - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionShippingAddressCollection`'s `allowed_countries` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionShippingAddressCollectionAllowedCountries { - #[serde(rename = "AC")] - Ac, - #[serde(rename = "AD")] - Ad, - #[serde(rename = "AE")] - Ae, - #[serde(rename = "AF")] - Af, - #[serde(rename = "AG")] - Ag, - #[serde(rename = "AI")] - Ai, - #[serde(rename = "AL")] - Al, - #[serde(rename = "AM")] - Am, - #[serde(rename = "AO")] - Ao, - #[serde(rename = "AQ")] - Aq, - #[serde(rename = "AR")] - Ar, - #[serde(rename = "AT")] - At, - #[serde(rename = "AU")] - Au, - #[serde(rename = "AW")] - Aw, - #[serde(rename = "AX")] - Ax, - #[serde(rename = "AZ")] - Az, - #[serde(rename = "BA")] - Ba, - #[serde(rename = "BB")] - Bb, - #[serde(rename = "BD")] - Bd, - #[serde(rename = "BE")] - Be, - #[serde(rename = "BF")] - Bf, - #[serde(rename = "BG")] - Bg, - #[serde(rename = "BH")] - Bh, - #[serde(rename = "BI")] - Bi, - #[serde(rename = "BJ")] - Bj, - #[serde(rename = "BL")] - Bl, - #[serde(rename = "BM")] - Bm, - #[serde(rename = "BN")] - Bn, - #[serde(rename = "BO")] - Bo, - #[serde(rename = "BQ")] - Bq, - #[serde(rename = "BR")] - Br, - #[serde(rename = "BS")] - Bs, - #[serde(rename = "BT")] - Bt, - #[serde(rename = "BV")] - Bv, - #[serde(rename = "BW")] - Bw, - #[serde(rename = "BY")] - By, - #[serde(rename = "BZ")] - Bz, - #[serde(rename = "CA")] - Ca, - #[serde(rename = "CD")] - Cd, - #[serde(rename = "CF")] - Cf, - #[serde(rename = "CG")] - Cg, - #[serde(rename = "CH")] - Ch, - #[serde(rename = "CI")] - Ci, - #[serde(rename = "CK")] - Ck, - #[serde(rename = "CL")] - Cl, - #[serde(rename = "CM")] - Cm, - #[serde(rename = "CN")] - Cn, - #[serde(rename = "CO")] - Co, - #[serde(rename = "CR")] - Cr, - #[serde(rename = "CV")] - Cv, - #[serde(rename = "CW")] - Cw, - #[serde(rename = "CY")] - Cy, - #[serde(rename = "CZ")] - Cz, - #[serde(rename = "DE")] - De, - #[serde(rename = "DJ")] - Dj, - #[serde(rename = "DK")] - Dk, - #[serde(rename = "DM")] - Dm, - #[serde(rename = "DO")] - Do, - #[serde(rename = "DZ")] - Dz, - #[serde(rename = "EC")] - Ec, - #[serde(rename = "EE")] - Ee, - #[serde(rename = "EG")] - Eg, - #[serde(rename = "EH")] - Eh, - #[serde(rename = "ER")] - Er, - #[serde(rename = "ES")] - Es, - #[serde(rename = "ET")] - Et, - #[serde(rename = "FI")] - Fi, - #[serde(rename = "FJ")] - Fj, - #[serde(rename = "FK")] - Fk, - #[serde(rename = "FO")] - Fo, - #[serde(rename = "FR")] - Fr, - #[serde(rename = "GA")] - Ga, - #[serde(rename = "GB")] - Gb, - #[serde(rename = "GD")] - Gd, - #[serde(rename = "GE")] - Ge, - #[serde(rename = "GF")] - Gf, - #[serde(rename = "GG")] - Gg, - #[serde(rename = "GH")] - Gh, - #[serde(rename = "GI")] - Gi, - #[serde(rename = "GL")] - Gl, - #[serde(rename = "GM")] - Gm, - #[serde(rename = "GN")] - Gn, - #[serde(rename = "GP")] - Gp, - #[serde(rename = "GQ")] - Gq, - #[serde(rename = "GR")] - Gr, - #[serde(rename = "GS")] - Gs, - #[serde(rename = "GT")] - Gt, - #[serde(rename = "GU")] - Gu, - #[serde(rename = "GW")] - Gw, - #[serde(rename = "GY")] - Gy, - #[serde(rename = "HK")] - Hk, - #[serde(rename = "HN")] - Hn, - #[serde(rename = "HR")] - Hr, - #[serde(rename = "HT")] - Ht, - #[serde(rename = "HU")] - Hu, - #[serde(rename = "ID")] - Id, - #[serde(rename = "IE")] - Ie, - #[serde(rename = "IL")] - Il, - #[serde(rename = "IM")] - Im, - #[serde(rename = "IN")] - In, - #[serde(rename = "IO")] - Io, - #[serde(rename = "IQ")] - Iq, - #[serde(rename = "IS")] - Is, - #[serde(rename = "IT")] - It, - #[serde(rename = "JE")] - Je, - #[serde(rename = "JM")] - Jm, - #[serde(rename = "JO")] - Jo, - #[serde(rename = "JP")] - Jp, - #[serde(rename = "KE")] - Ke, - #[serde(rename = "KG")] - Kg, - #[serde(rename = "KH")] - Kh, - #[serde(rename = "KI")] - Ki, - #[serde(rename = "KM")] - Km, - #[serde(rename = "KN")] - Kn, - #[serde(rename = "KR")] - Kr, - #[serde(rename = "KW")] - Kw, - #[serde(rename = "KY")] - Ky, - #[serde(rename = "KZ")] - Kz, - #[serde(rename = "LA")] - La, - #[serde(rename = "LB")] - Lb, - #[serde(rename = "LC")] - Lc, - #[serde(rename = "LI")] - Li, - #[serde(rename = "LK")] - Lk, - #[serde(rename = "LR")] - Lr, - #[serde(rename = "LS")] - Ls, - #[serde(rename = "LT")] - Lt, - #[serde(rename = "LU")] - Lu, - #[serde(rename = "LV")] - Lv, - #[serde(rename = "LY")] - Ly, - #[serde(rename = "MA")] - Ma, - #[serde(rename = "MC")] - Mc, - #[serde(rename = "MD")] - Md, - #[serde(rename = "ME")] - Me, - #[serde(rename = "MF")] - Mf, - #[serde(rename = "MG")] - Mg, - #[serde(rename = "MK")] - Mk, - #[serde(rename = "ML")] - Ml, - #[serde(rename = "MM")] - Mm, - #[serde(rename = "MN")] - Mn, - #[serde(rename = "MO")] - Mo, - #[serde(rename = "MQ")] - Mq, - #[serde(rename = "MR")] - Mr, - #[serde(rename = "MS")] - Ms, - #[serde(rename = "MT")] - Mt, - #[serde(rename = "MU")] - Mu, - #[serde(rename = "MV")] - Mv, - #[serde(rename = "MW")] - Mw, - #[serde(rename = "MX")] - Mx, - #[serde(rename = "MY")] - My, - #[serde(rename = "MZ")] - Mz, - #[serde(rename = "NA")] - Na, - #[serde(rename = "NC")] - Nc, - #[serde(rename = "NE")] - Ne, - #[serde(rename = "NG")] - Ng, - #[serde(rename = "NI")] - Ni, - #[serde(rename = "NL")] - Nl, - #[serde(rename = "NO")] - No, - #[serde(rename = "NP")] - Np, - #[serde(rename = "NR")] - Nr, - #[serde(rename = "NU")] - Nu, - #[serde(rename = "NZ")] - Nz, - #[serde(rename = "OM")] - Om, - #[serde(rename = "PA")] - Pa, - #[serde(rename = "PE")] - Pe, - #[serde(rename = "PF")] - Pf, - #[serde(rename = "PG")] - Pg, - #[serde(rename = "PH")] - Ph, - #[serde(rename = "PK")] - Pk, - #[serde(rename = "PL")] - Pl, - #[serde(rename = "PM")] - Pm, - #[serde(rename = "PN")] - Pn, - #[serde(rename = "PR")] - Pr, - #[serde(rename = "PS")] - Ps, - #[serde(rename = "PT")] - Pt, - #[serde(rename = "PY")] - Py, - #[serde(rename = "QA")] - Qa, - #[serde(rename = "RE")] - Re, - #[serde(rename = "RO")] - Ro, - #[serde(rename = "RS")] - Rs, - #[serde(rename = "RU")] - Ru, - #[serde(rename = "RW")] - Rw, - #[serde(rename = "SA")] - Sa, - #[serde(rename = "SB")] - Sb, - #[serde(rename = "SC")] - Sc, - #[serde(rename = "SE")] - Se, - #[serde(rename = "SG")] - Sg, - #[serde(rename = "SH")] - Sh, - #[serde(rename = "SI")] - Si, - #[serde(rename = "SJ")] - Sj, - #[serde(rename = "SK")] - Sk, - #[serde(rename = "SL")] - Sl, - #[serde(rename = "SM")] - Sm, - #[serde(rename = "SN")] - Sn, - #[serde(rename = "SO")] - So, - #[serde(rename = "SR")] - Sr, - #[serde(rename = "SS")] - Ss, - #[serde(rename = "ST")] - St, - #[serde(rename = "SV")] - Sv, - #[serde(rename = "SX")] - Sx, - #[serde(rename = "SZ")] - Sz, - #[serde(rename = "TA")] - Ta, - #[serde(rename = "TC")] - Tc, - #[serde(rename = "TD")] - Td, - #[serde(rename = "TF")] - Tf, - #[serde(rename = "TG")] - Tg, - #[serde(rename = "TH")] - Th, - #[serde(rename = "TJ")] - Tj, - #[serde(rename = "TK")] - Tk, - #[serde(rename = "TL")] - Tl, - #[serde(rename = "TM")] - Tm, - #[serde(rename = "TN")] - Tn, - #[serde(rename = "TO")] - To, - #[serde(rename = "TR")] - Tr, - #[serde(rename = "TT")] - Tt, - #[serde(rename = "TV")] - Tv, - #[serde(rename = "TW")] - Tw, - #[serde(rename = "TZ")] - Tz, - #[serde(rename = "UA")] - Ua, - #[serde(rename = "UG")] - Ug, - #[serde(rename = "US")] - Us, - #[serde(rename = "UY")] - Uy, - #[serde(rename = "UZ")] - Uz, - #[serde(rename = "VA")] - Va, - #[serde(rename = "VC")] - Vc, - #[serde(rename = "VE")] - Ve, - #[serde(rename = "VG")] - Vg, - #[serde(rename = "VN")] - Vn, - #[serde(rename = "VU")] - Vu, - #[serde(rename = "WF")] - Wf, - #[serde(rename = "WS")] - Ws, - #[serde(rename = "XK")] - Xk, - #[serde(rename = "YE")] - Ye, - #[serde(rename = "YT")] - Yt, - #[serde(rename = "ZA")] - Za, - #[serde(rename = "ZM")] - Zm, - #[serde(rename = "ZW")] - Zw, - #[serde(rename = "ZZ")] - Zz, -} - -impl CreateCheckoutSessionShippingAddressCollectionAllowedCountries { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ac => "AC", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ad => "AD", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ae => "AE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Af => "AF", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ag => "AG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ai => "AI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Al => "AL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Am => "AM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ao => "AO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Aq => "AQ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ar => "AR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::At => "AT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Au => "AU", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Aw => "AW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ax => "AX", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Az => "AZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ba => "BA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bb => "BB", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bd => "BD", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Be => "BE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bf => "BF", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bg => "BG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bh => "BH", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bi => "BI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bj => "BJ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bl => "BL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bm => "BM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bn => "BN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bo => "BO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bq => "BQ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Br => "BR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bs => "BS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bt => "BT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bv => "BV", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bw => "BW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::By => "BY", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bz => "BZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ca => "CA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cd => "CD", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cf => "CF", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cg => "CG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ch => "CH", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ci => "CI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ck => "CK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cl => "CL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cm => "CM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cn => "CN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Co => "CO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cr => "CR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cv => "CV", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cw => "CW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cy => "CY", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cz => "CZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::De => "DE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Dj => "DJ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Dk => "DK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Dm => "DM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Do => "DO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Dz => "DZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ec => "EC", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ee => "EE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Eg => "EG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Eh => "EH", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Er => "ER", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Es => "ES", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Et => "ET", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Fi => "FI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Fj => "FJ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Fk => "FK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Fo => "FO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Fr => "FR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ga => "GA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gb => "GB", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gd => "GD", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ge => "GE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gf => "GF", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gg => "GG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gh => "GH", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gi => "GI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gl => "GL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gm => "GM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gn => "GN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gp => "GP", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gq => "GQ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gr => "GR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gs => "GS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gt => "GT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gu => "GU", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gw => "GW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gy => "GY", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Hk => "HK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Hn => "HN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Hr => "HR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ht => "HT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Hu => "HU", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Id => "ID", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ie => "IE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Il => "IL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Im => "IM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::In => "IN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Io => "IO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Iq => "IQ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Is => "IS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::It => "IT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Je => "JE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Jm => "JM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Jo => "JO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Jp => "JP", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ke => "KE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Kg => "KG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Kh => "KH", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ki => "KI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Km => "KM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Kn => "KN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Kr => "KR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Kw => "KW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ky => "KY", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Kz => "KZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::La => "LA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Lb => "LB", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Lc => "LC", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Li => "LI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Lk => "LK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Lr => "LR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ls => "LS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Lt => "LT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Lu => "LU", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Lv => "LV", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ly => "LY", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ma => "MA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mc => "MC", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Md => "MD", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Me => "ME", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mf => "MF", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mg => "MG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mk => "MK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ml => "ML", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mm => "MM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mn => "MN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mo => "MO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mq => "MQ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mr => "MR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ms => "MS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mt => "MT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mu => "MU", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mv => "MV", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mw => "MW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mx => "MX", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::My => "MY", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mz => "MZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Na => "NA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Nc => "NC", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ne => "NE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ng => "NG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ni => "NI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Nl => "NL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::No => "NO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Np => "NP", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Nr => "NR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Nu => "NU", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Nz => "NZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Om => "OM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pa => "PA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pe => "PE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pf => "PF", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pg => "PG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ph => "PH", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pk => "PK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pl => "PL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pm => "PM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pn => "PN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pr => "PR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ps => "PS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pt => "PT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Py => "PY", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Qa => "QA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Re => "RE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ro => "RO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Rs => "RS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ru => "RU", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Rw => "RW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sa => "SA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sb => "SB", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sc => "SC", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Se => "SE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sg => "SG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sh => "SH", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Si => "SI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sj => "SJ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sk => "SK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sl => "SL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sm => "SM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sn => "SN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::So => "SO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sr => "SR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ss => "SS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::St => "ST", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sv => "SV", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sx => "SX", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sz => "SZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ta => "TA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tc => "TC", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Td => "TD", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tf => "TF", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tg => "TG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Th => "TH", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tj => "TJ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tk => "TK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tl => "TL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tm => "TM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tn => "TN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::To => "TO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tr => "TR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tt => "TT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tv => "TV", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tw => "TW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tz => "TZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ua => "UA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ug => "UG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Us => "US", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Uy => "UY", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Uz => "UZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Va => "VA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Vc => "VC", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ve => "VE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Vg => "VG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Vn => "VN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Vu => "VU", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Wf => "WF", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ws => "WS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Xk => "XK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ye => "YE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Yt => "YT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Za => "ZA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Zm => "ZM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Zw => "ZW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Zz => "ZZ", - } - } -} - -impl AsRef for CreateCheckoutSessionShippingAddressCollectionAllowedCountries { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionShippingAddressCollectionAllowedCountries { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionShippingAddressCollectionAllowedCountries { - fn default() -> Self { - Self::Ac - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum`'s `unit` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit { - BusinessDay, - Day, - Hour, - Month, - Week, -} - -impl CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::BusinessDay => "business_day", - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::Day => "day", - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::Hour => "hour", - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::Month => "month", - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::Week => "week", - } - } -} - -impl AsRef - for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit -{ - fn default() -> Self { - Self::BusinessDay - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum`'s `unit` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit { - BusinessDay, - Day, - Hour, - Month, - Week, -} - -impl CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::BusinessDay => "business_day", - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::Day => "day", - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::Hour => "hour", - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::Month => "month", - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::Week => "week", - } - } -} - -impl AsRef - for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit -{ - fn default() -> Self { - Self::BusinessDay - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::Exclusive => "exclusive", - CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::Inclusive => "inclusive", - CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef - for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior -{ - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionShippingOptionsShippingRateData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior::Exclusive => { - "exclusive" - } - CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior::Inclusive => { - "inclusive" - } - CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior::Unspecified => { - "unspecified" - } - } - } -} - -impl AsRef for CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionShippingOptionsShippingRateData`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionShippingOptionsShippingRateDataType { - FixedAmount, -} - -impl CreateCheckoutSessionShippingOptionsShippingRateDataType { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionShippingOptionsShippingRateDataType::FixedAmount => "fixed_amount", - } - } -} - -impl AsRef for CreateCheckoutSessionShippingOptionsShippingRateDataType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionShippingOptionsShippingRateDataType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionShippingOptionsShippingRateDataType { - fn default() -> Self { - Self::FixedAmount - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionSubscriptionData`'s `proration_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionSubscriptionDataProrationBehavior { - CreateProrations, - None, -} - -impl CreateCheckoutSessionSubscriptionDataProrationBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionSubscriptionDataProrationBehavior::CreateProrations => { - "create_prorations" - } - CreateCheckoutSessionSubscriptionDataProrationBehavior::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionSubscriptionDataProrationBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionSubscriptionDataProrationBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionSubscriptionDataProrationBehavior { - fn default() -> Self { - Self::CreateProrations - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior`'s `missing_payment_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { - Cancel, - CreateInvoice, - Pause, -} - -impl CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::Cancel => "cancel", - CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::CreateInvoice => "create_invoice", - CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::Pause => "pause", - } - } -} - -impl AsRef - for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod -{ - fn default() -> Self { - Self::Cancel - } -} - -/// An enum representing the possible values of an `LineItemsTaxAmount`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum LineItemsTaxAmountTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl LineItemsTaxAmountTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - LineItemsTaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - LineItemsTaxAmountTaxabilityReason::NotCollecting => "not_collecting", - LineItemsTaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - LineItemsTaxAmountTaxabilityReason::NotSupported => "not_supported", - LineItemsTaxAmountTaxabilityReason::PortionProductExempt => "portion_product_exempt", - LineItemsTaxAmountTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - LineItemsTaxAmountTaxabilityReason::PortionStandardRated => "portion_standard_rated", - LineItemsTaxAmountTaxabilityReason::ProductExempt => "product_exempt", - LineItemsTaxAmountTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - LineItemsTaxAmountTaxabilityReason::ProportionallyRated => "proportionally_rated", - LineItemsTaxAmountTaxabilityReason::ReducedRated => "reduced_rated", - LineItemsTaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", - LineItemsTaxAmountTaxabilityReason::StandardRated => "standard_rated", - LineItemsTaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - LineItemsTaxAmountTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for LineItemsTaxAmountTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for LineItemsTaxAmountTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for LineItemsTaxAmountTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionAutomaticTax`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionAutomaticTaxStatus { - Complete, - Failed, - RequiresLocationInputs, -} - -impl PaymentPagesCheckoutSessionAutomaticTaxStatus { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionAutomaticTaxStatus::Complete => "complete", - PaymentPagesCheckoutSessionAutomaticTaxStatus::Failed => "failed", - PaymentPagesCheckoutSessionAutomaticTaxStatus::RequiresLocationInputs => { - "requires_location_inputs" - } - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionAutomaticTaxStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionAutomaticTaxStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionAutomaticTaxStatus { - fn default() -> Self { - Self::Complete - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionConsentCollection`'s `promotions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionConsentCollectionPromotions { - Auto, - None, -} - -impl PaymentPagesCheckoutSessionConsentCollectionPromotions { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionConsentCollectionPromotions::Auto => "auto", - PaymentPagesCheckoutSessionConsentCollectionPromotions::None => "none", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionConsentCollectionPromotions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionConsentCollectionPromotions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionConsentCollectionPromotions { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionConsentCollection`'s `terms_of_service` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionConsentCollectionTermsOfService { - None, - Required, -} - -impl PaymentPagesCheckoutSessionConsentCollectionTermsOfService { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionConsentCollectionTermsOfService::None => "none", - PaymentPagesCheckoutSessionConsentCollectionTermsOfService::Required => "required", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionConsentCollectionTermsOfService { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionConsentCollectionTermsOfService { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionConsentCollectionTermsOfService { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionConsent`'s `promotions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionConsentPromotions { - OptIn, - OptOut, -} - -impl PaymentPagesCheckoutSessionConsentPromotions { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionConsentPromotions::OptIn => "opt_in", - PaymentPagesCheckoutSessionConsentPromotions::OptOut => "opt_out", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionConsentPromotions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionConsentPromotions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionConsentPromotions { - fn default() -> Self { - Self::OptIn - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionConsent`'s `terms_of_service` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionConsentTermsOfService { - Accepted, -} - -impl PaymentPagesCheckoutSessionConsentTermsOfService { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionConsentTermsOfService::Accepted => "accepted", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionConsentTermsOfService { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionConsentTermsOfService { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionConsentTermsOfService { - fn default() -> Self { - Self::Accepted - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionCustomFieldsLabel`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionCustomFieldsLabelType { - Custom, -} - -impl PaymentPagesCheckoutSessionCustomFieldsLabelType { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionCustomFieldsLabelType::Custom => "custom", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionCustomFieldsLabelType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionCustomFieldsLabelType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionCustomFieldsLabelType { - fn default() -> Self { - Self::Custom - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionCustomFields`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionCustomFieldsType { - Dropdown, - Numeric, - Text, -} - -impl PaymentPagesCheckoutSessionCustomFieldsType { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionCustomFieldsType::Dropdown => "dropdown", - PaymentPagesCheckoutSessionCustomFieldsType::Numeric => "numeric", - PaymentPagesCheckoutSessionCustomFieldsType::Text => "text", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionCustomFieldsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionCustomFieldsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionCustomFieldsType { - fn default() -> Self { - Self::Dropdown - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionCustomerDetails`'s `tax_exempt` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { - Exempt, - None, - Reverse, -} - -impl PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionCustomerDetailsTaxExempt::Exempt => "exempt", - PaymentPagesCheckoutSessionCustomerDetailsTaxExempt::None => "none", - PaymentPagesCheckoutSessionCustomerDetailsTaxExempt::Reverse => "reverse", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { - fn default() -> Self { - Self::Exempt - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionShippingAddressCollection`'s `allowed_countries` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { - #[serde(rename = "AC")] - Ac, - #[serde(rename = "AD")] - Ad, - #[serde(rename = "AE")] - Ae, - #[serde(rename = "AF")] - Af, - #[serde(rename = "AG")] - Ag, - #[serde(rename = "AI")] - Ai, - #[serde(rename = "AL")] - Al, - #[serde(rename = "AM")] - Am, - #[serde(rename = "AO")] - Ao, - #[serde(rename = "AQ")] - Aq, - #[serde(rename = "AR")] - Ar, - #[serde(rename = "AT")] - At, - #[serde(rename = "AU")] - Au, - #[serde(rename = "AW")] - Aw, - #[serde(rename = "AX")] - Ax, - #[serde(rename = "AZ")] - Az, - #[serde(rename = "BA")] - Ba, - #[serde(rename = "BB")] - Bb, - #[serde(rename = "BD")] - Bd, - #[serde(rename = "BE")] - Be, - #[serde(rename = "BF")] - Bf, - #[serde(rename = "BG")] - Bg, - #[serde(rename = "BH")] - Bh, - #[serde(rename = "BI")] - Bi, - #[serde(rename = "BJ")] - Bj, - #[serde(rename = "BL")] - Bl, - #[serde(rename = "BM")] - Bm, - #[serde(rename = "BN")] - Bn, - #[serde(rename = "BO")] - Bo, - #[serde(rename = "BQ")] - Bq, - #[serde(rename = "BR")] - Br, - #[serde(rename = "BS")] - Bs, - #[serde(rename = "BT")] - Bt, - #[serde(rename = "BV")] - Bv, - #[serde(rename = "BW")] - Bw, - #[serde(rename = "BY")] - By, - #[serde(rename = "BZ")] - Bz, - #[serde(rename = "CA")] - Ca, - #[serde(rename = "CD")] - Cd, - #[serde(rename = "CF")] - Cf, - #[serde(rename = "CG")] - Cg, - #[serde(rename = "CH")] - Ch, - #[serde(rename = "CI")] - Ci, - #[serde(rename = "CK")] - Ck, - #[serde(rename = "CL")] - Cl, - #[serde(rename = "CM")] - Cm, - #[serde(rename = "CN")] - Cn, - #[serde(rename = "CO")] - Co, - #[serde(rename = "CR")] - Cr, - #[serde(rename = "CV")] - Cv, - #[serde(rename = "CW")] - Cw, - #[serde(rename = "CY")] - Cy, - #[serde(rename = "CZ")] - Cz, - #[serde(rename = "DE")] - De, - #[serde(rename = "DJ")] - Dj, - #[serde(rename = "DK")] - Dk, - #[serde(rename = "DM")] - Dm, - #[serde(rename = "DO")] - Do, - #[serde(rename = "DZ")] - Dz, - #[serde(rename = "EC")] - Ec, - #[serde(rename = "EE")] - Ee, - #[serde(rename = "EG")] - Eg, - #[serde(rename = "EH")] - Eh, - #[serde(rename = "ER")] - Er, - #[serde(rename = "ES")] - Es, - #[serde(rename = "ET")] - Et, - #[serde(rename = "FI")] - Fi, - #[serde(rename = "FJ")] - Fj, - #[serde(rename = "FK")] - Fk, - #[serde(rename = "FO")] - Fo, - #[serde(rename = "FR")] - Fr, - #[serde(rename = "GA")] - Ga, - #[serde(rename = "GB")] - Gb, - #[serde(rename = "GD")] - Gd, - #[serde(rename = "GE")] - Ge, - #[serde(rename = "GF")] - Gf, - #[serde(rename = "GG")] - Gg, - #[serde(rename = "GH")] - Gh, - #[serde(rename = "GI")] - Gi, - #[serde(rename = "GL")] - Gl, - #[serde(rename = "GM")] - Gm, - #[serde(rename = "GN")] - Gn, - #[serde(rename = "GP")] - Gp, - #[serde(rename = "GQ")] - Gq, - #[serde(rename = "GR")] - Gr, - #[serde(rename = "GS")] - Gs, - #[serde(rename = "GT")] - Gt, - #[serde(rename = "GU")] - Gu, - #[serde(rename = "GW")] - Gw, - #[serde(rename = "GY")] - Gy, - #[serde(rename = "HK")] - Hk, - #[serde(rename = "HN")] - Hn, - #[serde(rename = "HR")] - Hr, - #[serde(rename = "HT")] - Ht, - #[serde(rename = "HU")] - Hu, - #[serde(rename = "ID")] - Id, - #[serde(rename = "IE")] - Ie, - #[serde(rename = "IL")] - Il, - #[serde(rename = "IM")] - Im, - #[serde(rename = "IN")] - In, - #[serde(rename = "IO")] - Io, - #[serde(rename = "IQ")] - Iq, - #[serde(rename = "IS")] - Is, - #[serde(rename = "IT")] - It, - #[serde(rename = "JE")] - Je, - #[serde(rename = "JM")] - Jm, - #[serde(rename = "JO")] - Jo, - #[serde(rename = "JP")] - Jp, - #[serde(rename = "KE")] - Ke, - #[serde(rename = "KG")] - Kg, - #[serde(rename = "KH")] - Kh, - #[serde(rename = "KI")] - Ki, - #[serde(rename = "KM")] - Km, - #[serde(rename = "KN")] - Kn, - #[serde(rename = "KR")] - Kr, - #[serde(rename = "KW")] - Kw, - #[serde(rename = "KY")] - Ky, - #[serde(rename = "KZ")] - Kz, - #[serde(rename = "LA")] - La, - #[serde(rename = "LB")] - Lb, - #[serde(rename = "LC")] - Lc, - #[serde(rename = "LI")] - Li, - #[serde(rename = "LK")] - Lk, - #[serde(rename = "LR")] - Lr, - #[serde(rename = "LS")] - Ls, - #[serde(rename = "LT")] - Lt, - #[serde(rename = "LU")] - Lu, - #[serde(rename = "LV")] - Lv, - #[serde(rename = "LY")] - Ly, - #[serde(rename = "MA")] - Ma, - #[serde(rename = "MC")] - Mc, - #[serde(rename = "MD")] - Md, - #[serde(rename = "ME")] - Me, - #[serde(rename = "MF")] - Mf, - #[serde(rename = "MG")] - Mg, - #[serde(rename = "MK")] - Mk, - #[serde(rename = "ML")] - Ml, - #[serde(rename = "MM")] - Mm, - #[serde(rename = "MN")] - Mn, - #[serde(rename = "MO")] - Mo, - #[serde(rename = "MQ")] - Mq, - #[serde(rename = "MR")] - Mr, - #[serde(rename = "MS")] - Ms, - #[serde(rename = "MT")] - Mt, - #[serde(rename = "MU")] - Mu, - #[serde(rename = "MV")] - Mv, - #[serde(rename = "MW")] - Mw, - #[serde(rename = "MX")] - Mx, - #[serde(rename = "MY")] - My, - #[serde(rename = "MZ")] - Mz, - #[serde(rename = "NA")] - Na, - #[serde(rename = "NC")] - Nc, - #[serde(rename = "NE")] - Ne, - #[serde(rename = "NG")] - Ng, - #[serde(rename = "NI")] - Ni, - #[serde(rename = "NL")] - Nl, - #[serde(rename = "NO")] - No, - #[serde(rename = "NP")] - Np, - #[serde(rename = "NR")] - Nr, - #[serde(rename = "NU")] - Nu, - #[serde(rename = "NZ")] - Nz, - #[serde(rename = "OM")] - Om, - #[serde(rename = "PA")] - Pa, - #[serde(rename = "PE")] - Pe, - #[serde(rename = "PF")] - Pf, - #[serde(rename = "PG")] - Pg, - #[serde(rename = "PH")] - Ph, - #[serde(rename = "PK")] - Pk, - #[serde(rename = "PL")] - Pl, - #[serde(rename = "PM")] - Pm, - #[serde(rename = "PN")] - Pn, - #[serde(rename = "PR")] - Pr, - #[serde(rename = "PS")] - Ps, - #[serde(rename = "PT")] - Pt, - #[serde(rename = "PY")] - Py, - #[serde(rename = "QA")] - Qa, - #[serde(rename = "RE")] - Re, - #[serde(rename = "RO")] - Ro, - #[serde(rename = "RS")] - Rs, - #[serde(rename = "RU")] - Ru, - #[serde(rename = "RW")] - Rw, - #[serde(rename = "SA")] - Sa, - #[serde(rename = "SB")] - Sb, - #[serde(rename = "SC")] - Sc, - #[serde(rename = "SE")] - Se, - #[serde(rename = "SG")] - Sg, - #[serde(rename = "SH")] - Sh, - #[serde(rename = "SI")] - Si, - #[serde(rename = "SJ")] - Sj, - #[serde(rename = "SK")] - Sk, - #[serde(rename = "SL")] - Sl, - #[serde(rename = "SM")] - Sm, - #[serde(rename = "SN")] - Sn, - #[serde(rename = "SO")] - So, - #[serde(rename = "SR")] - Sr, - #[serde(rename = "SS")] - Ss, - #[serde(rename = "ST")] - St, - #[serde(rename = "SV")] - Sv, - #[serde(rename = "SX")] - Sx, - #[serde(rename = "SZ")] - Sz, - #[serde(rename = "TA")] - Ta, - #[serde(rename = "TC")] - Tc, - #[serde(rename = "TD")] - Td, - #[serde(rename = "TF")] - Tf, - #[serde(rename = "TG")] - Tg, - #[serde(rename = "TH")] - Th, - #[serde(rename = "TJ")] - Tj, - #[serde(rename = "TK")] - Tk, - #[serde(rename = "TL")] - Tl, - #[serde(rename = "TM")] - Tm, - #[serde(rename = "TN")] - Tn, - #[serde(rename = "TO")] - To, - #[serde(rename = "TR")] - Tr, - #[serde(rename = "TT")] - Tt, - #[serde(rename = "TV")] - Tv, - #[serde(rename = "TW")] - Tw, - #[serde(rename = "TZ")] - Tz, - #[serde(rename = "UA")] - Ua, - #[serde(rename = "UG")] - Ug, - #[serde(rename = "US")] - Us, - #[serde(rename = "UY")] - Uy, - #[serde(rename = "UZ")] - Uz, - #[serde(rename = "VA")] - Va, - #[serde(rename = "VC")] - Vc, - #[serde(rename = "VE")] - Ve, - #[serde(rename = "VG")] - Vg, - #[serde(rename = "VN")] - Vn, - #[serde(rename = "VU")] - Vu, - #[serde(rename = "WF")] - Wf, - #[serde(rename = "WS")] - Ws, - #[serde(rename = "XK")] - Xk, - #[serde(rename = "YE")] - Ye, - #[serde(rename = "YT")] - Yt, - #[serde(rename = "ZA")] - Za, - #[serde(rename = "ZM")] - Zm, - #[serde(rename = "ZW")] - Zw, - #[serde(rename = "ZZ")] - Zz, -} - -impl PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ac => "AC", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ad => "AD", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ae => "AE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Af => "AF", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ag => "AG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ai => "AI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Al => "AL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Am => "AM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ao => "AO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Aq => "AQ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ar => "AR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::At => "AT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Au => "AU", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Aw => "AW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ax => "AX", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Az => "AZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ba => "BA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bb => "BB", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bd => "BD", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Be => "BE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bf => "BF", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bg => "BG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bh => "BH", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bi => "BI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bj => "BJ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bl => "BL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bm => "BM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bn => "BN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bo => "BO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bq => "BQ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Br => "BR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bs => "BS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bt => "BT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bv => "BV", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bw => "BW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::By => "BY", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bz => "BZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ca => "CA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cd => "CD", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cf => "CF", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cg => "CG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ch => "CH", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ci => "CI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ck => "CK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cl => "CL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cm => "CM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cn => "CN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Co => "CO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cr => "CR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cv => "CV", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cw => "CW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cy => "CY", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cz => "CZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::De => "DE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Dj => "DJ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Dk => "DK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Dm => "DM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Do => "DO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Dz => "DZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ec => "EC", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ee => "EE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Eg => "EG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Eh => "EH", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Er => "ER", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Es => "ES", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Et => "ET", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Fi => "FI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Fj => "FJ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Fk => "FK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Fo => "FO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Fr => "FR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ga => "GA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gb => "GB", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gd => "GD", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ge => "GE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gf => "GF", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gg => "GG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gh => "GH", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gi => "GI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gl => "GL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gm => "GM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gn => "GN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gp => "GP", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gq => "GQ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gr => "GR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gs => "GS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gt => "GT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gu => "GU", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gw => "GW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gy => "GY", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Hk => "HK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Hn => "HN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Hr => "HR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ht => "HT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Hu => "HU", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Id => "ID", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ie => "IE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Il => "IL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Im => "IM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::In => "IN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Io => "IO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Iq => "IQ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Is => "IS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::It => "IT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Je => "JE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Jm => "JM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Jo => "JO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Jp => "JP", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ke => "KE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Kg => "KG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Kh => "KH", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ki => "KI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Km => "KM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Kn => "KN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Kr => "KR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Kw => "KW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ky => "KY", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Kz => "KZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::La => "LA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Lb => "LB", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Lc => "LC", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Li => "LI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Lk => "LK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Lr => "LR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ls => "LS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Lt => "LT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Lu => "LU", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Lv => "LV", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ly => "LY", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ma => "MA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mc => "MC", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Md => "MD", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Me => "ME", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mf => "MF", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mg => "MG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mk => "MK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ml => "ML", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mm => "MM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mn => "MN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mo => "MO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mq => "MQ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mr => "MR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ms => "MS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mt => "MT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mu => "MU", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mv => "MV", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mw => "MW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mx => "MX", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::My => "MY", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mz => "MZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Na => "NA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Nc => "NC", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ne => "NE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ng => "NG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ni => "NI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Nl => "NL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::No => "NO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Np => "NP", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Nr => "NR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Nu => "NU", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Nz => "NZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Om => "OM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pa => "PA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pe => "PE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pf => "PF", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pg => "PG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ph => "PH", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pk => "PK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pl => "PL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pm => "PM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pn => "PN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pr => "PR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ps => "PS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pt => "PT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Py => "PY", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Qa => "QA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Re => "RE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ro => "RO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Rs => "RS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ru => "RU", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Rw => "RW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sa => "SA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sb => "SB", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sc => "SC", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Se => "SE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sg => "SG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sh => "SH", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Si => "SI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sj => "SJ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sk => "SK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sl => "SL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sm => "SM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sn => "SN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::So => "SO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sr => "SR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ss => "SS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::St => "ST", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sv => "SV", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sx => "SX", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sz => "SZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ta => "TA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tc => "TC", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Td => "TD", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tf => "TF", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tg => "TG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Th => "TH", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tj => "TJ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tk => "TK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tl => "TL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tm => "TM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tn => "TN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::To => "TO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tr => "TR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tt => "TT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tv => "TV", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tw => "TW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tz => "TZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ua => "UA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ug => "UG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Us => "US", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Uy => "UY", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Uz => "UZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Va => "VA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Vc => "VC", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ve => "VE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Vg => "VG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Vn => "VN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Vu => "VU", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Wf => "WF", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ws => "WS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Xk => "XK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ye => "YE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Yt => "YT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Za => "ZA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Zm => "ZM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Zw => "ZW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Zz => "ZZ", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries -{ - fn default() -> Self { - Self::Ac - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionTaxId`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionTaxIdType { - AdNrt, - AeTrn, - ArCuit, - AuAbn, - AuArn, - BgUic, - BoTin, - BrCnpj, - BrCpf, - CaBn, - CaGstHst, - CaPstBc, - CaPstMb, - CaPstSk, - CaQst, - ChVat, - ClTin, - CnTin, - CoNit, - CrTin, - DoRcn, - EcRuc, - EgTin, - EsCif, - EuOssVat, - EuVat, - GbVat, - GeVat, - HkBr, - HuTin, - IdNpwp, - IlVat, - InGst, - IsVat, - JpCn, - JpRn, - JpTrn, - KePin, - KrBrn, - LiUid, - MxRfc, - MyFrp, - MyItn, - MySst, - NoVat, - NzGst, - PeRuc, - PhTin, - RoTin, - RsPib, - RuInn, - RuKpp, - SaVat, - SgGst, - SgUen, - SiTin, - SvNit, - ThVat, - TrTin, - TwVat, - UaVat, - Unknown, - UsEin, - UyRuc, - VeRif, - VnTin, - ZaVat, -} - -impl PaymentPagesCheckoutSessionTaxIdType { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionTaxIdType::AdNrt => "ad_nrt", - PaymentPagesCheckoutSessionTaxIdType::AeTrn => "ae_trn", - PaymentPagesCheckoutSessionTaxIdType::ArCuit => "ar_cuit", - PaymentPagesCheckoutSessionTaxIdType::AuAbn => "au_abn", - PaymentPagesCheckoutSessionTaxIdType::AuArn => "au_arn", - PaymentPagesCheckoutSessionTaxIdType::BgUic => "bg_uic", - PaymentPagesCheckoutSessionTaxIdType::BoTin => "bo_tin", - PaymentPagesCheckoutSessionTaxIdType::BrCnpj => "br_cnpj", - PaymentPagesCheckoutSessionTaxIdType::BrCpf => "br_cpf", - PaymentPagesCheckoutSessionTaxIdType::CaBn => "ca_bn", - PaymentPagesCheckoutSessionTaxIdType::CaGstHst => "ca_gst_hst", - PaymentPagesCheckoutSessionTaxIdType::CaPstBc => "ca_pst_bc", - PaymentPagesCheckoutSessionTaxIdType::CaPstMb => "ca_pst_mb", - PaymentPagesCheckoutSessionTaxIdType::CaPstSk => "ca_pst_sk", - PaymentPagesCheckoutSessionTaxIdType::CaQst => "ca_qst", - PaymentPagesCheckoutSessionTaxIdType::ChVat => "ch_vat", - PaymentPagesCheckoutSessionTaxIdType::ClTin => "cl_tin", - PaymentPagesCheckoutSessionTaxIdType::CnTin => "cn_tin", - PaymentPagesCheckoutSessionTaxIdType::CoNit => "co_nit", - PaymentPagesCheckoutSessionTaxIdType::CrTin => "cr_tin", - PaymentPagesCheckoutSessionTaxIdType::DoRcn => "do_rcn", - PaymentPagesCheckoutSessionTaxIdType::EcRuc => "ec_ruc", - PaymentPagesCheckoutSessionTaxIdType::EgTin => "eg_tin", - PaymentPagesCheckoutSessionTaxIdType::EsCif => "es_cif", - PaymentPagesCheckoutSessionTaxIdType::EuOssVat => "eu_oss_vat", - PaymentPagesCheckoutSessionTaxIdType::EuVat => "eu_vat", - PaymentPagesCheckoutSessionTaxIdType::GbVat => "gb_vat", - PaymentPagesCheckoutSessionTaxIdType::GeVat => "ge_vat", - PaymentPagesCheckoutSessionTaxIdType::HkBr => "hk_br", - PaymentPagesCheckoutSessionTaxIdType::HuTin => "hu_tin", - PaymentPagesCheckoutSessionTaxIdType::IdNpwp => "id_npwp", - PaymentPagesCheckoutSessionTaxIdType::IlVat => "il_vat", - PaymentPagesCheckoutSessionTaxIdType::InGst => "in_gst", - PaymentPagesCheckoutSessionTaxIdType::IsVat => "is_vat", - PaymentPagesCheckoutSessionTaxIdType::JpCn => "jp_cn", - PaymentPagesCheckoutSessionTaxIdType::JpRn => "jp_rn", - PaymentPagesCheckoutSessionTaxIdType::JpTrn => "jp_trn", - PaymentPagesCheckoutSessionTaxIdType::KePin => "ke_pin", - PaymentPagesCheckoutSessionTaxIdType::KrBrn => "kr_brn", - PaymentPagesCheckoutSessionTaxIdType::LiUid => "li_uid", - PaymentPagesCheckoutSessionTaxIdType::MxRfc => "mx_rfc", - PaymentPagesCheckoutSessionTaxIdType::MyFrp => "my_frp", - PaymentPagesCheckoutSessionTaxIdType::MyItn => "my_itn", - PaymentPagesCheckoutSessionTaxIdType::MySst => "my_sst", - PaymentPagesCheckoutSessionTaxIdType::NoVat => "no_vat", - PaymentPagesCheckoutSessionTaxIdType::NzGst => "nz_gst", - PaymentPagesCheckoutSessionTaxIdType::PeRuc => "pe_ruc", - PaymentPagesCheckoutSessionTaxIdType::PhTin => "ph_tin", - PaymentPagesCheckoutSessionTaxIdType::RoTin => "ro_tin", - PaymentPagesCheckoutSessionTaxIdType::RsPib => "rs_pib", - PaymentPagesCheckoutSessionTaxIdType::RuInn => "ru_inn", - PaymentPagesCheckoutSessionTaxIdType::RuKpp => "ru_kpp", - PaymentPagesCheckoutSessionTaxIdType::SaVat => "sa_vat", - PaymentPagesCheckoutSessionTaxIdType::SgGst => "sg_gst", - PaymentPagesCheckoutSessionTaxIdType::SgUen => "sg_uen", - PaymentPagesCheckoutSessionTaxIdType::SiTin => "si_tin", - PaymentPagesCheckoutSessionTaxIdType::SvNit => "sv_nit", - PaymentPagesCheckoutSessionTaxIdType::ThVat => "th_vat", - PaymentPagesCheckoutSessionTaxIdType::TrTin => "tr_tin", - PaymentPagesCheckoutSessionTaxIdType::TwVat => "tw_vat", - PaymentPagesCheckoutSessionTaxIdType::UaVat => "ua_vat", - PaymentPagesCheckoutSessionTaxIdType::Unknown => "unknown", - PaymentPagesCheckoutSessionTaxIdType::UsEin => "us_ein", - PaymentPagesCheckoutSessionTaxIdType::UyRuc => "uy_ruc", - PaymentPagesCheckoutSessionTaxIdType::VeRif => "ve_rif", - PaymentPagesCheckoutSessionTaxIdType::VnTin => "vn_tin", - PaymentPagesCheckoutSessionTaxIdType::ZaVat => "za_vat", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionTaxIdType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionTaxIdType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionTaxIdType { - fn default() -> Self { - Self::AdNrt - } -} diff --git a/src/resources/generated/connect_collection_transfer.rs b/src/resources/generated/connect_collection_transfer.rs deleted file mode 100644 index ab8344dac..000000000 --- a/src/resources/generated/connect_collection_transfer.rs +++ /dev/null @@ -1,40 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::ConnectCollectionTransferId; -use crate::params::{Expandable, Object}; -use crate::resources::{Account, Currency}; - -/// The resource representing a Stripe "ConnectCollectionTransfer". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ConnectCollectionTransfer { - /// Unique identifier for the object. - pub id: ConnectCollectionTransferId, - - /// Amount transferred, in cents (or local equivalent). - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// ID of the account that funds are being collected for. - pub destination: Expandable, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, -} - -impl Object for ConnectCollectionTransfer { - type Id = ConnectCollectionTransferId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "connect_collection_transfer" - } -} diff --git a/src/resources/generated/country_spec.rs b/src/resources/generated/country_spec.rs deleted file mode 100644 index 2392888f0..000000000 --- a/src/resources/generated/country_spec.rs +++ /dev/null @@ -1,129 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::client::{Client, Response}; -use crate::ids::{CountrySpecId}; -use crate::params::{Expand, List, Object, Paginable}; -use crate::resources::{Currency}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "CountrySpec". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CountrySpec { - /// Unique identifier for the object. - /// - /// Represented as the ISO country code for this country. - pub id: CountrySpecId, - - /// The default currency for this country. - /// - /// This applies to both payment methods and bank accounts. - pub default_currency: Currency, - - /// Currencies that can be accepted in the specific country (for transfers). - pub supported_bank_account_currencies: Vec, - - /// Currencies that can be accepted in the specified country (for payments). - pub supported_payment_currencies: Vec, - - /// Payment methods available in the specified country. - /// - /// You may need to enable some payment methods (e.g., [ACH](https://stripe.com/docs/ach)) on your account before they appear in this list. - /// The `stripe` payment method refers to [charging through your platform](https://stripe.com/docs/connect/destination-charges). - pub supported_payment_methods: Vec, - - /// Countries that can accept transfers from the specified country. - pub supported_transfer_countries: Vec, - - pub verification_fields: CountrySpecVerificationFields, -} - -impl CountrySpec { - - /// Lists all Country Spec objects available in the API. -pub fn list(client: &Client, params: &ListCountrySpecs<'_>) -> Response> { - client.get_query("/country_specs", ¶ms) -} - - - /// Returns a Country Spec for a given Country code. - pub fn retrieve(client: &Client, id: &CountrySpecId, expand: &[&str]) -> Response { - client.get_query(&format!("/country_specs/{}", id), &Expand { expand }) - } -} - -impl Object for CountrySpec { - type Id = CountrySpecId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "country_spec" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CountrySpecVerificationFields { - - pub company: CountrySpecVerificationFieldDetails, - - pub individual: CountrySpecVerificationFieldDetails, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CountrySpecVerificationFieldDetails { - - /// Additional fields which are only required for some users. - pub additional: Vec, - - /// Fields which every account must eventually provide. - pub minimum: Vec, -} - -/// The parameters for `CountrySpec::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListCountrySpecs<'a> { - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListCountrySpecs<'a> { - pub fn new() -> Self { - ListCountrySpecs { - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListCountrySpecs<'_> { - type O = CountrySpec; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - }} \ No newline at end of file diff --git a/src/resources/generated/coupon.rs b/src/resources/generated/coupon.rs deleted file mode 100644 index b32bb4f38..000000000 --- a/src/resources/generated/coupon.rs +++ /dev/null @@ -1,391 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::CouponId; -use crate::params::{ - CurrencyMap, Deleted, Expand, List, Metadata, Object, Paginable, RangeQuery, Timestamp, -}; -use crate::resources::Currency; - -/// The resource representing a Stripe "Coupon". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Coupon { - /// Unique identifier for the object. - pub id: CouponId, - - /// Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_off: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub applies_to: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// If `amount_off` has been set, the three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the amount to take off. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Coupons defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// One of `forever`, `once`, and `repeating`. - /// - /// Describes how long a customer who applies this coupon will get the discount. - #[serde(skip_serializing_if = "Option::is_none")] - pub duration: Option, - - /// If `duration` is `repeating`, the number of months the coupon applies. - /// - /// Null if coupon `duration` is `forever` or `once`. - #[serde(skip_serializing_if = "Option::is_none")] - pub duration_in_months: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid. - #[serde(skip_serializing_if = "Option::is_none")] - pub max_redemptions: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Name of the coupon displayed to customers on for instance invoices or receipts. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. - /// - /// For example, a coupon with percent_off of 50 will make a $ (or local equivalent)100 invoice $ (or local equivalent)50 instead. - #[serde(skip_serializing_if = "Option::is_none")] - pub percent_off: Option, - - /// Date after which the coupon can no longer be redeemed. - #[serde(skip_serializing_if = "Option::is_none")] - pub redeem_by: Option, - - /// Number of times this coupon has been applied to a customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub times_redeemed: Option, - - /// Taking account of the above properties, whether this coupon can still be applied to a customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub valid: Option, -} - -impl Coupon { - /// Returns a list of your coupons. - pub fn list(client: &Client, params: &ListCoupons<'_>) -> Response> { - client.get_query("/coupons", ¶ms) - } - - /// You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. - /// - /// Coupon creation is also accessible via the API if you need to create coupons on the fly. A coupon has either a `percent_off` or an `amount_off` and `currency`. - /// If you set an `amount_off`, that amount will be subtracted from any invoice’s subtotal. - /// For example, an invoice with a subtotal of $100 will have a final total of $0 if a coupon with an `amount_off` of 20000 is applied to it and an invoice with a subtotal of $300 will have a final total of $100 if a coupon with an `amount_off` of 20000 is applied to it. - pub fn create(client: &Client, params: CreateCoupon<'_>) -> Response { - client.post_form("/coupons", ¶ms) - } - - /// Retrieves the coupon with the given ID. - pub fn retrieve(client: &Client, id: &CouponId, expand: &[&str]) -> Response { - client.get_query(&format!("/coupons/{}", id), &Expand { expand }) - } - - /// Updates the metadata of a coupon. - /// - /// Other coupon details (currency, duration, amount_off) are, by design, not editable. - pub fn update(client: &Client, id: &CouponId, params: UpdateCoupon<'_>) -> Response { - client.post_form(&format!("/coupons/{}", id), ¶ms) - } - - /// You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. - /// - /// However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can’t redeem the coupon. - /// You can also delete coupons via the API. - pub fn delete(client: &Client, id: &CouponId) -> Response> { - client.delete(&format!("/coupons/{}", id)) - } -} - -impl Object for Coupon { - type Id = CouponId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "coupon" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CouponAppliesTo { - /// A list of product IDs this coupon applies to. - pub products: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CouponCurrencyOption { - /// Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. - pub amount_off: i64, -} - -/// The parameters for `Coupon::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateCoupon<'a> { - /// A positive integer representing the amount to subtract from an invoice total (required if `percent_off` is not passed). - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_off: Option, - - /// A hash containing directions for what this Coupon will apply discounts to. - #[serde(skip_serializing_if = "Option::is_none")] - pub applies_to: Option, - - /// Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `amount_off` parameter (required if `amount_off` is passed). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Coupons defined in each available currency option (only supported if `amount_off` is passed). - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, - - /// Specifies how long the discount will be in effect if used on a subscription. - /// - /// Defaults to `once`. - #[serde(skip_serializing_if = "Option::is_none")] - pub duration: Option, - - /// Required only if `duration` is `repeating`, in which case it must be a positive integer that specifies the number of months the discount will be in effect. - #[serde(skip_serializing_if = "Option::is_none")] - pub duration_in_months: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Unique string of your choice that will be used to identify this coupon when applying it to a customer. - /// - /// If you don't want to specify a particular code, you can leave the ID blank and we'll generate a random code for you. - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option<&'a str>, - - /// A positive integer specifying the number of times the coupon can be redeemed before it's no longer valid. - /// - /// For example, you might have a 50% off coupon that the first 20 readers of your blog can use. - #[serde(skip_serializing_if = "Option::is_none")] - pub max_redemptions: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Name of the coupon displayed to customers on, for instance invoices, or receipts. - /// - /// By default the `id` is shown if `name` is not set. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option<&'a str>, - - /// A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if `amount_off` is not passed). - #[serde(skip_serializing_if = "Option::is_none")] - pub percent_off: Option, - - /// Unix timestamp specifying the last time at which the coupon can be redeemed. - /// - /// After the redeem_by date, the coupon can no longer be applied to new customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub redeem_by: Option, -} - -impl<'a> CreateCoupon<'a> { - pub fn new() -> Self { - CreateCoupon { - amount_off: Default::default(), - applies_to: Default::default(), - currency: Default::default(), - currency_options: Default::default(), - duration: Default::default(), - duration_in_months: Default::default(), - expand: Default::default(), - id: Default::default(), - max_redemptions: Default::default(), - metadata: Default::default(), - name: Default::default(), - percent_off: Default::default(), - redeem_by: Default::default(), - } - } -} - -/// The parameters for `Coupon::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListCoupons<'a> { - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListCoupons<'a> { - pub fn new() -> Self { - ListCoupons { - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListCoupons<'_> { - type O = Coupon; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Coupon::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateCoupon<'a> { - /// Coupons defined in each available currency option (only supported if the coupon is amount-based). - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Name of the coupon displayed to customers on, for instance invoices, or receipts. - /// - /// By default the `id` is shown if `name` is not set. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option<&'a str>, -} - -impl<'a> UpdateCoupon<'a> { - pub fn new() -> Self { - UpdateCoupon { - currency_options: Default::default(), - expand: Default::default(), - metadata: Default::default(), - name: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCouponAppliesTo { - /// An array of Product IDs that this Coupon will apply to. - #[serde(skip_serializing_if = "Option::is_none")] - pub products: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCouponCurrencyOptions { - /// A positive integer representing the amount to subtract from an invoice total. - pub amount_off: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateCouponCurrencyOptions { - /// A positive integer representing the amount to subtract from an invoice total. - pub amount_off: i64, -} - -/// An enum representing the possible values of an `Coupon`'s `duration` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CouponDuration { - Forever, - Once, - Repeating, -} - -impl CouponDuration { - pub fn as_str(self) -> &'static str { - match self { - CouponDuration::Forever => "forever", - CouponDuration::Once => "once", - CouponDuration::Repeating => "repeating", - } - } -} - -impl AsRef for CouponDuration { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CouponDuration { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CouponDuration { - fn default() -> Self { - Self::Forever - } -} diff --git a/src/resources/generated/credit_note.rs b/src/resources/generated/credit_note.rs deleted file mode 100644 index b3e206e0c..000000000 --- a/src/resources/generated/credit_note.rs +++ /dev/null @@ -1,614 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CreditNoteId, CustomerId, InvoiceId, RefundId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, Timestamp}; -use crate::resources::{ - CreditNoteLineItem, Currency, Customer, CustomerBalanceTransaction, Discount, Invoice, - InvoicesShippingCost, Refund, TaxRate, -}; - -/// The resource representing a Stripe "CreditNote". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreditNote { - /// Unique identifier for the object. - pub id: CreditNoteId, - - /// The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax. - pub amount: i64, - - /// This is the sum of all the shipping amounts. - pub amount_shipping: i64, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// ID of the customer. - pub customer: Expandable, - - /// Customer balance transaction related to this credit note. - pub customer_balance_transaction: Option>, - - /// The integer amount in cents (or local equivalent) representing the total amount of discount that was credited. - pub discount_amount: i64, - - /// The aggregate amounts calculated per discount for all line items. - pub discount_amounts: Vec, - - /// The date when this credit note is in effect. - /// - /// Same as `created` unless overwritten. - /// When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. - pub effective_at: Option, - - /// ID of the invoice. - pub invoice: Expandable, - - /// Line items that make up the credit note. - pub lines: List, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Customer-facing text that appears on the credit note PDF. - pub memo: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice. - pub number: String, - - /// Amount that was credited outside of Stripe. - pub out_of_band_amount: Option, - - /// The link to download the PDF of the credit note. - pub pdf: String, - - /// Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`. - pub reason: Option, - - /// Refund related to this credit note. - pub refund: Option>, - - /// The details of the cost of shipping, including the ShippingRate applied to the invoice. - pub shipping_cost: Option, - - /// Status of this credit note, one of `issued` or `void`. - /// - /// Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). - pub status: CreditNoteStatus, - - /// The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding exclusive tax and invoice level discounts. - pub subtotal: i64, - - /// The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding all tax and invoice level discounts. - pub subtotal_excluding_tax: Option, - - /// The aggregate amounts calculated per tax rate for all line items. - pub tax_amounts: Vec, - - /// The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount. - pub total: i64, - - /// The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts. - pub total_excluding_tax: Option, - - /// Type of this credit note, one of `pre_payment` or `post_payment`. - /// - /// A `pre_payment` credit note means it was issued when the invoice was open. - /// A `post_payment` credit note means it was issued when the invoice was paid. - #[serde(rename = "type")] - pub type_: CreditNoteType, - - /// The time that the credit note was voided. - pub voided_at: Option, -} - -impl CreditNote { - /// Returns a list of credit notes. - pub fn list(client: &Client, params: &ListCreditNotes<'_>) -> Response> { - client.get_query("/credit_notes", ¶ms) - } - - /// Issue a credit note to adjust the amount of a finalized invoice. - /// - /// For a `status=open` invoice, a credit note reduces its `amount_due`. - /// For a `status=paid` invoice, a credit note does not affect its `amount_due`. - /// Instead, it can result in any combination of the following:
  • Refund: create a new refund (using `refund_amount`) or link an existing refund (using `refund`).
  • Customer balance credit: credit the customer’s balance (using `credit_amount`) which will be automatically applied to their next invoice when it’s finalized.
  • Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using `out_of_band_amount`).
For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total. You may issue multiple credit notes for an invoice. - /// Each credit note will increment the invoice’s `pre_payment_credit_notes_amount` or `post_payment_credit_notes_amount` depending on its `status` at the time of credit note creation. - pub fn create(client: &Client, params: CreateCreditNote<'_>) -> Response { - client.post_form("/credit_notes", ¶ms) - } - - /// Retrieves the credit note object with the given identifier. - pub fn retrieve(client: &Client, id: &CreditNoteId, expand: &[&str]) -> Response { - client.get_query(&format!("/credit_notes/{}", id), &Expand { expand }) - } - - /// Updates an existing credit note. - pub fn update( - client: &Client, - id: &CreditNoteId, - params: UpdateCreditNote<'_>, - ) -> Response { - client.post_form(&format!("/credit_notes/{}", id), ¶ms) - } -} - -impl Object for CreditNote { - type Id = CreditNoteId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "credit_note" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreditNoteTaxAmount { - /// The amount, in cents (or local equivalent), of the tax. - pub amount: i64, - - /// Whether this tax amount is inclusive or exclusive. - pub inclusive: bool, - - /// The tax rate that was applied to get this tax amount. - pub tax_rate: Expandable, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: Option, - - /// The amount on which tax is calculated, in cents (or local equivalent). - pub taxable_amount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DiscountsResourceDiscountAmount { - /// The amount, in cents (or local equivalent), of the discount. - pub amount: i64, - - /// The discount that was applied to get this discount amount. - pub discount: Expandable, -} - -/// The parameters for `CreditNote::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateCreditNote<'a> { - /// The integer amount in cents (or local equivalent) representing the total amount of the credit note. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub credit_amount: Option, - - /// The date when this credit note is in effect. - /// - /// Same as `created` unless overwritten. - /// When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. - #[serde(skip_serializing_if = "Option::is_none")] - pub effective_at: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// ID of the invoice. - pub invoice: InvoiceId, - - /// Line items that make up the credit note. - #[serde(skip_serializing_if = "Option::is_none")] - pub lines: Option>, - - /// The credit note's memo appears on the credit note PDF. - #[serde(skip_serializing_if = "Option::is_none")] - pub memo: Option<&'a str>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. - #[serde(skip_serializing_if = "Option::is_none")] - pub out_of_band_amount: Option, - - /// Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`. - #[serde(skip_serializing_if = "Option::is_none")] - pub reason: Option, - - /// ID of an existing refund to link this credit note to. - #[serde(skip_serializing_if = "Option::is_none")] - pub refund: Option, - - /// The integer amount in cents (or local equivalent) representing the amount to refund. - /// - /// If set, a refund will be created for the charge associated with the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_amount: Option, - - /// When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_cost: Option, -} - -impl<'a> CreateCreditNote<'a> { - pub fn new(invoice: InvoiceId) -> Self { - CreateCreditNote { - amount: Default::default(), - credit_amount: Default::default(), - effective_at: Default::default(), - expand: Default::default(), - invoice, - lines: Default::default(), - memo: Default::default(), - metadata: Default::default(), - out_of_band_amount: Default::default(), - reason: Default::default(), - refund: Default::default(), - refund_amount: Default::default(), - shipping_cost: Default::default(), - } - } -} - -/// The parameters for `CreditNote::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListCreditNotes<'a> { - /// Only return credit notes for the customer specified by this customer ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Only return credit notes for the invoice specified by this invoice ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice: Option, - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListCreditNotes<'a> { - pub fn new() -> Self { - ListCreditNotes { - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - invoice: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListCreditNotes<'_> { - type O = CreditNote; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `CreditNote::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateCreditNote<'a> { - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Credit note memo. - #[serde(skip_serializing_if = "Option::is_none")] - pub memo: Option<&'a str>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl<'a> UpdateCreditNote<'a> { - pub fn new() -> Self { - UpdateCreditNote { - expand: Default::default(), - memo: Default::default(), - metadata: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCreditNoteLines { - /// The line item amount to credit. - /// - /// Only valid when `type` is `invoice_line_item`. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// The description of the credit note line item. - /// - /// Only valid when the `type` is `custom_line_item`. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// The invoice line item to credit. - /// - /// Only valid when the `type` is `invoice_line_item`. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_line_item: Option, - - /// The line item quantity to credit. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The tax rates which apply to the credit note line item. - /// - /// Only valid when the `type` is `custom_line_item`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, - - /// Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. - #[serde(rename = "type")] - pub type_: CreateCreditNoteLinesType, - - /// The integer unit amount in cents (or local equivalent) of the credit note line item. - /// - /// This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. - /// Only valid when `type` is `custom_line_item`. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCreditNoteShippingCost { - /// The ID of the shipping rate to use for this order. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_rate: Option, -} - -/// An enum representing the possible values of an `CreateCreditNoteLines`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCreditNoteLinesType { - CustomLineItem, - InvoiceLineItem, -} - -impl CreateCreditNoteLinesType { - pub fn as_str(self) -> &'static str { - match self { - CreateCreditNoteLinesType::CustomLineItem => "custom_line_item", - CreateCreditNoteLinesType::InvoiceLineItem => "invoice_line_item", - } - } -} - -impl AsRef for CreateCreditNoteLinesType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCreditNoteLinesType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCreditNoteLinesType { - fn default() -> Self { - Self::CustomLineItem - } -} - -/// An enum representing the possible values of an `CreditNote`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreditNoteReason { - Duplicate, - Fraudulent, - OrderChange, - ProductUnsatisfactory, -} - -impl CreditNoteReason { - pub fn as_str(self) -> &'static str { - match self { - CreditNoteReason::Duplicate => "duplicate", - CreditNoteReason::Fraudulent => "fraudulent", - CreditNoteReason::OrderChange => "order_change", - CreditNoteReason::ProductUnsatisfactory => "product_unsatisfactory", - } - } -} - -impl AsRef for CreditNoteReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreditNoteReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreditNoteReason { - fn default() -> Self { - Self::Duplicate - } -} - -/// An enum representing the possible values of an `CreditNote`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreditNoteStatus { - Issued, - Void, -} - -impl CreditNoteStatus { - pub fn as_str(self) -> &'static str { - match self { - CreditNoteStatus::Issued => "issued", - CreditNoteStatus::Void => "void", - } - } -} - -impl AsRef for CreditNoteStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreditNoteStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreditNoteStatus { - fn default() -> Self { - Self::Issued - } -} - -/// An enum representing the possible values of an `CreditNoteTaxAmount`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreditNoteTaxAmountTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl CreditNoteTaxAmountTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - CreditNoteTaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - CreditNoteTaxAmountTaxabilityReason::NotCollecting => "not_collecting", - CreditNoteTaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - CreditNoteTaxAmountTaxabilityReason::NotSupported => "not_supported", - CreditNoteTaxAmountTaxabilityReason::PortionProductExempt => "portion_product_exempt", - CreditNoteTaxAmountTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - CreditNoteTaxAmountTaxabilityReason::PortionStandardRated => "portion_standard_rated", - CreditNoteTaxAmountTaxabilityReason::ProductExempt => "product_exempt", - CreditNoteTaxAmountTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - CreditNoteTaxAmountTaxabilityReason::ProportionallyRated => "proportionally_rated", - CreditNoteTaxAmountTaxabilityReason::ReducedRated => "reduced_rated", - CreditNoteTaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", - CreditNoteTaxAmountTaxabilityReason::StandardRated => "standard_rated", - CreditNoteTaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - CreditNoteTaxAmountTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for CreditNoteTaxAmountTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreditNoteTaxAmountTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreditNoteTaxAmountTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} - -/// An enum representing the possible values of an `CreditNote`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreditNoteType { - PostPayment, - PrePayment, -} - -impl CreditNoteType { - pub fn as_str(self) -> &'static str { - match self { - CreditNoteType::PostPayment => "post_payment", - CreditNoteType::PrePayment => "pre_payment", - } - } -} - -impl AsRef for CreditNoteType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreditNoteType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreditNoteType { - fn default() -> Self { - Self::PostPayment - } -} diff --git a/src/resources/generated/credit_note_line_item.rs b/src/resources/generated/credit_note_line_item.rs deleted file mode 100644 index 4461be9d3..000000000 --- a/src/resources/generated/credit_note_line_item.rs +++ /dev/null @@ -1,197 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::CreditNoteLineItemId; -use crate::params::{Expandable, Object}; -use crate::resources::{Discount, TaxRate}; - -/// The resource representing a Stripe "CreditNoteLineItem". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreditNoteLineItem { - /// Unique identifier for the object. - pub id: CreditNoteLineItemId, - - /// The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts. - pub amount: i64, - - /// The integer amount in cents (or local equivalent) representing the amount being credited for this line item, excluding all tax and discounts. - pub amount_excluding_tax: Option, - - /// Description of the item being credited. - pub description: Option, - - /// The integer amount in cents (or local equivalent) representing the discount being credited for this line item. - pub discount_amount: i64, - - /// The amount of discount calculated per discount for this line item. - pub discount_amounts: Vec, - - /// ID of the invoice line item being credited. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_line_item: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The number of units of product being credited. - pub quantity: Option, - - /// The amount of tax calculated per tax rate for this line item. - pub tax_amounts: Vec, - - /// The tax rates which apply to the line item. - pub tax_rates: Vec, - - /// The type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. - /// - /// When the type is `invoice_line_item` there is an additional `invoice_line_item` property on the resource the value of which is the id of the credited line item on the invoice. - #[serde(rename = "type")] - pub type_: CreditNoteLineItemType, - - /// The cost of each unit of product being credited. - pub unit_amount: Option, - - /// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. - pub unit_amount_decimal: Option, - - /// The amount in cents (or local equivalent) representing the unit amount being credited for this line item, excluding all tax and discounts. - pub unit_amount_excluding_tax: Option, -} - -impl Object for CreditNoteLineItem { - type Id = CreditNoteLineItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "credit_note_line_item" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreditNoteTaxAmount { - /// The amount, in cents (or local equivalent), of the tax. - pub amount: i64, - - /// Whether this tax amount is inclusive or exclusive. - pub inclusive: bool, - - /// The tax rate that was applied to get this tax amount. - pub tax_rate: Expandable, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: Option, - - /// The amount on which tax is calculated, in cents (or local equivalent). - pub taxable_amount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DiscountsResourceDiscountAmount { - /// The amount, in cents (or local equivalent), of the discount. - pub amount: i64, - - /// The discount that was applied to get this discount amount. - pub discount: Expandable, -} - -/// An enum representing the possible values of an `CreditNoteLineItem`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreditNoteLineItemType { - CustomLineItem, - InvoiceLineItem, -} - -impl CreditNoteLineItemType { - pub fn as_str(self) -> &'static str { - match self { - CreditNoteLineItemType::CustomLineItem => "custom_line_item", - CreditNoteLineItemType::InvoiceLineItem => "invoice_line_item", - } - } -} - -impl AsRef for CreditNoteLineItemType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreditNoteLineItemType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreditNoteLineItemType { - fn default() -> Self { - Self::CustomLineItem - } -} - -/// An enum representing the possible values of an `CreditNoteTaxAmount`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreditNoteTaxAmountTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl CreditNoteTaxAmountTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - CreditNoteTaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - CreditNoteTaxAmountTaxabilityReason::NotCollecting => "not_collecting", - CreditNoteTaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - CreditNoteTaxAmountTaxabilityReason::NotSupported => "not_supported", - CreditNoteTaxAmountTaxabilityReason::PortionProductExempt => "portion_product_exempt", - CreditNoteTaxAmountTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - CreditNoteTaxAmountTaxabilityReason::PortionStandardRated => "portion_standard_rated", - CreditNoteTaxAmountTaxabilityReason::ProductExempt => "product_exempt", - CreditNoteTaxAmountTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - CreditNoteTaxAmountTaxabilityReason::ProportionallyRated => "proportionally_rated", - CreditNoteTaxAmountTaxabilityReason::ReducedRated => "reduced_rated", - CreditNoteTaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", - CreditNoteTaxAmountTaxabilityReason::StandardRated => "standard_rated", - CreditNoteTaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - CreditNoteTaxAmountTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for CreditNoteTaxAmountTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreditNoteTaxAmountTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreditNoteTaxAmountTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} diff --git a/src/resources/generated/custom_unit_amount.rs b/src/resources/generated/custom_unit_amount.rs deleted file mode 100644 index d5a85c842..000000000 --- a/src/resources/generated/custom_unit_amount.rs +++ /dev/null @@ -1,20 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "CustomUnitAmount". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomUnitAmount { - /// The maximum unit amount the customer can specify for this item. - pub maximum: Option, - - /// The minimum unit amount the customer can specify for this item. - /// - /// Must be at least the minimum charge amount. - pub minimum: Option, - - /// The starting unit amount which can be updated by the customer. - pub preset: Option, -} diff --git a/src/resources/generated/customer.rs b/src/resources/generated/customer.rs deleted file mode 100644 index c92d45ed2..000000000 --- a/src/resources/generated/customer.rs +++ /dev/null @@ -1,1217 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CouponId, CustomerId, PaymentMethodId, PaymentSourceId, PromotionCodeId}; -use crate::params::{ - Deleted, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp, -}; -use crate::resources::{ - Address, CashBalance, Currency, Discount, InvoiceSettingRenderingOptions, PaymentMethod, - PaymentSource, PaymentSourceParams, Shipping, Subscription, TaxId, TestHelpersTestClock, -}; - -/// The resource representing a Stripe "Customer". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Customer { - /// Unique identifier for the object. - pub id: CustomerId, - - /// The customer's address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// The current balance, if any, that's stored on the customer. - /// - /// If negative, the customer has credit to apply to their next invoice. - /// If positive, the customer has an amount owed that's added to their next invoice. - /// The balance only considers amounts that Stripe hasn't successfully applied to any invoice. - /// It doesn't reflect unpaid invoices. - /// This balance is only taken into account after invoices finalize. - #[serde(skip_serializing_if = "Option::is_none")] - pub balance: Option, - - /// The current funds being held by Stripe on behalf of the customer. - /// - /// You can apply these funds towards payment intents when the source is "cash_balance". - /// The `settings[reconciliation_mode]` field describes if these funds apply to these payment intents manually or automatically. - #[serde(skip_serializing_if = "Option::is_none")] - pub cash_balance: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) the customer can be charged in for recurring billing purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// ID of the default payment source for the customer. - /// - /// If you use payment methods created through the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) field instead. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_source: Option>, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// If Stripe bills the customer's latest invoice by automatically charging and the latest charge fails, it sets `delinquent`` to `true``. - /// - /// If Stripe bills the invoice by sending it, and the invoice isn't paid by the due date, it also sets `delinquent`` to `true`. If an invoice becomes uncollectible by [dunning](https://stripe.com/docs/billing/automatic-collection), `delinquent` doesn't reset to `false`. - #[serde(skip_serializing_if = "Option::is_none")] - pub delinquent: Option, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Describes the current discount active on the customer, if there is one. - #[serde(skip_serializing_if = "Option::is_none")] - pub discount: Option, - - /// The customer's email address. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// The current multi-currency balances, if any, that's stored on the customer. - /// - /// If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. - /// If negative, the customer has an amount owed that's added to their next invoice denominated in that currency. - /// These balances don't apply to unpaid invoices. - /// They solely track amounts that Stripe hasn't successfully applied to any invoice. - /// Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_credit_balance: Option, - - /// The prefix for the customer used to generate unique invoice numbers. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_prefix: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_settings: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The customer's full name or business name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// The suffix of the customer's next invoice number (for example, 0001). - #[serde(skip_serializing_if = "Option::is_none")] - pub next_invoice_sequence: Option, - - /// The customer's phone number. - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// The customer's preferred locales (languages), ordered by preference. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locales: Option>, - - /// Mailing and shipping address for the customer. - /// - /// Appears on invoices emailed to this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - - /// The customer's payment sources, if any. - #[serde(default)] - pub sources: List, - - /// The customer's current subscriptions, if any. - #[serde(default)] - pub subscriptions: List, - - #[serde(skip_serializing_if = "Option::is_none")] - pub tax: Option, - - /// Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. - /// - /// When set to `reverse`, invoice and receipt PDFs include the following text: **"Reverse charge"**. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_exempt: Option, - - /// The customer's tax IDs. - #[serde(default)] - pub tax_ids: List, - - /// ID of the test clock that this customer belongs to. - #[serde(skip_serializing_if = "Option::is_none")] - pub test_clock: Option>, -} - -impl Customer { - /// Returns a list of your customers. - /// - /// The customers are returned sorted by creation date, with the most recent customers appearing first. - pub fn list(client: &Client, params: &ListCustomers<'_>) -> Response> { - client.get_query("/customers", ¶ms) - } - - /// Creates a new customer object. - pub fn create(client: &Client, params: CreateCustomer<'_>) -> Response { - client.post_form("/customers", ¶ms) - } - - /// Retrieves a Customer object. - pub fn retrieve(client: &Client, id: &CustomerId, expand: &[&str]) -> Response { - client.get_query(&format!("/customers/{}", id), &Expand { expand }) - } - - /// Updates the specified customer by setting the values of the parameters passed. - /// - /// Any parameters not provided will be left unchanged. - /// For example, if you pass the **source** parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges in the future. - /// When you update a customer to a new valid card source by passing the **source** parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the `past_due` state, then the latest open invoice for the subscription with automatic collection enabled will be retried. - /// This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. - /// Changing the **default_source** for a customer will not trigger this behavior. This request accepts mostly the same arguments as the customer creation call. - pub fn update( - client: &Client, - id: &CustomerId, - params: UpdateCustomer<'_>, - ) -> Response { - client.post_form(&format!("/customers/{}", id), ¶ms) - } - - /// Permanently deletes a customer. - /// - /// It cannot be undone. - /// Also immediately cancels any active subscriptions on the customer. - pub fn delete(client: &Client, id: &CustomerId) -> Response> { - client.delete(&format!("/customers/{}", id)) - } -} - -impl Object for Customer { - type Id = CustomerId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "customer" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerTax { - /// Surfaces if automatic tax computation is possible given the current customer location information. - pub automatic_tax: CustomerTaxAutomaticTax, - - /// A recent IP address of the customer used for tax reporting and tax location inference. - pub ip_address: Option, - - /// The customer's location as identified by Stripe Tax. - pub location: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerTaxLocation { - /// The customer's country as identified by Stripe Tax. - pub country: String, - - /// The data source used to infer the customer's location. - pub source: CustomerTaxLocationSource, - - /// The customer's state, county, province, or region as identified by Stripe Tax. - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceSettingCustomerSetting { - /// Default custom fields to be displayed on invoices for this customer. - pub custom_fields: Option>, - - /// ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. - pub default_payment_method: Option>, - - /// Default footer to be displayed on invoices for this customer. - pub footer: Option, - - /// Default options for invoice PDF rendering for this customer. - pub rendering_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceSettingCustomField { - /// The name of the custom field. - pub name: String, - - /// The value of the custom field. - pub value: String, -} - -/// The parameters for `Customer::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateCustomer<'a> { - /// The customer's address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. - /// - /// A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub balance: Option, - - /// Balance information and default balance settings for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub cash_balance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// An arbitrary string that you can attach to a customer object. - /// - /// It is displayed alongside the customer in the dashboard. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Customer's email address. - /// - /// It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. - /// This may be up to *512 characters*. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The prefix for the customer used to generate unique invoice numbers. - /// - /// Must be 3–12 uppercase letters or numbers. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_prefix: Option<&'a str>, - - /// Default invoice settings for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_settings: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The customer's full name or business name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option<&'a str>, - - /// The sequence to be used on the customer's next invoice. - /// - /// Defaults to 1. - #[serde(skip_serializing_if = "Option::is_none")] - pub next_invoice_sequence: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - /// The customer's phone number. - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option<&'a str>, - - /// Customer's preferred languages, ordered by preference. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locales: Option>, - - /// The API ID of a promotion code to apply to the customer. - /// - /// The customer will have a discount applied on all recurring payments. - /// Charges you create through the API will not have the discount. - #[serde(skip_serializing_if = "Option::is_none")] - pub promotion_code: Option, - - /// The customer's shipping information. - /// - /// Appears on invoices emailed to this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub source: Option, - - /// Tax details about the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax: Option, - - /// The customer's tax exemption. - /// - /// One of `none`, `exempt`, or `reverse`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_exempt: Option, - - /// The customer's tax IDs. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_id_data: Option>, - - /// ID of the test clock to attach to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub test_clock: Option<&'a str>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub validate: Option, -} - -impl<'a> CreateCustomer<'a> { - pub fn new() -> Self { - CreateCustomer { - address: Default::default(), - balance: Default::default(), - cash_balance: Default::default(), - coupon: Default::default(), - description: Default::default(), - email: Default::default(), - expand: Default::default(), - invoice_prefix: Default::default(), - invoice_settings: Default::default(), - metadata: Default::default(), - name: Default::default(), - next_invoice_sequence: Default::default(), - payment_method: Default::default(), - phone: Default::default(), - preferred_locales: Default::default(), - promotion_code: Default::default(), - shipping: Default::default(), - source: Default::default(), - tax: Default::default(), - tax_exempt: Default::default(), - tax_id_data: Default::default(), - test_clock: Default::default(), - validate: Default::default(), - } - } -} - -/// The parameters for `Customer::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListCustomers<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A case-sensitive filter on the list based on the customer's `email` field. - /// - /// The value must be a string. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option<&'a str>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// Provides a list of customers that are associated with the specified test clock. - /// - /// The response will not include customers with test clocks if this parameter is not set. - #[serde(skip_serializing_if = "Option::is_none")] - pub test_clock: Option<&'a str>, -} - -impl<'a> ListCustomers<'a> { - pub fn new() -> Self { - ListCustomers { - created: Default::default(), - email: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - test_clock: Default::default(), - } - } -} -impl Paginable for ListCustomers<'_> { - type O = Customer; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Customer::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateCustomer<'a> { - /// The customer's address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. - /// - /// A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub balance: Option, - - /// Balance information and default balance settings for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub cash_balance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) parameter. - /// - /// Provide the ID of a payment source already attached to this customer to make it this customer's default payment source. - /// - /// If you want to add a new payment source and make it the default, see the [source](https://stripe.com/docs/api/customers/update#update_customer-source) property. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_source: Option, - - /// An arbitrary string that you can attach to a customer object. - /// - /// It is displayed alongside the customer in the dashboard. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Customer's email address. - /// - /// It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. - /// This may be up to *512 characters*. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The prefix for the customer used to generate unique invoice numbers. - /// - /// Must be 3–12 uppercase letters or numbers. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_prefix: Option<&'a str>, - - /// Default invoice settings for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_settings: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The customer's full name or business name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option<&'a str>, - - /// The sequence to be used on the customer's next invoice. - /// - /// Defaults to 1. - #[serde(skip_serializing_if = "Option::is_none")] - pub next_invoice_sequence: Option, - - /// The customer's phone number. - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option<&'a str>, - - /// Customer's preferred languages, ordered by preference. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locales: Option>, - - /// The API ID of a promotion code to apply to the customer. - /// - /// The customer will have a discount applied on all recurring payments. - /// Charges you create through the API will not have the discount. - #[serde(skip_serializing_if = "Option::is_none")] - pub promotion_code: Option, - - /// The customer's shipping information. - /// - /// Appears on invoices emailed to this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub source: Option, - - /// Tax details about the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax: Option, - - /// The customer's tax exemption. - /// - /// One of `none`, `exempt`, or `reverse`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_exempt: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub validate: Option, -} - -impl<'a> UpdateCustomer<'a> { - pub fn new() -> Self { - UpdateCustomer { - address: Default::default(), - balance: Default::default(), - cash_balance: Default::default(), - coupon: Default::default(), - default_source: Default::default(), - description: Default::default(), - email: Default::default(), - expand: Default::default(), - invoice_prefix: Default::default(), - invoice_settings: Default::default(), - metadata: Default::default(), - name: Default::default(), - next_invoice_sequence: Default::default(), - phone: Default::default(), - preferred_locales: Default::default(), - promotion_code: Default::default(), - shipping: Default::default(), - source: Default::default(), - tax: Default::default(), - tax_exempt: Default::default(), - validate: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCustomerCashBalance { - /// Settings controlling the behavior of the customer's cash balance, - /// such as reconciliation of funds received. - #[serde(skip_serializing_if = "Option::is_none")] - pub settings: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCustomerShipping { - /// Customer shipping address. - pub address: CreateCustomerShippingAddress, - - /// Customer name. - pub name: String, - - /// Customer phone (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCustomerTax { - /// A recent IP address of the customer used for tax reporting and tax location inference. - /// - /// Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. - /// We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip_address: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerInvoiceSettings { - /// Default custom fields to be displayed on invoices for this customer. - /// - /// When updating, pass an empty string to remove previously-defined fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_payment_method: Option, - - /// Default footer to be displayed on invoices for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub footer: Option, - - /// Default options for invoice PDF rendering for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub rendering_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxIdData { - /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. - #[serde(rename = "type")] - pub type_: TaxIdType, - - /// Value of the tax ID. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateCustomerCashBalance { - /// Settings controlling the behavior of the customer's cash balance, - /// such as reconciliation of funds received. - #[serde(skip_serializing_if = "Option::is_none")] - pub settings: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateCustomerShipping { - /// Customer shipping address. - pub address: UpdateCustomerShippingAddress, - - /// Customer name. - pub name: String, - - /// Customer phone (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateCustomerTax { - /// A recent IP address of the customer used for tax reporting and tax location inference. - /// - /// Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. - /// We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip_address: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCustomerCashBalanceSettings { - /// Controls how funds transferred by the customer are applied to payment intents and invoices. - /// - /// Valid options are `automatic`, `manual`, or `merchant_default`. - /// For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). - #[serde(skip_serializing_if = "Option::is_none")] - pub reconciliation_mode: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCustomerShippingAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerInvoiceSettingsCustomFields { - /// The name of the custom field. - /// - /// This may be up to 30 characters. - pub name: String, - - /// The value of the custom field. - /// - /// This may be up to 30 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerInvoiceSettingsRenderingOptions { - /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. - /// - /// One of `exclude_tax` or `include_inclusive_tax`. - /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. - /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_tax_display: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateCustomerCashBalanceSettings { - /// Controls how funds transferred by the customer are applied to payment intents and invoices. - /// - /// Valid options are `automatic`, `manual`, or `merchant_default`. - /// For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). - #[serde(skip_serializing_if = "Option::is_none")] - pub reconciliation_mode: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateCustomerShippingAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -/// An enum representing the possible values of an `CreateCustomerCashBalanceSettings`'s `reconciliation_mode` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCustomerCashBalanceSettingsReconciliationMode { - Automatic, - Manual, - MerchantDefault, -} - -impl CreateCustomerCashBalanceSettingsReconciliationMode { - pub fn as_str(self) -> &'static str { - match self { - CreateCustomerCashBalanceSettingsReconciliationMode::Automatic => "automatic", - CreateCustomerCashBalanceSettingsReconciliationMode::Manual => "manual", - CreateCustomerCashBalanceSettingsReconciliationMode::MerchantDefault => { - "merchant_default" - } - } - } -} - -impl AsRef for CreateCustomerCashBalanceSettingsReconciliationMode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCustomerCashBalanceSettingsReconciliationMode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCustomerCashBalanceSettingsReconciliationMode { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CustomerInvoiceSettingsRenderingOptions`'s `amount_tax_display` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { - ExcludeTax, - IncludeInclusiveTax, -} - -impl CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { - pub fn as_str(self) -> &'static str { - match self { - CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay::ExcludeTax => "exclude_tax", - CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay::IncludeInclusiveTax => { - "include_inclusive_tax" - } - } - } -} - -impl AsRef for CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { - fn default() -> Self { - Self::ExcludeTax - } -} - -/// An enum representing the possible values of an `CustomerTax`'s `automatic_tax` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerTaxAutomaticTax { - Failed, - NotCollecting, - Supported, - UnrecognizedLocation, -} - -impl CustomerTaxAutomaticTax { - pub fn as_str(self) -> &'static str { - match self { - CustomerTaxAutomaticTax::Failed => "failed", - CustomerTaxAutomaticTax::NotCollecting => "not_collecting", - CustomerTaxAutomaticTax::Supported => "supported", - CustomerTaxAutomaticTax::UnrecognizedLocation => "unrecognized_location", - } - } -} - -impl AsRef for CustomerTaxAutomaticTax { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerTaxAutomaticTax { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerTaxAutomaticTax { - fn default() -> Self { - Self::Failed - } -} - -/// An enum representing the possible values of an `Customer`'s `tax_exempt` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerTaxExempt { - Exempt, - None, - Reverse, -} - -impl CustomerTaxExempt { - pub fn as_str(self) -> &'static str { - match self { - CustomerTaxExempt::Exempt => "exempt", - CustomerTaxExempt::None => "none", - CustomerTaxExempt::Reverse => "reverse", - } - } -} - -impl AsRef for CustomerTaxExempt { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerTaxExempt { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerTaxExempt { - fn default() -> Self { - Self::Exempt - } -} - -/// An enum representing the possible values of an `CreateCustomer`'s `tax_exempt` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerTaxExemptFilter { - Exempt, - None, - Reverse, -} - -impl CustomerTaxExemptFilter { - pub fn as_str(self) -> &'static str { - match self { - CustomerTaxExemptFilter::Exempt => "exempt", - CustomerTaxExemptFilter::None => "none", - CustomerTaxExemptFilter::Reverse => "reverse", - } - } -} - -impl AsRef for CustomerTaxExemptFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerTaxExemptFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerTaxExemptFilter { - fn default() -> Self { - Self::Exempt - } -} - -/// An enum representing the possible values of an `CustomerTaxLocation`'s `source` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerTaxLocationSource { - BillingAddress, - IpAddress, - PaymentMethod, - ShippingDestination, -} - -impl CustomerTaxLocationSource { - pub fn as_str(self) -> &'static str { - match self { - CustomerTaxLocationSource::BillingAddress => "billing_address", - CustomerTaxLocationSource::IpAddress => "ip_address", - CustomerTaxLocationSource::PaymentMethod => "payment_method", - CustomerTaxLocationSource::ShippingDestination => "shipping_destination", - } - } -} - -impl AsRef for CustomerTaxLocationSource { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerTaxLocationSource { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerTaxLocationSource { - fn default() -> Self { - Self::BillingAddress - } -} - -/// An enum representing the possible values of an `TaxIdData`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxIdType { - AdNrt, - AeTrn, - ArCuit, - AuAbn, - AuArn, - BgUic, - BoTin, - BrCnpj, - BrCpf, - CaBn, - CaGstHst, - CaPstBc, - CaPstMb, - CaPstSk, - CaQst, - ChVat, - ClTin, - CnTin, - CoNit, - CrTin, - DoRcn, - EcRuc, - EgTin, - EsCif, - EuOssVat, - EuVat, - GbVat, - GeVat, - HkBr, - HuTin, - IdNpwp, - IlVat, - InGst, - IsVat, - JpCn, - JpRn, - JpTrn, - KePin, - KrBrn, - LiUid, - MxRfc, - MyFrp, - MyItn, - MySst, - NoVat, - NzGst, - PeRuc, - PhTin, - RoTin, - RsPib, - RuInn, - RuKpp, - SaVat, - SgGst, - SgUen, - SiTin, - SvNit, - ThVat, - TrTin, - TwVat, - UaVat, - UsEin, - UyRuc, - VeRif, - VnTin, - ZaVat, -} - -impl TaxIdType { - pub fn as_str(self) -> &'static str { - match self { - TaxIdType::AdNrt => "ad_nrt", - TaxIdType::AeTrn => "ae_trn", - TaxIdType::ArCuit => "ar_cuit", - TaxIdType::AuAbn => "au_abn", - TaxIdType::AuArn => "au_arn", - TaxIdType::BgUic => "bg_uic", - TaxIdType::BoTin => "bo_tin", - TaxIdType::BrCnpj => "br_cnpj", - TaxIdType::BrCpf => "br_cpf", - TaxIdType::CaBn => "ca_bn", - TaxIdType::CaGstHst => "ca_gst_hst", - TaxIdType::CaPstBc => "ca_pst_bc", - TaxIdType::CaPstMb => "ca_pst_mb", - TaxIdType::CaPstSk => "ca_pst_sk", - TaxIdType::CaQst => "ca_qst", - TaxIdType::ChVat => "ch_vat", - TaxIdType::ClTin => "cl_tin", - TaxIdType::CnTin => "cn_tin", - TaxIdType::CoNit => "co_nit", - TaxIdType::CrTin => "cr_tin", - TaxIdType::DoRcn => "do_rcn", - TaxIdType::EcRuc => "ec_ruc", - TaxIdType::EgTin => "eg_tin", - TaxIdType::EsCif => "es_cif", - TaxIdType::EuOssVat => "eu_oss_vat", - TaxIdType::EuVat => "eu_vat", - TaxIdType::GbVat => "gb_vat", - TaxIdType::GeVat => "ge_vat", - TaxIdType::HkBr => "hk_br", - TaxIdType::HuTin => "hu_tin", - TaxIdType::IdNpwp => "id_npwp", - TaxIdType::IlVat => "il_vat", - TaxIdType::InGst => "in_gst", - TaxIdType::IsVat => "is_vat", - TaxIdType::JpCn => "jp_cn", - TaxIdType::JpRn => "jp_rn", - TaxIdType::JpTrn => "jp_trn", - TaxIdType::KePin => "ke_pin", - TaxIdType::KrBrn => "kr_brn", - TaxIdType::LiUid => "li_uid", - TaxIdType::MxRfc => "mx_rfc", - TaxIdType::MyFrp => "my_frp", - TaxIdType::MyItn => "my_itn", - TaxIdType::MySst => "my_sst", - TaxIdType::NoVat => "no_vat", - TaxIdType::NzGst => "nz_gst", - TaxIdType::PeRuc => "pe_ruc", - TaxIdType::PhTin => "ph_tin", - TaxIdType::RoTin => "ro_tin", - TaxIdType::RsPib => "rs_pib", - TaxIdType::RuInn => "ru_inn", - TaxIdType::RuKpp => "ru_kpp", - TaxIdType::SaVat => "sa_vat", - TaxIdType::SgGst => "sg_gst", - TaxIdType::SgUen => "sg_uen", - TaxIdType::SiTin => "si_tin", - TaxIdType::SvNit => "sv_nit", - TaxIdType::ThVat => "th_vat", - TaxIdType::TrTin => "tr_tin", - TaxIdType::TwVat => "tw_vat", - TaxIdType::UaVat => "ua_vat", - TaxIdType::UsEin => "us_ein", - TaxIdType::UyRuc => "uy_ruc", - TaxIdType::VeRif => "ve_rif", - TaxIdType::VnTin => "vn_tin", - TaxIdType::ZaVat => "za_vat", - } - } -} - -impl AsRef for TaxIdType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxIdType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxIdType { - fn default() -> Self { - Self::AdNrt - } -} - -/// An enum representing the possible values of an `UpdateCustomerCashBalanceSettings`'s `reconciliation_mode` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateCustomerCashBalanceSettingsReconciliationMode { - Automatic, - Manual, - MerchantDefault, -} - -impl UpdateCustomerCashBalanceSettingsReconciliationMode { - pub fn as_str(self) -> &'static str { - match self { - UpdateCustomerCashBalanceSettingsReconciliationMode::Automatic => "automatic", - UpdateCustomerCashBalanceSettingsReconciliationMode::Manual => "manual", - UpdateCustomerCashBalanceSettingsReconciliationMode::MerchantDefault => { - "merchant_default" - } - } - } -} - -impl AsRef for UpdateCustomerCashBalanceSettingsReconciliationMode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateCustomerCashBalanceSettingsReconciliationMode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateCustomerCashBalanceSettingsReconciliationMode { - fn default() -> Self { - Self::Automatic - } -} diff --git a/src/resources/generated/customer_balance_transaction.rs b/src/resources/generated/customer_balance_transaction.rs deleted file mode 100644 index 8b102c8a8..000000000 --- a/src/resources/generated/customer_balance_transaction.rs +++ /dev/null @@ -1,127 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::CustomerBalanceTransactionId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{CreditNote, Currency, Customer, Invoice}; - -/// The resource representing a Stripe "CustomerBalanceTransaction". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceTransaction { - /// Unique identifier for the object. - pub id: CustomerBalanceTransactionId, - - /// The amount of the transaction. - /// - /// A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's `balance`. - pub amount: i64, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The ID of the credit note (if any) related to the transaction. - pub credit_note: Option>, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of the customer the transaction belongs to. - pub customer: Expandable, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// The customer's `balance` after the transaction was applied. - /// - /// A negative value decreases the amount due on the customer's next invoice. - /// A positive value increases the amount due on the customer's next invoice. - pub ending_balance: i64, - - /// The ID of the invoice (if any) related to the transaction. - pub invoice: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, or `unapplied_from_invoice`. - /// - /// See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types. - #[serde(rename = "type")] - pub type_: CustomerBalanceTransactionType, -} - -impl Object for CustomerBalanceTransaction { - type Id = CustomerBalanceTransactionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "customer_balance_transaction" - } -} - -/// An enum representing the possible values of an `CustomerBalanceTransaction`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerBalanceTransactionType { - Adjustment, - AppliedToInvoice, - CreditNote, - Initial, - InvoiceOverpaid, - InvoiceTooLarge, - InvoiceTooSmall, - Migration, - UnappliedFromInvoice, - UnspentReceiverCredit, -} - -impl CustomerBalanceTransactionType { - pub fn as_str(self) -> &'static str { - match self { - CustomerBalanceTransactionType::Adjustment => "adjustment", - CustomerBalanceTransactionType::AppliedToInvoice => "applied_to_invoice", - CustomerBalanceTransactionType::CreditNote => "credit_note", - CustomerBalanceTransactionType::Initial => "initial", - CustomerBalanceTransactionType::InvoiceOverpaid => "invoice_overpaid", - CustomerBalanceTransactionType::InvoiceTooLarge => "invoice_too_large", - CustomerBalanceTransactionType::InvoiceTooSmall => "invoice_too_small", - CustomerBalanceTransactionType::Migration => "migration", - CustomerBalanceTransactionType::UnappliedFromInvoice => "unapplied_from_invoice", - CustomerBalanceTransactionType::UnspentReceiverCredit => "unspent_receiver_credit", - } - } -} - -impl AsRef for CustomerBalanceTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerBalanceTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerBalanceTransactionType { - fn default() -> Self { - Self::Adjustment - } -} diff --git a/src/resources/generated/customer_cash_balance_transaction.rs b/src/resources/generated/customer_cash_balance_transaction.rs deleted file mode 100644 index e2d8951bf..000000000 --- a/src/resources/generated/customer_cash_balance_transaction.rs +++ /dev/null @@ -1,309 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{CustomerCashBalanceTransactionId}; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::{BalanceTransaction, Currency, Customer, PaymentIntent, Refund}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "CustomerCashBalanceTransaction". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerCashBalanceTransaction { - /// Unique identifier for the object. - pub id: CustomerCashBalanceTransactionId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub adjusted_for_overdraft: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub applied_to_payment: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The customer whose available cash balance changed as a result of this transaction. - pub customer: Expandable, - - /// The total available cash balance for the specified currency after this transaction was applied. - /// - /// Represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub ending_balance: i64, - - #[serde(skip_serializing_if = "Option::is_none")] - pub funded: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The amount by which the cash balance changed, represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - /// - /// A positive value represents funds being added to the cash balance, a negative value represents funds being removed from the cash balance. - pub net_amount: i64, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refunded_from_payment: Option, - - /// The type of the cash balance transaction. - /// - /// New types may be added in future. - /// See [Customer Balance](https://stripe.com/docs/payments/customer-balance#types) to learn more about these types. - #[serde(rename = "type")] - pub type_: CustomerCashBalanceTransactionType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub unapplied_from_payment: Option, -} - -impl Object for CustomerCashBalanceTransaction { - type Id = CustomerCashBalanceTransactionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "customer_cash_balance_transaction" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceAdjustedForOverdraft { - - /// The [Balance Transaction](docs/api/balance_transactions/object) that corresponds to funds taken out of your Stripe balance. - pub balance_transaction: Expandable, - - /// The [Cash Balance Transaction](https://stripe.com/docs/api/cash_balance_transactions/object) that brought the customer balance negative, triggering the clawback of funds. - pub linked_transaction: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceAppliedToPaymentTransaction { - - /// The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were applied to. - pub payment_intent: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransaction { - - pub bank_transfer: CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransfer, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransfer { - - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub gb_bank_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub jp_bank_transfer: Option, - - /// The user-supplied reference field on the bank transfer. - pub reference: Option, - - /// The funding method type used to fund the customer balance. - /// - /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - pub type_: CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_transfer: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceEuBankTransfer { - - /// The BIC of the bank of the sender of the funding. - pub bic: Option, - - /// The last 4 digits of the IBAN of the sender of the funding. - pub iban_last4: Option, - - /// The full name of the sender, as supplied by the sending bank. - pub sender_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceGbBankTransfer { - - /// The last 4 digits of the account number of the sender of the funding. - pub account_number_last4: Option, - - /// The full name of the sender, as supplied by the sending bank. - pub sender_name: Option, - - /// The sort code of the bank of the sender of the funding. - pub sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceJpBankTransfer { - - /// The name of the bank of the sender of the funding. - pub sender_bank: Option, - - /// The name of the bank branch of the sender of the funding. - pub sender_branch: Option, - - /// The full name of the sender, as supplied by the sending bank. - pub sender_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransfer { - - /// The banking network used for this funding. - #[serde(skip_serializing_if = "Option::is_none")] - pub network: Option, - - /// The full name of the sender, as supplied by the sending bank. - pub sender_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceRefundedFromPaymentTransaction { - - /// The [Refund](https://stripe.com/docs/api/refunds/object) that moved these funds into the customer's cash balance. - pub refund: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceUnappliedFromPaymentTransaction { - - /// The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were unapplied from. - pub payment_intent: Expandable, -} - -/// An enum representing the possible values of an `CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransfer`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { - Ach, - DomesticWireUs, - Swift, -} - -impl CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { - pub fn as_str(self) -> &'static str { - match self { - CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork::Ach => "ach", - CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork::DomesticWireUs => "domestic_wire_us", - CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork::Swift => "swift", - } - } -} - -impl AsRef for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransfer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { - EuBankTransfer, - GbBankTransfer, - JpBankTransfer, - MxBankTransfer, - UsBankTransfer, -} - -impl CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { - pub fn as_str(self) -> &'static str { - match self { - CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType::EuBankTransfer => "eu_bank_transfer", - CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType::GbBankTransfer => "gb_bank_transfer", - CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType::JpBankTransfer => "jp_bank_transfer", - CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType::MxBankTransfer => "mx_bank_transfer", - CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType::UsBankTransfer => "us_bank_transfer", - } - } -} - -impl AsRef for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { - fn default() -> Self { - Self::EuBankTransfer - } -} - -/// An enum representing the possible values of an `CustomerCashBalanceTransaction`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerCashBalanceTransactionType { - AdjustedForOverdraft, - AppliedToPayment, - Funded, - FundingReversed, - RefundedFromPayment, - ReturnCanceled, - ReturnInitiated, - UnappliedFromPayment, -} - -impl CustomerCashBalanceTransactionType { - pub fn as_str(self) -> &'static str { - match self { - CustomerCashBalanceTransactionType::AdjustedForOverdraft => "adjusted_for_overdraft", - CustomerCashBalanceTransactionType::AppliedToPayment => "applied_to_payment", - CustomerCashBalanceTransactionType::Funded => "funded", - CustomerCashBalanceTransactionType::FundingReversed => "funding_reversed", - CustomerCashBalanceTransactionType::RefundedFromPayment => "refunded_from_payment", - CustomerCashBalanceTransactionType::ReturnCanceled => "return_canceled", - CustomerCashBalanceTransactionType::ReturnInitiated => "return_initiated", - CustomerCashBalanceTransactionType::UnappliedFromPayment => "unapplied_from_payment", - } - } -} - -impl AsRef for CustomerCashBalanceTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerCashBalanceTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerCashBalanceTransactionType { - fn default() -> Self { - Self::AdjustedForOverdraft - } -} diff --git a/src/resources/generated/discount.rs b/src/resources/generated/discount.rs deleted file mode 100644 index 4ab82cd45..000000000 --- a/src/resources/generated/discount.rs +++ /dev/null @@ -1,66 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::DiscountId; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::{Coupon, Customer, PromotionCode}; - -/// The resource representing a Stripe "Discount". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Discount { - /// The ID of the discount object. - /// - /// Discounts cannot be fetched by ID. - /// Use `expand[]=discounts` in API calls to expand discount IDs in an array. - pub id: DiscountId, - - /// The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. - /// - /// Will not be present for subscription mode. - pub checkout_session: Option, - - pub coupon: Coupon, - - /// The ID of the customer associated with this discount. - pub customer: Option>, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// If the coupon has a duration of `repeating`, the date that this discount will end. - /// - /// If the coupon has a duration of `once` or `forever`, this attribute will be null. - #[serde(skip_serializing_if = "Option::is_none")] - pub end: Option, - - /// The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice. - pub invoice: Option, - - /// The invoice item `id` (or invoice line item `id` for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item. - pub invoice_item: Option, - - /// The promotion code applied to create this discount. - pub promotion_code: Option>, - - /// Date that the coupon was applied. - pub start: Timestamp, - - /// The subscription that this coupon is applied to, if it is applied to a particular subscription. - pub subscription: Option, -} - -impl Object for Discount { - type Id = DiscountId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "discount" - } -} diff --git a/src/resources/generated/dispute.rs b/src/resources/generated/dispute.rs deleted file mode 100644 index 129291a98..000000000 --- a/src/resources/generated/dispute.rs +++ /dev/null @@ -1,380 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ChargeId, DisputeId, PaymentIntentId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{BalanceTransaction, Charge, Currency, File, PaymentIntent}; - -/// The resource representing a Stripe "Dispute". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Dispute { - /// Unique identifier for the object. - pub id: DisputeId, - - /// Disputed amount. - /// - /// Usually the amount of the charge, but it can differ (usually because of currency fluctuation or because only part of the order is disputed). - pub amount: i64, - - /// List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute. - pub balance_transactions: Vec, - - /// ID of the charge that's disputed. - pub charge: Expandable, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - pub evidence: DisputeEvidence, - - pub evidence_details: DisputeEvidenceDetails, - - /// If true, it's still possible to refund the disputed payment. - /// - /// After the payment has been fully refunded, no further funds are withdrawn from your Stripe account as a result of this dispute. - pub is_charge_refundable: bool, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// Network-dependent reason code for the dispute. - #[serde(skip_serializing_if = "Option::is_none")] - pub network_reason_code: Option, - - /// ID of the PaymentIntent that's disputed. - pub payment_intent: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_details: Option, - - /// Reason given by cardholder for dispute. - /// - /// Possible values are `bank_cannot_process`, `check_returned`, `credit_not_processed`, `customer_initiated`, `debit_not_authorized`, `duplicate`, `fraudulent`, `general`, `incorrect_account_details`, `insufficient_funds`, `product_not_received`, `product_unacceptable`, `subscription_canceled`, or `unrecognized`. - /// Learn more about [dispute reasons](https://stripe.com/docs/disputes/categories). - pub reason: String, - - /// Current status of dispute. - /// - /// Possible values are `warning_needs_response`, `warning_under_review`, `warning_closed`, `needs_response`, `under_review`, `won`, or `lost`. - pub status: DisputeStatus, -} - -impl Dispute { - /// Returns a list of your disputes. - pub fn list(client: &Client, params: &ListDisputes<'_>) -> Response> { - client.get_query("/disputes", ¶ms) - } - - /// Retrieves the dispute with the given ID. - pub fn retrieve(client: &Client, id: &DisputeId, expand: &[&str]) -> Response { - client.get_query(&format!("/disputes/{}", id), &Expand { expand }) - } -} - -impl Object for Dispute { - type Id = DisputeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "dispute" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DisputeEvidence { - /// Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. - /// - /// This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. - pub access_activity_log: Option, - - /// The billing address provided by the customer. - pub billing_address: Option, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your subscription cancellation policy, as shown to the customer. - pub cancellation_policy: Option>, - - /// An explanation of how and when the customer was shown your refund policy prior to purchase. - pub cancellation_policy_disclosure: Option, - - /// A justification for why the customer's subscription was not canceled. - pub cancellation_rebuttal: Option, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any communication with the customer that you feel is relevant to your case. - /// - /// Examples include emails proving that the customer received the product or service, or demonstrating their use of or satisfaction with the product or service. - pub customer_communication: Option>, - - /// The email address of the customer. - pub customer_email_address: Option, - - /// The name of the customer. - pub customer_name: Option, - - /// The IP address that the customer used when making the purchase. - pub customer_purchase_ip: Option, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A relevant document or contract showing the customer's signature. - pub customer_signature: Option>, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation for the prior charge that can uniquely identify the charge, such as a receipt, shipping label, work order, etc. - /// - /// This document should be paired with a similar document from the disputed payment that proves the two payments are separate. - pub duplicate_charge_documentation: Option>, - - /// An explanation of the difference between the disputed charge versus the prior charge that appears to be a duplicate. - pub duplicate_charge_explanation: Option, - - /// The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. - pub duplicate_charge_id: Option, - - /// A description of the product or service that was sold. - pub product_description: Option, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any receipt or message sent to the customer notifying them of the charge. - pub receipt: Option>, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your refund policy, as shown to the customer. - pub refund_policy: Option>, - - /// Documentation demonstrating that the customer was shown your refund policy prior to purchase. - pub refund_policy_disclosure: Option, - - /// A justification for why the customer is not entitled to a refund. - pub refund_refusal_explanation: Option, - - /// The date on which the customer received or began receiving the purchased service, in a clear human-readable format. - pub service_date: Option, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a service was provided to the customer. - /// - /// This could include a copy of a signed contract, work order, or other form of written agreement. - pub service_documentation: Option>, - - /// The address to which a physical product was shipped. - /// - /// You should try to include as complete address information as possible. - pub shipping_address: Option, - - /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - /// - /// If multiple carriers were used for this purchase, please separate them with commas. - pub shipping_carrier: Option, - - /// The date on which a physical product began its route to the shipping address, in a clear human-readable format. - pub shipping_date: Option, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a product was shipped to the customer at the same address the customer provided to you. - /// - /// This could include a copy of the shipment receipt, shipping label, etc. - /// It should show the customer's full shipping address, if possible. - pub shipping_documentation: Option>, - - /// The tracking number for a physical product, obtained from the delivery service. - /// - /// If multiple tracking numbers were generated for this purchase, please separate them with commas. - pub shipping_tracking_number: Option, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any additional evidence or statements. - pub uncategorized_file: Option>, - - /// Any additional evidence or statements. - pub uncategorized_text: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DisputeEvidenceDetails { - /// Date by which evidence must be submitted in order to successfully challenge dispute. - /// - /// Will be 0 if the customer's bank or credit card company doesn't allow a response for this particular dispute. - pub due_by: Option, - - /// Whether evidence has been staged for this dispute. - pub has_evidence: bool, - - /// Whether the last evidence submission was submitted past the due date. - /// - /// Defaults to `false` if no evidence submissions have occurred. - /// If `true`, then delivery of the latest evidence is *not* guaranteed. - pub past_due: bool, - - /// The number of times evidence has been submitted. - /// - /// Typically, you may only submit evidence once. - pub submission_count: u64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DisputePaymentMethodDetails { - /// Card specific dispute details. - pub card: Option, - - /// Payment method type. - #[serde(rename = "type")] - pub type_: DisputePaymentMethodDetailsType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DisputePaymentMethodDetailsCard { - /// Card brand. - /// - /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub brand: String, - - /// The card network's specific dispute reason code, which maps to one of Stripe's primary dispute categories to simplify response guidance. - /// - /// The [Network code map](https://stripe.com/docs/disputes/categories#network-code-map) lists all available dispute reason codes by network. - pub network_reason_code: Option, -} - -/// The parameters for `Dispute::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListDisputes<'a> { - /// Only return disputes associated to the charge specified by this charge ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub charge: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return disputes associated to the PaymentIntent specified by this PaymentIntent ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListDisputes<'a> { - pub fn new() -> Self { - ListDisputes { - charge: Default::default(), - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - payment_intent: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListDisputes<'_> { - type O = Dispute; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// An enum representing the possible values of an `DisputePaymentMethodDetails`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum DisputePaymentMethodDetailsType { - Card, -} - -impl DisputePaymentMethodDetailsType { - pub fn as_str(self) -> &'static str { - match self { - DisputePaymentMethodDetailsType::Card => "card", - } - } -} - -impl AsRef for DisputePaymentMethodDetailsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for DisputePaymentMethodDetailsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for DisputePaymentMethodDetailsType { - fn default() -> Self { - Self::Card - } -} - -/// An enum representing the possible values of an `Dispute`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum DisputeStatus { - Lost, - NeedsResponse, - UnderReview, - WarningClosed, - WarningNeedsResponse, - WarningUnderReview, - Won, -} - -impl DisputeStatus { - pub fn as_str(self) -> &'static str { - match self { - DisputeStatus::Lost => "lost", - DisputeStatus::NeedsResponse => "needs_response", - DisputeStatus::UnderReview => "under_review", - DisputeStatus::WarningClosed => "warning_closed", - DisputeStatus::WarningNeedsResponse => "warning_needs_response", - DisputeStatus::WarningUnderReview => "warning_under_review", - DisputeStatus::Won => "won", - } - } -} - -impl AsRef for DisputeStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for DisputeStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for DisputeStatus { - fn default() -> Self { - Self::Lost - } -} diff --git a/src/resources/generated/ephemeral_key.rs b/src/resources/generated/ephemeral_key.rs deleted file mode 100644 index a9ee6c0fc..000000000 --- a/src/resources/generated/ephemeral_key.rs +++ /dev/null @@ -1,93 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, EphemeralKeyId, IssuingCardId}; -use crate::params::{Deleted, Expand, Object, Timestamp}; - -/// The resource representing a Stripe "EphemeralKey". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct EphemeralKey { - /// Unique identifier for the object. - pub id: EphemeralKeyId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Time at which the key will expire. - /// - /// Measured in seconds since the Unix epoch. - pub expires: Timestamp, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The key's secret. - /// - /// You can use this value to make authorized requests to the Stripe API. - #[serde(skip_serializing_if = "Option::is_none")] - pub secret: Option, -} - -impl EphemeralKey { - /// Creates a short-lived API key for a given resource. - pub fn create(client: &Client, params: CreateEphemeralKey<'_>) -> Response { - client.post_form("/ephemeral_keys", ¶ms) - } - - /// Invalidates a short-lived API key for a given resource. - pub fn delete(client: &Client, id: &EphemeralKeyId) -> Response> { - client.delete(&format!("/ephemeral_keys/{}", id)) - } -} - -impl Object for EphemeralKey { - type Id = EphemeralKeyId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "ephemeral_key" - } -} - -/// The parameters for `EphemeralKey::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateEphemeralKey<'a> { - /// The ID of the Customer you'd like to modify using the resulting ephemeral key. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The ID of the Issuing Card you'd like to access using the resulting ephemeral key. - #[serde(skip_serializing_if = "Option::is_none")] - pub issuing_card: Option, - - /// A single-use token, created by Stripe.js, used for creating ephemeral keys for Issuing Cards without exchanging sensitive information. - #[serde(skip_serializing_if = "Option::is_none")] - pub nonce: Option<&'a str>, - - /// The ID of the Identity VerificationSession you'd like to access using the resulting ephemeral key. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_session: Option<&'a str>, -} - -impl<'a> CreateEphemeralKey<'a> { - pub fn new() -> Self { - CreateEphemeralKey { - customer: Default::default(), - expand: Default::default(), - issuing_card: Default::default(), - nonce: Default::default(), - verification_session: Default::default(), - } - } -} diff --git a/src/resources/generated/event.rs b/src/resources/generated/event.rs deleted file mode 100644 index a3a85e112..000000000 --- a/src/resources/generated/event.rs +++ /dev/null @@ -1,160 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::EventId; -use crate::params::{Expand, List, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{EventType, NotificationEventData}; - -/// The resource representing a Stripe "NotificationEvent". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Event { - /// Unique identifier for the object. - pub id: EventId, - - /// The connected account that originates the event. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// The Stripe API version used to render `data`. - /// - /// This property is populated only for events on or after October 31, 2014. - pub api_version: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - pub data: NotificationEventData, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify. - pub pending_webhooks: i64, - - /// Information on the API request that triggers the event. - pub request: Option, - - /// Description of the event (for example, `invoice.created` or `charge.refunded`). - #[serde(rename = "type")] - pub type_: EventType, -} - -impl Event { - /// List events, going back up to 30 days. - /// - /// Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) `api_version` attribute (not according to your current Stripe API version or `Stripe-Version` header). - pub fn list(client: &Client, params: &ListEvents<'_>) -> Response> { - client.get_query("/events", ¶ms) - } - - /// Retrieves the details of an event. - /// - /// Supply the unique identifier of the event, which you might have received in a webhook. - pub fn retrieve(client: &Client, id: &EventId, expand: &[&str]) -> Response { - client.get_query(&format!("/events/{}", id), &Expand { expand }) - } -} - -impl Object for Event { - type Id = EventId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "event" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct NotificationEventRequest { - /// ID of the API request that caused the event. - /// - /// If null, the event was automatic (e.g., Stripe's automatic subscription handling). - /// Request logs are available in the [dashboard](https://dashboard.stripe.com/logs), but currently not in the API. - pub id: Option, - - /// The idempotency key transmitted during the request, if any. - /// - /// *Note: This property is populated only for events on or after May 23, 2017*. - pub idempotency_key: Option, -} - -/// The parameters for `Event::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListEvents<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Filter events by whether all webhooks were successfully delivered. - /// - /// If false, events which are still pending or have failed all delivery attempts to a webhook endpoint will be returned. - #[serde(skip_serializing_if = "Option::is_none")] - pub delivery_success: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// A string containing a specific event name, or group of events using * as a wildcard. - /// - /// The list will be filtered to include only events with a matching event property. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option<&'a str>, - - /// An array of up to 20 strings containing specific event names. - /// - /// The list will be filtered to include only events with a matching event property. - /// You may pass either `type` or `types`, but not both. - #[serde(skip_serializing_if = "Option::is_none")] - pub types: Option>, -} - -impl<'a> ListEvents<'a> { - pub fn new() -> Self { - ListEvents { - created: Default::default(), - delivery_success: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - type_: Default::default(), - types: Default::default(), - } - } -} -impl Paginable for ListEvents<'_> { - type O = Event; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} diff --git a/src/resources/generated/exchange_rate.rs b/src/resources/generated/exchange_rate.rs deleted file mode 100644 index 52f13cf58..000000000 --- a/src/resources/generated/exchange_rate.rs +++ /dev/null @@ -1,91 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::client::{Client, Response}; -use crate::ids::{ExchangeRateId}; -use crate::params::{Expand, List, Object, Paginable}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "ExchangeRate". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ExchangeRate { - /// Unique identifier for the object. - /// - /// Represented as the three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. - pub id: ExchangeRateId, - - /// Hash where the keys are supported currencies and the values are the exchange rate at which the base id currency converts to the key currency. - pub rates: f64, -} - -impl ExchangeRate { - - /// Returns a list of objects that contain the rates at which foreign currencies are converted to one another. - /// - /// Only shows the currencies for which Stripe supports. -pub fn list(client: &Client, params: &ListExchangeRates<'_>) -> Response> { - client.get_query("/exchange_rates", ¶ms) -} - - - /// Retrieves the exchange rates from the given currency to every supported currency. - pub fn retrieve(client: &Client, id: &ExchangeRateId, expand: &[&str]) -> Response { - client.get_query(&format!("/exchange_rates/{}", id), &Expand { expand }) - } -} - -impl Object for ExchangeRate { - type Id = ExchangeRateId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "exchange_rate" - } -} - -/// The parameters for `ExchangeRate::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListExchangeRates<'a> { - - /// A cursor for use in pagination. - /// - /// `ending_before` is the currency that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with the exchange rate for currency X your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and total number of supported payout currencies, and the default is the max. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is the currency that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with the exchange rate for currency X, your subsequent call can include `starting_after=X` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListExchangeRates<'a> { - pub fn new() -> Self { - ListExchangeRates { - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListExchangeRates<'_> { - type O = ExchangeRate; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - }} \ No newline at end of file diff --git a/src/resources/generated/fee_refund.rs b/src/resources/generated/fee_refund.rs deleted file mode 100644 index e2b84faee..000000000 --- a/src/resources/generated/fee_refund.rs +++ /dev/null @@ -1,52 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::ApplicationFeeRefundId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{ApplicationFee, BalanceTransaction, Currency}; - -/// The resource representing a Stripe "FeeRefund". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ApplicationFeeRefund { - /// Unique identifier for the object. - pub id: ApplicationFeeRefundId, - - /// Amount, in cents (or local equivalent). - pub amount: i64, - - /// Balance transaction that describes the impact on your account balance. - pub balance_transaction: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// ID of the application fee that was refunded. - pub fee: Expandable, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, -} - -impl Object for ApplicationFeeRefund { - type Id = ApplicationFeeRefundId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "fee_refund" - } -} diff --git a/src/resources/generated/file.rs b/src/resources/generated/file.rs deleted file mode 100644 index 8325cc6ac..000000000 --- a/src/resources/generated/file.rs +++ /dev/null @@ -1,192 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::FileId; -use crate::params::{Expand, List, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::FileLink; - -/// The resource representing a Stripe "File". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct File { - /// Unique identifier for the object. - pub id: FileId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The file expires and isn't available at this time in epoch seconds. - pub expires_at: Option, - - /// The suitable name for saving the file to a filesystem. - pub filename: Option, - - /// A list of [file links](https://stripe.com/docs/api#file_links) that point at this file. - #[serde(default)] - pub links: List, - - /// The [purpose](https://stripe.com/docs/file-upload#uploading-a-file) of the uploaded file. - pub purpose: FilePurpose, - - /// The size of the file object in bytes. - pub size: u64, - - /// A suitable title for the document. - pub title: Option, - - /// The returned file type (for example, `csv`, `pdf`, `jpg`, or `png`). - #[serde(rename = "type")] - pub type_: Option, - - /// Use your live secret API key to download the file from this URL. - pub url: Option, -} - -impl File { - /// Returns a list of the files that your account has access to. - /// - /// Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. - pub fn list(client: &Client, params: &ListFiles<'_>) -> Response> { - client.get_query("/files", ¶ms) - } - - /// Retrieves the details of an existing file object. - /// - /// After you supply a unique file ID, Stripe returns the corresponding file object. - /// Learn how to [access file contents](https://stripe.com/docs/file-upload#download-file-contents). - pub fn retrieve(client: &Client, id: &FileId, expand: &[&str]) -> Response { - client.get_query(&format!("/files/{}", id), &Expand { expand }) - } -} - -impl Object for File { - type Id = FileId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "file" - } -} - -/// The parameters for `File::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListFiles<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Filter queries by the file purpose. - /// - /// If you don't provide a purpose, the queries return unfiltered files. - #[serde(skip_serializing_if = "Option::is_none")] - pub purpose: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListFiles<'a> { - pub fn new() -> Self { - ListFiles { - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - purpose: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListFiles<'_> { - type O = File; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// An enum representing the possible values of an `ListFiles`'s `purpose` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FilePurpose { - AccountRequirement, - AdditionalVerification, - BusinessIcon, - BusinessLogo, - CustomerSignature, - DisputeEvidence, - DocumentProviderIdentityDocument, - FinanceReportRun, - IdentityDocument, - IdentityDocumentDownloadable, - PciDocument, - Selfie, - SigmaScheduledQuery, - TaxDocumentUserUpload, - TerminalReaderSplashscreen, -} - -impl FilePurpose { - pub fn as_str(self) -> &'static str { - match self { - FilePurpose::AccountRequirement => "account_requirement", - FilePurpose::AdditionalVerification => "additional_verification", - FilePurpose::BusinessIcon => "business_icon", - FilePurpose::BusinessLogo => "business_logo", - FilePurpose::CustomerSignature => "customer_signature", - FilePurpose::DisputeEvidence => "dispute_evidence", - FilePurpose::DocumentProviderIdentityDocument => "document_provider_identity_document", - FilePurpose::FinanceReportRun => "finance_report_run", - FilePurpose::IdentityDocument => "identity_document", - FilePurpose::IdentityDocumentDownloadable => "identity_document_downloadable", - FilePurpose::PciDocument => "pci_document", - FilePurpose::Selfie => "selfie", - FilePurpose::SigmaScheduledQuery => "sigma_scheduled_query", - FilePurpose::TaxDocumentUserUpload => "tax_document_user_upload", - FilePurpose::TerminalReaderSplashscreen => "terminal_reader_splashscreen", - } - } -} - -impl AsRef for FilePurpose { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FilePurpose { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FilePurpose { - fn default() -> Self { - Self::AccountRequirement - } -} diff --git a/src/resources/generated/file_link.rs b/src/resources/generated/file_link.rs deleted file mode 100644 index 7b30826cc..000000000 --- a/src/resources/generated/file_link.rs +++ /dev/null @@ -1,208 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{FileId, FileLinkId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{File, Scheduled}; - -/// The resource representing a Stripe "FileLink". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FileLink { - /// Unique identifier for the object. - pub id: FileLinkId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Returns if the link is already expired. - pub expired: bool, - - /// Time that the link expires. - pub expires_at: Option, - - /// The file object this link points to. - pub file: Expandable, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// The publicly accessible URL to download the file. - pub url: Option, -} - -impl FileLink { - /// Returns a list of file links. - pub fn list(client: &Client, params: &ListFileLinks<'_>) -> Response> { - client.get_query("/file_links", ¶ms) - } - - /// Creates a new file link object. - pub fn create(client: &Client, params: CreateFileLink<'_>) -> Response { - client.post_form("/file_links", ¶ms) - } - - /// Retrieves the file link with the given ID. - pub fn retrieve(client: &Client, id: &FileLinkId, expand: &[&str]) -> Response { - client.get_query(&format!("/file_links/{}", id), &Expand { expand }) - } - - /// Updates an existing file link object. - /// - /// Expired links can no longer be updated. - pub fn update( - client: &Client, - id: &FileLinkId, - params: UpdateFileLink<'_>, - ) -> Response { - client.post_form(&format!("/file_links/{}", id), ¶ms) - } -} - -impl Object for FileLink { - type Id = FileLinkId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "file_link" - } -} - -/// The parameters for `FileLink::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateFileLink<'a> { - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The link isn't usable after this future timestamp. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option, - - /// The ID of the file. - /// - /// The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `identity_document_downloadable`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. - pub file: FileId, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl<'a> CreateFileLink<'a> { - pub fn new(file: FileId) -> Self { - CreateFileLink { - expand: Default::default(), - expires_at: Default::default(), - file, - metadata: Default::default(), - } - } -} - -/// The parameters for `FileLink::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListFileLinks<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Filter links by their expiration status. - /// - /// By default, Stripe returns all links. - #[serde(skip_serializing_if = "Option::is_none")] - pub expired: Option, - - /// Only return links for the given file. - #[serde(skip_serializing_if = "Option::is_none")] - pub file: Option, - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListFileLinks<'a> { - pub fn new() -> Self { - ListFileLinks { - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - expired: Default::default(), - file: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListFileLinks<'_> { - type O = FileLink; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `FileLink::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateFileLink<'a> { - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A future timestamp after which the link will no longer be usable, or `now` to expire the link immediately. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl<'a> UpdateFileLink<'a> { - pub fn new() -> Self { - UpdateFileLink { - expand: Default::default(), - expires_at: Default::default(), - metadata: Default::default(), - } - } -} diff --git a/src/resources/generated/financial_connections_account.rs b/src/resources/generated/financial_connections_account.rs deleted file mode 100644 index 84e86242b..000000000 --- a/src/resources/generated/financial_connections_account.rs +++ /dev/null @@ -1,465 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{FinancialConnectionsAccountId}; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::{BankConnectionsResourceAccountholder, FinancialConnectionsAccountOwnership}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "BankConnectionsResourceLinkedAccount". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FinancialConnectionsAccount { - /// Unique identifier for the object. - pub id: FinancialConnectionsAccountId, - - /// The account holder that this account belongs to. - pub account_holder: Option, - - /// The most recent information about the account's balance. - pub balance: Option, - - /// The state of the most recent attempt to refresh the account balance. - pub balance_refresh: Option, - - /// The type of the account. - /// - /// Account category is further divided in `subcategory`. - pub category: FinancialConnectionsAccountCategory, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// A human-readable name that has been assigned to this account, either by the account holder or by the institution. - pub display_name: Option, - - /// The name of the institution that holds this account. - pub institution_name: String, - - /// The last 4 digits of the account number. - /// - /// If present, this will be 4 numeric characters. - pub last4: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The most recent information about the account's owners. - pub ownership: Option>, - - /// The state of the most recent attempt to refresh the account owners. - pub ownership_refresh: Option, - - /// The list of permissions granted by this account. - pub permissions: Option>, - - /// The status of the link to the account. - pub status: FinancialConnectionsAccountStatus, - - /// If `category` is `cash`, one of: - /// - /// - `checking` - /// - `savings` - /// - `other` - /// - /// If `category` is `credit`, one of: - /// - /// - `mortgage` - /// - `line_of_credit` - /// - `credit_card` - /// - `other` - /// - /// If `category` is `investment` or `other`, this will be `other`. - pub subcategory: FinancialConnectionsAccountSubcategory, - - /// The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) that can be created from this account. - pub supported_payment_method_types: Vec, -} - -impl Object for FinancialConnectionsAccount { - type Id = FinancialConnectionsAccountId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "financial_connections.account" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankConnectionsResourceBalance { - - /// The time that the external institution calculated this balance. - /// - /// Measured in seconds since the Unix epoch. - pub as_of: Timestamp, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cash: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub credit: Option, - - /// The balances owed to (or by) the account holder. - /// - /// Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Each value is a integer amount. - /// - /// A positive amount indicates money owed to the account holder. - /// A negative amount indicates money owed by the account holder. - pub current: i64, - - /// The `type` of the balance. - /// - /// An additional hash is included on the balance with a name matching this value. - #[serde(rename = "type")] - pub type_: BankConnectionsResourceBalanceType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankConnectionsResourceBalanceApiResourceCashBalance { - - /// The funds available to the account holder. - /// - /// Typically this is the current balance less any holds. Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Each value is a integer amount. - /// A positive amount indicates money owed to the account holder. - /// A negative amount indicates money owed by the account holder. - pub available: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankConnectionsResourceBalanceApiResourceCreditBalance { - - /// The credit that has been used by the account holder. - /// - /// Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Each value is a integer amount. - /// - /// A positive amount indicates money owed to the account holder. - /// A negative amount indicates money owed by the account holder. - pub used: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankConnectionsResourceBalanceRefresh { - - /// The time at which the last refresh attempt was initiated. - /// - /// Measured in seconds since the Unix epoch. - pub last_attempted_at: Timestamp, - - /// The status of the last refresh attempt. - pub status: BankConnectionsResourceBalanceRefreshStatus, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankConnectionsResourceOwnershipRefresh { - - /// The time at which the last refresh attempt was initiated. - /// - /// Measured in seconds since the Unix epoch. - pub last_attempted_at: Timestamp, - - /// The status of the last refresh attempt. - pub status: BankConnectionsResourceOwnershipRefreshStatus, -} - -/// An enum representing the possible values of an `BankConnectionsResourceBalanceRefresh`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BankConnectionsResourceBalanceRefreshStatus { - Failed, - Pending, - Succeeded, -} - -impl BankConnectionsResourceBalanceRefreshStatus { - pub fn as_str(self) -> &'static str { - match self { - BankConnectionsResourceBalanceRefreshStatus::Failed => "failed", - BankConnectionsResourceBalanceRefreshStatus::Pending => "pending", - BankConnectionsResourceBalanceRefreshStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for BankConnectionsResourceBalanceRefreshStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BankConnectionsResourceBalanceRefreshStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for BankConnectionsResourceBalanceRefreshStatus { - fn default() -> Self { - Self::Failed - } -} - -/// An enum representing the possible values of an `BankConnectionsResourceBalance`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BankConnectionsResourceBalanceType { - Cash, - Credit, -} - -impl BankConnectionsResourceBalanceType { - pub fn as_str(self) -> &'static str { - match self { - BankConnectionsResourceBalanceType::Cash => "cash", - BankConnectionsResourceBalanceType::Credit => "credit", - } - } -} - -impl AsRef for BankConnectionsResourceBalanceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BankConnectionsResourceBalanceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for BankConnectionsResourceBalanceType { - fn default() -> Self { - Self::Cash - } -} - -/// An enum representing the possible values of an `BankConnectionsResourceOwnershipRefresh`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BankConnectionsResourceOwnershipRefreshStatus { - Failed, - Pending, - Succeeded, -} - -impl BankConnectionsResourceOwnershipRefreshStatus { - pub fn as_str(self) -> &'static str { - match self { - BankConnectionsResourceOwnershipRefreshStatus::Failed => "failed", - BankConnectionsResourceOwnershipRefreshStatus::Pending => "pending", - BankConnectionsResourceOwnershipRefreshStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for BankConnectionsResourceOwnershipRefreshStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BankConnectionsResourceOwnershipRefreshStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for BankConnectionsResourceOwnershipRefreshStatus { - fn default() -> Self { - Self::Failed - } -} - -/// An enum representing the possible values of an `FinancialConnectionsAccount`'s `category` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FinancialConnectionsAccountCategory { - Cash, - Credit, - Investment, - Other, -} - -impl FinancialConnectionsAccountCategory { - pub fn as_str(self) -> &'static str { - match self { - FinancialConnectionsAccountCategory::Cash => "cash", - FinancialConnectionsAccountCategory::Credit => "credit", - FinancialConnectionsAccountCategory::Investment => "investment", - FinancialConnectionsAccountCategory::Other => "other", - } - } -} - -impl AsRef for FinancialConnectionsAccountCategory { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FinancialConnectionsAccountCategory { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FinancialConnectionsAccountCategory { - fn default() -> Self { - Self::Cash - } -} - -/// An enum representing the possible values of an `FinancialConnectionsAccount`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FinancialConnectionsAccountPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl FinancialConnectionsAccountPermissions { - pub fn as_str(self) -> &'static str { - match self { - FinancialConnectionsAccountPermissions::Balances => "balances", - FinancialConnectionsAccountPermissions::Ownership => "ownership", - FinancialConnectionsAccountPermissions::PaymentMethod => "payment_method", - FinancialConnectionsAccountPermissions::Transactions => "transactions", - } - } -} - -impl AsRef for FinancialConnectionsAccountPermissions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FinancialConnectionsAccountPermissions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FinancialConnectionsAccountPermissions { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `FinancialConnectionsAccount`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FinancialConnectionsAccountStatus { - Active, - Disconnected, - Inactive, -} - -impl FinancialConnectionsAccountStatus { - pub fn as_str(self) -> &'static str { - match self { - FinancialConnectionsAccountStatus::Active => "active", - FinancialConnectionsAccountStatus::Disconnected => "disconnected", - FinancialConnectionsAccountStatus::Inactive => "inactive", - } - } -} - -impl AsRef for FinancialConnectionsAccountStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FinancialConnectionsAccountStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FinancialConnectionsAccountStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `FinancialConnectionsAccount`'s `subcategory` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FinancialConnectionsAccountSubcategory { - Checking, - CreditCard, - LineOfCredit, - Mortgage, - Other, - Savings, -} - -impl FinancialConnectionsAccountSubcategory { - pub fn as_str(self) -> &'static str { - match self { - FinancialConnectionsAccountSubcategory::Checking => "checking", - FinancialConnectionsAccountSubcategory::CreditCard => "credit_card", - FinancialConnectionsAccountSubcategory::LineOfCredit => "line_of_credit", - FinancialConnectionsAccountSubcategory::Mortgage => "mortgage", - FinancialConnectionsAccountSubcategory::Other => "other", - FinancialConnectionsAccountSubcategory::Savings => "savings", - } - } -} - -impl AsRef for FinancialConnectionsAccountSubcategory { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FinancialConnectionsAccountSubcategory { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FinancialConnectionsAccountSubcategory { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `FinancialConnectionsAccount`'s `supported_payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FinancialConnectionsAccountSupportedPaymentMethodTypes { - Link, - UsBankAccount, -} - -impl FinancialConnectionsAccountSupportedPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - FinancialConnectionsAccountSupportedPaymentMethodTypes::Link => "link", - FinancialConnectionsAccountSupportedPaymentMethodTypes::UsBankAccount => "us_bank_account", - } - } -} - -impl AsRef for FinancialConnectionsAccountSupportedPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FinancialConnectionsAccountSupportedPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FinancialConnectionsAccountSupportedPaymentMethodTypes { - fn default() -> Self { - Self::Link - } -} diff --git a/src/resources/generated/financial_connections_account_owner.rs b/src/resources/generated/financial_connections_account_owner.rs deleted file mode 100644 index 657886a30..000000000 --- a/src/resources/generated/financial_connections_account_owner.rs +++ /dev/null @@ -1,42 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{FinancialConnectionsAccountOwnerId}; -use crate::params::{Object, Timestamp}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "BankConnectionsResourceOwner". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FinancialConnectionsAccountOwner { - /// Unique identifier for the object. - pub id: FinancialConnectionsAccountOwnerId, - - /// The email address of the owner. - pub email: Option, - - /// The full name of the owner. - pub name: String, - - /// The ownership object that this owner belongs to. - pub ownership: String, - - /// The raw phone number of the owner. - pub phone: Option, - - /// The raw physical address of the owner. - pub raw_address: Option, - - /// The timestamp of the refresh that updated this owner. - pub refreshed_at: Option, -} - -impl Object for FinancialConnectionsAccountOwner { - type Id = FinancialConnectionsAccountOwnerId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "financial_connections.account_owner" - } -} diff --git a/src/resources/generated/financial_connections_account_ownership.rs b/src/resources/generated/financial_connections_account_ownership.rs deleted file mode 100644 index 1ff6c9aa9..000000000 --- a/src/resources/generated/financial_connections_account_ownership.rs +++ /dev/null @@ -1,33 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{FinancialConnectionsAccountOwnershipId}; -use crate::params::{List, Object, Timestamp}; -use crate::resources::{FinancialConnectionsAccountOwner}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "BankConnectionsResourceOwnership". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FinancialConnectionsAccountOwnership { - /// Unique identifier for the object. - pub id: FinancialConnectionsAccountOwnershipId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// A paginated list of owners for this account. - pub owners: List, -} - -impl Object for FinancialConnectionsAccountOwnership { - type Id = FinancialConnectionsAccountOwnershipId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "financial_connections.account_ownership" - } -} diff --git a/src/resources/generated/financial_connections_session.rs b/src/resources/generated/financial_connections_session.rs deleted file mode 100644 index c32276e9b..000000000 --- a/src/resources/generated/financial_connections_session.rs +++ /dev/null @@ -1,321 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::client::{Client, Response}; -use crate::ids::{FinancialConnectionsSessionId}; -use crate::params::{Expand, List, Object}; -use crate::resources::{BankConnectionsResourceAccountholder, FinancialConnectionsAccount}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "BankConnectionsResourceLinkAccountSession". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FinancialConnectionsSession { - /// Unique identifier for the object. - pub id: FinancialConnectionsSessionId, - - /// The account holder for whom accounts are collected in this session. - pub account_holder: Option, - - /// The accounts that were collected as part of this Session. - pub accounts: List, - - /// A value that will be passed to the client to launch the authentication flow. - pub client_secret: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub filters: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Permissions requested for accounts collected during this session. - pub permissions: Vec, - - /// Data features requested to be retrieved upon account creation. - pub prefetch: Option>, - - /// For webview integrations only. - /// - /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option, -} - -impl FinancialConnectionsSession { - - /// To launch the Financial Connections authorization flow, create a `Session`. - /// - /// The session’s `client_secret` can be used to launch the flow using Stripe.js. - pub fn create(client: &Client, params: CreateFinancialConnectionsSession<'_>) -> Response { - client.post_form("/financial_connections/sessions", ¶ms) - } -} - -impl Object for FinancialConnectionsSession { - type Id = FinancialConnectionsSessionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "financial_connections.session" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankConnectionsResourceLinkAccountSessionFilters { - - /// List of countries from which to filter accounts. - pub countries: Option>, -} - -/// The parameters for `FinancialConnectionsSession::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateFinancialConnectionsSession<'a> { - - /// The account holder to link accounts for. - pub account_holder: CreateFinancialConnectionsSessionAccountHolder, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Filters to restrict the kinds of accounts to collect. - #[serde(skip_serializing_if = "Option::is_none")] - pub filters: Option, - - /// List of data features that you would like to request access to. - /// - /// Possible values are `balances`, `transactions`, `ownership`, and `payment_method`. - pub permissions: Vec, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: Option>, - - /// For webview integrations only. - /// - /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option<&'a str>, -} - -impl<'a> CreateFinancialConnectionsSession<'a> { - pub fn new(account_holder: CreateFinancialConnectionsSessionAccountHolder, permissions: Vec) -> Self { - CreateFinancialConnectionsSession { - account_holder, - expand: Default::default(), - filters: Default::default(), - permissions, - prefetch: Default::default(), - return_url: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateFinancialConnectionsSessionAccountHolder { - - /// The ID of the Stripe account whose accounts will be retrieved. - /// - /// Should only be present if `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// The ID of the Stripe customer whose accounts will be retrieved. - /// - /// Should only be present if `type` is `customer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// Type of account holder to collect accounts for. - #[serde(rename = "type")] - pub type_: CreateFinancialConnectionsSessionAccountHolderType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateFinancialConnectionsSessionFilters { - - /// List of countries from which to collect accounts. - pub countries: Vec, -} - -/// An enum representing the possible values of an `CreateFinancialConnectionsSessionAccountHolder`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateFinancialConnectionsSessionAccountHolderType { - Account, - Customer, -} - -impl CreateFinancialConnectionsSessionAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - CreateFinancialConnectionsSessionAccountHolderType::Account => "account", - CreateFinancialConnectionsSessionAccountHolderType::Customer => "customer", - } - } -} - -impl AsRef for CreateFinancialConnectionsSessionAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateFinancialConnectionsSessionAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateFinancialConnectionsSessionAccountHolderType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `CreateFinancialConnectionsSession`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateFinancialConnectionsSessionPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl CreateFinancialConnectionsSessionPermissions { - pub fn as_str(self) -> &'static str { - match self { - CreateFinancialConnectionsSessionPermissions::Balances => "balances", - CreateFinancialConnectionsSessionPermissions::Ownership => "ownership", - CreateFinancialConnectionsSessionPermissions::PaymentMethod => "payment_method", - CreateFinancialConnectionsSessionPermissions::Transactions => "transactions", - } - } -} - -impl AsRef for CreateFinancialConnectionsSessionPermissions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateFinancialConnectionsSessionPermissions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateFinancialConnectionsSessionPermissions { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateFinancialConnectionsSession`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateFinancialConnectionsSessionPrefetch { - Balances, - Ownership, -} - -impl CreateFinancialConnectionsSessionPrefetch { - pub fn as_str(self) -> &'static str { - match self { - CreateFinancialConnectionsSessionPrefetch::Balances => "balances", - CreateFinancialConnectionsSessionPrefetch::Ownership => "ownership", - } - } -} - -impl AsRef for CreateFinancialConnectionsSessionPrefetch { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateFinancialConnectionsSessionPrefetch { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateFinancialConnectionsSessionPrefetch { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `FinancialConnectionsSession`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FinancialConnectionsSessionPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl FinancialConnectionsSessionPermissions { - pub fn as_str(self) -> &'static str { - match self { - FinancialConnectionsSessionPermissions::Balances => "balances", - FinancialConnectionsSessionPermissions::Ownership => "ownership", - FinancialConnectionsSessionPermissions::PaymentMethod => "payment_method", - FinancialConnectionsSessionPermissions::Transactions => "transactions", - } - } -} - -impl AsRef for FinancialConnectionsSessionPermissions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FinancialConnectionsSessionPermissions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FinancialConnectionsSessionPermissions { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `FinancialConnectionsSession`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FinancialConnectionsSessionPrefetch { - Balances, - Ownership, -} - -impl FinancialConnectionsSessionPrefetch { - pub fn as_str(self) -> &'static str { - match self { - FinancialConnectionsSessionPrefetch::Balances => "balances", - FinancialConnectionsSessionPrefetch::Ownership => "ownership", - } - } -} - -impl AsRef for FinancialConnectionsSessionPrefetch { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FinancialConnectionsSessionPrefetch { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FinancialConnectionsSessionPrefetch { - fn default() -> Self { - Self::Balances - } -} diff --git a/src/resources/generated/funding_instructions.rs b/src/resources/generated/funding_instructions.rs deleted file mode 100644 index 4b3ccf738..000000000 --- a/src/resources/generated/funding_instructions.rs +++ /dev/null @@ -1,284 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::params::{Object}; -use crate::resources::{Currency}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructions". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructions { - - pub bank_transfer: FundingInstructionsBankTransfer, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The `funding_type` of the returned instructions. - pub funding_type: FundingInstructionsFundingType, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, -} - -impl Object for FundingInstructions { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "funding_instructions" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransfer { - - /// The country of the bank account to fund. - pub country: String, - - /// A list of financial addresses that can be used to fund a particular balance. - pub financial_addresses: Vec, - - /// The bank_transfer type. - #[serde(rename = "type")] - pub type_: FundingInstructionsBankTransferType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferFinancialAddress { - - #[serde(skip_serializing_if = "Option::is_none")] - pub iban: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sort_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub spei: Option, - - /// The payment networks supported by this FinancialAddress. - #[serde(skip_serializing_if = "Option::is_none")] - pub supported_networks: Option>, - - /// The type of financial address. - #[serde(rename = "type")] - pub type_: FundingInstructionsBankTransferFinancialAddressType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub zengin: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferIbanRecord { - - /// The name of the person or business that owns the bank account. - pub account_holder_name: String, - - /// The BIC/SWIFT code of the account. - pub bic: String, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: String, - - /// The IBAN of the account. - pub iban: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferSortCodeRecord { - - /// The name of the person or business that owns the bank account. - pub account_holder_name: String, - - /// The account number. - pub account_number: String, - - /// The six-digit sort code. - pub sort_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferSpeiRecord { - - /// The three-digit bank code. - pub bank_code: String, - - /// The short banking institution name. - pub bank_name: String, - - /// The CLABE number. - pub clabe: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferZenginRecord { - - /// The account holder name. - pub account_holder_name: Option, - - /// The account number. - pub account_number: Option, - - /// The bank account type. - /// - /// In Japan, this can only be `futsu` or `toza`. - pub account_type: Option, - - /// The bank code of the account. - pub bank_code: Option, - - /// The bank name of the account. - pub bank_name: Option, - - /// The branch code of the account. - pub branch_code: Option, - - /// The branch name of the account. - pub branch_name: Option, -} - -/// An enum representing the possible values of an `FundingInstructionsBankTransferFinancialAddress`'s `supported_networks` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - Bacs, - Fps, - Sepa, - Spei, - Zengin, -} - -impl FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - pub fn as_str(self) -> &'static str { - match self { - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Bacs => "bacs", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Fps => "fps", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Sepa => "sepa", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Spei => "spei", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Zengin => "zengin", - } - } -} - -impl AsRef for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - fn default() -> Self { - Self::Bacs - } -} - -/// An enum representing the possible values of an `FundingInstructionsBankTransferFinancialAddress`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FundingInstructionsBankTransferFinancialAddressType { - Iban, - SortCode, - Spei, - Zengin, -} - -impl FundingInstructionsBankTransferFinancialAddressType { - pub fn as_str(self) -> &'static str { - match self { - FundingInstructionsBankTransferFinancialAddressType::Iban => "iban", - FundingInstructionsBankTransferFinancialAddressType::SortCode => "sort_code", - FundingInstructionsBankTransferFinancialAddressType::Spei => "spei", - FundingInstructionsBankTransferFinancialAddressType::Zengin => "zengin", - } - } -} - -impl AsRef for FundingInstructionsBankTransferFinancialAddressType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FundingInstructionsBankTransferFinancialAddressType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FundingInstructionsBankTransferFinancialAddressType { - fn default() -> Self { - Self::Iban - } -} - -/// An enum representing the possible values of an `FundingInstructionsBankTransfer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FundingInstructionsBankTransferType { - EuBankTransfer, - JpBankTransfer, -} - -impl FundingInstructionsBankTransferType { - pub fn as_str(self) -> &'static str { - match self { - FundingInstructionsBankTransferType::EuBankTransfer => "eu_bank_transfer", - FundingInstructionsBankTransferType::JpBankTransfer => "jp_bank_transfer", - } - } -} - -impl AsRef for FundingInstructionsBankTransferType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FundingInstructionsBankTransferType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FundingInstructionsBankTransferType { - fn default() -> Self { - Self::EuBankTransfer - } -} - -/// An enum representing the possible values of an `FundingInstructions`'s `funding_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FundingInstructionsFundingType { - BankTransfer, -} - -impl FundingInstructionsFundingType { - pub fn as_str(self) -> &'static str { - match self { - FundingInstructionsFundingType::BankTransfer => "bank_transfer", - } - } -} - -impl AsRef for FundingInstructionsFundingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FundingInstructionsFundingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FundingInstructionsFundingType { - fn default() -> Self { - Self::BankTransfer - } -} diff --git a/src/resources/generated/identity_verification_report.rs b/src/resources/generated/identity_verification_report.rs deleted file mode 100644 index 7caa8ee18..000000000 --- a/src/resources/generated/identity_verification_report.rs +++ /dev/null @@ -1,623 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{IdentityVerificationReportId}; -use crate::params::{Object, Timestamp}; -use crate::resources::{Address}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "GelatoVerificationReport". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IdentityVerificationReport { - /// Unique identifier for the object. - pub id: IdentityVerificationReportId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - #[serde(skip_serializing_if = "Option::is_none")] - pub document: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - #[serde(skip_serializing_if = "Option::is_none")] - pub options: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub selfie: Option, - - /// Type of report. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, - - /// ID of the VerificationSession that created this report. - pub verification_session: Option, -} - -impl Object for IdentityVerificationReport { - type Id = IdentityVerificationReportId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "identity.verification_report" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoDocumentReport { - - /// Address as it appears in the document. - pub address: Option
, - - /// Date of birth as it appears in the document. - pub dob: Option, - - /// Details on the verification error. - /// - /// Present when status is `unverified`. - pub error: Option, - - /// Expiration date of the document. - pub expiration_date: Option, - - /// Array of [File](https://stripe.com/docs/api/files) ids containing images for this document. - pub files: Option>, - - /// First name as it appears in the document. - pub first_name: Option, - - /// Issued date of the document. - pub issued_date: Option, - - /// Issuing country of the document. - pub issuing_country: Option, - - /// Last name as it appears in the document. - pub last_name: Option, - - /// Document ID number. - pub number: Option, - - /// Status of this `document` check. - pub status: GelatoDocumentReportStatus, - - /// Type of the document. - #[serde(rename = "type")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoDataDocumentReportDateOfBirth { - - /// Numerical day between 1 and 31. - pub day: Option, - - /// Numerical month between 1 and 12. - pub month: Option, - - /// The four-digit year. - pub year: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoDataDocumentReportExpirationDate { - - /// Numerical day between 1 and 31. - pub day: Option, - - /// Numerical month between 1 and 12. - pub month: Option, - - /// The four-digit year. - pub year: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoDataDocumentReportIssuedDate { - - /// Numerical day between 1 and 31. - pub day: Option, - - /// Numerical month between 1 and 12. - pub month: Option, - - /// The four-digit year. - pub year: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoDocumentReportError { - - /// A short machine-readable string giving the reason for the verification failure. - pub code: Option, - - /// A human-readable message giving the reason for the failure. - /// - /// These messages can be shown to your users. - pub reason: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoIdNumberReport { - - /// Date of birth. - pub dob: Option, - - /// Details on the verification error. - /// - /// Present when status is `unverified`. - pub error: Option, - - /// First name. - pub first_name: Option, - - /// ID number. - pub id_number: Option, - - /// Type of ID number. - pub id_number_type: Option, - - /// Last name. - pub last_name: Option, - - /// Status of this `id_number` check. - pub status: GelatoIdNumberReportStatus, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoDataIdNumberReportDate { - - /// Numerical day between 1 and 31. - pub day: Option, - - /// Numerical month between 1 and 12. - pub month: Option, - - /// The four-digit year. - pub year: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoIdNumberReportError { - - /// A short machine-readable string giving the reason for the verification failure. - pub code: Option, - - /// A human-readable message giving the reason for the failure. - /// - /// These messages can be shown to your users. - pub reason: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoSelfieReport { - - /// ID of the [File](https://stripe.com/docs/api/files) holding the image of the identity document used in this check. - pub document: Option, - - /// Details on the verification error. - /// - /// Present when status is `unverified`. - pub error: Option, - - /// ID of the [File](https://stripe.com/docs/api/files) holding the image of the selfie used in this check. - pub selfie: Option, - - /// Status of this `selfie` check. - pub status: GelatoSelfieReportStatus, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoSelfieReportError { - - /// A short machine-readable string giving the reason for the verification failure. - pub code: Option, - - /// A human-readable message giving the reason for the failure. - /// - /// These messages can be shown to your users. - pub reason: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoVerificationReportOptions { - - #[serde(skip_serializing_if = "Option::is_none")] - pub document: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoReportDocumentOptions { - - /// Array of strings of allowed identity document types. - /// - /// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. - #[serde(skip_serializing_if = "Option::is_none")] - pub allowed_types: Option>, - - /// Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub require_id_number: Option, - - /// Disable image uploads, identity document images have to be captured using the device’s camera. - #[serde(skip_serializing_if = "Option::is_none")] - pub require_live_capture: Option, - - /// Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. - /// - /// [Learn more](https://stripe.com/docs/identity/selfie). - #[serde(skip_serializing_if = "Option::is_none")] - pub require_matching_selfie: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoReportIdNumberOptions { -} - -/// An enum representing the possible values of an `GelatoDocumentReportError`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoDocumentReportErrorCode { - DocumentExpired, - DocumentTypeNotSupported, - DocumentUnverifiedOther, -} - -impl GelatoDocumentReportErrorCode { - pub fn as_str(self) -> &'static str { - match self { - GelatoDocumentReportErrorCode::DocumentExpired => "document_expired", - GelatoDocumentReportErrorCode::DocumentTypeNotSupported => "document_type_not_supported", - GelatoDocumentReportErrorCode::DocumentUnverifiedOther => "document_unverified_other", - } - } -} - -impl AsRef for GelatoDocumentReportErrorCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoDocumentReportErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoDocumentReportErrorCode { - fn default() -> Self { - Self::DocumentExpired - } -} - -/// An enum representing the possible values of an `GelatoDocumentReport`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoDocumentReportStatus { - Unverified, - Verified, -} - -impl GelatoDocumentReportStatus { - pub fn as_str(self) -> &'static str { - match self { - GelatoDocumentReportStatus::Unverified => "unverified", - GelatoDocumentReportStatus::Verified => "verified", - } - } -} - -impl AsRef for GelatoDocumentReportStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoDocumentReportStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoDocumentReportStatus { - fn default() -> Self { - Self::Unverified - } -} - -/// An enum representing the possible values of an `GelatoDocumentReport`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoDocumentReportType { - DrivingLicense, - IdCard, - Passport, -} - -impl GelatoDocumentReportType { - pub fn as_str(self) -> &'static str { - match self { - GelatoDocumentReportType::DrivingLicense => "driving_license", - GelatoDocumentReportType::IdCard => "id_card", - GelatoDocumentReportType::Passport => "passport", - } - } -} - -impl AsRef for GelatoDocumentReportType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoDocumentReportType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoDocumentReportType { - fn default() -> Self { - Self::DrivingLicense - } -} - -/// An enum representing the possible values of an `GelatoIdNumberReportError`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoIdNumberReportErrorCode { - IdNumberInsufficientDocumentData, - IdNumberMismatch, - IdNumberUnverifiedOther, -} - -impl GelatoIdNumberReportErrorCode { - pub fn as_str(self) -> &'static str { - match self { - GelatoIdNumberReportErrorCode::IdNumberInsufficientDocumentData => "id_number_insufficient_document_data", - GelatoIdNumberReportErrorCode::IdNumberMismatch => "id_number_mismatch", - GelatoIdNumberReportErrorCode::IdNumberUnverifiedOther => "id_number_unverified_other", - } - } -} - -impl AsRef for GelatoIdNumberReportErrorCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoIdNumberReportErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoIdNumberReportErrorCode { - fn default() -> Self { - Self::IdNumberInsufficientDocumentData - } -} - -/// An enum representing the possible values of an `GelatoIdNumberReport`'s `id_number_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoIdNumberReportIdNumberType { - BrCpf, - SgNric, - UsSsn, -} - -impl GelatoIdNumberReportIdNumberType { - pub fn as_str(self) -> &'static str { - match self { - GelatoIdNumberReportIdNumberType::BrCpf => "br_cpf", - GelatoIdNumberReportIdNumberType::SgNric => "sg_nric", - GelatoIdNumberReportIdNumberType::UsSsn => "us_ssn", - } - } -} - -impl AsRef for GelatoIdNumberReportIdNumberType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoIdNumberReportIdNumberType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoIdNumberReportIdNumberType { - fn default() -> Self { - Self::BrCpf - } -} - -/// An enum representing the possible values of an `GelatoIdNumberReport`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoIdNumberReportStatus { - Unverified, - Verified, -} - -impl GelatoIdNumberReportStatus { - pub fn as_str(self) -> &'static str { - match self { - GelatoIdNumberReportStatus::Unverified => "unverified", - GelatoIdNumberReportStatus::Verified => "verified", - } - } -} - -impl AsRef for GelatoIdNumberReportStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoIdNumberReportStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoIdNumberReportStatus { - fn default() -> Self { - Self::Unverified - } -} - -/// An enum representing the possible values of an `GelatoReportDocumentOptions`'s `allowed_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoReportDocumentOptionsAllowedTypes { - DrivingLicense, - IdCard, - Passport, -} - -impl GelatoReportDocumentOptionsAllowedTypes { - pub fn as_str(self) -> &'static str { - match self { - GelatoReportDocumentOptionsAllowedTypes::DrivingLicense => "driving_license", - GelatoReportDocumentOptionsAllowedTypes::IdCard => "id_card", - GelatoReportDocumentOptionsAllowedTypes::Passport => "passport", - } - } -} - -impl AsRef for GelatoReportDocumentOptionsAllowedTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoReportDocumentOptionsAllowedTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoReportDocumentOptionsAllowedTypes { - fn default() -> Self { - Self::DrivingLicense - } -} - -/// An enum representing the possible values of an `GelatoSelfieReportError`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoSelfieReportErrorCode { - SelfieDocumentMissingPhoto, - SelfieFaceMismatch, - SelfieManipulated, - SelfieUnverifiedOther, -} - -impl GelatoSelfieReportErrorCode { - pub fn as_str(self) -> &'static str { - match self { - GelatoSelfieReportErrorCode::SelfieDocumentMissingPhoto => "selfie_document_missing_photo", - GelatoSelfieReportErrorCode::SelfieFaceMismatch => "selfie_face_mismatch", - GelatoSelfieReportErrorCode::SelfieManipulated => "selfie_manipulated", - GelatoSelfieReportErrorCode::SelfieUnverifiedOther => "selfie_unverified_other", - } - } -} - -impl AsRef for GelatoSelfieReportErrorCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoSelfieReportErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoSelfieReportErrorCode { - fn default() -> Self { - Self::SelfieDocumentMissingPhoto - } -} - -/// An enum representing the possible values of an `GelatoSelfieReport`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoSelfieReportStatus { - Unverified, - Verified, -} - -impl GelatoSelfieReportStatus { - pub fn as_str(self) -> &'static str { - match self { - GelatoSelfieReportStatus::Unverified => "unverified", - GelatoSelfieReportStatus::Verified => "verified", - } - } -} - -impl AsRef for GelatoSelfieReportStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoSelfieReportStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoSelfieReportStatus { - fn default() -> Self { - Self::Unverified - } -} - -/// An enum representing the possible values of an `IdentityVerificationReport`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IdentityVerificationReportType { - Document, - IdNumber, -} - -impl IdentityVerificationReportType { - pub fn as_str(self) -> &'static str { - match self { - IdentityVerificationReportType::Document => "document", - IdentityVerificationReportType::IdNumber => "id_number", - } - } -} - -impl AsRef for IdentityVerificationReportType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IdentityVerificationReportType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IdentityVerificationReportType { - fn default() -> Self { - Self::Document - } -} diff --git a/src/resources/generated/identity_verification_session.rs b/src/resources/generated/identity_verification_session.rs deleted file mode 100644 index 187d047c2..000000000 --- a/src/resources/generated/identity_verification_session.rs +++ /dev/null @@ -1,411 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{IdentityVerificationSessionId}; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Address, IdentityVerificationReport}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "GelatoVerificationSession". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IdentityVerificationSession { - /// Unique identifier for the object. - pub id: IdentityVerificationSessionId, - - /// The short-lived client secret used by Stripe.js to [show a verification modal](https://stripe.com/docs/js/identity/modal) inside your app. - /// - /// This client secret expires after 24 hours and can only be used once. - /// Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. - /// Make sure that you have TLS enabled on any page that includes the client secret. - /// Refer to our docs on [passing the client secret to the frontend](https://stripe.com/docs/identity/verification-sessions#client-secret) to learn more. - pub client_secret: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// If present, this property tells you the last error encountered when processing the verification. - pub last_error: Option, - - /// ID of the most recent VerificationReport. - /// - /// [Learn more about accessing detailed verification results.](https://stripe.com/docs/identity/verification-sessions#results). - pub last_verification_report: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// A set of options for the session’s verification checks. - pub options: Option, - - /// Redaction status of this VerificationSession. - /// - /// If the VerificationSession is not redacted, this field will be null. - pub redaction: Option, - - /// Status of this VerificationSession. - /// - /// [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). - pub status: IdentityVerificationSessionStatus, - - /// The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. - #[serde(rename = "type")] - pub type_: Option, - - /// The short-lived URL that you use to redirect a user to Stripe to submit their identity information. - /// - /// This URL expires after 48 hours and can only be used once. - /// Don’t store it, log it, send it in emails or expose it to anyone other than the user. - /// Refer to our docs on [verifying identity documents](https://stripe.com/docs/identity/verify-identity-documents?platform=web&type=redirect) to learn how to redirect users to Stripe. - pub url: Option, - - /// The user’s verified data. - pub verified_outputs: Option, -} - -impl Object for IdentityVerificationSession { - type Id = IdentityVerificationSessionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "identity.verification_session" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoSessionLastError { - - /// A short machine-readable string giving the reason for the verification or user-session failure. - pub code: Option, - - /// A message that explains the reason for verification or user-session failure. - pub reason: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoVerificationSessionOptions { - - #[serde(skip_serializing_if = "Option::is_none")] - pub document: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoSessionDocumentOptions { - - /// Array of strings of allowed identity document types. - /// - /// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. - #[serde(skip_serializing_if = "Option::is_none")] - pub allowed_types: Option>, - - /// Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub require_id_number: Option, - - /// Disable image uploads, identity document images have to be captured using the device’s camera. - #[serde(skip_serializing_if = "Option::is_none")] - pub require_live_capture: Option, - - /// Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. - /// - /// [Learn more](https://stripe.com/docs/identity/selfie). - #[serde(skip_serializing_if = "Option::is_none")] - pub require_matching_selfie: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoSessionIdNumberOptions { -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoVerifiedOutputs { - - /// The user's verified address. - pub address: Option
, - - /// The user’s verified date of birth. - pub dob: Option, - - /// The user's verified first name. - pub first_name: Option, - - /// The user's verified id number. - pub id_number: Option, - - /// The user's verified id number type. - pub id_number_type: Option, - - /// The user's verified last name. - pub last_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoDataVerifiedOutputsDate { - - /// Numerical day between 1 and 31. - pub day: Option, - - /// Numerical month between 1 and 12. - pub month: Option, - - /// The four-digit year. - pub year: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct VerificationSessionRedaction { - - /// Indicates whether this object and its related objects have been redacted or not. - pub status: VerificationSessionRedactionStatus, -} - -/// An enum representing the possible values of an `GelatoSessionDocumentOptions`'s `allowed_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoSessionDocumentOptionsAllowedTypes { - DrivingLicense, - IdCard, - Passport, -} - -impl GelatoSessionDocumentOptionsAllowedTypes { - pub fn as_str(self) -> &'static str { - match self { - GelatoSessionDocumentOptionsAllowedTypes::DrivingLicense => "driving_license", - GelatoSessionDocumentOptionsAllowedTypes::IdCard => "id_card", - GelatoSessionDocumentOptionsAllowedTypes::Passport => "passport", - } - } -} - -impl AsRef for GelatoSessionDocumentOptionsAllowedTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoSessionDocumentOptionsAllowedTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoSessionDocumentOptionsAllowedTypes { - fn default() -> Self { - Self::DrivingLicense - } -} - -/// An enum representing the possible values of an `GelatoSessionLastError`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoSessionLastErrorCode { - Abandoned, - ConsentDeclined, - CountryNotSupported, - DeviceNotSupported, - DocumentExpired, - DocumentTypeNotSupported, - DocumentUnverifiedOther, - IdNumberInsufficientDocumentData, - IdNumberMismatch, - IdNumberUnverifiedOther, - SelfieDocumentMissingPhoto, - SelfieFaceMismatch, - SelfieManipulated, - SelfieUnverifiedOther, - UnderSupportedAge, -} - -impl GelatoSessionLastErrorCode { - pub fn as_str(self) -> &'static str { - match self { - GelatoSessionLastErrorCode::Abandoned => "abandoned", - GelatoSessionLastErrorCode::ConsentDeclined => "consent_declined", - GelatoSessionLastErrorCode::CountryNotSupported => "country_not_supported", - GelatoSessionLastErrorCode::DeviceNotSupported => "device_not_supported", - GelatoSessionLastErrorCode::DocumentExpired => "document_expired", - GelatoSessionLastErrorCode::DocumentTypeNotSupported => "document_type_not_supported", - GelatoSessionLastErrorCode::DocumentUnverifiedOther => "document_unverified_other", - GelatoSessionLastErrorCode::IdNumberInsufficientDocumentData => "id_number_insufficient_document_data", - GelatoSessionLastErrorCode::IdNumberMismatch => "id_number_mismatch", - GelatoSessionLastErrorCode::IdNumberUnverifiedOther => "id_number_unverified_other", - GelatoSessionLastErrorCode::SelfieDocumentMissingPhoto => "selfie_document_missing_photo", - GelatoSessionLastErrorCode::SelfieFaceMismatch => "selfie_face_mismatch", - GelatoSessionLastErrorCode::SelfieManipulated => "selfie_manipulated", - GelatoSessionLastErrorCode::SelfieUnverifiedOther => "selfie_unverified_other", - GelatoSessionLastErrorCode::UnderSupportedAge => "under_supported_age", - } - } -} - -impl AsRef for GelatoSessionLastErrorCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoSessionLastErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoSessionLastErrorCode { - fn default() -> Self { - Self::Abandoned - } -} - -/// An enum representing the possible values of an `GelatoVerifiedOutputs`'s `id_number_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoVerifiedOutputsIdNumberType { - BrCpf, - SgNric, - UsSsn, -} - -impl GelatoVerifiedOutputsIdNumberType { - pub fn as_str(self) -> &'static str { - match self { - GelatoVerifiedOutputsIdNumberType::BrCpf => "br_cpf", - GelatoVerifiedOutputsIdNumberType::SgNric => "sg_nric", - GelatoVerifiedOutputsIdNumberType::UsSsn => "us_ssn", - } - } -} - -impl AsRef for GelatoVerifiedOutputsIdNumberType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoVerifiedOutputsIdNumberType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoVerifiedOutputsIdNumberType { - fn default() -> Self { - Self::BrCpf - } -} - -/// An enum representing the possible values of an `IdentityVerificationSession`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IdentityVerificationSessionStatus { - Canceled, - Processing, - RequiresInput, - Verified, -} - -impl IdentityVerificationSessionStatus { - pub fn as_str(self) -> &'static str { - match self { - IdentityVerificationSessionStatus::Canceled => "canceled", - IdentityVerificationSessionStatus::Processing => "processing", - IdentityVerificationSessionStatus::RequiresInput => "requires_input", - IdentityVerificationSessionStatus::Verified => "verified", - } - } -} - -impl AsRef for IdentityVerificationSessionStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IdentityVerificationSessionStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IdentityVerificationSessionStatus { - fn default() -> Self { - Self::Canceled - } -} - -/// An enum representing the possible values of an `IdentityVerificationSession`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IdentityVerificationSessionType { - Document, - IdNumber, -} - -impl IdentityVerificationSessionType { - pub fn as_str(self) -> &'static str { - match self { - IdentityVerificationSessionType::Document => "document", - IdentityVerificationSessionType::IdNumber => "id_number", - } - } -} - -impl AsRef for IdentityVerificationSessionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IdentityVerificationSessionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IdentityVerificationSessionType { - fn default() -> Self { - Self::Document - } -} - -/// An enum representing the possible values of an `VerificationSessionRedaction`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum VerificationSessionRedactionStatus { - Processing, - Redacted, -} - -impl VerificationSessionRedactionStatus { - pub fn as_str(self) -> &'static str { - match self { - VerificationSessionRedactionStatus::Processing => "processing", - VerificationSessionRedactionStatus::Redacted => "redacted", - } - } -} - -impl AsRef for VerificationSessionRedactionStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for VerificationSessionRedactionStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for VerificationSessionRedactionStatus { - fn default() -> Self { - Self::Processing - } -} diff --git a/src/resources/generated/invoice.rs b/src/resources/generated/invoice.rs deleted file mode 100644 index c987a1f91..000000000 --- a/src/resources/generated/invoice.rs +++ /dev/null @@ -1,2652 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, InvoiceId, SubscriptionId}; -use crate::params::{ - CurrencyMap, Deleted, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, - Timestamp, -}; -use crate::resources::{ - Account, Address, ApiErrors, Application, Charge, Currency, Customer, Discount, - InvoiceLineItem, InvoicePaymentMethodOptionsAcssDebit, InvoicePaymentMethodOptionsBancontact, - InvoicePaymentMethodOptionsCustomerBalance, InvoicePaymentMethodOptionsKonbini, - InvoicePaymentMethodOptionsUsBankAccount, InvoiceSettingRenderingOptions, InvoicesShippingCost, - PaymentIntent, PaymentMethod, PaymentSource, Quote, Shipping, Subscription, TaxId, TaxRate, - TestHelpersTestClock, -}; - -/// The resource representing a Stripe "Invoice". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Invoice { - /// Unique identifier for the object. - /// - /// This property is always present unless the invoice is an upcoming invoice. - /// See [Retrieve an upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) for more details. - #[serde(default = "InvoiceId::none")] - pub id: InvoiceId, - - /// The country of the business associated with this invoice, most often the business creating the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_country: Option, - - /// The public name of the business associated with this invoice, most often the business creating the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_name: Option, - - /// The account tax IDs associated with the invoice. - /// - /// Only editable when the invoice is a draft. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_tax_ids: Option>>, - - /// Final amount due at this time for this invoice. - /// - /// If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. - /// If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. - /// The charge that gets generated for the invoice will be for the amount specified in `amount_due`. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_due: Option, - - /// The amount, in cents (or local equivalent), that was paid. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_paid: Option, - - /// The difference between amount_due and amount_paid, in cents (or local equivalent). - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_remaining: Option, - - /// This is the sum of all the shipping amounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_shipping: Option, - - /// ID of the Connect Application that created the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub application: Option>, - - /// The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, - - /// Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. - /// - /// Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. - /// In other words, manual payment attempts after the first attempt do not affect the retry schedule. - #[serde(skip_serializing_if = "Option::is_none")] - pub attempt_count: Option, - - /// Whether an attempt has been made to pay the invoice. - /// - /// An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users. - #[serde(skip_serializing_if = "Option::is_none")] - pub attempted: Option, - - /// Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. - /// - /// If `false`, the invoice's state doesn't automatically advance without an explicit action. - #[serde(skip_serializing_if = "Option::is_none")] - pub auto_advance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Indicates the reason why the invoice was created. - /// - /// * `manual`: Unrelated to a subscription, for example, created via the invoice editor. - /// * `subscription`: No longer in use. - /// - /// Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. * `subscription_create`: A new subscription was created. * `subscription_cycle`: A subscription advanced into a new period. * `subscription_threshold`: A subscription reached a billing threshold. * `subscription_update`: A subscription was updated. * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_reason: Option, - - /// ID of the latest charge generated for this invoice, if any. - #[serde(skip_serializing_if = "Option::is_none")] - pub charge: Option>, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. - /// When sending an invoice, Stripe will email this invoice to the customer with payment instructions. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Custom fields displayed on the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// The ID of the customer who will be billed. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option>, - - /// The customer's address. - /// - /// Until the invoice is finalized, this field will equal `customer.address`. - /// Once the invoice is finalized, this field will no longer be updated. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_address: Option
, - - /// The customer's email. - /// - /// Until the invoice is finalized, this field will equal `customer.email`. - /// Once the invoice is finalized, this field will no longer be updated. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_email: Option, - - /// The customer's name. - /// - /// Until the invoice is finalized, this field will equal `customer.name`. - /// Once the invoice is finalized, this field will no longer be updated. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_name: Option, - - /// The customer's phone number. - /// - /// Until the invoice is finalized, this field will equal `customer.phone`. - /// Once the invoice is finalized, this field will no longer be updated. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_phone: Option, - - /// The customer's shipping information. - /// - /// Until the invoice is finalized, this field will equal `customer.shipping`. - /// Once the invoice is finalized, this field will no longer be updated. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_shipping: Option, - - /// The customer's tax exempt status. - /// - /// Until the invoice is finalized, this field will equal `customer.tax_exempt`. - /// Once the invoice is finalized, this field will no longer be updated. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_tax_exempt: Option, - - /// The customer's tax IDs. - /// - /// Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. - /// Once the invoice is finalized, this field will no longer be updated. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_tax_ids: Option>, - - /// ID of the default payment method for the invoice. - /// - /// It must belong to the customer associated with the invoice. - /// If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_payment_method: Option>, - - /// ID of the default payment source for the invoice. - /// - /// It must belong to the customer associated with the invoice and be in a chargeable state. - /// If not set, defaults to the subscription's default source, if any, or to the customer's default source. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_source: Option>, - - /// The tax rates applied to this invoice, if any. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - /// Referenced as 'memo' in the Dashboard. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Describes the current discount applied to this invoice, if there is one. - /// - /// Not populated if there are multiple discounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub discount: Option, - - /// The discounts applied to the invoice. - /// - /// Line item discounts are applied before invoice discounts. - /// Use `expand[]=discounts` to expand each discount. - #[serde(skip_serializing_if = "Option::is_none")] - pub discounts: Option>>, - - /// The date on which payment for this invoice is due. - /// - /// This value will be `null` for invoices where `collection_method=charge_automatically`. - #[serde(skip_serializing_if = "Option::is_none")] - pub due_date: Option, - - /// The date when this invoice is in effect. - /// - /// Same as `finalized_at` unless overwritten. - /// When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. - #[serde(skip_serializing_if = "Option::is_none")] - pub effective_at: Option, - - /// Ending customer balance after the invoice is finalized. - /// - /// Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. - /// If the invoice has not been finalized yet, this will be null. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_balance: Option, - - /// Footer displayed on the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub footer: Option, - - /// Details of the invoice that was cloned. - /// - /// See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub from_invoice: Option, - - /// The URL for the hosted invoice page, which allows customers to view and pay an invoice. - /// - /// If the invoice has not been finalized yet, this will be null. - #[serde(skip_serializing_if = "Option::is_none")] - pub hosted_invoice_url: Option, - - /// The link to download the PDF for the invoice. - /// - /// If the invoice has not been finalized yet, this will be null. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_pdf: Option, - - /// The error encountered during the previous attempt to finalize the invoice. - /// - /// This field is cleared when the invoice is successfully finalized. - #[serde(skip_serializing_if = "Option::is_none")] - pub last_finalization_error: Option>, - - /// The ID of the most recent non-draft revision of this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub latest_revision: Option>, - - /// The individual line items that make up the invoice. - /// - /// `lines` is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order. - #[serde(default)] - pub lines: List, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The time at which payment will next be attempted. - /// - /// This value will be `null` for invoices where `collection_method=send_invoice`. - #[serde(skip_serializing_if = "Option::is_none")] - pub next_payment_attempt: Option, - - /// A unique, identifying string that appears on emails sent to the customer for this invoice. - /// - /// This starts with the customer's unique invoice_prefix if it is specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub number: Option, - - /// The account (if any) for which the funds of the invoice payment are intended. - /// - /// If set, the invoice will be presented with the branding and support information of the specified account. - /// See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option>, - - /// Whether payment was successfully collected for this invoice. - /// - /// An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. - #[serde(skip_serializing_if = "Option::is_none")] - pub paid: Option, - - /// Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe. - #[serde(skip_serializing_if = "Option::is_none")] - pub paid_out_of_band: Option, - - /// The PaymentIntent associated with this invoice. - /// - /// The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. - /// Note that voiding an invoice will cancel the PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_settings: Option, - - /// End of the usage period during which invoice items were added to this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub period_end: Option, - - /// Start of the usage period during which invoice items were added to this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub period_start: Option, - - /// Total amount of all post-payment credit notes issued for this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub post_payment_credit_notes_amount: Option, - - /// Total amount of all pre-payment credit notes issued for this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub pre_payment_credit_notes_amount: Option, - - /// The quote this invoice was generated from. - #[serde(skip_serializing_if = "Option::is_none")] - pub quote: Option>, - - /// This is the transaction number that appears on email receipts sent for this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_number: Option, - - /// Options for invoice PDF rendering. - #[serde(skip_serializing_if = "Option::is_none")] - pub rendering_options: Option, - - /// The details of the cost of shipping, including the ShippingRate applied on the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_cost: Option, - - /// Shipping details for the invoice. - /// - /// The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_details: Option, - - /// Starting customer balance before the invoice is finalized. - /// - /// If the invoice has not been finalized yet, this will be the current customer balance. - /// For revision invoices, this also includes any customer balance that was applied to the original invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_balance: Option, - - /// Extra information about an invoice for the customer's credit card statement. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, - - /// The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. - /// - /// [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview). - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub status_transitions: Option, - - /// The subscription that this invoice was prepared for, if any. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option>, - - /// Details about the subscription that created this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_details: Option, - - /// Only set for upcoming invoices that preview prorations. - /// - /// The time used to calculate prorations. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_proration_date: Option, - - /// Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. - /// - /// Item discounts are already incorporated. - #[serde(skip_serializing_if = "Option::is_none")] - pub subtotal: Option, - - /// The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. - /// - /// Item discounts are already incorporated. - #[serde(skip_serializing_if = "Option::is_none")] - pub subtotal_excluding_tax: Option, - - /// The amount of tax on this invoice. - /// - /// This is the sum of all the tax amounts on this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax: Option, - - /// ID of the test clock this invoice belongs to. - #[serde(skip_serializing_if = "Option::is_none")] - pub test_clock: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub threshold_reason: Option, - - /// Total after discounts and taxes. - #[serde(skip_serializing_if = "Option::is_none")] - pub total: Option, - - /// The aggregate amounts calculated per discount across all line items. - #[serde(skip_serializing_if = "Option::is_none")] - pub total_discount_amounts: Option>, - - /// The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax. - #[serde(skip_serializing_if = "Option::is_none")] - pub total_excluding_tax: Option, - - /// The aggregate amounts calculated per tax rate for all line items. - #[serde(skip_serializing_if = "Option::is_none")] - pub total_tax_amounts: Option>, - - /// The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://stripe.com/docs/billing/webhooks#understand). - /// - /// This field tracks the time when webhooks for this invoice were successfully delivered. - /// If the invoice had no webhooks to deliver, this will be set while the invoice is being created. - #[serde(skip_serializing_if = "Option::is_none")] - pub webhooks_delivered_at: Option, -} - -impl Invoice { - /// You can list all invoices, or list the invoices for a specific customer. - /// - /// The invoices are returned sorted by creation date, with the most recently created invoices appearing first. - pub fn list(client: &Client, params: &ListInvoices<'_>) -> Response> { - client.get_query("/invoices", ¶ms) - } - - /// This endpoint creates a draft invoice for a given customer. - /// - /// The invoice remains a draft until you [finalize](https://stripe.com/docs/api#finalize_invoice) the invoice, which allows you to [pay](https://stripe.com/docs/api#pay_invoice) or [send](https://stripe.com/docs/api#send_invoice) the invoice to your customers. - pub fn create(client: &Client, params: CreateInvoice<'_>) -> Response { - client.post_form("/invoices", ¶ms) - } - - /// Retrieves the invoice with the given ID. - pub fn retrieve(client: &Client, id: &InvoiceId, expand: &[&str]) -> Response { - client.get_query(&format!("/invoices/{}", id), &Expand { expand }) - } - - /// Permanently deletes a one-off invoice draft. - /// - /// This cannot be undone. - /// Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). - pub fn delete(client: &Client, id: &InvoiceId) -> Response> { - client.delete(&format!("/invoices/{}", id)) - } -} - -impl Object for Invoice { - type Id = InvoiceId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "invoice" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AutomaticTax { - /// Whether Stripe automatically computes tax on this invoice. - /// - /// Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. - pub enabled: bool, - - /// The status of the most recent automated tax calculation for this invoice. - pub status: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DiscountsResourceDiscountAmount { - /// The amount, in cents (or local equivalent), of the discount. - pub amount: i64, - - /// The discount that was applied to get this discount amount. - pub discount: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceSettingCustomField { - /// The name of the custom field. - pub name: String, - - /// The value of the custom field. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxAmount { - /// The amount, in cents (or local equivalent), of the tax. - pub amount: i64, - - /// Whether this tax amount is inclusive or exclusive. - pub inclusive: bool, - - /// The tax rate that was applied to get this tax amount. - pub tax_rate: Expandable, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: Option, - - /// The amount on which tax is calculated, in cents (or local equivalent). - pub taxable_amount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceThresholdReason { - /// The total invoice amount threshold boundary if it triggered the threshold invoice. - pub amount_gte: Option, - - /// Indicates which line items triggered a threshold invoice. - pub item_reasons: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceItemThresholdReason { - /// The IDs of the line items that triggered the threshold invoice. - pub line_item_ids: Vec, - - /// The quantity threshold boundary that applied to the given line item. - pub usage_gte: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceTransferData { - /// The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. - /// - /// By default, the entire amount is transferred to the destination. - pub amount: Option, - - /// The account where funds from the payment will be transferred to upon payment success. - pub destination: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesFromInvoice { - /// The relation between this invoice and the cloned invoice. - pub action: String, - - /// The invoice that was cloned. - pub invoice: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesPaymentSettings { - /// ID of the mandate to be used for this invoice. - /// - /// It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. - pub default_mandate: Option, - - /// Payment-method-specific configuration to provide to the invoice’s PaymentIntent. - pub payment_method_options: Option, - - /// The list of payment method types (e.g. - /// - /// card) to provide to the invoice’s PaymentIntent. - /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). - pub payment_method_types: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesPaymentMethodOptions { - /// If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. - pub acss_debit: Option, - - /// If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. - pub bancontact: Option, - - /// If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. - pub card: Option, - - /// If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. - pub customer_balance: Option, - - /// If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. - pub konbini: Option, - - /// If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsCard { - #[serde(skip_serializing_if = "Option::is_none")] - pub installments: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - pub request_three_d_secure: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceInstallmentsCard { - /// Whether Installments are enabled for this Invoice. - pub enabled: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesResourceInvoiceTaxId { - /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. - #[serde(rename = "type")] - pub type_: TaxIdType, - - /// The value of the tax ID. - pub value: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesStatusTransitions { - /// The time that the invoice draft was finalized. - pub finalized_at: Option, - - /// The time that the invoice was marked uncollectible. - pub marked_uncollectible_at: Option, - - /// The time that the invoice was paid. - pub paid_at: Option, - - /// The time that the invoice was voided. - pub voided_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionDetailsData { - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will reflect the metadata of the subscription at the time of invoice creation. - /// - /// *Note: This attribute is populated only for invoices created on or after June 29, 2023.*. - pub metadata: Option, -} - -/// The parameters for `Invoice::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateInvoice<'a> { - /// The account tax IDs associated with the invoice. - /// - /// Only editable when the invoice is a draft. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_tax_ids: Option>, - - /// A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. - /// - /// The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. - /// For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, - - /// Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. - /// - /// If `false`, the invoice's state doesn't automatically advance without an explicit action. - #[serde(skip_serializing_if = "Option::is_none")] - pub auto_advance: Option, - - /// Settings for automatic tax lookup for this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. - /// When sending an invoice, Stripe will email this invoice to the customer with payment instructions. - /// Defaults to `charge_automatically`. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - /// The currency to create this invoice in. - /// - /// Defaults to that of `customer` if not specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// A list of up to 4 custom fields to be displayed on the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// The ID of the customer who will be billed. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// The number of days from when the invoice is created until it is due. - /// - /// Valid only for invoices where `collection_method=send_invoice`. - #[serde(skip_serializing_if = "Option::is_none")] - pub days_until_due: Option, - - /// ID of the default payment method for the invoice. - /// - /// It must belong to the customer associated with the invoice. - /// If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_payment_method: Option<&'a str>, - - /// ID of the default payment source for the invoice. - /// - /// It must belong to the customer associated with the invoice and be in a chargeable state. - /// If not set, defaults to the subscription's default source, if any, or to the customer's default source. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_source: Option<&'a str>, - - /// The tax rates that will apply to any line item that does not have `tax_rates` set. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - /// Referenced as 'memo' in the Dashboard. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// The coupons to redeem into discounts for the invoice. - /// - /// If not specified, inherits the discount from the invoice's customer. - /// Pass an empty string to avoid inheriting any discounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub discounts: Option>, - - /// The date on which payment for this invoice is due. - /// - /// Valid only for invoices where `collection_method=send_invoice`. - #[serde(skip_serializing_if = "Option::is_none")] - pub due_date: Option, - - /// The date when this invoice is in effect. - /// - /// Same as `finalized_at` unless overwritten. - /// When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. - #[serde(skip_serializing_if = "Option::is_none")] - pub effective_at: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Footer to be displayed on the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub footer: Option<&'a str>, - - /// Revise an existing invoice. - /// - /// The new invoice will be created in `status=draft`. - /// See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub from_invoice: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The account (if any) for which the funds of the invoice payment are intended. - /// - /// If set, the invoice will be presented with the branding and support information of the specified account. - /// See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option<&'a str>, - - /// Configuration settings for the PaymentIntent that is generated when the invoice is finalized. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_settings: Option, - - /// How to handle pending invoice items on invoice creation. - /// - /// One of `include` or `exclude`. - /// `include` will include any pending invoice items, and will create an empty draft invoice if no pending invoice items exist. - /// `exclude` will always create an empty invoice draft regardless if there are pending invoice items or not. - /// Defaults to `exclude` if the parameter is omitted. - #[serde(skip_serializing_if = "Option::is_none")] - pub pending_invoice_items_behavior: Option, - - /// Options for invoice PDF rendering. - #[serde(skip_serializing_if = "Option::is_none")] - pub rendering_options: Option, - - /// Settings for the cost of shipping for this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_cost: Option, - - /// Shipping details for the invoice. - /// - /// The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_details: Option, - - /// Extra information about a charge for the customer's credit card statement. - /// - /// It must contain at least one letter. - /// If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option<&'a str>, - - /// The ID of the subscription to invoice, if any. - /// - /// If set, the created invoice will only include pending invoice items for that subscription. - /// The subscription's billing cycle and regular subscription events won't be affected. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option, - - /// If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, -} - -impl<'a> CreateInvoice<'a> { - pub fn new() -> Self { - CreateInvoice { - account_tax_ids: Default::default(), - application_fee_amount: Default::default(), - auto_advance: Default::default(), - automatic_tax: Default::default(), - collection_method: Default::default(), - currency: Default::default(), - custom_fields: Default::default(), - customer: Default::default(), - days_until_due: Default::default(), - default_payment_method: Default::default(), - default_source: Default::default(), - default_tax_rates: Default::default(), - description: Default::default(), - discounts: Default::default(), - due_date: Default::default(), - effective_at: Default::default(), - expand: Default::default(), - footer: Default::default(), - from_invoice: Default::default(), - metadata: Default::default(), - on_behalf_of: Default::default(), - payment_settings: Default::default(), - pending_invoice_items_behavior: Default::default(), - rendering_options: Default::default(), - shipping_cost: Default::default(), - shipping_details: Default::default(), - statement_descriptor: Default::default(), - subscription: Default::default(), - transfer_data: Default::default(), - } - } -} - -/// The parameters for `Invoice::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListInvoices<'a> { - /// The collection method of the invoice to retrieve. - /// - /// Either `charge_automatically` or `send_invoice`. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return invoices for the customer specified by this customer ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub due_date: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. - /// - /// [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview). - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, - - /// Only return invoices for the subscription specified by this subscription ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option, -} - -impl<'a> ListInvoices<'a> { - pub fn new() -> Self { - ListInvoices { - collection_method: Default::default(), - created: Default::default(), - customer: Default::default(), - due_date: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - status: Default::default(), - subscription: Default::default(), - } - } -} -impl Paginable for ListInvoices<'_> { - type O = Invoice; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceAutomaticTax { - /// Whether Stripe automatically computes tax on this invoice. - /// - /// Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceCustomFields { - /// The name of the custom field. - /// - /// This may be up to 30 characters. - pub name: String, - - /// The value of the custom field. - /// - /// This may be up to 30 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceDiscounts { - /// ID of the coupon to create a new discount for. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// ID of an existing discount on the object (or one of its ancestors) to reuse. - #[serde(skip_serializing_if = "Option::is_none")] - pub discount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceFromInvoice { - /// The relation between the new invoice and the original invoice. - /// - /// Currently, only 'revision' is permitted. - pub action: CreateInvoiceFromInvoiceAction, - - /// The `id` of the invoice that will be cloned. - pub invoice: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettings { - /// ID of the mandate to be used for this invoice. - /// - /// It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_mandate: Option, - - /// Payment-method-specific configuration to provide to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_options: Option, - - /// The list of payment method types (e.g. - /// - /// card) to provide to the invoice’s PaymentIntent. - /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceRenderingOptions { - /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. - /// - /// One of `exclude_tax` or `include_inclusive_tax`. - /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. - /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_tax_display: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingCost { - /// The ID of the shipping rate to use for this order. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_rate: Option, - - /// Parameters to create a new ad-hoc shipping rate for this order. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_rate_data: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingDetails { - /// Shipping address. - pub address: CreateInvoiceShippingDetailsAddress, - - /// Recipient name. - pub name: String, - - /// Recipient phone (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceTransferData { - /// The amount that will be transferred automatically when the invoice is paid. - /// - /// If no amount is set, the full amount is transferred. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// ID of an existing, connected Stripe account. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptions { - /// If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingCostShippingRateData { - /// The estimated range for how long shipping will take, meant to be displayable to the customer. - /// - /// This will appear on CheckoutSessions. - #[serde(skip_serializing_if = "Option::is_none")] - pub delivery_estimate: Option, - - /// The name of the shipping rate, meant to be displayable to the customer. - /// - /// This will appear on CheckoutSessions. - pub display_name: String, - - /// Describes a fixed amount to charge for shipping. - /// - /// Must be present if type is `fixed_amount`. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amount: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - /// - /// The Shipping tax code is `txcd_92010001`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, - - /// The type of calculation to use on the shipping rate. - /// - /// Can only be `fixed_amount` for now. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingDetailsAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: - Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsBancontact { - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCard { - /// Installment configuration for payments attempted on this invoice (Mexico Only). - /// - /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). - #[serde(skip_serializing_if = "Option::is_none")] - pub installments: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_three_d_secure: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalance { - /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: - Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub funding_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccount { - /// Additional fields for Financial Connections Session creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: - Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingCostShippingRateDataDeliveryEstimate { - /// The upper bound of the estimated range. - /// - /// If empty, represents no upper bound i.e., infinite. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: Option, - - /// The lower bound of the estimated range. - /// - /// If empty, represents no lower bound. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingCostShippingRateDataFixedAmount { - /// A non-negative integer in cents representing how much to charge. - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Shipping rates defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: - Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { - /// Transaction type of the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_type: Option< - CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType, - >, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallments { - /// Setting to true enables installments for this invoice. - /// Setting to false will prevent any selected plan from applying to a payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled: Option, - - /// The selected installment plan to use for this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer { - /// Configuration for eu_bank_transfer funding type. - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: Option< - CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer, - >, - - /// The bank transfer type that can be used for funding. - /// - /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections { - - /// The list of permissions to request. - /// - /// If this parameter is passed, the `payment_method` permission must be included. - /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option>, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximum { - /// A unit of time. - pub unit: CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit, - - /// Must be greater than 0. - pub value: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimum { - /// A unit of time. - pub unit: CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit, - - /// Must be greater than 0. - pub value: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptions { - /// A non-negative integer in cents representing how much to charge. - pub amount: i64, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan { - /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. - pub count: u64, - - /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. - /// One of `month`. - pub interval: CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval, - - /// Type of installment plan, one of `fixed_count`. - #[serde(rename = "type")] - pub type_: CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer -{ - /// The desired country code of the bank account information. - /// - /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. - pub country: String, -} - -/// An enum representing the possible values of an `AutomaticTax`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AutomaticTaxStatus { - Complete, - Failed, - RequiresLocationInputs, -} - -impl AutomaticTaxStatus { - pub fn as_str(self) -> &'static str { - match self { - AutomaticTaxStatus::Complete => "complete", - AutomaticTaxStatus::Failed => "failed", - AutomaticTaxStatus::RequiresLocationInputs => "requires_location_inputs", - } - } -} - -impl AsRef for AutomaticTaxStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AutomaticTaxStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AutomaticTaxStatus { - fn default() -> Self { - Self::Complete - } -} - -/// An enum representing the possible values of an `Invoice`'s `collection_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CollectionMethod { - ChargeAutomatically, - SendInvoice, -} - -impl CollectionMethod { - pub fn as_str(self) -> &'static str { - match self { - CollectionMethod::ChargeAutomatically => "charge_automatically", - CollectionMethod::SendInvoice => "send_invoice", - } - } -} - -impl AsRef for CollectionMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CollectionMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CollectionMethod { - fn default() -> Self { - Self::ChargeAutomatically - } -} - -/// An enum representing the possible values of an `CreateInvoiceFromInvoice`'s `action` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceFromInvoiceAction { - Revision, -} - -impl CreateInvoiceFromInvoiceAction { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceFromInvoiceAction::Revision => "revision", - } - } -} - -impl AsRef for CreateInvoiceFromInvoiceAction { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoiceFromInvoiceAction { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateInvoiceFromInvoiceAction { - fn default() -> Self { - Self::Revision - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - Business, - Personal, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business", - CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef - for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => "automatic", - CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant", - CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => "microdeposits", - } - } -} - -impl AsRef for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::De => "de", - CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::En => "en", - CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::Fr => "fr", - CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef for CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage -{ - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval { - Month, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval::Month => { - "month" - } - } - } -} - -impl AsRef for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval -{ - fn default() -> Self { - Self::Month - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { - FixedCount, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType::FixedCount => "fixed_count", - } - } -} - -impl AsRef for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType -{ - fn default() -> Self { - Self::FixedCount - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Automatic => { - "automatic" - } - } - } -} - -impl AsRef for CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure -{ - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances", - CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership", - CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method", - CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - Balances, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", - } - } -} - -impl AsRef - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => "automatic", - CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant", - CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => "microdeposits", - } - } -} - -impl AsRef - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettings`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodTypes { - AchCreditTransfer, - AchDebit, - AcssDebit, - AuBecsDebit, - BacsDebit, - Bancontact, - Boleto, - Card, - Cashapp, - CustomerBalance, - Fpx, - Giropay, - Grabpay, - Ideal, - Konbini, - Link, - Paynow, - Paypal, - Promptpay, - SepaCreditTransfer, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, -} - -impl CreateInvoicePaymentSettingsPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodTypes::AchCreditTransfer => { - "ach_credit_transfer" - } - CreateInvoicePaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit", - CreateInvoicePaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit", - CreateInvoicePaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - CreateInvoicePaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit", - CreateInvoicePaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", - CreateInvoicePaymentSettingsPaymentMethodTypes::Boleto => "boleto", - CreateInvoicePaymentSettingsPaymentMethodTypes::Card => "card", - CreateInvoicePaymentSettingsPaymentMethodTypes::Cashapp => "cashapp", - CreateInvoicePaymentSettingsPaymentMethodTypes::CustomerBalance => "customer_balance", - CreateInvoicePaymentSettingsPaymentMethodTypes::Fpx => "fpx", - CreateInvoicePaymentSettingsPaymentMethodTypes::Giropay => "giropay", - CreateInvoicePaymentSettingsPaymentMethodTypes::Grabpay => "grabpay", - CreateInvoicePaymentSettingsPaymentMethodTypes::Ideal => "ideal", - CreateInvoicePaymentSettingsPaymentMethodTypes::Konbini => "konbini", - CreateInvoicePaymentSettingsPaymentMethodTypes::Link => "link", - CreateInvoicePaymentSettingsPaymentMethodTypes::Paynow => "paynow", - CreateInvoicePaymentSettingsPaymentMethodTypes::Paypal => "paypal", - CreateInvoicePaymentSettingsPaymentMethodTypes::Promptpay => "promptpay", - CreateInvoicePaymentSettingsPaymentMethodTypes::SepaCreditTransfer => { - "sepa_credit_transfer" - } - CreateInvoicePaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit", - CreateInvoicePaymentSettingsPaymentMethodTypes::Sofort => "sofort", - CreateInvoicePaymentSettingsPaymentMethodTypes::UsBankAccount => "us_bank_account", - CreateInvoicePaymentSettingsPaymentMethodTypes::WechatPay => "wechat_pay", - } - } -} - -impl AsRef for CreateInvoicePaymentSettingsPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoicePaymentSettingsPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateInvoicePaymentSettingsPaymentMethodTypes { - fn default() -> Self { - Self::AchCreditTransfer - } -} - -/// An enum representing the possible values of an `CreateInvoiceRenderingOptions`'s `amount_tax_display` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceRenderingOptionsAmountTaxDisplay { - ExcludeTax, - IncludeInclusiveTax, -} - -impl CreateInvoiceRenderingOptionsAmountTaxDisplay { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceRenderingOptionsAmountTaxDisplay::ExcludeTax => "exclude_tax", - CreateInvoiceRenderingOptionsAmountTaxDisplay::IncludeInclusiveTax => { - "include_inclusive_tax" - } - } - } -} - -impl AsRef for CreateInvoiceRenderingOptionsAmountTaxDisplay { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoiceRenderingOptionsAmountTaxDisplay { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateInvoiceRenderingOptionsAmountTaxDisplay { - fn default() -> Self { - Self::ExcludeTax - } -} - -/// An enum representing the possible values of an `CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximum`'s `unit` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { - BusinessDay, - Day, - Hour, - Month, - Week, -} - -impl CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::BusinessDay => { - "business_day" - } - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::Day => "day", - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::Hour => "hour", - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::Month => "month", - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::Week => "week", - } - } -} - -impl AsRef for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit -{ - fn default() -> Self { - Self::BusinessDay - } -} - -/// An enum representing the possible values of an `CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimum`'s `unit` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { - BusinessDay, - Day, - Hour, - Month, - Week, -} - -impl CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::BusinessDay => { - "business_day" - } - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::Day => "day", - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::Hour => "hour", - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::Month => "month", - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::Week => "week", - } - } -} - -impl AsRef for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit -{ - fn default() -> Self { - Self::BusinessDay - } -} - -/// An enum representing the possible values of an `CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptions`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::Exclusive => "exclusive", - CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::Inclusive => "inclusive", - CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior -{ - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreateInvoiceShippingCostShippingRateData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceShippingCostShippingRateDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreateInvoiceShippingCostShippingRateDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceShippingCostShippingRateDataTaxBehavior::Exclusive => "exclusive", - CreateInvoiceShippingCostShippingRateDataTaxBehavior::Inclusive => "inclusive", - CreateInvoiceShippingCostShippingRateDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for CreateInvoiceShippingCostShippingRateDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoiceShippingCostShippingRateDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateInvoiceShippingCostShippingRateDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreateInvoiceShippingCostShippingRateData`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceShippingCostShippingRateDataType { - FixedAmount, -} - -impl CreateInvoiceShippingCostShippingRateDataType { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceShippingCostShippingRateDataType::FixedAmount => "fixed_amount", - } - } -} - -impl AsRef for CreateInvoiceShippingCostShippingRateDataType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoiceShippingCostShippingRateDataType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateInvoiceShippingCostShippingRateDataType { - fn default() -> Self { - Self::FixedAmount - } -} - -/// An enum representing the possible values of an `Invoice`'s `billing_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceBillingReason { - AutomaticPendingInvoiceItemInvoice, - Manual, - QuoteAccept, - Subscription, - SubscriptionCreate, - SubscriptionCycle, - SubscriptionThreshold, - SubscriptionUpdate, - Upcoming, -} - -impl InvoiceBillingReason { - pub fn as_str(self) -> &'static str { - match self { - InvoiceBillingReason::AutomaticPendingInvoiceItemInvoice => { - "automatic_pending_invoice_item_invoice" - } - InvoiceBillingReason::Manual => "manual", - InvoiceBillingReason::QuoteAccept => "quote_accept", - InvoiceBillingReason::Subscription => "subscription", - InvoiceBillingReason::SubscriptionCreate => "subscription_create", - InvoiceBillingReason::SubscriptionCycle => "subscription_cycle", - InvoiceBillingReason::SubscriptionThreshold => "subscription_threshold", - InvoiceBillingReason::SubscriptionUpdate => "subscription_update", - InvoiceBillingReason::Upcoming => "upcoming", - } - } -} - -impl AsRef for InvoiceBillingReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceBillingReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceBillingReason { - fn default() -> Self { - Self::AutomaticPendingInvoiceItemInvoice - } -} - -/// An enum representing the possible values of an `Invoice`'s `customer_tax_exempt` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceCustomerTaxExempt { - Exempt, - None, - Reverse, -} - -impl InvoiceCustomerTaxExempt { - pub fn as_str(self) -> &'static str { - match self { - InvoiceCustomerTaxExempt::Exempt => "exempt", - InvoiceCustomerTaxExempt::None => "none", - InvoiceCustomerTaxExempt::Reverse => "reverse", - } - } -} - -impl AsRef for InvoiceCustomerTaxExempt { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceCustomerTaxExempt { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceCustomerTaxExempt { - fn default() -> Self { - Self::Exempt - } -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, -} - -impl InvoicePaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - InvoicePaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoicePaymentMethodOptionsCardRequestThreeDSecure { - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `CreateInvoice`'s `pending_invoice_items_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePendingInvoiceItemsBehavior { - Exclude, - Include, - IncludeAndRequire, -} - -impl InvoicePendingInvoiceItemsBehavior { - pub fn as_str(self) -> &'static str { - match self { - InvoicePendingInvoiceItemsBehavior::Exclude => "exclude", - InvoicePendingInvoiceItemsBehavior::Include => "include", - InvoicePendingInvoiceItemsBehavior::IncludeAndRequire => "include_and_require", - } - } -} - -impl AsRef for InvoicePendingInvoiceItemsBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePendingInvoiceItemsBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoicePendingInvoiceItemsBehavior { - fn default() -> Self { - Self::Exclude - } -} - -/// An enum representing the possible values of an `Invoice`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceStatus { - Draft, - Open, - Paid, - Uncollectible, - Void, -} - -impl InvoiceStatus { - pub fn as_str(self) -> &'static str { - match self { - InvoiceStatus::Draft => "draft", - InvoiceStatus::Open => "open", - InvoiceStatus::Paid => "paid", - InvoiceStatus::Uncollectible => "uncollectible", - InvoiceStatus::Void => "void", - } - } -} - -impl AsRef for InvoiceStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceStatus { - fn default() -> Self { - Self::Draft - } -} - -/// An enum representing the possible values of an `InvoicesPaymentSettings`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicesPaymentSettingsPaymentMethodTypes { - AchCreditTransfer, - AchDebit, - AcssDebit, - AuBecsDebit, - BacsDebit, - Bancontact, - Boleto, - Card, - Cashapp, - CustomerBalance, - Fpx, - Giropay, - Grabpay, - Ideal, - Konbini, - Link, - Paynow, - Paypal, - Promptpay, - SepaCreditTransfer, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, -} - -impl InvoicesPaymentSettingsPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - InvoicesPaymentSettingsPaymentMethodTypes::AchCreditTransfer => "ach_credit_transfer", - InvoicesPaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit", - InvoicesPaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit", - InvoicesPaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - InvoicesPaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit", - InvoicesPaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", - InvoicesPaymentSettingsPaymentMethodTypes::Boleto => "boleto", - InvoicesPaymentSettingsPaymentMethodTypes::Card => "card", - InvoicesPaymentSettingsPaymentMethodTypes::Cashapp => "cashapp", - InvoicesPaymentSettingsPaymentMethodTypes::CustomerBalance => "customer_balance", - InvoicesPaymentSettingsPaymentMethodTypes::Fpx => "fpx", - InvoicesPaymentSettingsPaymentMethodTypes::Giropay => "giropay", - InvoicesPaymentSettingsPaymentMethodTypes::Grabpay => "grabpay", - InvoicesPaymentSettingsPaymentMethodTypes::Ideal => "ideal", - InvoicesPaymentSettingsPaymentMethodTypes::Konbini => "konbini", - InvoicesPaymentSettingsPaymentMethodTypes::Link => "link", - InvoicesPaymentSettingsPaymentMethodTypes::Paynow => "paynow", - InvoicesPaymentSettingsPaymentMethodTypes::Paypal => "paypal", - InvoicesPaymentSettingsPaymentMethodTypes::Promptpay => "promptpay", - InvoicesPaymentSettingsPaymentMethodTypes::SepaCreditTransfer => "sepa_credit_transfer", - InvoicesPaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit", - InvoicesPaymentSettingsPaymentMethodTypes::Sofort => "sofort", - InvoicesPaymentSettingsPaymentMethodTypes::UsBankAccount => "us_bank_account", - InvoicesPaymentSettingsPaymentMethodTypes::WechatPay => "wechat_pay", - } - } -} - -impl AsRef for InvoicesPaymentSettingsPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicesPaymentSettingsPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoicesPaymentSettingsPaymentMethodTypes { - fn default() -> Self { - Self::AchCreditTransfer - } -} - -/// An enum representing the possible values of an `TaxAmount`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxAmountTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl TaxAmountTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - TaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - TaxAmountTaxabilityReason::NotCollecting => "not_collecting", - TaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - TaxAmountTaxabilityReason::NotSupported => "not_supported", - TaxAmountTaxabilityReason::PortionProductExempt => "portion_product_exempt", - TaxAmountTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - TaxAmountTaxabilityReason::PortionStandardRated => "portion_standard_rated", - TaxAmountTaxabilityReason::ProductExempt => "product_exempt", - TaxAmountTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - TaxAmountTaxabilityReason::ProportionallyRated => "proportionally_rated", - TaxAmountTaxabilityReason::ReducedRated => "reduced_rated", - TaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", - TaxAmountTaxabilityReason::StandardRated => "standard_rated", - TaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - TaxAmountTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for TaxAmountTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxAmountTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxAmountTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} - -/// An enum representing the possible values of an `InvoicesResourceInvoiceTaxId`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxIdType { - AdNrt, - AeTrn, - ArCuit, - AuAbn, - AuArn, - BgUic, - BoTin, - BrCnpj, - BrCpf, - CaBn, - CaGstHst, - CaPstBc, - CaPstMb, - CaPstSk, - CaQst, - ChVat, - ClTin, - CnTin, - CoNit, - CrTin, - DoRcn, - EcRuc, - EgTin, - EsCif, - EuOssVat, - EuVat, - GbVat, - GeVat, - HkBr, - HuTin, - IdNpwp, - IlVat, - InGst, - IsVat, - JpCn, - JpRn, - JpTrn, - KePin, - KrBrn, - LiUid, - MxRfc, - MyFrp, - MyItn, - MySst, - NoVat, - NzGst, - PeRuc, - PhTin, - RoTin, - RsPib, - RuInn, - RuKpp, - SaVat, - SgGst, - SgUen, - SiTin, - SvNit, - ThVat, - TrTin, - TwVat, - UaVat, - Unknown, - UsEin, - UyRuc, - VeRif, - VnTin, - ZaVat, -} - -impl TaxIdType { - pub fn as_str(self) -> &'static str { - match self { - TaxIdType::AdNrt => "ad_nrt", - TaxIdType::AeTrn => "ae_trn", - TaxIdType::ArCuit => "ar_cuit", - TaxIdType::AuAbn => "au_abn", - TaxIdType::AuArn => "au_arn", - TaxIdType::BgUic => "bg_uic", - TaxIdType::BoTin => "bo_tin", - TaxIdType::BrCnpj => "br_cnpj", - TaxIdType::BrCpf => "br_cpf", - TaxIdType::CaBn => "ca_bn", - TaxIdType::CaGstHst => "ca_gst_hst", - TaxIdType::CaPstBc => "ca_pst_bc", - TaxIdType::CaPstMb => "ca_pst_mb", - TaxIdType::CaPstSk => "ca_pst_sk", - TaxIdType::CaQst => "ca_qst", - TaxIdType::ChVat => "ch_vat", - TaxIdType::ClTin => "cl_tin", - TaxIdType::CnTin => "cn_tin", - TaxIdType::CoNit => "co_nit", - TaxIdType::CrTin => "cr_tin", - TaxIdType::DoRcn => "do_rcn", - TaxIdType::EcRuc => "ec_ruc", - TaxIdType::EgTin => "eg_tin", - TaxIdType::EsCif => "es_cif", - TaxIdType::EuOssVat => "eu_oss_vat", - TaxIdType::EuVat => "eu_vat", - TaxIdType::GbVat => "gb_vat", - TaxIdType::GeVat => "ge_vat", - TaxIdType::HkBr => "hk_br", - TaxIdType::HuTin => "hu_tin", - TaxIdType::IdNpwp => "id_npwp", - TaxIdType::IlVat => "il_vat", - TaxIdType::InGst => "in_gst", - TaxIdType::IsVat => "is_vat", - TaxIdType::JpCn => "jp_cn", - TaxIdType::JpRn => "jp_rn", - TaxIdType::JpTrn => "jp_trn", - TaxIdType::KePin => "ke_pin", - TaxIdType::KrBrn => "kr_brn", - TaxIdType::LiUid => "li_uid", - TaxIdType::MxRfc => "mx_rfc", - TaxIdType::MyFrp => "my_frp", - TaxIdType::MyItn => "my_itn", - TaxIdType::MySst => "my_sst", - TaxIdType::NoVat => "no_vat", - TaxIdType::NzGst => "nz_gst", - TaxIdType::PeRuc => "pe_ruc", - TaxIdType::PhTin => "ph_tin", - TaxIdType::RoTin => "ro_tin", - TaxIdType::RsPib => "rs_pib", - TaxIdType::RuInn => "ru_inn", - TaxIdType::RuKpp => "ru_kpp", - TaxIdType::SaVat => "sa_vat", - TaxIdType::SgGst => "sg_gst", - TaxIdType::SgUen => "sg_uen", - TaxIdType::SiTin => "si_tin", - TaxIdType::SvNit => "sv_nit", - TaxIdType::ThVat => "th_vat", - TaxIdType::TrTin => "tr_tin", - TaxIdType::TwVat => "tw_vat", - TaxIdType::UaVat => "ua_vat", - TaxIdType::Unknown => "unknown", - TaxIdType::UsEin => "us_ein", - TaxIdType::UyRuc => "uy_ruc", - TaxIdType::VeRif => "ve_rif", - TaxIdType::VnTin => "vn_tin", - TaxIdType::ZaVat => "za_vat", - } - } -} - -impl AsRef for TaxIdType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxIdType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxIdType { - fn default() -> Self { - Self::AdNrt - } -} diff --git a/src/resources/generated/invoice_payment_method_options_acss_debit.rs b/src/resources/generated/invoice_payment_method_options_acss_debit.rs deleted file mode 100644 index b94d1fe29..000000000 --- a/src/resources/generated/invoice_payment_method_options_acss_debit.rs +++ /dev/null @@ -1,98 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice_payment_method_options_acss_debit". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsAcssDebit { - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsAcssDebitMandateOptions { - /// Transaction type of the mandate. - pub transaction_type: Option, -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - Business, - Personal, -} - -impl InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => { - "business" - } - InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => { - "personal" - } - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl InvoicePaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsAcssDebitVerificationMethod::Automatic => "automatic", - InvoicePaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant", - InvoicePaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePaymentMethodOptionsAcssDebitVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoicePaymentMethodOptionsAcssDebitVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} diff --git a/src/resources/generated/invoice_payment_method_options_bancontact.rs b/src/resources/generated/invoice_payment_method_options_bancontact.rs deleted file mode 100644 index 0790a6dd8..000000000 --- a/src/resources/generated/invoice_payment_method_options_bancontact.rs +++ /dev/null @@ -1,50 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice_payment_method_options_bancontact". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsBancontact { - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - pub preferred_language: InvoicePaymentMethodOptionsBancontactPreferredLanguage, -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl InvoicePaymentMethodOptionsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsBancontactPreferredLanguage::De => "de", - InvoicePaymentMethodOptionsBancontactPreferredLanguage::En => "en", - InvoicePaymentMethodOptionsBancontactPreferredLanguage::Fr => "fr", - InvoicePaymentMethodOptionsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsBancontactPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePaymentMethodOptionsBancontactPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoicePaymentMethodOptionsBancontactPreferredLanguage { - fn default() -> Self { - Self::De - } -} diff --git a/src/resources/generated/invoice_payment_method_options_customer_balance.rs b/src/resources/generated/invoice_payment_method_options_customer_balance.rs deleted file mode 100644 index f170a5e7a..000000000 --- a/src/resources/generated/invoice_payment_method_options_customer_balance.rs +++ /dev/null @@ -1,122 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice_payment_method_options_customer_balance". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsCustomerBalance { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - pub funding_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsCustomerBalanceBankTransfer { - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: - Option, - - /// The bank transfer type that can be used for funding. - /// - /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer { - /// The desired country code of the bank account information. - /// - /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. - pub country: InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry, -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer`'s `country` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry { - #[serde(rename = "BE")] - Be, - #[serde(rename = "DE")] - De, - #[serde(rename = "ES")] - Es, - #[serde(rename = "FR")] - Fr, - #[serde(rename = "IE")] - Ie, - #[serde(rename = "NL")] - Nl, -} - -impl InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Be => "BE", - InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::De => "DE", - InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Es => "ES", - InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Fr => "FR", - InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Ie => "IE", - InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Nl => "NL", - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry -{ - fn default() -> Self { - Self::Be - } -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsCustomerBalance`'s `funding_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsCustomerBalanceFundingType { - BankTransfer, -} - -impl InvoicePaymentMethodOptionsCustomerBalanceFundingType { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsCustomerBalanceFundingType::BankTransfer => "bank_transfer", - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsCustomerBalanceFundingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePaymentMethodOptionsCustomerBalanceFundingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoicePaymentMethodOptionsCustomerBalanceFundingType { - fn default() -> Self { - Self::BankTransfer - } -} diff --git a/src/resources/generated/invoice_payment_method_options_konbini.rs b/src/resources/generated/invoice_payment_method_options_konbini.rs deleted file mode 100644 index 87f7350d0..000000000 --- a/src/resources/generated/invoice_payment_method_options_konbini.rs +++ /dev/null @@ -1,9 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice_payment_method_options_konbini". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsKonbini {} diff --git a/src/resources/generated/invoice_payment_method_options_us_bank_account.rs b/src/resources/generated/invoice_payment_method_options_us_bank_account.rs deleted file mode 100644 index e742f3468..000000000 --- a/src/resources/generated/invoice_payment_method_options_us_bank_account.rs +++ /dev/null @@ -1,141 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice_payment_method_options_us_bank_account". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsUsBankAccount { - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptions { - /// The list of permissions to request. - /// - /// The `payment_method` permission must be included. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: - Option>, - - /// Data features requested to be retrieved upon account creation. - pub prefetch: Option>, -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptions`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { - Balances, - PaymentMethod, - Transactions, -} - -impl InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions::Balances => "balances", - InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions::PaymentMethod => "payment_method", - InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptions`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { - Balances, -} - -impl InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch::Balances => { - "balances" - } - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => "automatic", - InvoicePaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant", - InvoicePaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} diff --git a/src/resources/generated/invoice_setting_rendering_options.rs b/src/resources/generated/invoice_setting_rendering_options.rs deleted file mode 100644 index 282332dfc..000000000 --- a/src/resources/generated/invoice_setting_rendering_options.rs +++ /dev/null @@ -1,12 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "InvoiceSettingRenderingOptions". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceSettingRenderingOptions { - /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. - pub amount_tax_display: Option, -} diff --git a/src/resources/generated/invoiceitem.rs b/src/resources/generated/invoiceitem.rs deleted file mode 100644 index bc114979d..000000000 --- a/src/resources/generated/invoiceitem.rs +++ /dev/null @@ -1,633 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, InvoiceId, InvoiceItemId, PriceId, SubscriptionId}; -use crate::params::{ - Deleted, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp, -}; -use crate::resources::{ - Currency, Customer, Discount, Invoice, Period, Plan, Price, Subscription, TaxRate, - TestHelpersTestClock, -}; - -/// The resource representing a Stripe "InvoiceItem". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceItem { - /// Unique identifier for the object. - pub id: InvoiceItemId, - - /// Amount (in the `currency` specified) of the invoice item. - /// - /// This should always be equal to `unit_amount * quantity`. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// The ID of the customer who will be billed when this invoice item is billed. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub date: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// If true, discounts will apply to this invoice item. - /// - /// Always false for prorations. - #[serde(skip_serializing_if = "Option::is_none")] - pub discountable: Option, - - /// The discounts which apply to the invoice item. - /// - /// Item discounts are applied before invoice discounts. - /// Use `expand[]=discounts` to expand each discount. - #[serde(skip_serializing_if = "Option::is_none")] - pub discounts: Option>>, - - /// The ID of the invoice this invoice item belongs to. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub period: Option, - - /// If the invoice item is a proration, the plan of the subscription that the proration was computed for. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - /// The price of the invoice item. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration: Option, - - /// Quantity of units for the invoice item. - /// - /// If the invoice item is a proration, the quantity of the subscription that the proration was computed for. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The subscription that this invoice item has been created for, if any. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option>, - - /// The subscription item that this invoice item has been created for, if any. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_item: Option, - - /// The tax rates which apply to the invoice item. - /// - /// When set, the `default_tax_rates` on the invoice do not apply to this invoice item. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, - - /// ID of the test clock this invoice item belongs to. - #[serde(skip_serializing_if = "Option::is_none")] - pub test_clock: Option>, - - /// Unit amount (in the `currency` specified) of the invoice item. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -impl InvoiceItem { - /// Returns a list of your invoice items. - /// - /// Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first. - pub fn list(client: &Client, params: &ListInvoiceItems<'_>) -> Response> { - client.get_query("/invoiceitems", ¶ms) - } - - /// Creates an item to be added to a draft invoice (up to 250 items per invoice). - /// - /// If no invoice is specified, the item will be on the next invoice created for the customer specified. - pub fn create(client: &Client, params: CreateInvoiceItem<'_>) -> Response { - client.post_form("/invoiceitems", ¶ms) - } - - /// Retrieves the invoice item with the given ID. - pub fn retrieve(client: &Client, id: &InvoiceItemId, expand: &[&str]) -> Response { - client.get_query(&format!("/invoiceitems/{}", id), &Expand { expand }) - } - - /// Updates the amount or description of an invoice item on an upcoming invoice. - /// - /// Updating an invoice item is only possible before the invoice it’s attached to is closed. - pub fn update( - client: &Client, - id: &InvoiceItemId, - params: UpdateInvoiceItem<'_>, - ) -> Response { - client.post_form(&format!("/invoiceitems/{}", id), ¶ms) - } - - /// Deletes an invoice item, removing it from an invoice. - /// - /// Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice. - pub fn delete(client: &Client, id: &InvoiceItemId) -> Response> { - client.delete(&format!("/invoiceitems/{}", id)) - } -} - -impl Object for InvoiceItem { - type Id = InvoiceItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "invoiceitem" - } -} - -/// The parameters for `InvoiceItem::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateInvoiceItem<'a> { - /// The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. - /// - /// Passing in a negative `amount` will reduce the `amount_due` on the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// The ID of the customer who will be billed when this invoice item is billed. - pub customer: CustomerId, - - /// An arbitrary string which you can attach to the invoice item. - /// - /// The description is displayed in the invoice for easy tracking. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Controls whether discounts apply to this invoice item. - /// - /// Defaults to false for prorations or negative invoice items, and true for all other invoice items. - #[serde(skip_serializing_if = "Option::is_none")] - pub discountable: Option, - - /// The coupons to redeem into discounts for the invoice item or invoice line item. - #[serde(skip_serializing_if = "Option::is_none")] - pub discounts: Option>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The ID of an existing invoice to add this invoice item to. - /// - /// When left blank, the invoice item will be added to the next upcoming scheduled invoice. - /// This is useful when adding invoice items in response to an invoice.created webhook. - /// You can only add invoice items to draft invoices and there is a maximum of 250 items per invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The period associated with this invoice item. - /// - /// When set to different values, the period will be rendered on the invoice. - /// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. - /// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub period: Option, - - /// The ID of the price object. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Non-negative integer. - /// - /// The quantity of units for the invoice item. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The ID of a subscription to add this invoice item to. - /// - /// When left blank, the invoice item will be be added to the next upcoming scheduled invoice. - /// When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. - /// Use this when you want to express that an invoice item has been accrued within the context of a particular subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, - - /// The tax rates which apply to the invoice item. - /// - /// When set, the `default_tax_rates` on the invoice do not apply to this invoice item. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, - - /// The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. - /// - /// This `unit_amount` will be multiplied by the quantity to get the full amount. - /// Passing in a negative `unit_amount` will reduce the `amount_due` on the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option<&'a str>, -} - -impl<'a> CreateInvoiceItem<'a> { - pub fn new(customer: CustomerId) -> Self { - CreateInvoiceItem { - amount: Default::default(), - currency: Default::default(), - customer, - description: Default::default(), - discountable: Default::default(), - discounts: Default::default(), - expand: Default::default(), - invoice: Default::default(), - metadata: Default::default(), - period: Default::default(), - price: Default::default(), - price_data: Default::default(), - quantity: Default::default(), - subscription: Default::default(), - tax_behavior: Default::default(), - tax_code: Default::default(), - tax_rates: Default::default(), - unit_amount: Default::default(), - unit_amount_decimal: Default::default(), - } - } -} - -/// The parameters for `InvoiceItem::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListInvoiceItems<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// The identifier of the customer whose invoice items to return. - /// - /// If none is provided, all invoice items will be returned. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Only return invoice items belonging to this invoice. - /// - /// If none is provided, all invoice items will be returned. - /// If specifying an invoice, no customer identifier is needed. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice: Option, - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Set to `true` to only show pending invoice items, which are not yet attached to any invoices. - /// - /// Set to `false` to only show invoice items already attached to invoices. - /// If unspecified, no filter is applied. - #[serde(skip_serializing_if = "Option::is_none")] - pub pending: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListInvoiceItems<'a> { - pub fn new() -> Self { - ListInvoiceItems { - created: Default::default(), - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - invoice: Default::default(), - limit: Default::default(), - pending: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListInvoiceItems<'_> { - type O = InvoiceItem; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `InvoiceItem::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateInvoiceItem<'a> { - /// The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. - /// - /// If you want to apply a credit to the customer's account, pass a negative amount. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// An arbitrary string which you can attach to the invoice item. - /// - /// The description is displayed in the invoice for easy tracking. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Controls whether discounts apply to this invoice item. - /// - /// Defaults to false for prorations or negative invoice items, and true for all other invoice items. - /// Cannot be set to true for prorations. - #[serde(skip_serializing_if = "Option::is_none")] - pub discountable: Option, - - /// The coupons & existing discounts which apply to the invoice item or invoice line item. - /// - /// Item discounts are applied before invoice discounts. - /// Pass an empty string to remove previously-defined discounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub discounts: Option>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The period associated with this invoice item. - /// - /// When set to different values, the period will be rendered on the invoice. - /// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. - /// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub period: Option, - - /// The ID of the price object. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Non-negative integer. - /// - /// The quantity of units for the invoice item. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, - - /// The tax rates which apply to the invoice item. - /// - /// When set, the `default_tax_rates` on the invoice do not apply to this invoice item. - /// Pass an empty string to remove previously-defined tax rates. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, - - /// The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. - /// - /// This unit_amount will be multiplied by the quantity to get the full amount. - /// If you want to apply a credit to the customer's account, pass a negative unit_amount. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option<&'a str>, -} - -impl<'a> UpdateInvoiceItem<'a> { - pub fn new() -> Self { - UpdateInvoiceItem { - amount: Default::default(), - description: Default::default(), - discountable: Default::default(), - discounts: Default::default(), - expand: Default::default(), - metadata: Default::default(), - period: Default::default(), - price: Default::default(), - price_data: Default::default(), - quantity: Default::default(), - tax_behavior: Default::default(), - tax_code: Default::default(), - tax_rates: Default::default(), - unit_amount: Default::default(), - unit_amount_decimal: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceItemDiscounts { - /// ID of the coupon to create a new discount for. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// ID of an existing discount on the object (or one of its ancestors) to reuse. - #[serde(skip_serializing_if = "Option::is_none")] - pub discount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceItemPriceData { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of the product that this price will belong to. - pub product: String, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateInvoiceItemDiscounts { - /// ID of the coupon to create a new discount for. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// ID of an existing discount on the object (or one of its ancestors) to reuse. - #[serde(skip_serializing_if = "Option::is_none")] - pub discount: Option, -} - -/// An enum representing the possible values of an `InvoiceItemPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceItemPriceDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl InvoiceItemPriceDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - InvoiceItemPriceDataTaxBehavior::Exclusive => "exclusive", - InvoiceItemPriceDataTaxBehavior::Inclusive => "inclusive", - InvoiceItemPriceDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for InvoiceItemPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceItemPriceDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceItemPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreateInvoiceItem`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceItemTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl InvoiceItemTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - InvoiceItemTaxBehavior::Exclusive => "exclusive", - InvoiceItemTaxBehavior::Inclusive => "inclusive", - InvoiceItemTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for InvoiceItemTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceItemTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceItemTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} diff --git a/src/resources/generated/invoices_shipping_cost.rs b/src/resources/generated/invoices_shipping_cost.rs deleted file mode 100644 index c2ab9c430..000000000 --- a/src/resources/generated/invoices_shipping_cost.rs +++ /dev/null @@ -1,106 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::params::Expandable; -use crate::resources::{ShippingRate, TaxRate}; - -/// The resource representing a Stripe "InvoicesShippingCost". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesShippingCost { - /// Total shipping cost before any taxes are applied. - pub amount_subtotal: i64, - - /// Total tax amount applied due to shipping costs. - /// - /// If no tax was applied, defaults to 0. - pub amount_tax: i64, - - /// Total shipping cost after taxes are applied. - pub amount_total: i64, - - /// The ID of the ShippingRate for this invoice. - pub shipping_rate: Option>, - - /// The taxes applied to the shipping rate. - #[serde(skip_serializing_if = "Option::is_none")] - pub taxes: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LineItemsTaxAmount { - /// Amount of tax applied for this rate. - pub amount: i64, - - pub rate: TaxRate, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: Option, - - /// The amount on which tax is calculated, in cents (or local equivalent). - pub taxable_amount: Option, -} - -/// An enum representing the possible values of an `LineItemsTaxAmount`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum LineItemsTaxAmountTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl LineItemsTaxAmountTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - LineItemsTaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - LineItemsTaxAmountTaxabilityReason::NotCollecting => "not_collecting", - LineItemsTaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - LineItemsTaxAmountTaxabilityReason::NotSupported => "not_supported", - LineItemsTaxAmountTaxabilityReason::PortionProductExempt => "portion_product_exempt", - LineItemsTaxAmountTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - LineItemsTaxAmountTaxabilityReason::PortionStandardRated => "portion_standard_rated", - LineItemsTaxAmountTaxabilityReason::ProductExempt => "product_exempt", - LineItemsTaxAmountTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - LineItemsTaxAmountTaxabilityReason::ProportionallyRated => "proportionally_rated", - LineItemsTaxAmountTaxabilityReason::ReducedRated => "reduced_rated", - LineItemsTaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", - LineItemsTaxAmountTaxabilityReason::StandardRated => "standard_rated", - LineItemsTaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - LineItemsTaxAmountTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for LineItemsTaxAmountTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for LineItemsTaxAmountTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for LineItemsTaxAmountTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} diff --git a/src/resources/generated/issuing_authorization.rs b/src/resources/generated/issuing_authorization.rs deleted file mode 100644 index 52710c9b4..000000000 --- a/src/resources/generated/issuing_authorization.rs +++ /dev/null @@ -1,259 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::IssuingAuthorizationId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{ - BalanceTransaction, Currency, IssuingAuthorizationAmountDetails, IssuingAuthorizationCheck, - IssuingAuthorizationMethod, IssuingAuthorizationReason, IssuingCard, IssuingCardholder, - IssuingTransaction, MerchantData, -}; - -/// The resource representing a Stripe "IssuingAuthorization". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorization { - /// Unique identifier for the object. - pub id: IssuingAuthorizationId, - - /// The total amount that was authorized or rejected. - /// - /// This amount is in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: i64, - - /// Detailed breakdown of amount components. - /// - /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount_details: Option, - - /// Whether the authorization has been approved. - pub approved: bool, - - /// How the card details were provided. - pub authorization_method: IssuingAuthorizationMethod, - - /// List of balance transactions associated with this authorization. - pub balance_transactions: Vec, - - pub card: IssuingCard, - - /// The cardholder to whom this authorization belongs. - pub cardholder: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The total amount that was authorized or rejected. - /// - /// This amount is in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub merchant_amount: i64, - - /// The currency that was presented to the cardholder for the authorization. - /// - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub merchant_currency: Currency, - - pub merchant_data: MerchantData, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// Details about the authorization, such as identifiers, set by the card network. - pub network_data: Option, - - /// The pending authorization request. - /// - /// This field will only be non-null during an `issuing_authorization.request` webhook. - pub pending_request: Option, - - /// History of every time a `pending_request` authorization was approved/declined, either by you directly or by Stripe (e.g. - /// - /// based on your spending_controls). - /// If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. - /// This field can be helpful in determining why a given authorization was approved/declined. - pub request_history: Vec, - - /// The current status of the authorization in its lifecycle. - pub status: IssuingAuthorizationStatus, - - /// List of [transactions](https://stripe.com/docs/api/issuing/transactions) associated with this authorization. - pub transactions: Vec, - - /// [Treasury](https://stripe.com/docs/api/treasury) details related to this authorization if it was created on a [FinancialAccount](https://stripe.com/docs/api/treasury/financial_accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub treasury: Option, - - pub verification_data: IssuingAuthorizationVerificationData, - - /// The digital wallet used for this transaction. - /// - /// One of `apple_pay`, `google_pay`, or `samsung_pay`. - /// Will populate as `null` when no digital wallet was utilized. - pub wallet: Option, -} - -impl Object for IssuingAuthorization { - type Id = IssuingAuthorizationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.authorization" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationNetworkData { - /// Identifier assigned to the acquirer by the card network. - /// - /// Sometimes this value is not provided by the network; in this case, the value will be `null`. - pub acquiring_institution_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationPendingRequest { - /// The additional amount Stripe will hold if the authorization is approved, in the card's [currency](https://stripe.com/docs/api#issuing_authorization_object-pending-request-currency) and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: i64, - - /// Detailed breakdown of amount components. - /// - /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount_details: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. - pub is_amount_controllable: bool, - - /// The amount the merchant is requesting to be authorized in the `merchant_currency`. - /// - /// The amount is in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub merchant_amount: i64, - - /// The local currency the merchant is requesting to authorize. - pub merchant_currency: Currency, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationRequest { - /// The `pending_request.amount` at the time of the request, presented in your card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - /// - /// Stripe held this amount from your account to fund the authorization if the request was approved. - pub amount: i64, - - /// Detailed breakdown of amount components. - /// - /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount_details: Option, - - /// Whether this request was approved. - pub approved: bool, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The `pending_request.merchant_amount` at the time of the request, presented in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub merchant_amount: i64, - - /// The currency that was collected by the merchant and presented to the cardholder for the authorization. - /// - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub merchant_currency: Currency, - - /// When an authorization is approved or declined by you or by Stripe, this field provides additional detail on the reason for the outcome. - pub reason: IssuingAuthorizationReason, - - /// If approve/decline decision is directly responsed to the webhook with json payload and if the response is invalid (e.g., parsing errors), we surface the detailed message via this field. - pub reason_message: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationTreasury { - /// The array of [ReceivedCredits](https://stripe.com/docs/api/treasury/received_credits) associated with this authorization. - pub received_credits: Vec, - - /// The array of [ReceivedDebits](https://stripe.com/docs/api/treasury/received_debits) associated with this authorization. - pub received_debits: Vec, - - /// The Treasury [Transaction](https://stripe.com/docs/api/treasury/transactions) associated with this authorization. - pub transaction: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationVerificationData { - /// Whether the cardholder provided an address first line and if it matched the cardholder’s `billing.address.line1`. - pub address_line1_check: IssuingAuthorizationCheck, - - /// Whether the cardholder provided a postal code and if it matched the cardholder’s `billing.address.postal_code`. - pub address_postal_code_check: IssuingAuthorizationCheck, - - /// Whether the cardholder provided a CVC and if it matched Stripe’s record. - pub cvc_check: IssuingAuthorizationCheck, - - /// Whether the cardholder provided an expiry date and if it matched Stripe’s record. - pub expiry_check: IssuingAuthorizationCheck, -} - -/// An enum representing the possible values of an `IssuingAuthorization`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingAuthorizationStatus { - Closed, - Pending, - Reversed, -} - -impl IssuingAuthorizationStatus { - pub fn as_str(self) -> &'static str { - match self { - IssuingAuthorizationStatus::Closed => "closed", - IssuingAuthorizationStatus::Pending => "pending", - IssuingAuthorizationStatus::Reversed => "reversed", - } - } -} - -impl AsRef for IssuingAuthorizationStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingAuthorizationStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingAuthorizationStatus { - fn default() -> Self { - Self::Closed - } -} diff --git a/src/resources/generated/issuing_authorization_amount_details.rs b/src/resources/generated/issuing_authorization_amount_details.rs deleted file mode 100644 index 17e92a082..000000000 --- a/src/resources/generated/issuing_authorization_amount_details.rs +++ /dev/null @@ -1,16 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "IssuingAuthorizationAmountDetails". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationAmountDetails { - - /// The fee charged by the ATM for the cash withdrawal. - pub atm_fee: Option, - - /// The amount of cash requested by the cardholder. - pub cashback_amount: Option, -} diff --git a/src/resources/generated/issuing_authorization_merchant_data.rs b/src/resources/generated/issuing_authorization_merchant_data.rs deleted file mode 100644 index 6067fe8d5..000000000 --- a/src/resources/generated/issuing_authorization_merchant_data.rs +++ /dev/null @@ -1,41 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "IssuingAuthorizationMerchantData". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MerchantData { - - /// A categorization of the seller's type of business. - /// - /// See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. - pub category: String, - - /// The merchant category code for the seller’s business. - pub category_code: String, - - /// City where the seller is located. - pub city: Option, - - /// Country where the seller is located. - pub country: Option, - - /// Name of the seller. - pub name: Option, - - /// Identifier assigned to the seller by the card network. - /// - /// Different card networks may assign different network_id fields to the same merchant. - pub network_id: String, - - /// Postal code where the seller is located. - pub postal_code: Option, - - /// State where the seller is located. - pub state: Option, - - /// An ID assigned by the seller to the location of the sale. - pub terminal_id: Option, -} diff --git a/src/resources/generated/issuing_card.rs b/src/resources/generated/issuing_card.rs deleted file mode 100644 index 87f07660d..000000000 --- a/src/resources/generated/issuing_card.rs +++ /dev/null @@ -1,1156 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::IssuingCardId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{ - Address, CardBrand, Currency, IssuingCardShippingStatus, IssuingCardShippingType, - IssuingCardType, IssuingCardholder, MerchantCategory, -}; - -/// The resource representing a Stripe "IssuingCard". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCard { - /// Unique identifier for the object. - pub id: IssuingCardId, - - /// The brand of the card. - pub brand: CardBrand, - - /// The reason why the card was canceled. - pub cancellation_reason: Option, - - pub cardholder: IssuingCardholder, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Supported currencies are `usd` in the US, `eur` in the EU, and `gbp` in the UK. - pub currency: Currency, - - /// The card's CVC. - /// - /// For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with [the `expand` parameter](https://stripe.com/docs/api/expanding_objects). - /// Additionally, it's only available via the ["Retrieve a card" endpoint](https://stripe.com/docs/api/issuing/cards/retrieve), not via "List all cards" or any other endpoint. - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc: Option, - - /// The expiration month of the card. - pub exp_month: i64, - - /// The expiration year of the card. - pub exp_year: i64, - - /// The financial account this card is attached to. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_account: Option, - - /// The last 4 digits of the card number. - pub last4: String, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// The full unredacted card number. - /// - /// For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with [the `expand` parameter](https://stripe.com/docs/api/expanding_objects). - /// Additionally, it's only available via the ["Retrieve a card" endpoint](https://stripe.com/docs/api/issuing/cards/retrieve), not via "List all cards" or any other endpoint. - #[serde(skip_serializing_if = "Option::is_none")] - pub number: Option, - - /// The latest card that replaces this card, if any. - pub replaced_by: Option>, - - /// The card this card replaces, if any. - pub replacement_for: Option>, - - /// The reason why the previous card needed to be replaced. - pub replacement_reason: Option, - - /// Where and how the card will be shipped. - pub shipping: Option, - - pub spending_controls: IssuingCardAuthorizationControls, - - /// Whether authorizations can be approved on this card. - /// - /// May be blocked from activating cards depending on past-due Cardholder requirements. - /// Defaults to `inactive`. - pub status: IssuingCardStatus, - - /// The type of the card. - #[serde(rename = "type")] - pub type_: IssuingCardType, - - /// Information relating to digital wallets (like Apple Pay and Google Pay). - pub wallets: Option, -} - -impl Object for IssuingCard { - type Id = IssuingCardId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.card" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardAuthorizationControls { - /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. - /// - /// All other categories will be blocked. - /// Cannot be set with `blocked_categories`. - pub allowed_categories: Option>, - - /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. - /// - /// All other categories will be allowed. - /// Cannot be set with `allowed_categories`. - pub blocked_categories: Option>, - - /// Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). - pub spending_limits: Option>, - - /// Currency of the amounts within `spending_limits`. - /// - /// Always the same as the currency of the card. - pub spending_limits_currency: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardShipping { - pub address: Address, - - /// The delivery company that shipped a card. - pub carrier: Option, - - /// Additional information that may be required for clearing customs. - pub customs: Option, - - /// A unix timestamp representing a best estimate of when the card will be delivered. - pub eta: Option, - - /// Recipient name. - pub name: String, - - /// The phone number of the receiver of the shipment. - /// - /// Our courier partners will use this number to contact you in the event of card delivery issues. - /// For individual shipments to the EU/UK, if this field is empty, we will provide them with the phone number provided when the cardholder was initially created. - pub phone_number: Option, - - /// Whether a signature is required for card delivery. - /// - /// This feature is only supported for US users. - /// Standard shipping service does not support signature on delivery. - /// The default value for standard shipping service is false and for express and priority services is true. - pub require_signature: Option, - - /// Shipment service, such as `standard` or `express`. - pub service: IssuingCardShippingService, - - /// The delivery status of the card. - pub status: Option, - - /// A tracking number for a card shipment. - pub tracking_number: Option, - - /// A link to the shipping carrier's site where you can view detailed information about a card shipment. - pub tracking_url: Option, - - /// Packaging options. - #[serde(rename = "type")] - pub type_: IssuingCardShippingType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardShippingCustoms { - /// A registration number used for customs in Europe. - /// - /// See [](https://www.gov.uk/eori) for the UK and [](https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en) for the EU. - pub eori_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardSpendingLimit { - /// Maximum amount allowed to spend per interval. - /// - /// This amount is in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: i64, - - /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. - /// - /// Omitting this field will apply the limit to all categories. - pub categories: Option>, - - /// Interval (or event) to which the amount applies. - pub interval: IssuingCardSpendingLimitInterval, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardWallets { - pub apple_pay: IssuingCardApplePay, - - pub google_pay: IssuingCardGooglePay, - - /// Unique identifier for a card used with digital wallets. - pub primary_account_identifier: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardApplePay { - /// Apple Pay Eligibility. - pub eligible: bool, - - /// Reason the card is ineligible for Apple Pay. - pub ineligible_reason: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardGooglePay { - /// Google Pay Eligibility. - pub eligible: bool, - - /// Reason the card is ineligible for Google Pay. - pub ineligible_reason: Option, -} - -/// An enum representing the possible values of an `IssuingCardApplePay`'s `ineligible_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardApplePayIneligibleReason { - MissingAgreement, - MissingCardholderContact, - UnsupportedRegion, -} - -impl IssuingCardApplePayIneligibleReason { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardApplePayIneligibleReason::MissingAgreement => "missing_agreement", - IssuingCardApplePayIneligibleReason::MissingCardholderContact => { - "missing_cardholder_contact" - } - IssuingCardApplePayIneligibleReason::UnsupportedRegion => "unsupported_region", - } - } -} - -impl AsRef for IssuingCardApplePayIneligibleReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardApplePayIneligibleReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardApplePayIneligibleReason { - fn default() -> Self { - Self::MissingAgreement - } -} - -/// An enum representing the possible values of an `IssuingCard`'s `cancellation_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardCancellationReason { - DesignRejected, - Lost, - Stolen, -} - -impl IssuingCardCancellationReason { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardCancellationReason::DesignRejected => "design_rejected", - IssuingCardCancellationReason::Lost => "lost", - IssuingCardCancellationReason::Stolen => "stolen", - } - } -} - -impl AsRef for IssuingCardCancellationReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardCancellationReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardCancellationReason { - fn default() -> Self { - Self::DesignRejected - } -} - -/// An enum representing the possible values of an `IssuingCardGooglePay`'s `ineligible_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardGooglePayIneligibleReason { - MissingAgreement, - MissingCardholderContact, - UnsupportedRegion, -} - -impl IssuingCardGooglePayIneligibleReason { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardGooglePayIneligibleReason::MissingAgreement => "missing_agreement", - IssuingCardGooglePayIneligibleReason::MissingCardholderContact => { - "missing_cardholder_contact" - } - IssuingCardGooglePayIneligibleReason::UnsupportedRegion => "unsupported_region", - } - } -} - -impl AsRef for IssuingCardGooglePayIneligibleReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardGooglePayIneligibleReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardGooglePayIneligibleReason { - fn default() -> Self { - Self::MissingAgreement - } -} - -/// An enum representing the possible values of an `IssuingCard`'s `replacement_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardReplacementReason { - Damaged, - Expired, - Lost, - Stolen, -} - -impl IssuingCardReplacementReason { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardReplacementReason::Damaged => "damaged", - IssuingCardReplacementReason::Expired => "expired", - IssuingCardReplacementReason::Lost => "lost", - IssuingCardReplacementReason::Stolen => "stolen", - } - } -} - -impl AsRef for IssuingCardReplacementReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardReplacementReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardReplacementReason { - fn default() -> Self { - Self::Damaged - } -} - -/// An enum representing the possible values of an `IssuingCardShipping`'s `carrier` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardShippingCarrier { - Dhl, - Fedex, - RoyalMail, - Usps, -} - -impl IssuingCardShippingCarrier { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardShippingCarrier::Dhl => "dhl", - IssuingCardShippingCarrier::Fedex => "fedex", - IssuingCardShippingCarrier::RoyalMail => "royal_mail", - IssuingCardShippingCarrier::Usps => "usps", - } - } -} - -impl AsRef for IssuingCardShippingCarrier { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardShippingCarrier { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardShippingCarrier { - fn default() -> Self { - Self::Dhl - } -} - -/// An enum representing the possible values of an `IssuingCardShipping`'s `service` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardShippingService { - Express, - Priority, - Standard, -} - -impl IssuingCardShippingService { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardShippingService::Express => "express", - IssuingCardShippingService::Priority => "priority", - IssuingCardShippingService::Standard => "standard", - } - } -} - -impl AsRef for IssuingCardShippingService { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardShippingService { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardShippingService { - fn default() -> Self { - Self::Express - } -} - -/// An enum representing the possible values of an `IssuingCardSpendingLimit`'s `categories` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardSpendingLimitCategories { - AcRefrigerationRepair, - AccountingBookkeepingServices, - AdvertisingServices, - AgriculturalCooperative, - AirlinesAirCarriers, - AirportsFlyingFields, - AmbulanceServices, - AmusementParksCarnivals, - AntiqueReproductions, - AntiqueShops, - Aquariums, - ArchitecturalSurveyingServices, - ArtDealersAndGalleries, - ArtistsSupplyAndCraftShops, - AutoAndHomeSupplyStores, - AutoBodyRepairShops, - AutoPaintShops, - AutoServiceShops, - AutomatedCashDisburse, - AutomatedFuelDispensers, - AutomobileAssociations, - AutomotivePartsAndAccessoriesStores, - AutomotiveTireStores, - BailAndBondPayments, - Bakeries, - BandsOrchestras, - BarberAndBeautyShops, - BettingCasinoGambling, - BicycleShops, - BilliardPoolEstablishments, - BoatDealers, - BoatRentalsAndLeases, - BookStores, - BooksPeriodicalsAndNewspapers, - BowlingAlleys, - BusLines, - BusinessSecretarialSchools, - BuyingShoppingServices, - CableSatelliteAndOtherPayTelevisionAndRadio, - CameraAndPhotographicSupplyStores, - CandyNutAndConfectioneryStores, - CarAndTruckDealersNewUsed, - CarAndTruckDealersUsedOnly, - CarRentalAgencies, - CarWashes, - CarpentryServices, - CarpetUpholsteryCleaning, - Caterers, - CharitableAndSocialServiceOrganizationsFundraising, - ChemicalsAndAlliedProducts, - ChildCareServices, - ChildrensAndInfantsWearStores, - ChiropodistsPodiatrists, - Chiropractors, - CigarStoresAndStands, - CivicSocialFraternalAssociations, - CleaningAndMaintenance, - ClothingRental, - CollegesUniversities, - CommercialEquipment, - CommercialFootwear, - CommercialPhotographyArtAndGraphics, - CommuterTransportAndFerries, - ComputerNetworkServices, - ComputerProgramming, - ComputerRepair, - ComputerSoftwareStores, - ComputersPeripheralsAndSoftware, - ConcreteWorkServices, - ConstructionMaterials, - ConsultingPublicRelations, - CorrespondenceSchools, - CosmeticStores, - CounselingServices, - CountryClubs, - CourierServices, - CourtCosts, - CreditReportingAgencies, - CruiseLines, - DairyProductsStores, - DanceHallStudiosSchools, - DatingEscortServices, - DentistsOrthodontists, - DepartmentStores, - DetectiveAgencies, - DigitalGoodsApplications, - DigitalGoodsGames, - DigitalGoodsLargeVolume, - DigitalGoodsMedia, - DirectMarketingCatalogMerchant, - DirectMarketingCombinationCatalogAndRetailMerchant, - DirectMarketingInboundTelemarketing, - DirectMarketingInsuranceServices, - DirectMarketingOther, - DirectMarketingOutboundTelemarketing, - DirectMarketingSubscription, - DirectMarketingTravel, - DiscountStores, - Doctors, - DoorToDoorSales, - DraperyWindowCoveringAndUpholsteryStores, - DrinkingPlaces, - DrugStoresAndPharmacies, - DrugsDrugProprietariesAndDruggistSundries, - DryCleaners, - DurableGoods, - DutyFreeStores, - EatingPlacesRestaurants, - EducationalServices, - ElectricRazorStores, - ElectricVehicleCharging, - ElectricalPartsAndEquipment, - ElectricalServices, - ElectronicsRepairShops, - ElectronicsStores, - ElementarySecondarySchools, - EmergencyServicesGcasVisaUseOnly, - EmploymentTempAgencies, - EquipmentRental, - ExterminatingServices, - FamilyClothingStores, - FastFoodRestaurants, - FinancialInstitutions, - FinesGovernmentAdministrativeEntities, - FireplaceFireplaceScreensAndAccessoriesStores, - FloorCoveringStores, - Florists, - FloristsSuppliesNurseryStockAndFlowers, - FreezerAndLockerMeatProvisioners, - FuelDealersNonAutomotive, - FuneralServicesCrematories, - FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, - FurnitureRepairRefinishing, - FurriersAndFurShops, - GeneralServices, - GiftCardNoveltyAndSouvenirShops, - GlassPaintAndWallpaperStores, - GlasswareCrystalStores, - GolfCoursesPublic, - GovernmentLicensedHorseDogRacingUsRegionOnly, - GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, - GovernmentOwnedLotteriesNonUsRegion, - GovernmentOwnedLotteriesUsRegionOnly, - GovernmentServices, - GroceryStoresSupermarkets, - HardwareEquipmentAndSupplies, - HardwareStores, - HealthAndBeautySpas, - HearingAidsSalesAndSupplies, - #[serde(rename = "heating_plumbing_a_c")] - HeatingPlumbingAC, - HobbyToyAndGameShops, - HomeSupplyWarehouseStores, - Hospitals, - HotelsMotelsAndResorts, - HouseholdApplianceStores, - IndustrialSupplies, - InformationRetrievalServices, - InsuranceDefault, - InsuranceUnderwritingPremiums, - IntraCompanyPurchases, - JewelryStoresWatchesClocksAndSilverwareStores, - LandscapingServices, - Laundries, - LaundryCleaningServices, - LegalServicesAttorneys, - LuggageAndLeatherGoodsStores, - LumberBuildingMaterialsStores, - ManualCashDisburse, - MarinasServiceAndSupplies, - Marketplaces, - MasonryStoneworkAndPlaster, - MassageParlors, - MedicalAndDentalLabs, - MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, - MedicalServices, - MembershipOrganizations, - MensAndBoysClothingAndAccessoriesStores, - MensWomensClothingStores, - MetalServiceCenters, - Miscellaneous, - MiscellaneousApparelAndAccessoryShops, - MiscellaneousAutoDealers, - MiscellaneousBusinessServices, - MiscellaneousFoodStores, - MiscellaneousGeneralMerchandise, - MiscellaneousGeneralServices, - MiscellaneousHomeFurnishingSpecialtyStores, - MiscellaneousPublishingAndPrinting, - MiscellaneousRecreationServices, - MiscellaneousRepairShops, - MiscellaneousSpecialtyRetail, - MobileHomeDealers, - MotionPictureTheaters, - MotorFreightCarriersAndTrucking, - MotorHomesDealers, - MotorVehicleSuppliesAndNewParts, - MotorcycleShopsAndDealers, - MotorcycleShopsDealers, - MusicStoresMusicalInstrumentsPianosAndSheetMusic, - NewsDealersAndNewsstands, - NonFiMoneyOrders, - NonFiStoredValueCardPurchaseLoad, - NondurableGoods, - NurseriesLawnAndGardenSupplyStores, - NursingPersonalCare, - OfficeAndCommercialFurniture, - OpticiansEyeglasses, - OptometristsOphthalmologist, - OrthopedicGoodsProstheticDevices, - Osteopaths, - PackageStoresBeerWineAndLiquor, - PaintsVarnishesAndSupplies, - ParkingLotsGarages, - PassengerRailways, - PawnShops, - PetShopsPetFoodAndSupplies, - PetroleumAndPetroleumProducts, - PhotoDeveloping, - PhotographicPhotocopyMicrofilmEquipmentAndSupplies, - PhotographicStudios, - PictureVideoProduction, - PieceGoodsNotionsAndOtherDryGoods, - PlumbingHeatingEquipmentAndSupplies, - PoliticalOrganizations, - PostalServicesGovernmentOnly, - PreciousStonesAndMetalsWatchesAndJewelry, - ProfessionalServices, - PublicWarehousingAndStorage, - QuickCopyReproAndBlueprint, - Railroads, - RealEstateAgentsAndManagersRentals, - RecordStores, - RecreationalVehicleRentals, - ReligiousGoodsStores, - ReligiousOrganizations, - RoofingSidingSheetMetal, - SecretarialSupportServices, - SecurityBrokersDealers, - ServiceStations, - SewingNeedleworkFabricAndPieceGoodsStores, - ShoeRepairHatCleaning, - ShoeStores, - SmallApplianceRepair, - SnowmobileDealers, - SpecialTradeServices, - SpecialtyCleaning, - SportingGoodsStores, - SportingRecreationCamps, - SportsAndRidingApparelStores, - SportsClubsFields, - StampAndCoinStores, - StationaryOfficeSuppliesPrintingAndWritingPaper, - StationeryStoresOfficeAndSchoolSupplyStores, - SwimmingPoolsSales, - TUiTravelGermany, - TailorsAlterations, - TaxPaymentsGovernmentAgencies, - TaxPreparationServices, - TaxicabsLimousines, - TelecommunicationEquipmentAndTelephoneSales, - TelecommunicationServices, - TelegraphServices, - TentAndAwningShops, - TestingLaboratories, - TheatricalTicketAgencies, - Timeshares, - TireRetreadingAndRepair, - TollsBridgeFees, - TouristAttractionsAndExhibits, - TowingServices, - TrailerParksCampgrounds, - TransportationServices, - TravelAgenciesTourOperators, - TruckStopIteration, - TruckUtilityTrailerRentals, - TypesettingPlateMakingAndRelatedServices, - TypewriterStores, - #[serde(rename = "u_s_federal_government_agencies_or_departments")] - USFederalGovernmentAgenciesOrDepartments, - UniformsCommercialClothing, - UsedMerchandiseAndSecondhandStores, - Utilities, - VarietyStores, - VeterinaryServices, - VideoAmusementGameSupplies, - VideoGameArcades, - VideoTapeRentalStores, - VocationalTradeSchools, - WatchJewelryRepair, - WeldingRepair, - WholesaleClubs, - WigAndToupeeStores, - WiresMoneyOrders, - WomensAccessoryAndSpecialtyShops, - WomensReadyToWearStores, - WreckingAndSalvageYards, -} - -impl IssuingCardSpendingLimitCategories { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardSpendingLimitCategories::AcRefrigerationRepair => "ac_refrigeration_repair", - IssuingCardSpendingLimitCategories::AccountingBookkeepingServices => "accounting_bookkeeping_services", - IssuingCardSpendingLimitCategories::AdvertisingServices => "advertising_services", - IssuingCardSpendingLimitCategories::AgriculturalCooperative => "agricultural_cooperative", - IssuingCardSpendingLimitCategories::AirlinesAirCarriers => "airlines_air_carriers", - IssuingCardSpendingLimitCategories::AirportsFlyingFields => "airports_flying_fields", - IssuingCardSpendingLimitCategories::AmbulanceServices => "ambulance_services", - IssuingCardSpendingLimitCategories::AmusementParksCarnivals => "amusement_parks_carnivals", - IssuingCardSpendingLimitCategories::AntiqueReproductions => "antique_reproductions", - IssuingCardSpendingLimitCategories::AntiqueShops => "antique_shops", - IssuingCardSpendingLimitCategories::Aquariums => "aquariums", - IssuingCardSpendingLimitCategories::ArchitecturalSurveyingServices => "architectural_surveying_services", - IssuingCardSpendingLimitCategories::ArtDealersAndGalleries => "art_dealers_and_galleries", - IssuingCardSpendingLimitCategories::ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", - IssuingCardSpendingLimitCategories::AutoAndHomeSupplyStores => "auto_and_home_supply_stores", - IssuingCardSpendingLimitCategories::AutoBodyRepairShops => "auto_body_repair_shops", - IssuingCardSpendingLimitCategories::AutoPaintShops => "auto_paint_shops", - IssuingCardSpendingLimitCategories::AutoServiceShops => "auto_service_shops", - IssuingCardSpendingLimitCategories::AutomatedCashDisburse => "automated_cash_disburse", - IssuingCardSpendingLimitCategories::AutomatedFuelDispensers => "automated_fuel_dispensers", - IssuingCardSpendingLimitCategories::AutomobileAssociations => "automobile_associations", - IssuingCardSpendingLimitCategories::AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", - IssuingCardSpendingLimitCategories::AutomotiveTireStores => "automotive_tire_stores", - IssuingCardSpendingLimitCategories::BailAndBondPayments => "bail_and_bond_payments", - IssuingCardSpendingLimitCategories::Bakeries => "bakeries", - IssuingCardSpendingLimitCategories::BandsOrchestras => "bands_orchestras", - IssuingCardSpendingLimitCategories::BarberAndBeautyShops => "barber_and_beauty_shops", - IssuingCardSpendingLimitCategories::BettingCasinoGambling => "betting_casino_gambling", - IssuingCardSpendingLimitCategories::BicycleShops => "bicycle_shops", - IssuingCardSpendingLimitCategories::BilliardPoolEstablishments => "billiard_pool_establishments", - IssuingCardSpendingLimitCategories::BoatDealers => "boat_dealers", - IssuingCardSpendingLimitCategories::BoatRentalsAndLeases => "boat_rentals_and_leases", - IssuingCardSpendingLimitCategories::BookStores => "book_stores", - IssuingCardSpendingLimitCategories::BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", - IssuingCardSpendingLimitCategories::BowlingAlleys => "bowling_alleys", - IssuingCardSpendingLimitCategories::BusLines => "bus_lines", - IssuingCardSpendingLimitCategories::BusinessSecretarialSchools => "business_secretarial_schools", - IssuingCardSpendingLimitCategories::BuyingShoppingServices => "buying_shopping_services", - IssuingCardSpendingLimitCategories::CableSatelliteAndOtherPayTelevisionAndRadio => "cable_satellite_and_other_pay_television_and_radio", - IssuingCardSpendingLimitCategories::CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", - IssuingCardSpendingLimitCategories::CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", - IssuingCardSpendingLimitCategories::CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", - IssuingCardSpendingLimitCategories::CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", - IssuingCardSpendingLimitCategories::CarRentalAgencies => "car_rental_agencies", - IssuingCardSpendingLimitCategories::CarWashes => "car_washes", - IssuingCardSpendingLimitCategories::CarpentryServices => "carpentry_services", - IssuingCardSpendingLimitCategories::CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", - IssuingCardSpendingLimitCategories::Caterers => "caterers", - IssuingCardSpendingLimitCategories::CharitableAndSocialServiceOrganizationsFundraising => "charitable_and_social_service_organizations_fundraising", - IssuingCardSpendingLimitCategories::ChemicalsAndAlliedProducts => "chemicals_and_allied_products", - IssuingCardSpendingLimitCategories::ChildCareServices => "child_care_services", - IssuingCardSpendingLimitCategories::ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", - IssuingCardSpendingLimitCategories::ChiropodistsPodiatrists => "chiropodists_podiatrists", - IssuingCardSpendingLimitCategories::Chiropractors => "chiropractors", - IssuingCardSpendingLimitCategories::CigarStoresAndStands => "cigar_stores_and_stands", - IssuingCardSpendingLimitCategories::CivicSocialFraternalAssociations => "civic_social_fraternal_associations", - IssuingCardSpendingLimitCategories::CleaningAndMaintenance => "cleaning_and_maintenance", - IssuingCardSpendingLimitCategories::ClothingRental => "clothing_rental", - IssuingCardSpendingLimitCategories::CollegesUniversities => "colleges_universities", - IssuingCardSpendingLimitCategories::CommercialEquipment => "commercial_equipment", - IssuingCardSpendingLimitCategories::CommercialFootwear => "commercial_footwear", - IssuingCardSpendingLimitCategories::CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", - IssuingCardSpendingLimitCategories::CommuterTransportAndFerries => "commuter_transport_and_ferries", - IssuingCardSpendingLimitCategories::ComputerNetworkServices => "computer_network_services", - IssuingCardSpendingLimitCategories::ComputerProgramming => "computer_programming", - IssuingCardSpendingLimitCategories::ComputerRepair => "computer_repair", - IssuingCardSpendingLimitCategories::ComputerSoftwareStores => "computer_software_stores", - IssuingCardSpendingLimitCategories::ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", - IssuingCardSpendingLimitCategories::ConcreteWorkServices => "concrete_work_services", - IssuingCardSpendingLimitCategories::ConstructionMaterials => "construction_materials", - IssuingCardSpendingLimitCategories::ConsultingPublicRelations => "consulting_public_relations", - IssuingCardSpendingLimitCategories::CorrespondenceSchools => "correspondence_schools", - IssuingCardSpendingLimitCategories::CosmeticStores => "cosmetic_stores", - IssuingCardSpendingLimitCategories::CounselingServices => "counseling_services", - IssuingCardSpendingLimitCategories::CountryClubs => "country_clubs", - IssuingCardSpendingLimitCategories::CourierServices => "courier_services", - IssuingCardSpendingLimitCategories::CourtCosts => "court_costs", - IssuingCardSpendingLimitCategories::CreditReportingAgencies => "credit_reporting_agencies", - IssuingCardSpendingLimitCategories::CruiseLines => "cruise_lines", - IssuingCardSpendingLimitCategories::DairyProductsStores => "dairy_products_stores", - IssuingCardSpendingLimitCategories::DanceHallStudiosSchools => "dance_hall_studios_schools", - IssuingCardSpendingLimitCategories::DatingEscortServices => "dating_escort_services", - IssuingCardSpendingLimitCategories::DentistsOrthodontists => "dentists_orthodontists", - IssuingCardSpendingLimitCategories::DepartmentStores => "department_stores", - IssuingCardSpendingLimitCategories::DetectiveAgencies => "detective_agencies", - IssuingCardSpendingLimitCategories::DigitalGoodsApplications => "digital_goods_applications", - IssuingCardSpendingLimitCategories::DigitalGoodsGames => "digital_goods_games", - IssuingCardSpendingLimitCategories::DigitalGoodsLargeVolume => "digital_goods_large_volume", - IssuingCardSpendingLimitCategories::DigitalGoodsMedia => "digital_goods_media", - IssuingCardSpendingLimitCategories::DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", - IssuingCardSpendingLimitCategories::DirectMarketingCombinationCatalogAndRetailMerchant => "direct_marketing_combination_catalog_and_retail_merchant", - IssuingCardSpendingLimitCategories::DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", - IssuingCardSpendingLimitCategories::DirectMarketingInsuranceServices => "direct_marketing_insurance_services", - IssuingCardSpendingLimitCategories::DirectMarketingOther => "direct_marketing_other", - IssuingCardSpendingLimitCategories::DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", - IssuingCardSpendingLimitCategories::DirectMarketingSubscription => "direct_marketing_subscription", - IssuingCardSpendingLimitCategories::DirectMarketingTravel => "direct_marketing_travel", - IssuingCardSpendingLimitCategories::DiscountStores => "discount_stores", - IssuingCardSpendingLimitCategories::Doctors => "doctors", - IssuingCardSpendingLimitCategories::DoorToDoorSales => "door_to_door_sales", - IssuingCardSpendingLimitCategories::DraperyWindowCoveringAndUpholsteryStores => "drapery_window_covering_and_upholstery_stores", - IssuingCardSpendingLimitCategories::DrinkingPlaces => "drinking_places", - IssuingCardSpendingLimitCategories::DrugStoresAndPharmacies => "drug_stores_and_pharmacies", - IssuingCardSpendingLimitCategories::DrugsDrugProprietariesAndDruggistSundries => "drugs_drug_proprietaries_and_druggist_sundries", - IssuingCardSpendingLimitCategories::DryCleaners => "dry_cleaners", - IssuingCardSpendingLimitCategories::DurableGoods => "durable_goods", - IssuingCardSpendingLimitCategories::DutyFreeStores => "duty_free_stores", - IssuingCardSpendingLimitCategories::EatingPlacesRestaurants => "eating_places_restaurants", - IssuingCardSpendingLimitCategories::EducationalServices => "educational_services", - IssuingCardSpendingLimitCategories::ElectricRazorStores => "electric_razor_stores", - IssuingCardSpendingLimitCategories::ElectricVehicleCharging => "electric_vehicle_charging", - IssuingCardSpendingLimitCategories::ElectricalPartsAndEquipment => "electrical_parts_and_equipment", - IssuingCardSpendingLimitCategories::ElectricalServices => "electrical_services", - IssuingCardSpendingLimitCategories::ElectronicsRepairShops => "electronics_repair_shops", - IssuingCardSpendingLimitCategories::ElectronicsStores => "electronics_stores", - IssuingCardSpendingLimitCategories::ElementarySecondarySchools => "elementary_secondary_schools", - IssuingCardSpendingLimitCategories::EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", - IssuingCardSpendingLimitCategories::EmploymentTempAgencies => "employment_temp_agencies", - IssuingCardSpendingLimitCategories::EquipmentRental => "equipment_rental", - IssuingCardSpendingLimitCategories::ExterminatingServices => "exterminating_services", - IssuingCardSpendingLimitCategories::FamilyClothingStores => "family_clothing_stores", - IssuingCardSpendingLimitCategories::FastFoodRestaurants => "fast_food_restaurants", - IssuingCardSpendingLimitCategories::FinancialInstitutions => "financial_institutions", - IssuingCardSpendingLimitCategories::FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", - IssuingCardSpendingLimitCategories::FireplaceFireplaceScreensAndAccessoriesStores => "fireplace_fireplace_screens_and_accessories_stores", - IssuingCardSpendingLimitCategories::FloorCoveringStores => "floor_covering_stores", - IssuingCardSpendingLimitCategories::Florists => "florists", - IssuingCardSpendingLimitCategories::FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", - IssuingCardSpendingLimitCategories::FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", - IssuingCardSpendingLimitCategories::FuelDealersNonAutomotive => "fuel_dealers_non_automotive", - IssuingCardSpendingLimitCategories::FuneralServicesCrematories => "funeral_services_crematories", - IssuingCardSpendingLimitCategories::FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => "furniture_home_furnishings_and_equipment_stores_except_appliances", - IssuingCardSpendingLimitCategories::FurnitureRepairRefinishing => "furniture_repair_refinishing", - IssuingCardSpendingLimitCategories::FurriersAndFurShops => "furriers_and_fur_shops", - IssuingCardSpendingLimitCategories::GeneralServices => "general_services", - IssuingCardSpendingLimitCategories::GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", - IssuingCardSpendingLimitCategories::GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", - IssuingCardSpendingLimitCategories::GlasswareCrystalStores => "glassware_crystal_stores", - IssuingCardSpendingLimitCategories::GolfCoursesPublic => "golf_courses_public", - IssuingCardSpendingLimitCategories::GovernmentLicensedHorseDogRacingUsRegionOnly => "government_licensed_horse_dog_racing_us_region_only", - IssuingCardSpendingLimitCategories::GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => "government_licensed_online_casions_online_gambling_us_region_only", - IssuingCardSpendingLimitCategories::GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", - IssuingCardSpendingLimitCategories::GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", - IssuingCardSpendingLimitCategories::GovernmentServices => "government_services", - IssuingCardSpendingLimitCategories::GroceryStoresSupermarkets => "grocery_stores_supermarkets", - IssuingCardSpendingLimitCategories::HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", - IssuingCardSpendingLimitCategories::HardwareStores => "hardware_stores", - IssuingCardSpendingLimitCategories::HealthAndBeautySpas => "health_and_beauty_spas", - IssuingCardSpendingLimitCategories::HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", - IssuingCardSpendingLimitCategories::HeatingPlumbingAC => "heating_plumbing_a_c", - IssuingCardSpendingLimitCategories::HobbyToyAndGameShops => "hobby_toy_and_game_shops", - IssuingCardSpendingLimitCategories::HomeSupplyWarehouseStores => "home_supply_warehouse_stores", - IssuingCardSpendingLimitCategories::Hospitals => "hospitals", - IssuingCardSpendingLimitCategories::HotelsMotelsAndResorts => "hotels_motels_and_resorts", - IssuingCardSpendingLimitCategories::HouseholdApplianceStores => "household_appliance_stores", - IssuingCardSpendingLimitCategories::IndustrialSupplies => "industrial_supplies", - IssuingCardSpendingLimitCategories::InformationRetrievalServices => "information_retrieval_services", - IssuingCardSpendingLimitCategories::InsuranceDefault => "insurance_default", - IssuingCardSpendingLimitCategories::InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", - IssuingCardSpendingLimitCategories::IntraCompanyPurchases => "intra_company_purchases", - IssuingCardSpendingLimitCategories::JewelryStoresWatchesClocksAndSilverwareStores => "jewelry_stores_watches_clocks_and_silverware_stores", - IssuingCardSpendingLimitCategories::LandscapingServices => "landscaping_services", - IssuingCardSpendingLimitCategories::Laundries => "laundries", - IssuingCardSpendingLimitCategories::LaundryCleaningServices => "laundry_cleaning_services", - IssuingCardSpendingLimitCategories::LegalServicesAttorneys => "legal_services_attorneys", - IssuingCardSpendingLimitCategories::LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", - IssuingCardSpendingLimitCategories::LumberBuildingMaterialsStores => "lumber_building_materials_stores", - IssuingCardSpendingLimitCategories::ManualCashDisburse => "manual_cash_disburse", - IssuingCardSpendingLimitCategories::MarinasServiceAndSupplies => "marinas_service_and_supplies", - IssuingCardSpendingLimitCategories::Marketplaces => "marketplaces", - IssuingCardSpendingLimitCategories::MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", - IssuingCardSpendingLimitCategories::MassageParlors => "massage_parlors", - IssuingCardSpendingLimitCategories::MedicalAndDentalLabs => "medical_and_dental_labs", - IssuingCardSpendingLimitCategories::MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", - IssuingCardSpendingLimitCategories::MedicalServices => "medical_services", - IssuingCardSpendingLimitCategories::MembershipOrganizations => "membership_organizations", - IssuingCardSpendingLimitCategories::MensAndBoysClothingAndAccessoriesStores => "mens_and_boys_clothing_and_accessories_stores", - IssuingCardSpendingLimitCategories::MensWomensClothingStores => "mens_womens_clothing_stores", - IssuingCardSpendingLimitCategories::MetalServiceCenters => "metal_service_centers", - IssuingCardSpendingLimitCategories::Miscellaneous => "miscellaneous", - IssuingCardSpendingLimitCategories::MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", - IssuingCardSpendingLimitCategories::MiscellaneousAutoDealers => "miscellaneous_auto_dealers", - IssuingCardSpendingLimitCategories::MiscellaneousBusinessServices => "miscellaneous_business_services", - IssuingCardSpendingLimitCategories::MiscellaneousFoodStores => "miscellaneous_food_stores", - IssuingCardSpendingLimitCategories::MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", - IssuingCardSpendingLimitCategories::MiscellaneousGeneralServices => "miscellaneous_general_services", - IssuingCardSpendingLimitCategories::MiscellaneousHomeFurnishingSpecialtyStores => "miscellaneous_home_furnishing_specialty_stores", - IssuingCardSpendingLimitCategories::MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", - IssuingCardSpendingLimitCategories::MiscellaneousRecreationServices => "miscellaneous_recreation_services", - IssuingCardSpendingLimitCategories::MiscellaneousRepairShops => "miscellaneous_repair_shops", - IssuingCardSpendingLimitCategories::MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", - IssuingCardSpendingLimitCategories::MobileHomeDealers => "mobile_home_dealers", - IssuingCardSpendingLimitCategories::MotionPictureTheaters => "motion_picture_theaters", - IssuingCardSpendingLimitCategories::MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", - IssuingCardSpendingLimitCategories::MotorHomesDealers => "motor_homes_dealers", - IssuingCardSpendingLimitCategories::MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", - IssuingCardSpendingLimitCategories::MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", - IssuingCardSpendingLimitCategories::MotorcycleShopsDealers => "motorcycle_shops_dealers", - IssuingCardSpendingLimitCategories::MusicStoresMusicalInstrumentsPianosAndSheetMusic => "music_stores_musical_instruments_pianos_and_sheet_music", - IssuingCardSpendingLimitCategories::NewsDealersAndNewsstands => "news_dealers_and_newsstands", - IssuingCardSpendingLimitCategories::NonFiMoneyOrders => "non_fi_money_orders", - IssuingCardSpendingLimitCategories::NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", - IssuingCardSpendingLimitCategories::NondurableGoods => "nondurable_goods", - IssuingCardSpendingLimitCategories::NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", - IssuingCardSpendingLimitCategories::NursingPersonalCare => "nursing_personal_care", - IssuingCardSpendingLimitCategories::OfficeAndCommercialFurniture => "office_and_commercial_furniture", - IssuingCardSpendingLimitCategories::OpticiansEyeglasses => "opticians_eyeglasses", - IssuingCardSpendingLimitCategories::OptometristsOphthalmologist => "optometrists_ophthalmologist", - IssuingCardSpendingLimitCategories::OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", - IssuingCardSpendingLimitCategories::Osteopaths => "osteopaths", - IssuingCardSpendingLimitCategories::PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", - IssuingCardSpendingLimitCategories::PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", - IssuingCardSpendingLimitCategories::ParkingLotsGarages => "parking_lots_garages", - IssuingCardSpendingLimitCategories::PassengerRailways => "passenger_railways", - IssuingCardSpendingLimitCategories::PawnShops => "pawn_shops", - IssuingCardSpendingLimitCategories::PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", - IssuingCardSpendingLimitCategories::PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", - IssuingCardSpendingLimitCategories::PhotoDeveloping => "photo_developing", - IssuingCardSpendingLimitCategories::PhotographicPhotocopyMicrofilmEquipmentAndSupplies => "photographic_photocopy_microfilm_equipment_and_supplies", - IssuingCardSpendingLimitCategories::PhotographicStudios => "photographic_studios", - IssuingCardSpendingLimitCategories::PictureVideoProduction => "picture_video_production", - IssuingCardSpendingLimitCategories::PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", - IssuingCardSpendingLimitCategories::PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", - IssuingCardSpendingLimitCategories::PoliticalOrganizations => "political_organizations", - IssuingCardSpendingLimitCategories::PostalServicesGovernmentOnly => "postal_services_government_only", - IssuingCardSpendingLimitCategories::PreciousStonesAndMetalsWatchesAndJewelry => "precious_stones_and_metals_watches_and_jewelry", - IssuingCardSpendingLimitCategories::ProfessionalServices => "professional_services", - IssuingCardSpendingLimitCategories::PublicWarehousingAndStorage => "public_warehousing_and_storage", - IssuingCardSpendingLimitCategories::QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", - IssuingCardSpendingLimitCategories::Railroads => "railroads", - IssuingCardSpendingLimitCategories::RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", - IssuingCardSpendingLimitCategories::RecordStores => "record_stores", - IssuingCardSpendingLimitCategories::RecreationalVehicleRentals => "recreational_vehicle_rentals", - IssuingCardSpendingLimitCategories::ReligiousGoodsStores => "religious_goods_stores", - IssuingCardSpendingLimitCategories::ReligiousOrganizations => "religious_organizations", - IssuingCardSpendingLimitCategories::RoofingSidingSheetMetal => "roofing_siding_sheet_metal", - IssuingCardSpendingLimitCategories::SecretarialSupportServices => "secretarial_support_services", - IssuingCardSpendingLimitCategories::SecurityBrokersDealers => "security_brokers_dealers", - IssuingCardSpendingLimitCategories::ServiceStations => "service_stations", - IssuingCardSpendingLimitCategories::SewingNeedleworkFabricAndPieceGoodsStores => "sewing_needlework_fabric_and_piece_goods_stores", - IssuingCardSpendingLimitCategories::ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", - IssuingCardSpendingLimitCategories::ShoeStores => "shoe_stores", - IssuingCardSpendingLimitCategories::SmallApplianceRepair => "small_appliance_repair", - IssuingCardSpendingLimitCategories::SnowmobileDealers => "snowmobile_dealers", - IssuingCardSpendingLimitCategories::SpecialTradeServices => "special_trade_services", - IssuingCardSpendingLimitCategories::SpecialtyCleaning => "specialty_cleaning", - IssuingCardSpendingLimitCategories::SportingGoodsStores => "sporting_goods_stores", - IssuingCardSpendingLimitCategories::SportingRecreationCamps => "sporting_recreation_camps", - IssuingCardSpendingLimitCategories::SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", - IssuingCardSpendingLimitCategories::SportsClubsFields => "sports_clubs_fields", - IssuingCardSpendingLimitCategories::StampAndCoinStores => "stamp_and_coin_stores", - IssuingCardSpendingLimitCategories::StationaryOfficeSuppliesPrintingAndWritingPaper => "stationary_office_supplies_printing_and_writing_paper", - IssuingCardSpendingLimitCategories::StationeryStoresOfficeAndSchoolSupplyStores => "stationery_stores_office_and_school_supply_stores", - IssuingCardSpendingLimitCategories::SwimmingPoolsSales => "swimming_pools_sales", - IssuingCardSpendingLimitCategories::TUiTravelGermany => "t_ui_travel_germany", - IssuingCardSpendingLimitCategories::TailorsAlterations => "tailors_alterations", - IssuingCardSpendingLimitCategories::TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", - IssuingCardSpendingLimitCategories::TaxPreparationServices => "tax_preparation_services", - IssuingCardSpendingLimitCategories::TaxicabsLimousines => "taxicabs_limousines", - IssuingCardSpendingLimitCategories::TelecommunicationEquipmentAndTelephoneSales => "telecommunication_equipment_and_telephone_sales", - IssuingCardSpendingLimitCategories::TelecommunicationServices => "telecommunication_services", - IssuingCardSpendingLimitCategories::TelegraphServices => "telegraph_services", - IssuingCardSpendingLimitCategories::TentAndAwningShops => "tent_and_awning_shops", - IssuingCardSpendingLimitCategories::TestingLaboratories => "testing_laboratories", - IssuingCardSpendingLimitCategories::TheatricalTicketAgencies => "theatrical_ticket_agencies", - IssuingCardSpendingLimitCategories::Timeshares => "timeshares", - IssuingCardSpendingLimitCategories::TireRetreadingAndRepair => "tire_retreading_and_repair", - IssuingCardSpendingLimitCategories::TollsBridgeFees => "tolls_bridge_fees", - IssuingCardSpendingLimitCategories::TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", - IssuingCardSpendingLimitCategories::TowingServices => "towing_services", - IssuingCardSpendingLimitCategories::TrailerParksCampgrounds => "trailer_parks_campgrounds", - IssuingCardSpendingLimitCategories::TransportationServices => "transportation_services", - IssuingCardSpendingLimitCategories::TravelAgenciesTourOperators => "travel_agencies_tour_operators", - IssuingCardSpendingLimitCategories::TruckStopIteration => "truck_stop_iteration", - IssuingCardSpendingLimitCategories::TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", - IssuingCardSpendingLimitCategories::TypesettingPlateMakingAndRelatedServices => "typesetting_plate_making_and_related_services", - IssuingCardSpendingLimitCategories::TypewriterStores => "typewriter_stores", - IssuingCardSpendingLimitCategories::USFederalGovernmentAgenciesOrDepartments => "u_s_federal_government_agencies_or_departments", - IssuingCardSpendingLimitCategories::UniformsCommercialClothing => "uniforms_commercial_clothing", - IssuingCardSpendingLimitCategories::UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", - IssuingCardSpendingLimitCategories::Utilities => "utilities", - IssuingCardSpendingLimitCategories::VarietyStores => "variety_stores", - IssuingCardSpendingLimitCategories::VeterinaryServices => "veterinary_services", - IssuingCardSpendingLimitCategories::VideoAmusementGameSupplies => "video_amusement_game_supplies", - IssuingCardSpendingLimitCategories::VideoGameArcades => "video_game_arcades", - IssuingCardSpendingLimitCategories::VideoTapeRentalStores => "video_tape_rental_stores", - IssuingCardSpendingLimitCategories::VocationalTradeSchools => "vocational_trade_schools", - IssuingCardSpendingLimitCategories::WatchJewelryRepair => "watch_jewelry_repair", - IssuingCardSpendingLimitCategories::WeldingRepair => "welding_repair", - IssuingCardSpendingLimitCategories::WholesaleClubs => "wholesale_clubs", - IssuingCardSpendingLimitCategories::WigAndToupeeStores => "wig_and_toupee_stores", - IssuingCardSpendingLimitCategories::WiresMoneyOrders => "wires_money_orders", - IssuingCardSpendingLimitCategories::WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", - IssuingCardSpendingLimitCategories::WomensReadyToWearStores => "womens_ready_to_wear_stores", - IssuingCardSpendingLimitCategories::WreckingAndSalvageYards => "wrecking_and_salvage_yards", - } - } -} - -impl AsRef for IssuingCardSpendingLimitCategories { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardSpendingLimitCategories { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardSpendingLimitCategories { - fn default() -> Self { - Self::AcRefrigerationRepair - } -} - -/// An enum representing the possible values of an `IssuingCardSpendingLimit`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardSpendingLimitInterval { - AllTime, - Daily, - Monthly, - PerAuthorization, - Weekly, - Yearly, -} - -impl IssuingCardSpendingLimitInterval { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardSpendingLimitInterval::AllTime => "all_time", - IssuingCardSpendingLimitInterval::Daily => "daily", - IssuingCardSpendingLimitInterval::Monthly => "monthly", - IssuingCardSpendingLimitInterval::PerAuthorization => "per_authorization", - IssuingCardSpendingLimitInterval::Weekly => "weekly", - IssuingCardSpendingLimitInterval::Yearly => "yearly", - } - } -} - -impl AsRef for IssuingCardSpendingLimitInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardSpendingLimitInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardSpendingLimitInterval { - fn default() -> Self { - Self::AllTime - } -} - -/// An enum representing the possible values of an `IssuingCard`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardStatus { - Active, - Canceled, - Inactive, -} - -impl IssuingCardStatus { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardStatus::Active => "active", - IssuingCardStatus::Canceled => "canceled", - IssuingCardStatus::Inactive => "inactive", - } - } -} - -impl AsRef for IssuingCardStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardStatus { - fn default() -> Self { - Self::Active - } -} diff --git a/src/resources/generated/issuing_cardholder.rs b/src/resources/generated/issuing_cardholder.rs deleted file mode 100644 index ad1283a7d..000000000 --- a/src/resources/generated/issuing_cardholder.rs +++ /dev/null @@ -1,1093 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::IssuingCardholderId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Address, Currency, File, MerchantCategory}; - -/// The resource representing a Stripe "IssuingCardholder". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholder { - /// Unique identifier for the object. - pub id: IssuingCardholderId, - - pub billing: IssuingCardholderAddress, - - /// Additional information about a `company` cardholder. - pub company: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The cardholder's email address. - pub email: Option, - - /// Additional information about an `individual` cardholder. - pub individual: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// The cardholder's name. - /// - /// This will be printed on cards issued to them. - pub name: String, - - /// The cardholder's phone number. - /// - /// This is required for all cardholders who will be creating EU cards. - /// See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. - pub phone_number: Option, - - /// The cardholder’s preferred locales (languages), ordered by preference. - /// - /// Locales can be `de`, `en`, `es`, `fr`, or `it`. This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. - pub preferred_locales: Option>, - - pub requirements: IssuingCardholderRequirements, - - /// Rules that control spending across this cardholder's cards. - /// - /// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. - pub spending_controls: Option, - - /// Specifies whether to permit authorizations on this cardholder's cards. - pub status: IssuingCardholderStatus, - - /// One of `individual` or `company`. - /// - /// See [Choose a cardholder type](https://stripe.com/docs/issuing/other/choose-cardholder) for more details. - #[serde(rename = "type")] - pub type_: IssuingCardholderType, -} - -impl Object for IssuingCardholder { - type Id = IssuingCardholderId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.cardholder" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderAddress { - pub address: Address, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderAuthorizationControls { - /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. - /// - /// All other categories will be blocked. - /// Cannot be set with `blocked_categories`. - pub allowed_categories: Option>, - - /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. - /// - /// All other categories will be allowed. - /// Cannot be set with `allowed_categories`. - pub blocked_categories: Option>, - - /// Limit spending with amount-based rules that apply across this cardholder's cards. - pub spending_limits: Option>, - - /// Currency of the amounts within `spending_limits`. - pub spending_limits_currency: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderCompany { - /// Whether the company's business ID number was provided. - pub tax_id_provided: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderIndividual { - /// Information related to the card_issuing program for this cardholder. - pub card_issuing: Option, - - /// The date of birth of this cardholder. - pub dob: Option, - - /// The first name of this cardholder. - /// - /// Required before activating Cards. - /// This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. - pub first_name: Option, - - /// The last name of this cardholder. - /// - /// Required before activating Cards. - /// This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. - pub last_name: Option, - - /// Government-issued ID document for this cardholder. - pub verification: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderCardIssuing { - /// Information about cardholder acceptance of [Authorized User Terms](https://stripe.com/docs/issuing/cards). - pub user_terms_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderIndividualDob { - /// The day of birth, between 1 and 31. - pub day: Option, - - /// The month of birth, between 1 and 12. - pub month: Option, - - /// The four-digit year of birth. - pub year: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderRequirements { - /// If `disabled_reason` is present, all cards will decline authorizations with `cardholder_verification_required` reason. - pub disabled_reason: Option, - - /// Array of fields that need to be collected in order to verify and re-enable the cardholder. - pub past_due: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderSpendingLimit { - /// Maximum amount allowed to spend per interval. - /// - /// This amount is in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: i64, - - /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. - /// - /// Omitting this field will apply the limit to all categories. - pub categories: Option>, - - /// Interval (or event) to which the amount applies. - pub interval: IssuingCardholderSpendingLimitInterval, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderUserTermsAcceptance { - /// The Unix timestamp marking when the cardholder accepted the Authorized User Terms. - /// - /// Required for Celtic Spend Card users. - pub date: Option, - - /// The IP address from which the cardholder accepted the Authorized User Terms. - /// - /// Required for Celtic Spend Card users. - pub ip: Option, - - /// The user agent of the browser from which the cardholder accepted the Authorized User Terms. - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderVerification { - /// An identifying document, either a passport or local ID card. - pub document: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderIdDocument { - /// The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. - pub back: Option>, - - /// The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. - pub front: Option>, -} - -/// An enum representing the possible values of an `IssuingCardholder`'s `preferred_locales` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardholderPreferredLocales { - De, - En, - Es, - Fr, - It, -} - -impl IssuingCardholderPreferredLocales { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardholderPreferredLocales::De => "de", - IssuingCardholderPreferredLocales::En => "en", - IssuingCardholderPreferredLocales::Es => "es", - IssuingCardholderPreferredLocales::Fr => "fr", - IssuingCardholderPreferredLocales::It => "it", - } - } -} - -impl AsRef for IssuingCardholderPreferredLocales { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardholderPreferredLocales { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardholderPreferredLocales { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `IssuingCardholderRequirements`'s `disabled_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardholderRequirementsDisabledReason { - Listed, - #[serde(rename = "rejected.listed")] - RejectedListed, - #[serde(rename = "requirements.past_due")] - RequirementsPastDue, - UnderReview, -} - -impl IssuingCardholderRequirementsDisabledReason { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardholderRequirementsDisabledReason::Listed => "listed", - IssuingCardholderRequirementsDisabledReason::RejectedListed => "rejected.listed", - IssuingCardholderRequirementsDisabledReason::RequirementsPastDue => { - "requirements.past_due" - } - IssuingCardholderRequirementsDisabledReason::UnderReview => "under_review", - } - } -} - -impl AsRef for IssuingCardholderRequirementsDisabledReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardholderRequirementsDisabledReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardholderRequirementsDisabledReason { - fn default() -> Self { - Self::Listed - } -} - -/// An enum representing the possible values of an `IssuingCardholderRequirements`'s `past_due` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardholderRequirementsPastDue { - #[serde(rename = "company.tax_id")] - CompanyTaxId, - #[serde(rename = "individual.card_issuing.user_terms_acceptance.date")] - IndividualCardIssuingUserTermsAcceptanceDate, - #[serde(rename = "individual.card_issuing.user_terms_acceptance.ip")] - IndividualCardIssuingUserTermsAcceptanceIp, - #[serde(rename = "individual.dob.day")] - IndividualDobDay, - #[serde(rename = "individual.dob.month")] - IndividualDobMonth, - #[serde(rename = "individual.dob.year")] - IndividualDobYear, - #[serde(rename = "individual.first_name")] - IndividualFirstName, - #[serde(rename = "individual.last_name")] - IndividualLastName, - #[serde(rename = "individual.verification.document")] - IndividualVerificationDocument, -} - -impl IssuingCardholderRequirementsPastDue { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardholderRequirementsPastDue::CompanyTaxId => "company.tax_id", - IssuingCardholderRequirementsPastDue::IndividualCardIssuingUserTermsAcceptanceDate => { - "individual.card_issuing.user_terms_acceptance.date" - } - IssuingCardholderRequirementsPastDue::IndividualCardIssuingUserTermsAcceptanceIp => { - "individual.card_issuing.user_terms_acceptance.ip" - } - IssuingCardholderRequirementsPastDue::IndividualDobDay => "individual.dob.day", - IssuingCardholderRequirementsPastDue::IndividualDobMonth => "individual.dob.month", - IssuingCardholderRequirementsPastDue::IndividualDobYear => "individual.dob.year", - IssuingCardholderRequirementsPastDue::IndividualFirstName => "individual.first_name", - IssuingCardholderRequirementsPastDue::IndividualLastName => "individual.last_name", - IssuingCardholderRequirementsPastDue::IndividualVerificationDocument => { - "individual.verification.document" - } - } - } -} - -impl AsRef for IssuingCardholderRequirementsPastDue { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardholderRequirementsPastDue { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardholderRequirementsPastDue { - fn default() -> Self { - Self::CompanyTaxId - } -} - -/// An enum representing the possible values of an `IssuingCardholderSpendingLimit`'s `categories` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardholderSpendingLimitCategories { - AcRefrigerationRepair, - AccountingBookkeepingServices, - AdvertisingServices, - AgriculturalCooperative, - AirlinesAirCarriers, - AirportsFlyingFields, - AmbulanceServices, - AmusementParksCarnivals, - AntiqueReproductions, - AntiqueShops, - Aquariums, - ArchitecturalSurveyingServices, - ArtDealersAndGalleries, - ArtistsSupplyAndCraftShops, - AutoAndHomeSupplyStores, - AutoBodyRepairShops, - AutoPaintShops, - AutoServiceShops, - AutomatedCashDisburse, - AutomatedFuelDispensers, - AutomobileAssociations, - AutomotivePartsAndAccessoriesStores, - AutomotiveTireStores, - BailAndBondPayments, - Bakeries, - BandsOrchestras, - BarberAndBeautyShops, - BettingCasinoGambling, - BicycleShops, - BilliardPoolEstablishments, - BoatDealers, - BoatRentalsAndLeases, - BookStores, - BooksPeriodicalsAndNewspapers, - BowlingAlleys, - BusLines, - BusinessSecretarialSchools, - BuyingShoppingServices, - CableSatelliteAndOtherPayTelevisionAndRadio, - CameraAndPhotographicSupplyStores, - CandyNutAndConfectioneryStores, - CarAndTruckDealersNewUsed, - CarAndTruckDealersUsedOnly, - CarRentalAgencies, - CarWashes, - CarpentryServices, - CarpetUpholsteryCleaning, - Caterers, - CharitableAndSocialServiceOrganizationsFundraising, - ChemicalsAndAlliedProducts, - ChildCareServices, - ChildrensAndInfantsWearStores, - ChiropodistsPodiatrists, - Chiropractors, - CigarStoresAndStands, - CivicSocialFraternalAssociations, - CleaningAndMaintenance, - ClothingRental, - CollegesUniversities, - CommercialEquipment, - CommercialFootwear, - CommercialPhotographyArtAndGraphics, - CommuterTransportAndFerries, - ComputerNetworkServices, - ComputerProgramming, - ComputerRepair, - ComputerSoftwareStores, - ComputersPeripheralsAndSoftware, - ConcreteWorkServices, - ConstructionMaterials, - ConsultingPublicRelations, - CorrespondenceSchools, - CosmeticStores, - CounselingServices, - CountryClubs, - CourierServices, - CourtCosts, - CreditReportingAgencies, - CruiseLines, - DairyProductsStores, - DanceHallStudiosSchools, - DatingEscortServices, - DentistsOrthodontists, - DepartmentStores, - DetectiveAgencies, - DigitalGoodsApplications, - DigitalGoodsGames, - DigitalGoodsLargeVolume, - DigitalGoodsMedia, - DirectMarketingCatalogMerchant, - DirectMarketingCombinationCatalogAndRetailMerchant, - DirectMarketingInboundTelemarketing, - DirectMarketingInsuranceServices, - DirectMarketingOther, - DirectMarketingOutboundTelemarketing, - DirectMarketingSubscription, - DirectMarketingTravel, - DiscountStores, - Doctors, - DoorToDoorSales, - DraperyWindowCoveringAndUpholsteryStores, - DrinkingPlaces, - DrugStoresAndPharmacies, - DrugsDrugProprietariesAndDruggistSundries, - DryCleaners, - DurableGoods, - DutyFreeStores, - EatingPlacesRestaurants, - EducationalServices, - ElectricRazorStores, - ElectricVehicleCharging, - ElectricalPartsAndEquipment, - ElectricalServices, - ElectronicsRepairShops, - ElectronicsStores, - ElementarySecondarySchools, - EmergencyServicesGcasVisaUseOnly, - EmploymentTempAgencies, - EquipmentRental, - ExterminatingServices, - FamilyClothingStores, - FastFoodRestaurants, - FinancialInstitutions, - FinesGovernmentAdministrativeEntities, - FireplaceFireplaceScreensAndAccessoriesStores, - FloorCoveringStores, - Florists, - FloristsSuppliesNurseryStockAndFlowers, - FreezerAndLockerMeatProvisioners, - FuelDealersNonAutomotive, - FuneralServicesCrematories, - FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, - FurnitureRepairRefinishing, - FurriersAndFurShops, - GeneralServices, - GiftCardNoveltyAndSouvenirShops, - GlassPaintAndWallpaperStores, - GlasswareCrystalStores, - GolfCoursesPublic, - GovernmentLicensedHorseDogRacingUsRegionOnly, - GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, - GovernmentOwnedLotteriesNonUsRegion, - GovernmentOwnedLotteriesUsRegionOnly, - GovernmentServices, - GroceryStoresSupermarkets, - HardwareEquipmentAndSupplies, - HardwareStores, - HealthAndBeautySpas, - HearingAidsSalesAndSupplies, - #[serde(rename = "heating_plumbing_a_c")] - HeatingPlumbingAC, - HobbyToyAndGameShops, - HomeSupplyWarehouseStores, - Hospitals, - HotelsMotelsAndResorts, - HouseholdApplianceStores, - IndustrialSupplies, - InformationRetrievalServices, - InsuranceDefault, - InsuranceUnderwritingPremiums, - IntraCompanyPurchases, - JewelryStoresWatchesClocksAndSilverwareStores, - LandscapingServices, - Laundries, - LaundryCleaningServices, - LegalServicesAttorneys, - LuggageAndLeatherGoodsStores, - LumberBuildingMaterialsStores, - ManualCashDisburse, - MarinasServiceAndSupplies, - Marketplaces, - MasonryStoneworkAndPlaster, - MassageParlors, - MedicalAndDentalLabs, - MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, - MedicalServices, - MembershipOrganizations, - MensAndBoysClothingAndAccessoriesStores, - MensWomensClothingStores, - MetalServiceCenters, - Miscellaneous, - MiscellaneousApparelAndAccessoryShops, - MiscellaneousAutoDealers, - MiscellaneousBusinessServices, - MiscellaneousFoodStores, - MiscellaneousGeneralMerchandise, - MiscellaneousGeneralServices, - MiscellaneousHomeFurnishingSpecialtyStores, - MiscellaneousPublishingAndPrinting, - MiscellaneousRecreationServices, - MiscellaneousRepairShops, - MiscellaneousSpecialtyRetail, - MobileHomeDealers, - MotionPictureTheaters, - MotorFreightCarriersAndTrucking, - MotorHomesDealers, - MotorVehicleSuppliesAndNewParts, - MotorcycleShopsAndDealers, - MotorcycleShopsDealers, - MusicStoresMusicalInstrumentsPianosAndSheetMusic, - NewsDealersAndNewsstands, - NonFiMoneyOrders, - NonFiStoredValueCardPurchaseLoad, - NondurableGoods, - NurseriesLawnAndGardenSupplyStores, - NursingPersonalCare, - OfficeAndCommercialFurniture, - OpticiansEyeglasses, - OptometristsOphthalmologist, - OrthopedicGoodsProstheticDevices, - Osteopaths, - PackageStoresBeerWineAndLiquor, - PaintsVarnishesAndSupplies, - ParkingLotsGarages, - PassengerRailways, - PawnShops, - PetShopsPetFoodAndSupplies, - PetroleumAndPetroleumProducts, - PhotoDeveloping, - PhotographicPhotocopyMicrofilmEquipmentAndSupplies, - PhotographicStudios, - PictureVideoProduction, - PieceGoodsNotionsAndOtherDryGoods, - PlumbingHeatingEquipmentAndSupplies, - PoliticalOrganizations, - PostalServicesGovernmentOnly, - PreciousStonesAndMetalsWatchesAndJewelry, - ProfessionalServices, - PublicWarehousingAndStorage, - QuickCopyReproAndBlueprint, - Railroads, - RealEstateAgentsAndManagersRentals, - RecordStores, - RecreationalVehicleRentals, - ReligiousGoodsStores, - ReligiousOrganizations, - RoofingSidingSheetMetal, - SecretarialSupportServices, - SecurityBrokersDealers, - ServiceStations, - SewingNeedleworkFabricAndPieceGoodsStores, - ShoeRepairHatCleaning, - ShoeStores, - SmallApplianceRepair, - SnowmobileDealers, - SpecialTradeServices, - SpecialtyCleaning, - SportingGoodsStores, - SportingRecreationCamps, - SportsAndRidingApparelStores, - SportsClubsFields, - StampAndCoinStores, - StationaryOfficeSuppliesPrintingAndWritingPaper, - StationeryStoresOfficeAndSchoolSupplyStores, - SwimmingPoolsSales, - TUiTravelGermany, - TailorsAlterations, - TaxPaymentsGovernmentAgencies, - TaxPreparationServices, - TaxicabsLimousines, - TelecommunicationEquipmentAndTelephoneSales, - TelecommunicationServices, - TelegraphServices, - TentAndAwningShops, - TestingLaboratories, - TheatricalTicketAgencies, - Timeshares, - TireRetreadingAndRepair, - TollsBridgeFees, - TouristAttractionsAndExhibits, - TowingServices, - TrailerParksCampgrounds, - TransportationServices, - TravelAgenciesTourOperators, - TruckStopIteration, - TruckUtilityTrailerRentals, - TypesettingPlateMakingAndRelatedServices, - TypewriterStores, - #[serde(rename = "u_s_federal_government_agencies_or_departments")] - USFederalGovernmentAgenciesOrDepartments, - UniformsCommercialClothing, - UsedMerchandiseAndSecondhandStores, - Utilities, - VarietyStores, - VeterinaryServices, - VideoAmusementGameSupplies, - VideoGameArcades, - VideoTapeRentalStores, - VocationalTradeSchools, - WatchJewelryRepair, - WeldingRepair, - WholesaleClubs, - WigAndToupeeStores, - WiresMoneyOrders, - WomensAccessoryAndSpecialtyShops, - WomensReadyToWearStores, - WreckingAndSalvageYards, -} - -impl IssuingCardholderSpendingLimitCategories { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardholderSpendingLimitCategories::AcRefrigerationRepair => "ac_refrigeration_repair", - IssuingCardholderSpendingLimitCategories::AccountingBookkeepingServices => "accounting_bookkeeping_services", - IssuingCardholderSpendingLimitCategories::AdvertisingServices => "advertising_services", - IssuingCardholderSpendingLimitCategories::AgriculturalCooperative => "agricultural_cooperative", - IssuingCardholderSpendingLimitCategories::AirlinesAirCarriers => "airlines_air_carriers", - IssuingCardholderSpendingLimitCategories::AirportsFlyingFields => "airports_flying_fields", - IssuingCardholderSpendingLimitCategories::AmbulanceServices => "ambulance_services", - IssuingCardholderSpendingLimitCategories::AmusementParksCarnivals => "amusement_parks_carnivals", - IssuingCardholderSpendingLimitCategories::AntiqueReproductions => "antique_reproductions", - IssuingCardholderSpendingLimitCategories::AntiqueShops => "antique_shops", - IssuingCardholderSpendingLimitCategories::Aquariums => "aquariums", - IssuingCardholderSpendingLimitCategories::ArchitecturalSurveyingServices => "architectural_surveying_services", - IssuingCardholderSpendingLimitCategories::ArtDealersAndGalleries => "art_dealers_and_galleries", - IssuingCardholderSpendingLimitCategories::ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", - IssuingCardholderSpendingLimitCategories::AutoAndHomeSupplyStores => "auto_and_home_supply_stores", - IssuingCardholderSpendingLimitCategories::AutoBodyRepairShops => "auto_body_repair_shops", - IssuingCardholderSpendingLimitCategories::AutoPaintShops => "auto_paint_shops", - IssuingCardholderSpendingLimitCategories::AutoServiceShops => "auto_service_shops", - IssuingCardholderSpendingLimitCategories::AutomatedCashDisburse => "automated_cash_disburse", - IssuingCardholderSpendingLimitCategories::AutomatedFuelDispensers => "automated_fuel_dispensers", - IssuingCardholderSpendingLimitCategories::AutomobileAssociations => "automobile_associations", - IssuingCardholderSpendingLimitCategories::AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", - IssuingCardholderSpendingLimitCategories::AutomotiveTireStores => "automotive_tire_stores", - IssuingCardholderSpendingLimitCategories::BailAndBondPayments => "bail_and_bond_payments", - IssuingCardholderSpendingLimitCategories::Bakeries => "bakeries", - IssuingCardholderSpendingLimitCategories::BandsOrchestras => "bands_orchestras", - IssuingCardholderSpendingLimitCategories::BarberAndBeautyShops => "barber_and_beauty_shops", - IssuingCardholderSpendingLimitCategories::BettingCasinoGambling => "betting_casino_gambling", - IssuingCardholderSpendingLimitCategories::BicycleShops => "bicycle_shops", - IssuingCardholderSpendingLimitCategories::BilliardPoolEstablishments => "billiard_pool_establishments", - IssuingCardholderSpendingLimitCategories::BoatDealers => "boat_dealers", - IssuingCardholderSpendingLimitCategories::BoatRentalsAndLeases => "boat_rentals_and_leases", - IssuingCardholderSpendingLimitCategories::BookStores => "book_stores", - IssuingCardholderSpendingLimitCategories::BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", - IssuingCardholderSpendingLimitCategories::BowlingAlleys => "bowling_alleys", - IssuingCardholderSpendingLimitCategories::BusLines => "bus_lines", - IssuingCardholderSpendingLimitCategories::BusinessSecretarialSchools => "business_secretarial_schools", - IssuingCardholderSpendingLimitCategories::BuyingShoppingServices => "buying_shopping_services", - IssuingCardholderSpendingLimitCategories::CableSatelliteAndOtherPayTelevisionAndRadio => "cable_satellite_and_other_pay_television_and_radio", - IssuingCardholderSpendingLimitCategories::CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", - IssuingCardholderSpendingLimitCategories::CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", - IssuingCardholderSpendingLimitCategories::CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", - IssuingCardholderSpendingLimitCategories::CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", - IssuingCardholderSpendingLimitCategories::CarRentalAgencies => "car_rental_agencies", - IssuingCardholderSpendingLimitCategories::CarWashes => "car_washes", - IssuingCardholderSpendingLimitCategories::CarpentryServices => "carpentry_services", - IssuingCardholderSpendingLimitCategories::CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", - IssuingCardholderSpendingLimitCategories::Caterers => "caterers", - IssuingCardholderSpendingLimitCategories::CharitableAndSocialServiceOrganizationsFundraising => "charitable_and_social_service_organizations_fundraising", - IssuingCardholderSpendingLimitCategories::ChemicalsAndAlliedProducts => "chemicals_and_allied_products", - IssuingCardholderSpendingLimitCategories::ChildCareServices => "child_care_services", - IssuingCardholderSpendingLimitCategories::ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", - IssuingCardholderSpendingLimitCategories::ChiropodistsPodiatrists => "chiropodists_podiatrists", - IssuingCardholderSpendingLimitCategories::Chiropractors => "chiropractors", - IssuingCardholderSpendingLimitCategories::CigarStoresAndStands => "cigar_stores_and_stands", - IssuingCardholderSpendingLimitCategories::CivicSocialFraternalAssociations => "civic_social_fraternal_associations", - IssuingCardholderSpendingLimitCategories::CleaningAndMaintenance => "cleaning_and_maintenance", - IssuingCardholderSpendingLimitCategories::ClothingRental => "clothing_rental", - IssuingCardholderSpendingLimitCategories::CollegesUniversities => "colleges_universities", - IssuingCardholderSpendingLimitCategories::CommercialEquipment => "commercial_equipment", - IssuingCardholderSpendingLimitCategories::CommercialFootwear => "commercial_footwear", - IssuingCardholderSpendingLimitCategories::CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", - IssuingCardholderSpendingLimitCategories::CommuterTransportAndFerries => "commuter_transport_and_ferries", - IssuingCardholderSpendingLimitCategories::ComputerNetworkServices => "computer_network_services", - IssuingCardholderSpendingLimitCategories::ComputerProgramming => "computer_programming", - IssuingCardholderSpendingLimitCategories::ComputerRepair => "computer_repair", - IssuingCardholderSpendingLimitCategories::ComputerSoftwareStores => "computer_software_stores", - IssuingCardholderSpendingLimitCategories::ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", - IssuingCardholderSpendingLimitCategories::ConcreteWorkServices => "concrete_work_services", - IssuingCardholderSpendingLimitCategories::ConstructionMaterials => "construction_materials", - IssuingCardholderSpendingLimitCategories::ConsultingPublicRelations => "consulting_public_relations", - IssuingCardholderSpendingLimitCategories::CorrespondenceSchools => "correspondence_schools", - IssuingCardholderSpendingLimitCategories::CosmeticStores => "cosmetic_stores", - IssuingCardholderSpendingLimitCategories::CounselingServices => "counseling_services", - IssuingCardholderSpendingLimitCategories::CountryClubs => "country_clubs", - IssuingCardholderSpendingLimitCategories::CourierServices => "courier_services", - IssuingCardholderSpendingLimitCategories::CourtCosts => "court_costs", - IssuingCardholderSpendingLimitCategories::CreditReportingAgencies => "credit_reporting_agencies", - IssuingCardholderSpendingLimitCategories::CruiseLines => "cruise_lines", - IssuingCardholderSpendingLimitCategories::DairyProductsStores => "dairy_products_stores", - IssuingCardholderSpendingLimitCategories::DanceHallStudiosSchools => "dance_hall_studios_schools", - IssuingCardholderSpendingLimitCategories::DatingEscortServices => "dating_escort_services", - IssuingCardholderSpendingLimitCategories::DentistsOrthodontists => "dentists_orthodontists", - IssuingCardholderSpendingLimitCategories::DepartmentStores => "department_stores", - IssuingCardholderSpendingLimitCategories::DetectiveAgencies => "detective_agencies", - IssuingCardholderSpendingLimitCategories::DigitalGoodsApplications => "digital_goods_applications", - IssuingCardholderSpendingLimitCategories::DigitalGoodsGames => "digital_goods_games", - IssuingCardholderSpendingLimitCategories::DigitalGoodsLargeVolume => "digital_goods_large_volume", - IssuingCardholderSpendingLimitCategories::DigitalGoodsMedia => "digital_goods_media", - IssuingCardholderSpendingLimitCategories::DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", - IssuingCardholderSpendingLimitCategories::DirectMarketingCombinationCatalogAndRetailMerchant => "direct_marketing_combination_catalog_and_retail_merchant", - IssuingCardholderSpendingLimitCategories::DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", - IssuingCardholderSpendingLimitCategories::DirectMarketingInsuranceServices => "direct_marketing_insurance_services", - IssuingCardholderSpendingLimitCategories::DirectMarketingOther => "direct_marketing_other", - IssuingCardholderSpendingLimitCategories::DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", - IssuingCardholderSpendingLimitCategories::DirectMarketingSubscription => "direct_marketing_subscription", - IssuingCardholderSpendingLimitCategories::DirectMarketingTravel => "direct_marketing_travel", - IssuingCardholderSpendingLimitCategories::DiscountStores => "discount_stores", - IssuingCardholderSpendingLimitCategories::Doctors => "doctors", - IssuingCardholderSpendingLimitCategories::DoorToDoorSales => "door_to_door_sales", - IssuingCardholderSpendingLimitCategories::DraperyWindowCoveringAndUpholsteryStores => "drapery_window_covering_and_upholstery_stores", - IssuingCardholderSpendingLimitCategories::DrinkingPlaces => "drinking_places", - IssuingCardholderSpendingLimitCategories::DrugStoresAndPharmacies => "drug_stores_and_pharmacies", - IssuingCardholderSpendingLimitCategories::DrugsDrugProprietariesAndDruggistSundries => "drugs_drug_proprietaries_and_druggist_sundries", - IssuingCardholderSpendingLimitCategories::DryCleaners => "dry_cleaners", - IssuingCardholderSpendingLimitCategories::DurableGoods => "durable_goods", - IssuingCardholderSpendingLimitCategories::DutyFreeStores => "duty_free_stores", - IssuingCardholderSpendingLimitCategories::EatingPlacesRestaurants => "eating_places_restaurants", - IssuingCardholderSpendingLimitCategories::EducationalServices => "educational_services", - IssuingCardholderSpendingLimitCategories::ElectricRazorStores => "electric_razor_stores", - IssuingCardholderSpendingLimitCategories::ElectricVehicleCharging => "electric_vehicle_charging", - IssuingCardholderSpendingLimitCategories::ElectricalPartsAndEquipment => "electrical_parts_and_equipment", - IssuingCardholderSpendingLimitCategories::ElectricalServices => "electrical_services", - IssuingCardholderSpendingLimitCategories::ElectronicsRepairShops => "electronics_repair_shops", - IssuingCardholderSpendingLimitCategories::ElectronicsStores => "electronics_stores", - IssuingCardholderSpendingLimitCategories::ElementarySecondarySchools => "elementary_secondary_schools", - IssuingCardholderSpendingLimitCategories::EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", - IssuingCardholderSpendingLimitCategories::EmploymentTempAgencies => "employment_temp_agencies", - IssuingCardholderSpendingLimitCategories::EquipmentRental => "equipment_rental", - IssuingCardholderSpendingLimitCategories::ExterminatingServices => "exterminating_services", - IssuingCardholderSpendingLimitCategories::FamilyClothingStores => "family_clothing_stores", - IssuingCardholderSpendingLimitCategories::FastFoodRestaurants => "fast_food_restaurants", - IssuingCardholderSpendingLimitCategories::FinancialInstitutions => "financial_institutions", - IssuingCardholderSpendingLimitCategories::FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", - IssuingCardholderSpendingLimitCategories::FireplaceFireplaceScreensAndAccessoriesStores => "fireplace_fireplace_screens_and_accessories_stores", - IssuingCardholderSpendingLimitCategories::FloorCoveringStores => "floor_covering_stores", - IssuingCardholderSpendingLimitCategories::Florists => "florists", - IssuingCardholderSpendingLimitCategories::FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", - IssuingCardholderSpendingLimitCategories::FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", - IssuingCardholderSpendingLimitCategories::FuelDealersNonAutomotive => "fuel_dealers_non_automotive", - IssuingCardholderSpendingLimitCategories::FuneralServicesCrematories => "funeral_services_crematories", - IssuingCardholderSpendingLimitCategories::FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => "furniture_home_furnishings_and_equipment_stores_except_appliances", - IssuingCardholderSpendingLimitCategories::FurnitureRepairRefinishing => "furniture_repair_refinishing", - IssuingCardholderSpendingLimitCategories::FurriersAndFurShops => "furriers_and_fur_shops", - IssuingCardholderSpendingLimitCategories::GeneralServices => "general_services", - IssuingCardholderSpendingLimitCategories::GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", - IssuingCardholderSpendingLimitCategories::GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", - IssuingCardholderSpendingLimitCategories::GlasswareCrystalStores => "glassware_crystal_stores", - IssuingCardholderSpendingLimitCategories::GolfCoursesPublic => "golf_courses_public", - IssuingCardholderSpendingLimitCategories::GovernmentLicensedHorseDogRacingUsRegionOnly => "government_licensed_horse_dog_racing_us_region_only", - IssuingCardholderSpendingLimitCategories::GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => "government_licensed_online_casions_online_gambling_us_region_only", - IssuingCardholderSpendingLimitCategories::GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", - IssuingCardholderSpendingLimitCategories::GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", - IssuingCardholderSpendingLimitCategories::GovernmentServices => "government_services", - IssuingCardholderSpendingLimitCategories::GroceryStoresSupermarkets => "grocery_stores_supermarkets", - IssuingCardholderSpendingLimitCategories::HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", - IssuingCardholderSpendingLimitCategories::HardwareStores => "hardware_stores", - IssuingCardholderSpendingLimitCategories::HealthAndBeautySpas => "health_and_beauty_spas", - IssuingCardholderSpendingLimitCategories::HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", - IssuingCardholderSpendingLimitCategories::HeatingPlumbingAC => "heating_plumbing_a_c", - IssuingCardholderSpendingLimitCategories::HobbyToyAndGameShops => "hobby_toy_and_game_shops", - IssuingCardholderSpendingLimitCategories::HomeSupplyWarehouseStores => "home_supply_warehouse_stores", - IssuingCardholderSpendingLimitCategories::Hospitals => "hospitals", - IssuingCardholderSpendingLimitCategories::HotelsMotelsAndResorts => "hotels_motels_and_resorts", - IssuingCardholderSpendingLimitCategories::HouseholdApplianceStores => "household_appliance_stores", - IssuingCardholderSpendingLimitCategories::IndustrialSupplies => "industrial_supplies", - IssuingCardholderSpendingLimitCategories::InformationRetrievalServices => "information_retrieval_services", - IssuingCardholderSpendingLimitCategories::InsuranceDefault => "insurance_default", - IssuingCardholderSpendingLimitCategories::InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", - IssuingCardholderSpendingLimitCategories::IntraCompanyPurchases => "intra_company_purchases", - IssuingCardholderSpendingLimitCategories::JewelryStoresWatchesClocksAndSilverwareStores => "jewelry_stores_watches_clocks_and_silverware_stores", - IssuingCardholderSpendingLimitCategories::LandscapingServices => "landscaping_services", - IssuingCardholderSpendingLimitCategories::Laundries => "laundries", - IssuingCardholderSpendingLimitCategories::LaundryCleaningServices => "laundry_cleaning_services", - IssuingCardholderSpendingLimitCategories::LegalServicesAttorneys => "legal_services_attorneys", - IssuingCardholderSpendingLimitCategories::LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", - IssuingCardholderSpendingLimitCategories::LumberBuildingMaterialsStores => "lumber_building_materials_stores", - IssuingCardholderSpendingLimitCategories::ManualCashDisburse => "manual_cash_disburse", - IssuingCardholderSpendingLimitCategories::MarinasServiceAndSupplies => "marinas_service_and_supplies", - IssuingCardholderSpendingLimitCategories::Marketplaces => "marketplaces", - IssuingCardholderSpendingLimitCategories::MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", - IssuingCardholderSpendingLimitCategories::MassageParlors => "massage_parlors", - IssuingCardholderSpendingLimitCategories::MedicalAndDentalLabs => "medical_and_dental_labs", - IssuingCardholderSpendingLimitCategories::MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", - IssuingCardholderSpendingLimitCategories::MedicalServices => "medical_services", - IssuingCardholderSpendingLimitCategories::MembershipOrganizations => "membership_organizations", - IssuingCardholderSpendingLimitCategories::MensAndBoysClothingAndAccessoriesStores => "mens_and_boys_clothing_and_accessories_stores", - IssuingCardholderSpendingLimitCategories::MensWomensClothingStores => "mens_womens_clothing_stores", - IssuingCardholderSpendingLimitCategories::MetalServiceCenters => "metal_service_centers", - IssuingCardholderSpendingLimitCategories::Miscellaneous => "miscellaneous", - IssuingCardholderSpendingLimitCategories::MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", - IssuingCardholderSpendingLimitCategories::MiscellaneousAutoDealers => "miscellaneous_auto_dealers", - IssuingCardholderSpendingLimitCategories::MiscellaneousBusinessServices => "miscellaneous_business_services", - IssuingCardholderSpendingLimitCategories::MiscellaneousFoodStores => "miscellaneous_food_stores", - IssuingCardholderSpendingLimitCategories::MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", - IssuingCardholderSpendingLimitCategories::MiscellaneousGeneralServices => "miscellaneous_general_services", - IssuingCardholderSpendingLimitCategories::MiscellaneousHomeFurnishingSpecialtyStores => "miscellaneous_home_furnishing_specialty_stores", - IssuingCardholderSpendingLimitCategories::MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", - IssuingCardholderSpendingLimitCategories::MiscellaneousRecreationServices => "miscellaneous_recreation_services", - IssuingCardholderSpendingLimitCategories::MiscellaneousRepairShops => "miscellaneous_repair_shops", - IssuingCardholderSpendingLimitCategories::MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", - IssuingCardholderSpendingLimitCategories::MobileHomeDealers => "mobile_home_dealers", - IssuingCardholderSpendingLimitCategories::MotionPictureTheaters => "motion_picture_theaters", - IssuingCardholderSpendingLimitCategories::MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", - IssuingCardholderSpendingLimitCategories::MotorHomesDealers => "motor_homes_dealers", - IssuingCardholderSpendingLimitCategories::MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", - IssuingCardholderSpendingLimitCategories::MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", - IssuingCardholderSpendingLimitCategories::MotorcycleShopsDealers => "motorcycle_shops_dealers", - IssuingCardholderSpendingLimitCategories::MusicStoresMusicalInstrumentsPianosAndSheetMusic => "music_stores_musical_instruments_pianos_and_sheet_music", - IssuingCardholderSpendingLimitCategories::NewsDealersAndNewsstands => "news_dealers_and_newsstands", - IssuingCardholderSpendingLimitCategories::NonFiMoneyOrders => "non_fi_money_orders", - IssuingCardholderSpendingLimitCategories::NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", - IssuingCardholderSpendingLimitCategories::NondurableGoods => "nondurable_goods", - IssuingCardholderSpendingLimitCategories::NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", - IssuingCardholderSpendingLimitCategories::NursingPersonalCare => "nursing_personal_care", - IssuingCardholderSpendingLimitCategories::OfficeAndCommercialFurniture => "office_and_commercial_furniture", - IssuingCardholderSpendingLimitCategories::OpticiansEyeglasses => "opticians_eyeglasses", - IssuingCardholderSpendingLimitCategories::OptometristsOphthalmologist => "optometrists_ophthalmologist", - IssuingCardholderSpendingLimitCategories::OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", - IssuingCardholderSpendingLimitCategories::Osteopaths => "osteopaths", - IssuingCardholderSpendingLimitCategories::PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", - IssuingCardholderSpendingLimitCategories::PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", - IssuingCardholderSpendingLimitCategories::ParkingLotsGarages => "parking_lots_garages", - IssuingCardholderSpendingLimitCategories::PassengerRailways => "passenger_railways", - IssuingCardholderSpendingLimitCategories::PawnShops => "pawn_shops", - IssuingCardholderSpendingLimitCategories::PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", - IssuingCardholderSpendingLimitCategories::PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", - IssuingCardholderSpendingLimitCategories::PhotoDeveloping => "photo_developing", - IssuingCardholderSpendingLimitCategories::PhotographicPhotocopyMicrofilmEquipmentAndSupplies => "photographic_photocopy_microfilm_equipment_and_supplies", - IssuingCardholderSpendingLimitCategories::PhotographicStudios => "photographic_studios", - IssuingCardholderSpendingLimitCategories::PictureVideoProduction => "picture_video_production", - IssuingCardholderSpendingLimitCategories::PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", - IssuingCardholderSpendingLimitCategories::PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", - IssuingCardholderSpendingLimitCategories::PoliticalOrganizations => "political_organizations", - IssuingCardholderSpendingLimitCategories::PostalServicesGovernmentOnly => "postal_services_government_only", - IssuingCardholderSpendingLimitCategories::PreciousStonesAndMetalsWatchesAndJewelry => "precious_stones_and_metals_watches_and_jewelry", - IssuingCardholderSpendingLimitCategories::ProfessionalServices => "professional_services", - IssuingCardholderSpendingLimitCategories::PublicWarehousingAndStorage => "public_warehousing_and_storage", - IssuingCardholderSpendingLimitCategories::QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", - IssuingCardholderSpendingLimitCategories::Railroads => "railroads", - IssuingCardholderSpendingLimitCategories::RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", - IssuingCardholderSpendingLimitCategories::RecordStores => "record_stores", - IssuingCardholderSpendingLimitCategories::RecreationalVehicleRentals => "recreational_vehicle_rentals", - IssuingCardholderSpendingLimitCategories::ReligiousGoodsStores => "religious_goods_stores", - IssuingCardholderSpendingLimitCategories::ReligiousOrganizations => "religious_organizations", - IssuingCardholderSpendingLimitCategories::RoofingSidingSheetMetal => "roofing_siding_sheet_metal", - IssuingCardholderSpendingLimitCategories::SecretarialSupportServices => "secretarial_support_services", - IssuingCardholderSpendingLimitCategories::SecurityBrokersDealers => "security_brokers_dealers", - IssuingCardholderSpendingLimitCategories::ServiceStations => "service_stations", - IssuingCardholderSpendingLimitCategories::SewingNeedleworkFabricAndPieceGoodsStores => "sewing_needlework_fabric_and_piece_goods_stores", - IssuingCardholderSpendingLimitCategories::ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", - IssuingCardholderSpendingLimitCategories::ShoeStores => "shoe_stores", - IssuingCardholderSpendingLimitCategories::SmallApplianceRepair => "small_appliance_repair", - IssuingCardholderSpendingLimitCategories::SnowmobileDealers => "snowmobile_dealers", - IssuingCardholderSpendingLimitCategories::SpecialTradeServices => "special_trade_services", - IssuingCardholderSpendingLimitCategories::SpecialtyCleaning => "specialty_cleaning", - IssuingCardholderSpendingLimitCategories::SportingGoodsStores => "sporting_goods_stores", - IssuingCardholderSpendingLimitCategories::SportingRecreationCamps => "sporting_recreation_camps", - IssuingCardholderSpendingLimitCategories::SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", - IssuingCardholderSpendingLimitCategories::SportsClubsFields => "sports_clubs_fields", - IssuingCardholderSpendingLimitCategories::StampAndCoinStores => "stamp_and_coin_stores", - IssuingCardholderSpendingLimitCategories::StationaryOfficeSuppliesPrintingAndWritingPaper => "stationary_office_supplies_printing_and_writing_paper", - IssuingCardholderSpendingLimitCategories::StationeryStoresOfficeAndSchoolSupplyStores => "stationery_stores_office_and_school_supply_stores", - IssuingCardholderSpendingLimitCategories::SwimmingPoolsSales => "swimming_pools_sales", - IssuingCardholderSpendingLimitCategories::TUiTravelGermany => "t_ui_travel_germany", - IssuingCardholderSpendingLimitCategories::TailorsAlterations => "tailors_alterations", - IssuingCardholderSpendingLimitCategories::TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", - IssuingCardholderSpendingLimitCategories::TaxPreparationServices => "tax_preparation_services", - IssuingCardholderSpendingLimitCategories::TaxicabsLimousines => "taxicabs_limousines", - IssuingCardholderSpendingLimitCategories::TelecommunicationEquipmentAndTelephoneSales => "telecommunication_equipment_and_telephone_sales", - IssuingCardholderSpendingLimitCategories::TelecommunicationServices => "telecommunication_services", - IssuingCardholderSpendingLimitCategories::TelegraphServices => "telegraph_services", - IssuingCardholderSpendingLimitCategories::TentAndAwningShops => "tent_and_awning_shops", - IssuingCardholderSpendingLimitCategories::TestingLaboratories => "testing_laboratories", - IssuingCardholderSpendingLimitCategories::TheatricalTicketAgencies => "theatrical_ticket_agencies", - IssuingCardholderSpendingLimitCategories::Timeshares => "timeshares", - IssuingCardholderSpendingLimitCategories::TireRetreadingAndRepair => "tire_retreading_and_repair", - IssuingCardholderSpendingLimitCategories::TollsBridgeFees => "tolls_bridge_fees", - IssuingCardholderSpendingLimitCategories::TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", - IssuingCardholderSpendingLimitCategories::TowingServices => "towing_services", - IssuingCardholderSpendingLimitCategories::TrailerParksCampgrounds => "trailer_parks_campgrounds", - IssuingCardholderSpendingLimitCategories::TransportationServices => "transportation_services", - IssuingCardholderSpendingLimitCategories::TravelAgenciesTourOperators => "travel_agencies_tour_operators", - IssuingCardholderSpendingLimitCategories::TruckStopIteration => "truck_stop_iteration", - IssuingCardholderSpendingLimitCategories::TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", - IssuingCardholderSpendingLimitCategories::TypesettingPlateMakingAndRelatedServices => "typesetting_plate_making_and_related_services", - IssuingCardholderSpendingLimitCategories::TypewriterStores => "typewriter_stores", - IssuingCardholderSpendingLimitCategories::USFederalGovernmentAgenciesOrDepartments => "u_s_federal_government_agencies_or_departments", - IssuingCardholderSpendingLimitCategories::UniformsCommercialClothing => "uniforms_commercial_clothing", - IssuingCardholderSpendingLimitCategories::UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", - IssuingCardholderSpendingLimitCategories::Utilities => "utilities", - IssuingCardholderSpendingLimitCategories::VarietyStores => "variety_stores", - IssuingCardholderSpendingLimitCategories::VeterinaryServices => "veterinary_services", - IssuingCardholderSpendingLimitCategories::VideoAmusementGameSupplies => "video_amusement_game_supplies", - IssuingCardholderSpendingLimitCategories::VideoGameArcades => "video_game_arcades", - IssuingCardholderSpendingLimitCategories::VideoTapeRentalStores => "video_tape_rental_stores", - IssuingCardholderSpendingLimitCategories::VocationalTradeSchools => "vocational_trade_schools", - IssuingCardholderSpendingLimitCategories::WatchJewelryRepair => "watch_jewelry_repair", - IssuingCardholderSpendingLimitCategories::WeldingRepair => "welding_repair", - IssuingCardholderSpendingLimitCategories::WholesaleClubs => "wholesale_clubs", - IssuingCardholderSpendingLimitCategories::WigAndToupeeStores => "wig_and_toupee_stores", - IssuingCardholderSpendingLimitCategories::WiresMoneyOrders => "wires_money_orders", - IssuingCardholderSpendingLimitCategories::WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", - IssuingCardholderSpendingLimitCategories::WomensReadyToWearStores => "womens_ready_to_wear_stores", - IssuingCardholderSpendingLimitCategories::WreckingAndSalvageYards => "wrecking_and_salvage_yards", - } - } -} - -impl AsRef for IssuingCardholderSpendingLimitCategories { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardholderSpendingLimitCategories { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardholderSpendingLimitCategories { - fn default() -> Self { - Self::AcRefrigerationRepair - } -} - -/// An enum representing the possible values of an `IssuingCardholderSpendingLimit`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardholderSpendingLimitInterval { - AllTime, - Daily, - Monthly, - PerAuthorization, - Weekly, - Yearly, -} - -impl IssuingCardholderSpendingLimitInterval { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardholderSpendingLimitInterval::AllTime => "all_time", - IssuingCardholderSpendingLimitInterval::Daily => "daily", - IssuingCardholderSpendingLimitInterval::Monthly => "monthly", - IssuingCardholderSpendingLimitInterval::PerAuthorization => "per_authorization", - IssuingCardholderSpendingLimitInterval::Weekly => "weekly", - IssuingCardholderSpendingLimitInterval::Yearly => "yearly", - } - } -} - -impl AsRef for IssuingCardholderSpendingLimitInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardholderSpendingLimitInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardholderSpendingLimitInterval { - fn default() -> Self { - Self::AllTime - } -} - -/// An enum representing the possible values of an `IssuingCardholder`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardholderStatus { - Active, - Blocked, - Inactive, -} - -impl IssuingCardholderStatus { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardholderStatus::Active => "active", - IssuingCardholderStatus::Blocked => "blocked", - IssuingCardholderStatus::Inactive => "inactive", - } - } -} - -impl AsRef for IssuingCardholderStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardholderStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardholderStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `IssuingCardholder`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardholderType { - Company, - Individual, -} - -impl IssuingCardholderType { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardholderType::Company => "company", - IssuingCardholderType::Individual => "individual", - } - } -} - -impl AsRef for IssuingCardholderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardholderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardholderType { - fn default() -> Self { - Self::Company - } -} diff --git a/src/resources/generated/issuing_dispute.rs b/src/resources/generated/issuing_dispute.rs deleted file mode 100644 index 55b88e081..000000000 --- a/src/resources/generated/issuing_dispute.rs +++ /dev/null @@ -1,459 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::IssuingDisputeId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{ - BalanceTransaction, Currency, File, IssuingDisputeStatus, IssuingTransaction, -}; - -/// The resource representing a Stripe "IssuingDispute". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDispute { - /// Unique identifier for the object. - pub id: IssuingDisputeId, - - /// Disputed amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - /// - /// Usually the amount of the `transaction`, but can differ (usually because of currency fluctuation). - pub amount: i64, - - /// List of balance transactions associated with the dispute. - pub balance_transactions: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The currency the `transaction` was made in. - pub currency: Currency, - - pub evidence: IssuingDisputeEvidence, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// Current status of the dispute. - pub status: IssuingDisputeStatus, - - /// The transaction being disputed. - pub transaction: Expandable, - - /// [Treasury](https://stripe.com/docs/api/treasury) details related to this dispute if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub treasury: Option, -} - -impl Object for IssuingDispute { - type Id = IssuingDisputeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.dispute" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeEvidence { - #[serde(skip_serializing_if = "Option::is_none")] - pub canceled: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub duplicate: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fraudulent: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub merchandise_not_as_described: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub not_received: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub other: Option, - - /// The reason for filing the dispute. - /// - /// Its value will match the field containing the evidence. - pub reason: IssuingDisputeEvidenceReason, - - #[serde(skip_serializing_if = "Option::is_none")] - pub service_not_as_described: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeCanceledEvidence { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - pub additional_documentation: Option>, - - /// Date when order was canceled. - pub canceled_at: Option, - - /// Whether the cardholder was provided with a cancellation policy. - pub cancellation_policy_provided: Option, - - /// Reason for canceling the order. - pub cancellation_reason: Option, - - /// Date when the cardholder expected to receive the product. - pub expected_at: Option, - - /// Explanation of why the cardholder is disputing this transaction. - pub explanation: Option, - - /// Description of the merchandise or service that was purchased. - pub product_description: Option, - - /// Whether the product was a merchandise or service. - pub product_type: Option, - - /// Result of cardholder's attempt to return the product. - pub return_status: Option, - - /// Date when the product was returned or attempted to be returned. - pub returned_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeDuplicateEvidence { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - pub additional_documentation: Option>, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. - pub card_statement: Option>, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. - pub cash_receipt: Option>, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. - pub check_image: Option>, - - /// Explanation of why the cardholder is disputing this transaction. - pub explanation: Option, - - /// Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. - /// - /// Of the two or more transactions that are copies of each other, this is original undisputed one. - pub original_transaction: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeFraudulentEvidence { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - pub additional_documentation: Option>, - - /// Explanation of why the cardholder is disputing this transaction. - pub explanation: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeMerchandiseNotAsDescribedEvidence { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - pub additional_documentation: Option>, - - /// Explanation of why the cardholder is disputing this transaction. - pub explanation: Option, - - /// Date when the product was received. - pub received_at: Option, - - /// Description of the cardholder's attempt to return the product. - pub return_description: Option, - - /// Result of cardholder's attempt to return the product. - pub return_status: Option, - - /// Date when the product was returned or attempted to be returned. - pub returned_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeNotReceivedEvidence { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - pub additional_documentation: Option>, - - /// Date when the cardholder expected to receive the product. - pub expected_at: Option, - - /// Explanation of why the cardholder is disputing this transaction. - pub explanation: Option, - - /// Description of the merchandise or service that was purchased. - pub product_description: Option, - - /// Whether the product was a merchandise or service. - pub product_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeOtherEvidence { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - pub additional_documentation: Option>, - - /// Explanation of why the cardholder is disputing this transaction. - pub explanation: Option, - - /// Description of the merchandise or service that was purchased. - pub product_description: Option, - - /// Whether the product was a merchandise or service. - pub product_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeServiceNotAsDescribedEvidence { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - pub additional_documentation: Option>, - - /// Date when order was canceled. - pub canceled_at: Option, - - /// Reason for canceling the order. - pub cancellation_reason: Option, - - /// Explanation of why the cardholder is disputing this transaction. - pub explanation: Option, - - /// Date when the product was received. - pub received_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeTreasury { - /// The Treasury [DebitReversal](https://stripe.com/docs/api/treasury/debit_reversals) representing this Issuing dispute. - pub debit_reversal: Option, - - /// The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_debits) that is being disputed. - pub received_debit: String, -} - -/// An enum representing the possible values of an `IssuingDisputeCanceledEvidence`'s `product_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingDisputeCanceledEvidenceProductType { - Merchandise, - Service, -} - -impl IssuingDisputeCanceledEvidenceProductType { - pub fn as_str(self) -> &'static str { - match self { - IssuingDisputeCanceledEvidenceProductType::Merchandise => "merchandise", - IssuingDisputeCanceledEvidenceProductType::Service => "service", - } - } -} - -impl AsRef for IssuingDisputeCanceledEvidenceProductType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingDisputeCanceledEvidenceProductType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingDisputeCanceledEvidenceProductType { - fn default() -> Self { - Self::Merchandise - } -} - -/// An enum representing the possible values of an `IssuingDisputeCanceledEvidence`'s `return_status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingDisputeCanceledEvidenceReturnStatus { - MerchantRejected, - Successful, -} - -impl IssuingDisputeCanceledEvidenceReturnStatus { - pub fn as_str(self) -> &'static str { - match self { - IssuingDisputeCanceledEvidenceReturnStatus::MerchantRejected => "merchant_rejected", - IssuingDisputeCanceledEvidenceReturnStatus::Successful => "successful", - } - } -} - -impl AsRef for IssuingDisputeCanceledEvidenceReturnStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingDisputeCanceledEvidenceReturnStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingDisputeCanceledEvidenceReturnStatus { - fn default() -> Self { - Self::MerchantRejected - } -} - -/// An enum representing the possible values of an `IssuingDisputeEvidence`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingDisputeEvidenceReason { - Canceled, - Duplicate, - Fraudulent, - MerchandiseNotAsDescribed, - NotReceived, - Other, - ServiceNotAsDescribed, -} - -impl IssuingDisputeEvidenceReason { - pub fn as_str(self) -> &'static str { - match self { - IssuingDisputeEvidenceReason::Canceled => "canceled", - IssuingDisputeEvidenceReason::Duplicate => "duplicate", - IssuingDisputeEvidenceReason::Fraudulent => "fraudulent", - IssuingDisputeEvidenceReason::MerchandiseNotAsDescribed => { - "merchandise_not_as_described" - } - IssuingDisputeEvidenceReason::NotReceived => "not_received", - IssuingDisputeEvidenceReason::Other => "other", - IssuingDisputeEvidenceReason::ServiceNotAsDescribed => "service_not_as_described", - } - } -} - -impl AsRef for IssuingDisputeEvidenceReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingDisputeEvidenceReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingDisputeEvidenceReason { - fn default() -> Self { - Self::Canceled - } -} - -/// An enum representing the possible values of an `IssuingDisputeMerchandiseNotAsDescribedEvidence`'s `return_status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { - MerchantRejected, - Successful, -} - -impl IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { - pub fn as_str(self) -> &'static str { - match self { - IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus::MerchantRejected => { - "merchant_rejected" - } - IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus::Successful => "successful", - } - } -} - -impl AsRef for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { - fn default() -> Self { - Self::MerchantRejected - } -} - -/// An enum representing the possible values of an `IssuingDisputeNotReceivedEvidence`'s `product_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingDisputeNotReceivedEvidenceProductType { - Merchandise, - Service, -} - -impl IssuingDisputeNotReceivedEvidenceProductType { - pub fn as_str(self) -> &'static str { - match self { - IssuingDisputeNotReceivedEvidenceProductType::Merchandise => "merchandise", - IssuingDisputeNotReceivedEvidenceProductType::Service => "service", - } - } -} - -impl AsRef for IssuingDisputeNotReceivedEvidenceProductType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingDisputeNotReceivedEvidenceProductType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingDisputeNotReceivedEvidenceProductType { - fn default() -> Self { - Self::Merchandise - } -} - -/// An enum representing the possible values of an `IssuingDisputeOtherEvidence`'s `product_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingDisputeOtherEvidenceProductType { - Merchandise, - Service, -} - -impl IssuingDisputeOtherEvidenceProductType { - pub fn as_str(self) -> &'static str { - match self { - IssuingDisputeOtherEvidenceProductType::Merchandise => "merchandise", - IssuingDisputeOtherEvidenceProductType::Service => "service", - } - } -} - -impl AsRef for IssuingDisputeOtherEvidenceProductType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingDisputeOtherEvidenceProductType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingDisputeOtherEvidenceProductType { - fn default() -> Self { - Self::Merchandise - } -} diff --git a/src/resources/generated/issuing_transaction.rs b/src/resources/generated/issuing_transaction.rs deleted file mode 100644 index f4c947b6a..000000000 --- a/src/resources/generated/issuing_transaction.rs +++ /dev/null @@ -1,257 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::IssuingTransactionId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{ - BalanceTransaction, Currency, IssuingAuthorization, IssuingCard, IssuingCardholder, - IssuingDispute, IssuingTransactionType, MerchantData, -}; - -/// The resource representing a Stripe "IssuingTransaction". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransaction { - /// Unique identifier for the object. - pub id: IssuingTransactionId, - - /// The transaction amount, which will be reflected in your balance. - /// - /// This amount is in your currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: i64, - - /// Detailed breakdown of amount components. - /// - /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount_details: Option, - - /// The `Authorization` object that led to this transaction. - pub authorization: Option>, - - /// ID of the [balance transaction](https://stripe.com/docs/api/balance_transactions) associated with this transaction. - pub balance_transaction: Option>, - - /// The card used to make this transaction. - pub card: Expandable, - - /// The cardholder to whom this transaction belongs. - pub cardholder: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// If you've disputed the transaction, the ID of the dispute. - pub dispute: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The amount that the merchant will receive, denominated in `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - /// - /// It will be different from `amount` if the merchant is taking payment in a different currency. - pub merchant_amount: i64, - - /// The currency with which the merchant is taking payment. - pub merchant_currency: Currency, - - pub merchant_data: MerchantData, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// Additional purchase information that is optionally provided by the merchant. - pub purchase_details: Option, - - /// [Treasury](https://stripe.com/docs/api/treasury) details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub treasury: Option, - - /// The nature of the transaction. - #[serde(rename = "type")] - pub type_: IssuingTransactionType, - - /// The digital wallet used for this transaction. - /// - /// One of `apple_pay`, `google_pay`, or `samsung_pay`. - pub wallet: Option, -} - -impl Object for IssuingTransaction { - type Id = IssuingTransactionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.transaction" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionAmountDetails { - /// The fee charged by the ATM for the cash withdrawal. - pub atm_fee: Option, - - /// The amount of cash requested by the cardholder. - pub cashback_amount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionPurchaseDetails { - /// Information about the flight that was purchased with this transaction. - pub flight: Option, - - /// Information about fuel that was purchased with this transaction. - pub fuel: Option, - - /// Information about lodging that was purchased with this transaction. - pub lodging: Option, - - /// The line items in the purchase. - pub receipt: Option>, - - /// A merchant-specific order number. - pub reference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionFlightData { - /// The time that the flight departed. - pub departure_at: Option, - - /// The name of the passenger. - pub passenger_name: Option, - - /// Whether the ticket is refundable. - pub refundable: Option, - - /// The legs of the trip. - pub segments: Option>, - - /// The travel agency that issued the ticket. - pub travel_agency: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionFlightDataLeg { - /// The three-letter IATA airport code of the flight's destination. - pub arrival_airport_code: Option, - - /// The airline carrier code. - pub carrier: Option, - - /// The three-letter IATA airport code that the flight departed from. - pub departure_airport_code: Option, - - /// The flight number. - pub flight_number: Option, - - /// The flight's service class. - pub service_class: Option, - - /// Whether a stopover is allowed on this flight. - pub stopover_allowed: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionFuelData { - /// The type of fuel that was purchased. - /// - /// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. - #[serde(rename = "type")] - pub type_: String, - - /// The units for `volume_decimal`. - /// - /// One of `us_gallon` or `liter`. - pub unit: String, - - /// The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. - pub unit_cost_decimal: String, - - /// The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. - pub volume_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionLodgingData { - /// The time of checking into the lodging. - pub check_in_at: Option, - - /// The number of nights stayed at the lodging. - pub nights: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionReceiptData { - /// The description of the item. - /// - /// The maximum length of this field is 26 characters. - pub description: Option, - - /// The quantity of the item. - pub quantity: Option, - - /// The total for this line item in cents. - pub total: Option, - - /// The unit cost of the item in cents. - pub unit_cost: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionTreasury { - /// The Treasury [ReceivedCredit](https://stripe.com/docs/api/treasury/received_credits) representing this Issuing transaction if it is a refund. - pub received_credit: Option, - - /// The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_debits) representing this Issuing transaction if it is a capture. - pub received_debit: Option, -} - -/// An enum representing the possible values of an `IssuingTransaction`'s `wallet` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingTransactionWallet { - ApplePay, - GooglePay, - SamsungPay, -} - -impl IssuingTransactionWallet { - pub fn as_str(self) -> &'static str { - match self { - IssuingTransactionWallet::ApplePay => "apple_pay", - IssuingTransactionWallet::GooglePay => "google_pay", - IssuingTransactionWallet::SamsungPay => "samsung_pay", - } - } -} - -impl AsRef for IssuingTransactionWallet { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingTransactionWallet { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingTransactionWallet { - fn default() -> Self { - Self::ApplePay - } -} diff --git a/src/resources/generated/item.rs b/src/resources/generated/item.rs deleted file mode 100644 index 5f012c684..000000000 --- a/src/resources/generated/item.rs +++ /dev/null @@ -1,151 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::CheckoutSessionItemId; -use crate::params::Object; -use crate::resources::{Currency, Discount, Price, TaxRate}; - -/// The resource representing a Stripe "LineItem". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutSessionItem { - /// Unique identifier for the object. - pub id: CheckoutSessionItemId, - - /// Total discount amount applied. - /// - /// If no discounts were applied, defaults to 0. - pub amount_discount: i64, - - /// Total before any discounts or taxes are applied. - pub amount_subtotal: i64, - - /// Total tax amount applied. - /// - /// If no tax was applied, defaults to 0. - pub amount_tax: i64, - - /// Total after discounts and taxes. - pub amount_total: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - /// Defaults to product name. - pub description: String, - - /// The discounts applied to the line item. - #[serde(skip_serializing_if = "Option::is_none")] - pub discounts: Option>, - - /// The price used to generate the line item. - pub price: Option, - - /// The quantity of products being purchased. - pub quantity: Option, - - /// The taxes applied to the line item. - #[serde(skip_serializing_if = "Option::is_none")] - pub taxes: Option>, -} - -impl Object for CheckoutSessionItem { - type Id = CheckoutSessionItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "item" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LineItemsDiscountAmount { - /// The amount discounted. - pub amount: i64, - - pub discount: Discount, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LineItemsTaxAmount { - /// Amount of tax applied for this rate. - pub amount: i64, - - pub rate: TaxRate, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: Option, - - /// The amount on which tax is calculated, in cents (or local equivalent). - pub taxable_amount: Option, -} - -/// An enum representing the possible values of an `LineItemsTaxAmount`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum LineItemsTaxAmountTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl LineItemsTaxAmountTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - LineItemsTaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - LineItemsTaxAmountTaxabilityReason::NotCollecting => "not_collecting", - LineItemsTaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - LineItemsTaxAmountTaxabilityReason::NotSupported => "not_supported", - LineItemsTaxAmountTaxabilityReason::PortionProductExempt => "portion_product_exempt", - LineItemsTaxAmountTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - LineItemsTaxAmountTaxabilityReason::PortionStandardRated => "portion_standard_rated", - LineItemsTaxAmountTaxabilityReason::ProductExempt => "product_exempt", - LineItemsTaxAmountTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - LineItemsTaxAmountTaxabilityReason::ProportionallyRated => "proportionally_rated", - LineItemsTaxAmountTaxabilityReason::ReducedRated => "reduced_rated", - LineItemsTaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", - LineItemsTaxAmountTaxabilityReason::StandardRated => "standard_rated", - LineItemsTaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - LineItemsTaxAmountTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for LineItemsTaxAmountTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for LineItemsTaxAmountTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for LineItemsTaxAmountTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} diff --git a/src/resources/generated/legal_entity_japan_address.rs b/src/resources/generated/legal_entity_japan_address.rs deleted file mode 100644 index 06250c23b..000000000 --- a/src/resources/generated/legal_entity_japan_address.rs +++ /dev/null @@ -1,31 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "LegalEntityJapanAddress". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Address { - - /// City/Ward. - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: Option, - - /// Block/Building number. - pub line1: Option, - - /// Building details. - pub line2: Option, - - /// ZIP or postal code. - pub postal_code: Option, - - /// Prefecture. - pub state: Option, - - /// Town/cho-me. - pub town: Option, -} diff --git a/src/resources/generated/line_item.rs b/src/resources/generated/line_item.rs deleted file mode 100644 index 3c54dab60..000000000 --- a/src/resources/generated/line_item.rs +++ /dev/null @@ -1,251 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::InvoiceLineItemId; -use crate::params::{Expandable, Metadata, Object}; -use crate::resources::{ - Currency, Discount, InvoiceItem, Period, Plan, Price, Subscription, SubscriptionItem, TaxRate, -}; - -/// The resource representing a Stripe "InvoiceLineItem". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceLineItem { - /// Unique identifier for the object. - pub id: InvoiceLineItemId, - - /// The amount, in cents (or local equivalent). - pub amount: i64, - - /// The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts. - pub amount_excluding_tax: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// The amount of discount calculated per discount for this line item. - pub discount_amounts: Option>, - - /// If true, discounts will apply to this line item. - /// - /// Always false for prorations. - pub discountable: bool, - - /// The discounts applied to the invoice line item. - /// - /// Line item discounts are applied before invoice discounts. - /// Use `expand[]=discounts` to expand each discount. - pub discounts: Option>>, - - /// The ID of the [invoice item](https://stripe.com/docs/api/invoiceitems) associated with this line item if any. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_item: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Note that for line items with `type=subscription` this will reflect the metadata of the subscription that caused the line item to be created. - pub metadata: Metadata, - - pub period: Option, - - /// The plan of the subscription, if the line item is a subscription or a proration. - pub plan: Option, - - /// The price of the line item. - pub price: Option, - - /// Whether this is a proration. - pub proration: bool, - - /// Additional details for proration line items. - pub proration_details: Option, - - /// The quantity of the subscription, if the line item is a subscription or a proration. - pub quantity: Option, - - /// The subscription that the invoice item pertains to, if any. - pub subscription: Option>, - - /// The subscription item that generated this line item. - /// - /// Left empty if the line item is not an explicit result of a subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_item: Option>, - - /// The amount of tax calculated per tax rate for this line item. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_amounts: Option>, - - /// The tax rates which apply to the line item. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, - - /// A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`. - #[serde(rename = "type")] - pub type_: InvoiceLineItemType, - - /// The amount in cents (or local equivalent) representing the unit amount for this line item, excluding all tax and discounts. - pub unit_amount_excluding_tax: Option, -} - -impl Object for InvoiceLineItem { - type Id = InvoiceLineItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "line_item" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DiscountsResourceDiscountAmount { - /// The amount, in cents (or local equivalent), of the discount. - pub amount: i64, - - /// The discount that was applied to get this discount amount. - pub discount: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxAmount { - /// The amount, in cents (or local equivalent), of the tax. - pub amount: i64, - - /// Whether this tax amount is inclusive or exclusive. - pub inclusive: bool, - - /// The tax rate that was applied to get this tax amount. - pub tax_rate: Expandable, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: Option, - - /// The amount on which tax is calculated, in cents (or local equivalent). - pub taxable_amount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesResourceLineItemsProrationDetails { - /// For a credit proration `line_item`, the original debit line_items to which the credit proration applies. - pub credited_items: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesResourceLineItemsCreditedItems { - /// Invoice containing the credited invoice line items. - pub invoice: String, - - /// Credited invoice line items. - pub invoice_line_items: Vec, -} - -/// An enum representing the possible values of an `InvoiceLineItem`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceLineItemType { - #[serde(rename = "invoiceitem")] - InvoiceItem, - Subscription, -} - -impl InvoiceLineItemType { - pub fn as_str(self) -> &'static str { - match self { - InvoiceLineItemType::InvoiceItem => "invoiceitem", - InvoiceLineItemType::Subscription => "subscription", - } - } -} - -impl AsRef for InvoiceLineItemType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceLineItemType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceLineItemType { - fn default() -> Self { - Self::InvoiceItem - } -} - -/// An enum representing the possible values of an `TaxAmount`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxAmountTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl TaxAmountTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - TaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - TaxAmountTaxabilityReason::NotCollecting => "not_collecting", - TaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - TaxAmountTaxabilityReason::NotSupported => "not_supported", - TaxAmountTaxabilityReason::PortionProductExempt => "portion_product_exempt", - TaxAmountTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - TaxAmountTaxabilityReason::PortionStandardRated => "portion_standard_rated", - TaxAmountTaxabilityReason::ProductExempt => "product_exempt", - TaxAmountTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - TaxAmountTaxabilityReason::ProportionallyRated => "proportionally_rated", - TaxAmountTaxabilityReason::ReducedRated => "reduced_rated", - TaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", - TaxAmountTaxabilityReason::StandardRated => "standard_rated", - TaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - TaxAmountTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for TaxAmountTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxAmountTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxAmountTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} diff --git a/src/resources/generated/linked_account_options_us_bank_account.rs b/src/resources/generated/linked_account_options_us_bank_account.rs deleted file mode 100644 index 1ed512a17..000000000 --- a/src/resources/generated/linked_account_options_us_bank_account.rs +++ /dev/null @@ -1,94 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "linked_account_options_us_bank_account". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LinkedAccountOptionsUsBankAccount { - /// The list of permissions to request. - /// - /// The `payment_method` permission must be included. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option>, - - /// Data features requested to be retrieved upon account creation. - pub prefetch: Option>, - - /// For webview integrations only. - /// - /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option, -} - -/// An enum representing the possible values of an `LinkedAccountOptionsUsBankAccount`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum LinkedAccountOptionsUsBankAccountPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl LinkedAccountOptionsUsBankAccountPermissions { - pub fn as_str(self) -> &'static str { - match self { - LinkedAccountOptionsUsBankAccountPermissions::Balances => "balances", - LinkedAccountOptionsUsBankAccountPermissions::Ownership => "ownership", - LinkedAccountOptionsUsBankAccountPermissions::PaymentMethod => "payment_method", - LinkedAccountOptionsUsBankAccountPermissions::Transactions => "transactions", - } - } -} - -impl AsRef for LinkedAccountOptionsUsBankAccountPermissions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for LinkedAccountOptionsUsBankAccountPermissions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for LinkedAccountOptionsUsBankAccountPermissions { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `LinkedAccountOptionsUsBankAccount`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum LinkedAccountOptionsUsBankAccountPrefetch { - Balances, -} - -impl LinkedAccountOptionsUsBankAccountPrefetch { - pub fn as_str(self) -> &'static str { - match self { - LinkedAccountOptionsUsBankAccountPrefetch::Balances => "balances", - } - } -} - -impl AsRef for LinkedAccountOptionsUsBankAccountPrefetch { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for LinkedAccountOptionsUsBankAccountPrefetch { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for LinkedAccountOptionsUsBankAccountPrefetch { - fn default() -> Self { - Self::Balances - } -} diff --git a/src/resources/generated/login_link.rs b/src/resources/generated/login_link.rs deleted file mode 100644 index 33817dc92..000000000 --- a/src/resources/generated/login_link.rs +++ /dev/null @@ -1,29 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::params::{Object, Timestamp}; - -/// The resource representing a Stripe "LoginLink". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LoginLink { - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The URL for the login link. - pub url: String, -} - -impl Object for LoginLink { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "login_link" - } -} diff --git a/src/resources/generated/mandate.rs b/src/resources/generated/mandate.rs deleted file mode 100644 index ffd5600e5..000000000 --- a/src/resources/generated/mandate.rs +++ /dev/null @@ -1,465 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::MandateId; -use crate::params::{Expand, Expandable, Object, Timestamp}; -use crate::resources::{Currency, PaymentMethod}; - -/// The resource representing a Stripe "Mandate". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Mandate { - /// Unique identifier for the object. - pub id: MandateId, - - pub customer_acceptance: CustomerAcceptance, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - #[serde(skip_serializing_if = "Option::is_none")] - pub multi_use: Option, - - /// The account (if any) for which the mandate is intended. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, - - /// ID of the payment method associated with this mandate. - pub payment_method: Expandable, - - pub payment_method_details: MandatePaymentMethodDetails, - - #[serde(skip_serializing_if = "Option::is_none")] - pub single_use: Option, - - /// The status of the mandate, which indicates whether it can be used to initiate a payment. - pub status: MandateStatus, - - /// The type of the mandate. - #[serde(rename = "type")] - pub type_: MandateType, -} - -impl Mandate { - /// Retrieves a Mandate object. - pub fn retrieve(client: &Client, id: &MandateId, expand: &[&str]) -> Response { - client.get_query(&format!("/mandates/{}", id), &Expand { expand }) - } -} - -impl Object for Mandate { - type Id = MandateId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "mandate" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerAcceptance { - /// The time at which the customer accepted the Mandate. - pub accepted_at: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub offline: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub online: Option, - - /// The type of customer acceptance information included with the Mandate. - /// - /// One of `online` or `offline`. - #[serde(rename = "type")] - pub type_: CustomerAcceptanceType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateMultiUse {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandatePaymentMethodDetails { - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// The type of the payment method associated with this mandate. - /// - /// An additional hash is included on `payment_method_details` with a name matching this value. - /// It contains mandate information specific to the payment method. - #[serde(rename = "type")] - pub type_: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CardMandatePaymentMethodDetails {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateAcssDebit { - /// List of Stripe products where this mandate can be selected automatically. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_for: Option>, - - /// Description of the interval. - /// - /// Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. - pub interval_description: Option, - - /// Payment schedule for the mandate. - pub payment_schedule: MandateAcssDebitPaymentSchedule, - - /// Transaction type of the mandate. - pub transaction_type: MandateAcssDebitTransactionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateAuBecsDebit { - /// The URL of the mandate. - /// - /// This URL generally contains sensitive information about the customer and should be shared with them exclusively. - pub url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateBacsDebit { - /// The status of the mandate on the Bacs network. - /// - /// Can be one of `pending`, `revoked`, `refused`, or `accepted`. - pub network_status: MandateBacsDebitNetworkStatus, - - /// The unique reference identifying the mandate on the Bacs network. - pub reference: String, - - /// The URL that will contain the mandate that the customer has signed. - pub url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateCashapp {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandatePaypal { - /// The PayPal Billing Agreement ID (BAID). - /// - /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer. - pub billing_agreement_id: Option, - - /// PayPal account PayerID. - /// - /// This identifier uniquely identifies the PayPal customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub payer_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateSepaDebit { - /// The unique reference of the mandate. - pub reference: String, - - /// The URL of the mandate. - /// - /// This URL generally contains sensitive information about the customer and should be shared with them exclusively. - pub url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateSingleUse { - /// On a single use mandate, the amount of the payment. - pub amount: i64, - - /// On a single use mandate, the currency of the payment. - pub currency: Currency, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateUsBankAccount {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OfflineAcceptance {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OnlineAcceptance { - /// The IP address from which the Mandate was accepted by the customer. - pub ip_address: Option, - - /// The user agent of the browser from which the Mandate was accepted by the customer. - pub user_agent: Option, -} - -/// An enum representing the possible values of an `CustomerAcceptance`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerAcceptanceType { - Offline, - Online, -} - -impl CustomerAcceptanceType { - pub fn as_str(self) -> &'static str { - match self { - CustomerAcceptanceType::Offline => "offline", - CustomerAcceptanceType::Online => "online", - } - } -} - -impl AsRef for CustomerAcceptanceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerAcceptanceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerAcceptanceType { - fn default() -> Self { - Self::Offline - } -} - -/// An enum representing the possible values of an `MandateAcssDebit`'s `default_for` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum MandateAcssDebitDefaultFor { - Invoice, - Subscription, -} - -impl MandateAcssDebitDefaultFor { - pub fn as_str(self) -> &'static str { - match self { - MandateAcssDebitDefaultFor::Invoice => "invoice", - MandateAcssDebitDefaultFor::Subscription => "subscription", - } - } -} - -impl AsRef for MandateAcssDebitDefaultFor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for MandateAcssDebitDefaultFor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for MandateAcssDebitDefaultFor { - fn default() -> Self { - Self::Invoice - } -} - -/// An enum representing the possible values of an `MandateAcssDebit`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum MandateAcssDebitPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl MandateAcssDebitPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - MandateAcssDebitPaymentSchedule::Combined => "combined", - MandateAcssDebitPaymentSchedule::Interval => "interval", - MandateAcssDebitPaymentSchedule::Sporadic => "sporadic", - } - } -} - -impl AsRef for MandateAcssDebitPaymentSchedule { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for MandateAcssDebitPaymentSchedule { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for MandateAcssDebitPaymentSchedule { - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `MandateAcssDebit`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum MandateAcssDebitTransactionType { - Business, - Personal, -} - -impl MandateAcssDebitTransactionType { - pub fn as_str(self) -> &'static str { - match self { - MandateAcssDebitTransactionType::Business => "business", - MandateAcssDebitTransactionType::Personal => "personal", - } - } -} - -impl AsRef for MandateAcssDebitTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for MandateAcssDebitTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for MandateAcssDebitTransactionType { - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `MandateBacsDebit`'s `network_status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum MandateBacsDebitNetworkStatus { - Accepted, - Pending, - Refused, - Revoked, -} - -impl MandateBacsDebitNetworkStatus { - pub fn as_str(self) -> &'static str { - match self { - MandateBacsDebitNetworkStatus::Accepted => "accepted", - MandateBacsDebitNetworkStatus::Pending => "pending", - MandateBacsDebitNetworkStatus::Refused => "refused", - MandateBacsDebitNetworkStatus::Revoked => "revoked", - } - } -} - -impl AsRef for MandateBacsDebitNetworkStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for MandateBacsDebitNetworkStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for MandateBacsDebitNetworkStatus { - fn default() -> Self { - Self::Accepted - } -} - -/// An enum representing the possible values of an `Mandate`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum MandateStatus { - Active, - Inactive, - Pending, -} - -impl MandateStatus { - pub fn as_str(self) -> &'static str { - match self { - MandateStatus::Active => "active", - MandateStatus::Inactive => "inactive", - MandateStatus::Pending => "pending", - } - } -} - -impl AsRef for MandateStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for MandateStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for MandateStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `Mandate`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum MandateType { - MultiUse, - SingleUse, -} - -impl MandateType { - pub fn as_str(self) -> &'static str { - match self { - MandateType::MultiUse => "multi_use", - MandateType::SingleUse => "single_use", - } - } -} - -impl AsRef for MandateType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for MandateType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for MandateType { - fn default() -> Self { - Self::MultiUse - } -} diff --git a/src/resources/generated/notification_event_data.rs b/src/resources/generated/notification_event_data.rs deleted file mode 100644 index 6bb13c4af..000000000 --- a/src/resources/generated/notification_event_data.rs +++ /dev/null @@ -1,21 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "NotificationEventData". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct NotificationEventData { - - /// Object containing the names of the updated attributes and their values prior to the event (only included in events of type `*.updated`). - /// - /// If an array attribute has any updated elements, this object contains the entire array. - /// In Stripe API versions 2017-04-06 or earlier, an updated array attribute in this object includes only the updated array elements. - #[serde(skip_serializing_if = "Option::is_none")] - pub previous_attributes: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct NotificationEventDataPreviousAttributes { -} diff --git a/src/resources/generated/payment_intent.rs b/src/resources/generated/payment_intent.rs deleted file mode 100644 index 4fa34dd30..000000000 --- a/src/resources/generated/payment_intent.rs +++ /dev/null @@ -1,12994 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ - CustomerId, MandateId, PaymentIntentId, PaymentMethodConfigurationId, PaymentMethodId, -}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{ - Account, ApiErrors, Application, Charge, Currency, Customer, Invoice, - LinkedAccountOptionsUsBankAccount, PaymentIntentNextActionCashappHandleRedirectOrDisplayQrCode, - PaymentIntentOffSession, PaymentMethod, - PaymentMethodConfigBizPaymentMethodConfigurationDetails, - PaymentMethodDetailsCardInstallmentsPlan, PaymentMethodOptionsCustomerBalanceEuBankAccount, - PaymentSource, Review, Shipping, -}; - -/// The resource representing a Stripe "PaymentIntent". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntent { - /// Unique identifier for the object. - pub id: PaymentIntentId, - - /// Amount intended to be collected by this PaymentIntent. - /// - /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - pub amount: i64, - - /// Amount that can be captured from this PaymentIntent. - pub amount_capturable: i64, - - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_details: Option, - - /// Amount that was collected by this PaymentIntent. - pub amount_received: i64, - - /// ID of the Connect application that created the PaymentIntent. - pub application: Option>, - - /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - /// - /// The amount of the application fee collected will be capped at the total payment amount. - /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - pub application_fee_amount: Option, - - /// Settings to configure compatible payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - pub automatic_payment_methods: Option, - - /// Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. - /// - /// Measured in seconds since the Unix epoch. - pub canceled_at: Option, - - /// Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`). - pub cancellation_reason: Option, - - /// Controls when the funds will be captured from the customer's account. - pub capture_method: PaymentIntentCaptureMethod, - - /// The client secret of this PaymentIntent. - /// - /// Used for client-side retrieval using a publishable key. - /// The client secret can be used to complete a payment from your frontend. - /// It should not be stored, logged, or exposed to anyone other than the customer. - /// Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs to [accept a payment](https://stripe.com/docs/payments/accept-a-payment?ui=elements) and learn about how `client_secret` should be handled. - pub client_secret: Option, - - pub confirmation_method: PaymentIntentConfirmationMethod, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// ID of the Customer this PaymentIntent belongs to, if one exists. - /// - /// Payment methods attached to other Customers cannot be used with this PaymentIntent. - /// - /// If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. - pub customer: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// ID of the invoice that created this PaymentIntent, if it exists. - pub invoice: Option>, - - /// The payment error encountered in the previous PaymentIntent confirmation. - /// - /// It will be cleared if the PaymentIntent is later updated for any reason. - pub last_payment_error: Option>, - - /// The latest charge created by this payment intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub latest_charge: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// For more information, see the [documentation](https://stripe.com/docs/payments/payment-intents/creating-payment-intents#storing-information-in-metadata). - pub metadata: Metadata, - - /// If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. - pub next_action: Option, - - /// The account (if any) for which the funds of the PaymentIntent are intended. - /// - /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. - pub on_behalf_of: Option>, - - /// ID of the payment method used in this PaymentIntent. - pub payment_method: Option>, - - /// Information about the payment method configuration used for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_configuration_details: - Option, - - /// Payment-method-specific configuration for this PaymentIntent. - pub payment_method_options: Option, - - /// The list of payment method types (e.g. - /// - /// card) that this PaymentIntent is allowed to use. - pub payment_method_types: Vec, - - /// If present, this property tells you about the processing state of the payment. - pub processing: Option, - - /// Email address that the receipt for the resulting payment will be sent to. - /// - /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). - pub receipt_email: Option, - - /// ID of the review associated with this PaymentIntent, if any. - pub review: Option>, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - pub setup_future_usage: Option, - - /// Shipping information for this PaymentIntent. - pub shipping: Option, - - /// This is a legacy field that will be removed in the future. - /// - /// It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. - pub source: Option>, - - /// For non-card charges, you can use this value as the complete description that appears on your customers’ statements. - /// - /// Must contain at least one letter, maximum 22 characters. - pub statement_descriptor: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters for the concatenated descriptor. - pub statement_descriptor_suffix: Option, - - /// Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. - /// - /// Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses). - pub status: PaymentIntentStatus, - - /// The data with which to automatically create a Transfer when the payment is finalized. - /// - /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. - pub transfer_data: Option, - - /// A string that identifies the resulting payment as part of a group. - /// - /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. - pub transfer_group: Option, -} - -impl PaymentIntent { - /// Returns a list of PaymentIntents. - pub fn list(client: &Client, params: &ListPaymentIntents<'_>) -> Response> { - client.get_query("/payment_intents", ¶ms) - } - - /// Creates a PaymentIntent object. - /// - /// After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm) - /// to continue the payment. - /// - /// You can read more about the different payment flows available via the Payment Intents API [here](https://stripe.com/docs/payments/payment-intents). When `confirm=true` is used during creation, it is equivalent to creating and confirming the PaymentIntent in the same call. - /// You may use any parameters available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when `confirm=true` is supplied. - pub fn create(client: &Client, params: CreatePaymentIntent<'_>) -> Response { - client.post_form("/payment_intents", ¶ms) - } - - /// Retrieves the details of a PaymentIntent that has previously been created. - /// - /// You can retrieve a PaymentIntent client-side using a publishable key when the `client_secret` is in the query string. - /// If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. - /// Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. - pub fn retrieve( - client: &Client, - id: &PaymentIntentId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/payment_intents/{}", id), &Expand { expand }) - } - - /// Updates properties on a PaymentIntent object without confirming. - /// - /// Depending on which properties you update, you might need to confirm the - /// PaymentIntent again. - /// - /// For example, updating the `payment_method` always requires you to confirm the PaymentIntent again. - /// If you prefer to update and confirm at the same time, we recommend updating properties through the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead. - pub fn update( - client: &Client, - id: &PaymentIntentId, - params: UpdatePaymentIntent<'_>, - ) -> Response { - client.post_form(&format!("/payment_intents/{}", id), ¶ms) - } -} - -impl Object for PaymentIntent { - type Id = PaymentIntentId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "payment_intent" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsAmountDetails { - #[serde(skip_serializing_if = "Option::is_none")] - pub tip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsAmountDetailsResourceTip { - /// Portion of the amount that corresponds to a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsAutomaticPaymentMethodsPaymentIntent { - /// Controls whether this PaymentIntent will accept redirect-based payment methods. - /// - /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. - /// - /// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub allow_redirects: Option, - - /// Automatically calculates compatible payment methods. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextAction { - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay_handle_redirect: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto_display_details: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card_await_notification: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp_handle_redirect_or_display_qr_code: - Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub display_bank_transfer_instructions: - Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini_display_details: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo_display_details: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow_display_qr_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pix_display_qr_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay_display_qr_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect_to_url: Option, - - /// Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. - #[serde(rename = "type")] - pub type_: String, - - /// When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. - /// - /// The shape of the contents is subject to change and is only intended to be used by Stripe.js. - #[serde(skip_serializing_if = "Option::is_none")] - pub use_stripe_sdk: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub verify_with_microdeposits: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay_display_qr_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay_redirect_to_android_app: - Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay_redirect_to_ios_app: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionAlipayHandleRedirect { - /// The native data to be used with Alipay SDK you must redirect your customer to in order to authenticate the payment in an Android App. - pub native_data: Option, - - /// The native URL you must redirect your customer to in order to authenticate the payment in an iOS App. - pub native_url: Option, - - /// If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. - pub return_url: Option, - - /// The URL you must redirect your customer to in order to authenticate the payment. - pub url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionBoleto { - /// The timestamp after which the boleto expires. - pub expires_at: Option, - - /// The URL to the hosted boleto voucher page, which allows customers to view the boleto voucher. - pub hosted_voucher_url: Option, - - /// The boleto number. - pub number: Option, - - /// The URL to the downloadable boleto voucher PDF. - pub pdf: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionCardAwaitNotification { - /// The time that payment will be attempted. - /// - /// If customer approval is required, they need to provide approval before this time. - pub charge_attempt_at: Option, - - /// For payments greater than INR 15000, the customer must provide explicit approval of the payment with their bank. - /// - /// For payments of lower amount, no customer action is required. - pub customer_approval_required: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionDisplayBankTransferInstructions { - /// The remaining amount that needs to be transferred to complete the payment. - pub amount_remaining: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Option, - - /// A list of financial addresses that can be used to fund the customer balance. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_addresses: Option>, - - /// A link to a hosted page that guides your customer through completing the transfer. - pub hosted_instructions_url: Option, - - /// A string identifying this payment. - /// - /// Instruct your customer to include this code in the reference or memo field of their bank transfer. - pub reference: Option, - - /// Type of bank transfer. - #[serde(rename = "type")] - pub type_: PaymentIntentNextActionDisplayBankTransferInstructionsType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferFinancialAddress { - #[serde(skip_serializing_if = "Option::is_none")] - pub iban: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sort_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub spei: Option, - - /// The payment networks supported by this FinancialAddress. - #[serde(skip_serializing_if = "Option::is_none")] - pub supported_networks: - Option>, - - /// The type of financial address. - #[serde(rename = "type")] - pub type_: FundingInstructionsBankTransferFinancialAddressType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub zengin: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferIbanRecord { - /// The name of the person or business that owns the bank account. - pub account_holder_name: String, - - /// The BIC/SWIFT code of the account. - pub bic: String, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: String, - - /// The IBAN of the account. - pub iban: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferSortCodeRecord { - /// The name of the person or business that owns the bank account. - pub account_holder_name: String, - - /// The account number. - pub account_number: String, - - /// The six-digit sort code. - pub sort_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferSpeiRecord { - /// The three-digit bank code. - pub bank_code: String, - - /// The short banking institution name. - pub bank_name: String, - - /// The CLABE number. - pub clabe: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferZenginRecord { - /// The account holder name. - pub account_holder_name: Option, - - /// The account number. - pub account_number: Option, - - /// The bank account type. - /// - /// In Japan, this can only be `futsu` or `toza`. - pub account_type: Option, - - /// The bank code of the account. - pub bank_code: Option, - - /// The bank name of the account. - pub bank_name: Option, - - /// The branch code of the account. - pub branch_code: Option, - - /// The branch name of the account. - pub branch_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionDisplayOxxoDetails { - /// The timestamp after which the OXXO voucher expires. - pub expires_after: Option, - - /// The URL for the hosted OXXO voucher page, which allows customers to view and print an OXXO voucher. - pub hosted_voucher_url: Option, - - /// OXXO reference number. - pub number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionKonbini { - /// The timestamp at which the pending Konbini payment expires. - pub expires_at: Timestamp, - - /// The URL for the Konbini payment instructions page, which allows customers to view and print a Konbini voucher. - pub hosted_voucher_url: Option, - - pub stores: PaymentIntentNextActionKonbiniStores, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionKonbiniStores { - /// FamilyMart instruction details. - pub familymart: Option, - - /// Lawson instruction details. - pub lawson: Option, - - /// Ministop instruction details. - pub ministop: Option, - - /// Seicomart instruction details. - pub seicomart: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionKonbiniFamilymart { - /// The confirmation number. - #[serde(skip_serializing_if = "Option::is_none")] - pub confirmation_number: Option, - - /// The payment code. - pub payment_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionKonbiniLawson { - /// The confirmation number. - #[serde(skip_serializing_if = "Option::is_none")] - pub confirmation_number: Option, - - /// The payment code. - pub payment_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionKonbiniMinistop { - /// The confirmation number. - #[serde(skip_serializing_if = "Option::is_none")] - pub confirmation_number: Option, - - /// The payment code. - pub payment_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionKonbiniSeicomart { - /// The confirmation number. - #[serde(skip_serializing_if = "Option::is_none")] - pub confirmation_number: Option, - - /// The payment code. - pub payment_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionPaynowDisplayQrCode { - /// The raw data string used to generate QR code, it should be used together with QR code library. - pub data: String, - - /// The URL to the hosted PayNow instructions page, which allows customers to view the PayNow QR code. - pub hosted_instructions_url: Option, - - /// The image_url_png string used to render QR code. - pub image_url_png: String, - - /// The image_url_svg string used to render QR code. - pub image_url_svg: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionPixDisplayQrCode { - /// The raw data string used to generate QR code, it should be used together with QR code library. - #[serde(skip_serializing_if = "Option::is_none")] - pub data: Option, - - /// The date (unix timestamp) when the PIX expires. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option, - - /// The URL to the hosted pix instructions page, which allows customers to view the pix QR code. - #[serde(skip_serializing_if = "Option::is_none")] - pub hosted_instructions_url: Option, - - /// The image_url_png string used to render png QR code. - #[serde(skip_serializing_if = "Option::is_none")] - pub image_url_png: Option, - - /// The image_url_svg string used to render svg QR code. - #[serde(skip_serializing_if = "Option::is_none")] - pub image_url_svg: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionPromptpayDisplayQrCode { - /// The raw data string used to generate QR code, it should be used together with QR code library. - pub data: String, - - /// The URL to the hosted PromptPay instructions page, which allows customers to view the PromptPay QR code. - pub hosted_instructions_url: String, - - /// The PNG path used to render the QR code, can be used as the source in an HTML img tag. - pub image_url_png: String, - - /// The SVG path used to render the QR code, can be used as the source in an HTML img tag. - pub image_url_svg: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionRedirectToUrl { - /// If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. - pub return_url: Option, - - /// The URL you must redirect your customer to in order to authenticate the payment. - pub url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionVerifyWithMicrodeposits { - /// The timestamp when the microdeposits are expected to land. - pub arrival_date: Timestamp, - - /// The URL for the hosted verification page, which allows customers to verify their bank account. - pub hosted_verification_url: String, - - /// The type of the microdeposit sent to the customer. - /// - /// Used to distinguish between different verification methods. - pub microdeposit_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionWechatPayDisplayQrCode { - /// The data being used to generate QR code. - pub data: String, - - /// The URL to the hosted WeChat Pay instructions page, which allows customers to view the WeChat Pay QR code. - pub hosted_instructions_url: String, - - /// The base64 image data for a pre-generated QR code. - pub image_data_url: String, - - /// The image_url_png string used to render QR code. - pub image_url_png: String, - - /// The image_url_svg string used to render QR code. - pub image_url_svg: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionWechatPayRedirectToAndroidApp { - /// app_id is the APP ID registered on WeChat open platform. - pub app_id: String, - - /// nonce_str is a random string. - pub nonce_str: String, - - /// package is static value. - pub package: String, - - /// an unique merchant ID assigned by WeChat Pay. - pub partner_id: String, - - /// an unique trading ID assigned by WeChat Pay. - pub prepay_id: String, - - /// A signature. - pub sign: String, - - /// Specifies the current time in epoch format. - pub timestamp: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionWechatPayRedirectToIosApp { - /// An universal link that redirect to WeChat Pay app. - pub native_url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptions { - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card_present: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsAcssDebit { - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsAuBecsDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsBlik {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsCard { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Installment details for this payment (Mexico only). - /// - /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). - pub installments: Option, - - /// Configuration options for setting up an eMandate for cards issued in India. - pub mandate_options: Option, - - /// Selected network to process this payment intent on. - /// - /// Depends on the available networks of the card attached to the payment intent. - /// Can be only set confirm-time. - pub network: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Permitted values include: `automatic` or `any`. - /// If not provided, defaults to `automatic`. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - pub request_three_d_secure: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kana: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 17 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kanji: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsEps { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsLink { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// [Deprecated] This is a legacy parameter that no longer has any function. - pub persistent_token: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit { - /// A URL for custom mandate text. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_mandate_url: Option, - - /// Description of the interval. - /// - /// Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. - pub interval_description: Option, - - /// Payment schedule for the mandate. - pub payment_schedule: - Option, - - /// Transaction type of the mandate. - pub transaction_type: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsSepaDebit { - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsMandateOptionsSepaDebit {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsUsBankAccount { - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: Option, - - /// Preferred transaction settlement speed. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_settlement_speed: - Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentProcessing { - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// Type of the payment method for which payment is in `processing` state, one of `card`. - #[serde(rename = "type")] - pub type_: PaymentIntentProcessingType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentCardProcessing { - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_notification: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentProcessingCustomerNotification { - /// Whether customer approval has been requested for this payment. - /// - /// For payments greater than INR 15000 or mandate amount, the customer must provide explicit approval of the payment with their bank. - pub approval_requested: Option, - - /// If customer approval is required, they need to provide approval before this time. - pub completes_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsAffirm { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Preferred language of the Affirm authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locale: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsAfterpayClearpay { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Order identifier shown to the customer in Afterpay’s online portal. - /// - /// We recommend using a value that helps you answer any questions a customer might have about the payment. - /// The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. - pub reference: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsAlipay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsBacsDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsBancontact { - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - pub preferred_language: PaymentMethodOptionsBancontactPreferredLanguage, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsBoleto { - /// The number of calendar days before a Boleto voucher expires. - /// - /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time. - pub expires_after_days: u32, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsCardInstallments { - /// Installment plans that may be selected for this PaymentIntent. - pub available_plans: Option>, - - /// Whether Installments are enabled for this PaymentIntent. - pub enabled: bool, - - /// Installment plan selected for this PaymentIntent. - pub plan: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsCardMandateOptions { - /// Amount to be charged for future payments. - pub amount: i64, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - pub amount_type: PaymentMethodOptionsCardMandateOptionsAmountType, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - pub description: Option, - - /// End date of the mandate or subscription. - /// - /// If not provided, the mandate will be active until canceled. - /// If provided, end date should be after start date. - pub end_date: Option, - - /// Specifies payment frequency. - /// - /// One of `day`, `week`, `month`, `year`, or `sporadic`. - pub interval: PaymentMethodOptionsCardMandateOptionsInterval, - - /// The number of intervals between payments. - /// - /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - /// This parameter is optional when `interval=sporadic`. - pub interval_count: Option, - - /// Unique identifier for the mandate or subscription. - pub reference: String, - - /// Start date of the mandate or subscription. - /// - /// Start date should not be lesser than yesterday. - pub start_date: Timestamp, - - /// Specifies the type of mandates supported. - /// - /// Possible values are `india`. - pub supported_types: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsCardPresent { - /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity). - pub request_extended_authorization: Option, - - /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. - /// - /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. - pub request_incremental_authorization_support: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsCashapp { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsCustomerBalance { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - pub funding_type: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsCustomerBalanceBankTransfer { - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: Option, - - /// List of address types that should be returned in the financial_addresses response. - /// - /// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested_address_types: - Option>, - - /// The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsFpx { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsGiropay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsGrabpay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsIdeal { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsInteracPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsKlarna { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Preferred locale of the Klarna checkout page that the customer is redirected to. - pub preferred_locale: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsKonbini { - /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. - pub confirmation_number: Option, - - /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. - /// - /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. - pub expires_after_days: Option, - - /// The timestamp at which the Konbini payment instructions will expire. - /// - /// Only one of `expires_after_days` or `expires_at` may be set. - pub expires_at: Option, - - /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store. - pub product_description: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsOxxo { - /// The number of calendar days before an OXXO invoice expires. - /// - /// For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - pub expires_after_days: u32, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsP24 { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsPaynow { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsPaypal { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Preferred locale of the PayPal checkout page that the customer is redirected to. - pub preferred_locale: Option, - - /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. - /// - /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsPix { - /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. - pub expires_after_seconds: Option, - - /// The timestamp at which the Pix expires. - pub expires_at: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsPromptpay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsSofort { - /// Preferred language of the SOFORT authorization page that the customer is redirected to. - pub preferred_language: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsWechatPay { - /// The app ID registered with WeChat Pay. - /// - /// Only required when client is ios or android. - pub app_id: Option, - - /// The client type that the end customer will pay from. - pub client: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsZip { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransferData { - /// Amount intended to be collected by this PaymentIntent. - /// - /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// The account (if any) the payment will be attributed to for tax - /// reporting, and where funds from the payment will be transferred to upon - /// payment success. - pub destination: Expandable, -} - -/// The parameters for `PaymentIntent::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreatePaymentIntent<'a> { - /// Amount intended to be collected by this PaymentIntent. - /// - /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - pub amount: i64, - - /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - /// - /// The amount of the application fee collected will be capped at the total payment amount. - /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, - - /// When enabled, this PaymentIntent will accept payment methods that you have enabled in the Dashboard and are compatible with this PaymentIntent's other parameters. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_payment_methods: Option, - - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Set to `true` to attempt to [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent immediately. - /// - /// This parameter defaults to `false`. - /// When creating and confirming a PaymentIntent at the same time, parameters available in the [confirm](https://stripe.com/docs/api/payment_intents/confirm) API may also be provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub confirm: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub confirmation_method: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// ID of the Customer this PaymentIntent belongs to, if one exists. - /// - /// Payment methods attached to other Customers cannot be used with this PaymentIntent. - /// - /// If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. - /// - /// This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). - /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). - #[serde(skip_serializing_if = "Option::is_none")] - pub error_on_requires_action: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// ID of the mandate to be used for this payment. - /// - /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate: Option, - - /// This hash contains details about the Mandate to create. - /// - /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_data: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Set to `true` to indicate that the customer is not in your checkout flow during this payment attempt, and therefore is unable to authenticate. - /// - /// This parameter is intended for scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). - /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). - #[serde(skip_serializing_if = "Option::is_none")] - pub off_session: Option, - - /// The Stripe account ID for which these funds are intended. - /// - /// For details, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option<&'a str>, - - /// ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent. - /// - /// If neither the `payment_method` parameter nor the `source` parameter are provided with `confirm=true`, `source` will be automatically populated with `customer.default_source` to improve the migration experience for users of the Charges API. - /// - /// We recommend that you explicitly provide the `payment_method` going forward. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - /// The ID of the payment method configuration to use with this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_configuration: Option, - - /// If provided, this hash will be used to create a PaymentMethod. - /// - /// The new PaymentMethod will appear in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) property on the PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_data: Option, - - /// Payment-method-specific configuration for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_options: Option, - - /// The list of payment method types (e.g. - /// - /// card) that this PaymentIntent is allowed to use. - /// If this is not provided, defaults to ["card"]. - /// Use automatic_payment_methods to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, - - /// Options to configure Radar. - /// - /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - /// Email address that the receipt for the resulting payment will be sent to. - /// - /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_email: Option<&'a str>, - - /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. - /// - /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. - /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option<&'a str>, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Shipping information for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - - /// For non-card charges, you can use this value as the complete description that appears on your customers’ statements. - /// - /// Must contain at least one letter, maximum 22 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option<&'a str>, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters for the concatenated descriptor. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix: Option<&'a str>, - - /// The parameters used to automatically create a Transfer when the payment succeeds. - /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// A string that identifies the resulting payment as part of a group. - /// - /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option<&'a str>, - - /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. - #[serde(skip_serializing_if = "Option::is_none")] - pub use_stripe_sdk: Option, -} - -impl<'a> CreatePaymentIntent<'a> { - pub fn new(amount: i64, currency: Currency) -> Self { - CreatePaymentIntent { - amount, - application_fee_amount: Default::default(), - automatic_payment_methods: Default::default(), - capture_method: Default::default(), - confirm: Default::default(), - confirmation_method: Default::default(), - currency, - customer: Default::default(), - description: Default::default(), - error_on_requires_action: Default::default(), - expand: Default::default(), - mandate: Default::default(), - mandate_data: Default::default(), - metadata: Default::default(), - off_session: Default::default(), - on_behalf_of: Default::default(), - payment_method: Default::default(), - payment_method_configuration: Default::default(), - payment_method_data: Default::default(), - payment_method_options: Default::default(), - payment_method_types: Default::default(), - radar_options: Default::default(), - receipt_email: Default::default(), - return_url: Default::default(), - setup_future_usage: Default::default(), - shipping: Default::default(), - statement_descriptor: Default::default(), - statement_descriptor_suffix: Default::default(), - transfer_data: Default::default(), - transfer_group: Default::default(), - use_stripe_sdk: Default::default(), - } - } -} - -/// The parameters for `PaymentIntent::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPaymentIntents<'a> { - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return PaymentIntents for the customer specified by this customer ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListPaymentIntents<'a> { - pub fn new() -> Self { - ListPaymentIntents { - created: Default::default(), - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListPaymentIntents<'_> { - type O = PaymentIntent; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `PaymentIntent::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePaymentIntent<'a> { - /// Amount intended to be collected by this PaymentIntent. - /// - /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - /// - /// The amount of the application fee collected will be capped at the total payment amount. - /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, - - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// ID of the Customer this PaymentIntent belongs to, if one exists. - /// - /// Payment methods attached to other Customers cannot be used with this PaymentIntent. - /// - /// If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - /// The ID of the payment method configuration to use with this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_configuration: Option, - - /// If provided, this hash will be used to create a PaymentMethod. - /// - /// The new PaymentMethod will appear in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) property on the PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_data: Option, - - /// Payment-method-specific configuration for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_options: Option, - - /// The list of payment method types (for example, card) that this PaymentIntent can use. - /// - /// Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, - - /// Email address that the receipt for the resulting payment will be sent to. - /// - /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_email: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Shipping information for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - - /// For non-card charges, you can use this value as the complete description that appears on your customers’ statements. - /// - /// Must contain at least one letter, maximum 22 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option<&'a str>, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters for the concatenated descriptor. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix: Option<&'a str>, - - /// Use this parameter to automatically create a Transfer when the payment succeeds. - /// - /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// A string that identifies the resulting payment as part of a group. - /// - /// You can only provide `transfer_group` if it hasn't been set. - /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option<&'a str>, -} - -impl<'a> UpdatePaymentIntent<'a> { - pub fn new() -> Self { - UpdatePaymentIntent { - amount: Default::default(), - application_fee_amount: Default::default(), - capture_method: Default::default(), - currency: Default::default(), - customer: Default::default(), - description: Default::default(), - expand: Default::default(), - metadata: Default::default(), - payment_method: Default::default(), - payment_method_configuration: Default::default(), - payment_method_data: Default::default(), - payment_method_options: Default::default(), - payment_method_types: Default::default(), - receipt_email: Default::default(), - setup_future_usage: Default::default(), - shipping: Default::default(), - statement_descriptor: Default::default(), - statement_descriptor_suffix: Default::default(), - transfer_data: Default::default(), - transfer_group: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentAutomaticPaymentMethods { - /// Controls whether this PaymentIntent will accept redirect-based payment methods. - /// - /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. - /// - /// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub allow_redirects: Option, - - /// Whether this feature is enabled. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentMandateData { - /// This hash contains details about the customer acceptance of the Mandate. - pub customer_acceptance: CreatePaymentIntentMandateDataCustomerAcceptance, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodData { - /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_details: Option, - - /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// Options to configure Radar. - /// - /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// The type of the PaymentMethod. - /// - /// An additional hash is included on the PaymentMethod with a name matching this value. - /// It contains additional information specific to the PaymentMethod type. - #[serde(rename = "type")] - pub type_: CreatePaymentIntentPaymentMethodDataType, - - /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptions { - /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// Configuration for any card payments attempted on this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_present: Option, - - /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentRadarOptions { - /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub session: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentShipping { - /// Shipping address. - pub address: CreatePaymentIntentShippingAddress, - - /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - #[serde(skip_serializing_if = "Option::is_none")] - pub carrier: Option, - - /// Recipient name. - pub name: String, - - /// Recipient phone (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// The tracking number for a physical product, obtained from the delivery service. - /// - /// If multiple tracking numbers were generated for this purchase, please separate them with commas. - #[serde(skip_serializing_if = "Option::is_none")] - pub tracking_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentTransferData { - /// The amount that will be transferred automatically when a charge succeeds. - /// The amount is capped at the total transaction amount and if no amount is set, - /// the full amount is transferred. - /// - /// If you intend to collect a fee and you need a more robust reporting experience, using - /// [application_fee_amount](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-application_fee_amount) - /// might be a better fit for your integration. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// If specified, successful charges will be attributed to the destination - /// account for tax reporting, and the funds from charges will be transferred - /// to the destination account. - /// - /// The ID of the resulting transfer will be returned on the successful charge's `transfer` field. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodData { - /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_details: Option, - - /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// Options to configure Radar. - /// - /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// The type of the PaymentMethod. - /// - /// An additional hash is included on the PaymentMethod with a name matching this value. - /// It contains additional information specific to the PaymentMethod type. - #[serde(rename = "type")] - pub type_: UpdatePaymentIntentPaymentMethodDataType, - - /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptions { - /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// Configuration for any card payments attempted on this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_present: Option, - - /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentShipping { - /// Shipping address. - pub address: UpdatePaymentIntentShippingAddress, - - /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - #[serde(skip_serializing_if = "Option::is_none")] - pub carrier: Option, - - /// Recipient name. - pub name: String, - - /// Recipient phone (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// The tracking number for a physical product, obtained from the delivery service. - /// - /// If multiple tracking numbers were generated for this purchase, please separate them with commas. - #[serde(skip_serializing_if = "Option::is_none")] - pub tracking_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentTransferData { - /// The amount that will be transferred automatically when a charge succeeds. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentMandateDataCustomerAcceptance { - /// The time at which the customer accepted the Mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub accepted_at: Option, - - /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance. - #[serde(skip_serializing_if = "Option::is_none")] - pub offline: Option, - - /// If this is a Mandate accepted online, this hash contains details about the online acceptance. - #[serde(skip_serializing_if = "Option::is_none")] - pub online: Option, - - /// The type of customer acceptance information included with the Mandate. - /// - /// One of `online` or `offline`. - #[serde(rename = "type")] - pub type_: CreatePaymentIntentMandateDataCustomerAcceptanceType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataAcssDebit { - /// Customer's bank account number. - pub account_number: String, - - /// Institution number of the customer's bank. - pub institution_number: String, - - /// Transit number of the customer's bank. - pub transit_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataAffirm {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataAfterpayClearpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataAlipay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataAuBecsDebit { - /// The account number for the bank account. - pub account_number: String, - - /// Bank-State-Branch number of the bank account. - pub bsb_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataBacsDebit { - /// Account number of the bank account that the funds will be debited from. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Sort code of the bank account. - /// - /// (e.g., `10-20-30`). - #[serde(skip_serializing_if = "Option::is_none")] - pub sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataBancontact {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataBillingDetails { - /// Billing address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option, - - /// Email address. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// Full name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Billing phone number (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataBlik {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataBoleto { - /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers). - pub tax_id: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataCashapp {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataCustomerBalance {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataEps { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataFpx { - /// Account holder type for FPX transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: Option, - - /// The customer's bank. - pub bank: CreatePaymentIntentPaymentMethodDataFpxBank, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataGiropay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataGrabpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataIdeal { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataInteracPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataKlarna { - /// Customer's date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub dob: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataOxxo {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataP24 { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataPaynow {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataPaypal {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataPix {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataPromptpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataRadarOptions { - /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub session: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataSepaDebit { - /// IBAN of the bank account. - pub iban: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataSofort { - /// Two-letter ISO code representing the country the bank account is located in. - pub country: CreatePaymentIntentPaymentMethodDataSofortCountry, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataUsBankAccount { - /// Account holder type: individual or company. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: - Option, - - /// Account number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_type: Option, - - /// The ID of a Financial Connections Account to use as a payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections_account: Option, - - /// Routing number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataWechatPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataZip {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsAffirm { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Preferred language of the Affirm authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locale: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: - Option, - - /// Order identifier shown to the customer in Afterpay’s online portal. - /// - /// We recommend using a value that helps you answer any questions a customer might have about the payment. - /// The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsAlipay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsAuBecsDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsBacsDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsBancontact { - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: - Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsBlik { - /// The 6-digit BLIK code that a customer has generated using their banking application. - /// - /// Can only be set on confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsBoleto { - /// The number of calendar days before a Boleto voucher expires. - /// - /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCard { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// A single-use `cvc_update` Token that represents a card CVC value. - /// - /// When provided, the CVC value will be verified during the card payment attempt. - /// This parameter can only be provided during confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc_token: Option, - - /// Installment configuration for payments attempted on this PaymentIntent (Mexico Only). - /// - /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). - #[serde(skip_serializing_if = "Option::is_none")] - pub installments: Option, - - /// Configuration options for setting up an eMandate for cards issued in India. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// When specified, this parameter indicates that a transaction will be marked - /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. - /// - /// This parameter can only be provided during confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub moto: Option, - - /// Selected network to process this PaymentIntent on. - /// - /// Depends on the available networks of the card attached to the PaymentIntent. - /// Can be only set confirm-time. - #[serde(skip_serializing_if = "Option::is_none")] - pub network: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Permitted values include: `automatic` or `any`. - /// If not provided, defaults to `automatic`. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_three_d_secure: - Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kana: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 17 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kanji: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCardPresent { - /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity). - #[serde(skip_serializing_if = "Option::is_none")] - pub request_extended_authorization: Option, - - /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. - /// - /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_incremental_authorization_support: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCashapp { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalance { - /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub funding_type: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsEps { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsFpx { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsGiropay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsGrabpay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsIdeal { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsInteracPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsKlarna { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Preferred language of the Klarna authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locale: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsKonbini { - /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. - /// - /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. - /// We recommend to use the customer's phone number. - #[serde(skip_serializing_if = "Option::is_none")] - pub confirmation_number: Option, - - /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. - /// - /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. - /// Defaults to 3 days. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// The timestamp at which the Konbini payment instructions will expire. - /// - /// Only one of `expires_after_days` or `expires_at` may be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option, - - /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store. - #[serde(skip_serializing_if = "Option::is_none")] - pub product_description: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsLink { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// [Deprecated] This is a legacy parameter that no longer has any function. - #[serde(skip_serializing_if = "Option::is_none")] - pub persistent_token: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsOxxo { - /// The number of calendar days before an OXXO voucher expires. - /// - /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsP24 { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Confirm that the payer has accepted the P24 terms and conditions. - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_shown_and_accepted: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsPaynow { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsPaypal { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locale: Option, - - /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. - /// - /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// The risk correlation ID for an on-session payment using a saved PayPal payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub risk_correlation_id: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsPix { - /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. - /// - /// Defaults to 86400 seconds. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_seconds: Option, - - /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). - /// - /// Defaults to 1 day in the future. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsPromptpay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsSepaDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsSofort { - /// Language shown to the payer on redirect. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccount { - /// Additional fields for Financial Connections Session creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: - Option, - - /// Additional fields for network related functions. - #[serde(skip_serializing_if = "Option::is_none")] - pub networks: Option, - - /// Preferred transaction settlement speed. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_settlement_speed: - Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsWechatPay { - /// The app ID registered with WeChat Pay. - /// - /// Only required when client is ios or android. - #[serde(skip_serializing_if = "Option::is_none")] - pub app_id: Option, - - /// The client type that the end customer will pay from. - pub client: CreatePaymentIntentPaymentMethodOptionsWechatPayClient, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsZip { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentShippingAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataAcssDebit { - /// Customer's bank account number. - pub account_number: String, - - /// Institution number of the customer's bank. - pub institution_number: String, - - /// Transit number of the customer's bank. - pub transit_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataAffirm {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataAfterpayClearpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataAlipay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataAuBecsDebit { - /// The account number for the bank account. - pub account_number: String, - - /// Bank-State-Branch number of the bank account. - pub bsb_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataBacsDebit { - /// Account number of the bank account that the funds will be debited from. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Sort code of the bank account. - /// - /// (e.g., `10-20-30`). - #[serde(skip_serializing_if = "Option::is_none")] - pub sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataBancontact {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataBillingDetails { - /// Billing address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option, - - /// Email address. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// Full name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Billing phone number (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataBlik {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataBoleto { - /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers). - pub tax_id: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataCashapp {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataCustomerBalance {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataEps { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataFpx { - /// Account holder type for FPX transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: Option, - - /// The customer's bank. - pub bank: UpdatePaymentIntentPaymentMethodDataFpxBank, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataGiropay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataGrabpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataIdeal { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataInteracPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataKlarna { - /// Customer's date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub dob: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataOxxo {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataP24 { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataPaynow {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataPaypal {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataPix {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataPromptpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataRadarOptions { - /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub session: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataSepaDebit { - /// IBAN of the bank account. - pub iban: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataSofort { - /// Two-letter ISO code representing the country the bank account is located in. - pub country: UpdatePaymentIntentPaymentMethodDataSofortCountry, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataUsBankAccount { - /// Account holder type: individual or company. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: - Option, - - /// Account number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_type: Option, - - /// The ID of a Financial Connections Account to use as a payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections_account: Option, - - /// Routing number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataWechatPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataZip {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsAffirm { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Preferred language of the Affirm authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locale: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: - Option, - - /// Order identifier shown to the customer in Afterpay’s online portal. - /// - /// We recommend using a value that helps you answer any questions a customer might have about the payment. - /// The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsAlipay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsBacsDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsBancontact { - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: - Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsBlik { - /// The 6-digit BLIK code that a customer has generated using their banking application. - /// - /// Can only be set on confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsBoleto { - /// The number of calendar days before a Boleto voucher expires. - /// - /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCard { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// A single-use `cvc_update` Token that represents a card CVC value. - /// - /// When provided, the CVC value will be verified during the card payment attempt. - /// This parameter can only be provided during confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc_token: Option, - - /// Installment configuration for payments attempted on this PaymentIntent (Mexico Only). - /// - /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). - #[serde(skip_serializing_if = "Option::is_none")] - pub installments: Option, - - /// Configuration options for setting up an eMandate for cards issued in India. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// When specified, this parameter indicates that a transaction will be marked - /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. - /// - /// This parameter can only be provided during confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub moto: Option, - - /// Selected network to process this PaymentIntent on. - /// - /// Depends on the available networks of the card attached to the PaymentIntent. - /// Can be only set confirm-time. - #[serde(skip_serializing_if = "Option::is_none")] - pub network: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Permitted values include: `automatic` or `any`. - /// If not provided, defaults to `automatic`. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_three_d_secure: - Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kana: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 17 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kanji: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCardPresent { - /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity). - #[serde(skip_serializing_if = "Option::is_none")] - pub request_extended_authorization: Option, - - /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. - /// - /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_incremental_authorization_support: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCashapp { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalance { - /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub funding_type: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsEps { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsFpx { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsGiropay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsGrabpay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsIdeal { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsInteracPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsKlarna { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Preferred language of the Klarna authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locale: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsKonbini { - /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. - /// - /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. - /// We recommend to use the customer's phone number. - #[serde(skip_serializing_if = "Option::is_none")] - pub confirmation_number: Option, - - /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. - /// - /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. - /// Defaults to 3 days. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// The timestamp at which the Konbini payment instructions will expire. - /// - /// Only one of `expires_after_days` or `expires_at` may be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option, - - /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store. - #[serde(skip_serializing_if = "Option::is_none")] - pub product_description: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsLink { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// [Deprecated] This is a legacy parameter that no longer has any function. - #[serde(skip_serializing_if = "Option::is_none")] - pub persistent_token: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsOxxo { - /// The number of calendar days before an OXXO voucher expires. - /// - /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsP24 { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Confirm that the payer has accepted the P24 terms and conditions. - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_shown_and_accepted: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsPaynow { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsPaypal { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locale: Option, - - /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. - /// - /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// The risk correlation ID for an on-session payment using a saved PayPal payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub risk_correlation_id: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsPix { - /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. - /// - /// Defaults to 86400 seconds. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_seconds: Option, - - /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). - /// - /// Defaults to 1 day in the future. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsPromptpay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsSepaDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsSofort { - /// Language shown to the payer on redirect. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccount { - /// Additional fields for Financial Connections Session creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: - Option, - - /// Additional fields for network related functions. - #[serde(skip_serializing_if = "Option::is_none")] - pub networks: Option, - - /// Preferred transaction settlement speed. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_settlement_speed: - Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsWechatPay { - /// The app ID registered with WeChat Pay. - /// - /// Only required when client is ios or android. - #[serde(skip_serializing_if = "Option::is_none")] - pub app_id: Option, - - /// The client type that the end customer will pay from. - pub client: UpdatePaymentIntentPaymentMethodOptionsWechatPayClient, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsZip { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentShippingAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentMandateDataCustomerAcceptanceOffline {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentMandateDataCustomerAcceptanceOnline { - /// The IP address from which the Mandate was accepted by the customer. - pub ip_address: String, - - /// The user agent of the browser from which the Mandate was accepted by the customer. - pub user_agent: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataBillingDetailsAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataKlarnaDob { - /// The day of birth, between 1 and 31. - pub day: i64, - - /// The month of birth, between 1 and 12. - pub month: i64, - - /// The four-digit year of birth. - pub year: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions { - /// A URL for custom mandate text to render during confirmation step. - /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_mandate_url: Option, - - /// Description of the mandate interval. - /// - /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_description: Option, - - /// Payment schedule for the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_schedule: - Option, - - /// Transaction type of the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_type: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallments { - /// Setting to true enables installments for this PaymentIntent. - /// This will cause the response to contain a list of available installment plans. - /// Setting to false will prevent any selected plan from applying to a charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled: Option, - - /// The selected installment plan to use for this payment attempt. - /// This parameter can only be provided during confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCardMandateOptions { - /// Amount to be charged for future payments. - pub amount: i64, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - pub amount_type: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// End date of the mandate or subscription. - /// - /// If not provided, the mandate will be active until canceled. - /// If provided, end date should be after start date. - #[serde(skip_serializing_if = "Option::is_none")] - pub end_date: Option, - - /// Specifies payment frequency. - /// - /// One of `day`, `week`, `month`, `year`, or `sporadic`. - pub interval: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval, - - /// The number of intervals between payments. - /// - /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - /// This parameter is optional when `interval=sporadic`. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, - - /// Unique identifier for the mandate or subscription. - pub reference: String, - - /// Start date of the mandate or subscription. - /// - /// Start date should not be lesser than yesterday. - pub start_date: Timestamp, - - /// Specifies the type of mandates supported. - /// - /// Possible values are `india`. - #[serde(skip_serializing_if = "Option::is_none")] - pub supported_types: - Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer { - /// Configuration for the eu_bank_transfer funding type. - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: - Option, - - /// List of address types that should be returned in the financial_addresses response. - /// - /// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested_address_types: Option< - Vec< - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes, - >, - >, - - /// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - pub type_: CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections { - /// The list of permissions to request. - /// - /// If this parameter is passed, the `payment_method` permission must be included. - /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option< - Vec, - >, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: Option< - Vec, - >, - - /// For webview integrations only. - /// - /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks { - /// Triggers validations to run across the selected networks. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: - Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataKlarnaDob { - /// The day of birth, between 1 and 31. - pub day: i64, - - /// The month of birth, between 1 and 12. - pub month: i64, - - /// The four-digit year of birth. - pub year: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions { - /// A URL for custom mandate text to render during confirmation step. - /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_mandate_url: Option, - - /// Description of the mandate interval. - /// - /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_description: Option, - - /// Payment schedule for the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_schedule: - Option, - - /// Transaction type of the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_type: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallments { - /// Setting to true enables installments for this PaymentIntent. - /// This will cause the response to contain a list of available installment plans. - /// Setting to false will prevent any selected plan from applying to a charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled: Option, - - /// The selected installment plan to use for this payment attempt. - /// This parameter can only be provided during confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions { - /// Amount to be charged for future payments. - pub amount: i64, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - pub amount_type: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// End date of the mandate or subscription. - /// - /// If not provided, the mandate will be active until canceled. - /// If provided, end date should be after start date. - #[serde(skip_serializing_if = "Option::is_none")] - pub end_date: Option, - - /// Specifies payment frequency. - /// - /// One of `day`, `week`, `month`, `year`, or `sporadic`. - pub interval: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval, - - /// The number of intervals between payments. - /// - /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - /// This parameter is optional when `interval=sporadic`. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, - - /// Unique identifier for the mandate or subscription. - pub reference: String, - - /// Start date of the mandate or subscription. - /// - /// Start date should not be lesser than yesterday. - pub start_date: Timestamp, - - /// Specifies the type of mandates supported. - /// - /// Possible values are `india`. - #[serde(skip_serializing_if = "Option::is_none")] - pub supported_types: - Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer { - /// Configuration for the eu_bank_transfer funding type. - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: - Option, - - /// List of address types that should be returned in the financial_addresses response. - /// - /// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested_address_types: Option< - Vec< - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes, - >, - >, - - /// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - pub type_: UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections { - /// The list of permissions to request. - /// - /// If this parameter is passed, the `payment_method` permission must be included. - /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option< - Vec, - >, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: Option< - Vec, - >, - - /// For webview integrations only. - /// - /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks { - /// Triggers validations to run across the selected networks. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: - Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan { - /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. - pub count: u64, - - /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. - /// One of `month`. - pub interval: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, - - /// Type of installment plan, one of `fixed_count`. - #[serde(rename = "type")] - pub type_: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer { - /// The desired country code of the bank account information. - /// - /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. - pub country: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan { - /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. - pub count: u64, - - /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. - /// One of `month`. - pub interval: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, - - /// Type of installment plan, one of `fixed_count`. - #[serde(rename = "type")] - pub type_: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer { - /// The desired country code of the bank account information. - /// - /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. - pub country: String, -} - -/// An enum representing the possible values of an `CreatePaymentIntentAutomaticPaymentMethods`'s `allow_redirects` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { - Always, - Never, -} - -impl CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::Always => "always", - CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::Never => "never", - } - } -} - -impl AsRef for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { - fn default() -> Self { - Self::Always - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentMandateDataCustomerAcceptance`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentMandateDataCustomerAcceptanceType { - Offline, - Online, -} - -impl CreatePaymentIntentMandateDataCustomerAcceptanceType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentMandateDataCustomerAcceptanceType::Offline => "offline", - CreatePaymentIntentMandateDataCustomerAcceptanceType::Online => "online", - } - } -} - -impl AsRef for CreatePaymentIntentMandateDataCustomerAcceptanceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentMandateDataCustomerAcceptanceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentMandateDataCustomerAcceptanceType { - fn default() -> Self { - Self::Offline - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodDataEps`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataEpsBank { - ArzteUndApothekerBank, - AustrianAnadiBankAg, - BankAustria, - BankhausCarlSpangler, - BankhausSchelhammerUndSchatteraAg, - BawagPskAg, - BksBankAg, - BrullKallmusBankAg, - BtvVierLanderBank, - CapitalBankGraweGruppeAg, - DeutscheBankAg, - Dolomitenbank, - EasybankAg, - ErsteBankUndSparkassen, - HypoAlpeadriabankInternationalAg, - HypoBankBurgenlandAktiengesellschaft, - HypoNoeLbFurNiederosterreichUWien, - HypoOberosterreichSalzburgSteiermark, - HypoTirolBankAg, - HypoVorarlbergBankAg, - MarchfelderBank, - OberbankAg, - RaiffeisenBankengruppeOsterreich, - SchoellerbankAg, - SpardaBankWien, - VolksbankGruppe, - VolkskreditbankAg, - VrBankBraunau, -} - -impl CreatePaymentIntentPaymentMethodDataEpsBank { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataEpsBank::ArzteUndApothekerBank => { - "arzte_und_apotheker_bank" - } - CreatePaymentIntentPaymentMethodDataEpsBank::AustrianAnadiBankAg => { - "austrian_anadi_bank_ag" - } - CreatePaymentIntentPaymentMethodDataEpsBank::BankAustria => "bank_austria", - CreatePaymentIntentPaymentMethodDataEpsBank::BankhausCarlSpangler => { - "bankhaus_carl_spangler" - } - CreatePaymentIntentPaymentMethodDataEpsBank::BankhausSchelhammerUndSchatteraAg => { - "bankhaus_schelhammer_und_schattera_ag" - } - CreatePaymentIntentPaymentMethodDataEpsBank::BawagPskAg => "bawag_psk_ag", - CreatePaymentIntentPaymentMethodDataEpsBank::BksBankAg => "bks_bank_ag", - CreatePaymentIntentPaymentMethodDataEpsBank::BrullKallmusBankAg => { - "brull_kallmus_bank_ag" - } - CreatePaymentIntentPaymentMethodDataEpsBank::BtvVierLanderBank => { - "btv_vier_lander_bank" - } - CreatePaymentIntentPaymentMethodDataEpsBank::CapitalBankGraweGruppeAg => { - "capital_bank_grawe_gruppe_ag" - } - CreatePaymentIntentPaymentMethodDataEpsBank::DeutscheBankAg => "deutsche_bank_ag", - CreatePaymentIntentPaymentMethodDataEpsBank::Dolomitenbank => "dolomitenbank", - CreatePaymentIntentPaymentMethodDataEpsBank::EasybankAg => "easybank_ag", - CreatePaymentIntentPaymentMethodDataEpsBank::ErsteBankUndSparkassen => { - "erste_bank_und_sparkassen" - } - CreatePaymentIntentPaymentMethodDataEpsBank::HypoAlpeadriabankInternationalAg => { - "hypo_alpeadriabank_international_ag" - } - CreatePaymentIntentPaymentMethodDataEpsBank::HypoBankBurgenlandAktiengesellschaft => { - "hypo_bank_burgenland_aktiengesellschaft" - } - CreatePaymentIntentPaymentMethodDataEpsBank::HypoNoeLbFurNiederosterreichUWien => { - "hypo_noe_lb_fur_niederosterreich_u_wien" - } - CreatePaymentIntentPaymentMethodDataEpsBank::HypoOberosterreichSalzburgSteiermark => { - "hypo_oberosterreich_salzburg_steiermark" - } - CreatePaymentIntentPaymentMethodDataEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag", - CreatePaymentIntentPaymentMethodDataEpsBank::HypoVorarlbergBankAg => { - "hypo_vorarlberg_bank_ag" - } - CreatePaymentIntentPaymentMethodDataEpsBank::MarchfelderBank => "marchfelder_bank", - CreatePaymentIntentPaymentMethodDataEpsBank::OberbankAg => "oberbank_ag", - CreatePaymentIntentPaymentMethodDataEpsBank::RaiffeisenBankengruppeOsterreich => { - "raiffeisen_bankengruppe_osterreich" - } - CreatePaymentIntentPaymentMethodDataEpsBank::SchoellerbankAg => "schoellerbank_ag", - CreatePaymentIntentPaymentMethodDataEpsBank::SpardaBankWien => "sparda_bank_wien", - CreatePaymentIntentPaymentMethodDataEpsBank::VolksbankGruppe => "volksbank_gruppe", - CreatePaymentIntentPaymentMethodDataEpsBank::VolkskreditbankAg => "volkskreditbank_ag", - CreatePaymentIntentPaymentMethodDataEpsBank::VrBankBraunau => "vr_bank_braunau", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataEpsBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataEpsBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataEpsBank { - fn default() -> Self { - Self::ArzteUndApothekerBank - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodDataFpx`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { - Company, - Individual, -} - -impl CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataFpxAccountHolderType::Company => "company", - CreatePaymentIntentPaymentMethodDataFpxAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodDataFpx`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataFpxBank { - AffinBank, - Agrobank, - AllianceBank, - Ambank, - BankIslam, - BankMuamalat, - BankOfChina, - BankRakyat, - Bsn, - Cimb, - DeutscheBank, - HongLeongBank, - Hsbc, - Kfh, - Maybank2e, - Maybank2u, - Ocbc, - PbEnterprise, - PublicBank, - Rhb, - StandardChartered, - Uob, -} - -impl CreatePaymentIntentPaymentMethodDataFpxBank { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataFpxBank::AffinBank => "affin_bank", - CreatePaymentIntentPaymentMethodDataFpxBank::Agrobank => "agrobank", - CreatePaymentIntentPaymentMethodDataFpxBank::AllianceBank => "alliance_bank", - CreatePaymentIntentPaymentMethodDataFpxBank::Ambank => "ambank", - CreatePaymentIntentPaymentMethodDataFpxBank::BankIslam => "bank_islam", - CreatePaymentIntentPaymentMethodDataFpxBank::BankMuamalat => "bank_muamalat", - CreatePaymentIntentPaymentMethodDataFpxBank::BankOfChina => "bank_of_china", - CreatePaymentIntentPaymentMethodDataFpxBank::BankRakyat => "bank_rakyat", - CreatePaymentIntentPaymentMethodDataFpxBank::Bsn => "bsn", - CreatePaymentIntentPaymentMethodDataFpxBank::Cimb => "cimb", - CreatePaymentIntentPaymentMethodDataFpxBank::DeutscheBank => "deutsche_bank", - CreatePaymentIntentPaymentMethodDataFpxBank::HongLeongBank => "hong_leong_bank", - CreatePaymentIntentPaymentMethodDataFpxBank::Hsbc => "hsbc", - CreatePaymentIntentPaymentMethodDataFpxBank::Kfh => "kfh", - CreatePaymentIntentPaymentMethodDataFpxBank::Maybank2e => "maybank2e", - CreatePaymentIntentPaymentMethodDataFpxBank::Maybank2u => "maybank2u", - CreatePaymentIntentPaymentMethodDataFpxBank::Ocbc => "ocbc", - CreatePaymentIntentPaymentMethodDataFpxBank::PbEnterprise => "pb_enterprise", - CreatePaymentIntentPaymentMethodDataFpxBank::PublicBank => "public_bank", - CreatePaymentIntentPaymentMethodDataFpxBank::Rhb => "rhb", - CreatePaymentIntentPaymentMethodDataFpxBank::StandardChartered => "standard_chartered", - CreatePaymentIntentPaymentMethodDataFpxBank::Uob => "uob", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataFpxBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataFpxBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataFpxBank { - fn default() -> Self { - Self::AffinBank - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodDataIdeal`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataIdealBank { - AbnAmro, - AsnBank, - Bunq, - Handelsbanken, - Ing, - Knab, - Moneyou, - N26, - Rabobank, - Regiobank, - Revolut, - SnsBank, - TriodosBank, - VanLanschot, - Yoursafe, -} - -impl CreatePaymentIntentPaymentMethodDataIdealBank { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataIdealBank::AbnAmro => "abn_amro", - CreatePaymentIntentPaymentMethodDataIdealBank::AsnBank => "asn_bank", - CreatePaymentIntentPaymentMethodDataIdealBank::Bunq => "bunq", - CreatePaymentIntentPaymentMethodDataIdealBank::Handelsbanken => "handelsbanken", - CreatePaymentIntentPaymentMethodDataIdealBank::Ing => "ing", - CreatePaymentIntentPaymentMethodDataIdealBank::Knab => "knab", - CreatePaymentIntentPaymentMethodDataIdealBank::Moneyou => "moneyou", - CreatePaymentIntentPaymentMethodDataIdealBank::N26 => "n26", - CreatePaymentIntentPaymentMethodDataIdealBank::Rabobank => "rabobank", - CreatePaymentIntentPaymentMethodDataIdealBank::Regiobank => "regiobank", - CreatePaymentIntentPaymentMethodDataIdealBank::Revolut => "revolut", - CreatePaymentIntentPaymentMethodDataIdealBank::SnsBank => "sns_bank", - CreatePaymentIntentPaymentMethodDataIdealBank::TriodosBank => "triodos_bank", - CreatePaymentIntentPaymentMethodDataIdealBank::VanLanschot => "van_lanschot", - CreatePaymentIntentPaymentMethodDataIdealBank::Yoursafe => "yoursafe", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataIdealBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataIdealBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataIdealBank { - fn default() -> Self { - Self::AbnAmro - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodDataP24`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataP24Bank { - AliorBank, - BankMillennium, - BankNowyBfgSa, - BankPekaoSa, - BankiSpbdzielcze, - Blik, - BnpParibas, - Boz, - CitiHandlowy, - CreditAgricole, - Envelobank, - EtransferPocztowy24, - GetinBank, - Ideabank, - Ing, - Inteligo, - MbankMtransfer, - NestPrzelew, - NoblePay, - PbacZIpko, - PlusBank, - SantanderPrzelew24, - TmobileUsbugiBankowe, - ToyotaBank, - VolkswagenBank, -} - -impl CreatePaymentIntentPaymentMethodDataP24Bank { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataP24Bank::AliorBank => "alior_bank", - CreatePaymentIntentPaymentMethodDataP24Bank::BankMillennium => "bank_millennium", - CreatePaymentIntentPaymentMethodDataP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa", - CreatePaymentIntentPaymentMethodDataP24Bank::BankPekaoSa => "bank_pekao_sa", - CreatePaymentIntentPaymentMethodDataP24Bank::BankiSpbdzielcze => "banki_spbdzielcze", - CreatePaymentIntentPaymentMethodDataP24Bank::Blik => "blik", - CreatePaymentIntentPaymentMethodDataP24Bank::BnpParibas => "bnp_paribas", - CreatePaymentIntentPaymentMethodDataP24Bank::Boz => "boz", - CreatePaymentIntentPaymentMethodDataP24Bank::CitiHandlowy => "citi_handlowy", - CreatePaymentIntentPaymentMethodDataP24Bank::CreditAgricole => "credit_agricole", - CreatePaymentIntentPaymentMethodDataP24Bank::Envelobank => "envelobank", - CreatePaymentIntentPaymentMethodDataP24Bank::EtransferPocztowy24 => { - "etransfer_pocztowy24" - } - CreatePaymentIntentPaymentMethodDataP24Bank::GetinBank => "getin_bank", - CreatePaymentIntentPaymentMethodDataP24Bank::Ideabank => "ideabank", - CreatePaymentIntentPaymentMethodDataP24Bank::Ing => "ing", - CreatePaymentIntentPaymentMethodDataP24Bank::Inteligo => "inteligo", - CreatePaymentIntentPaymentMethodDataP24Bank::MbankMtransfer => "mbank_mtransfer", - CreatePaymentIntentPaymentMethodDataP24Bank::NestPrzelew => "nest_przelew", - CreatePaymentIntentPaymentMethodDataP24Bank::NoblePay => "noble_pay", - CreatePaymentIntentPaymentMethodDataP24Bank::PbacZIpko => "pbac_z_ipko", - CreatePaymentIntentPaymentMethodDataP24Bank::PlusBank => "plus_bank", - CreatePaymentIntentPaymentMethodDataP24Bank::SantanderPrzelew24 => { - "santander_przelew24" - } - CreatePaymentIntentPaymentMethodDataP24Bank::TmobileUsbugiBankowe => { - "tmobile_usbugi_bankowe" - } - CreatePaymentIntentPaymentMethodDataP24Bank::ToyotaBank => "toyota_bank", - CreatePaymentIntentPaymentMethodDataP24Bank::VolkswagenBank => "volkswagen_bank", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataP24Bank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataP24Bank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataP24Bank { - fn default() -> Self { - Self::AliorBank - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodDataSofort`'s `country` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataSofortCountry { - #[serde(rename = "AT")] - At, - #[serde(rename = "BE")] - Be, - #[serde(rename = "DE")] - De, - #[serde(rename = "ES")] - Es, - #[serde(rename = "IT")] - It, - #[serde(rename = "NL")] - Nl, -} - -impl CreatePaymentIntentPaymentMethodDataSofortCountry { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataSofortCountry::At => "AT", - CreatePaymentIntentPaymentMethodDataSofortCountry::Be => "BE", - CreatePaymentIntentPaymentMethodDataSofortCountry::De => "DE", - CreatePaymentIntentPaymentMethodDataSofortCountry::Es => "ES", - CreatePaymentIntentPaymentMethodDataSofortCountry::It => "IT", - CreatePaymentIntentPaymentMethodDataSofortCountry::Nl => "NL", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataSofortCountry { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataSofortCountry { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataSofortCountry { - fn default() -> Self { - Self::At - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodData`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataType { - AcssDebit, - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, - Zip, -} - -impl CreatePaymentIntentPaymentMethodDataType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataType::AcssDebit => "acss_debit", - CreatePaymentIntentPaymentMethodDataType::Affirm => "affirm", - CreatePaymentIntentPaymentMethodDataType::AfterpayClearpay => "afterpay_clearpay", - CreatePaymentIntentPaymentMethodDataType::Alipay => "alipay", - CreatePaymentIntentPaymentMethodDataType::AuBecsDebit => "au_becs_debit", - CreatePaymentIntentPaymentMethodDataType::BacsDebit => "bacs_debit", - CreatePaymentIntentPaymentMethodDataType::Bancontact => "bancontact", - CreatePaymentIntentPaymentMethodDataType::Blik => "blik", - CreatePaymentIntentPaymentMethodDataType::Boleto => "boleto", - CreatePaymentIntentPaymentMethodDataType::Cashapp => "cashapp", - CreatePaymentIntentPaymentMethodDataType::CustomerBalance => "customer_balance", - CreatePaymentIntentPaymentMethodDataType::Eps => "eps", - CreatePaymentIntentPaymentMethodDataType::Fpx => "fpx", - CreatePaymentIntentPaymentMethodDataType::Giropay => "giropay", - CreatePaymentIntentPaymentMethodDataType::Grabpay => "grabpay", - CreatePaymentIntentPaymentMethodDataType::Ideal => "ideal", - CreatePaymentIntentPaymentMethodDataType::Klarna => "klarna", - CreatePaymentIntentPaymentMethodDataType::Konbini => "konbini", - CreatePaymentIntentPaymentMethodDataType::Link => "link", - CreatePaymentIntentPaymentMethodDataType::Oxxo => "oxxo", - CreatePaymentIntentPaymentMethodDataType::P24 => "p24", - CreatePaymentIntentPaymentMethodDataType::Paynow => "paynow", - CreatePaymentIntentPaymentMethodDataType::Paypal => "paypal", - CreatePaymentIntentPaymentMethodDataType::Pix => "pix", - CreatePaymentIntentPaymentMethodDataType::Promptpay => "promptpay", - CreatePaymentIntentPaymentMethodDataType::SepaDebit => "sepa_debit", - CreatePaymentIntentPaymentMethodDataType::Sofort => "sofort", - CreatePaymentIntentPaymentMethodDataType::UsBankAccount => "us_bank_account", - CreatePaymentIntentPaymentMethodDataType::WechatPay => "wechat_pay", - CreatePaymentIntentPaymentMethodDataType::Zip => "zip", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataType { - fn default() -> Self { - Self::AcssDebit - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodDataUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::Company => { - "company" - } - CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::Individual => { - "individual" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodDataUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - Checking, - Savings, -} - -impl CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType::Checking => "checking", - CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Combined => "combined", - CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Interval => "interval", - CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Sporadic => "sporadic", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - Business, - Personal, -} - -impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business", - CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAcssDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::OffSession => { - "off_session" - } - CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => { - "automatic" - } - CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Instant => { - "instant" - } - CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAffirm`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - Manual, -} - -impl CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAffirm`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { - Manual, -} - -impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::Manual => { - "manual" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod -{ - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAlipay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - None, - OffSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAuBecsDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::OffSession => { - "off_session" - } - CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsBacsDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::OffSession => { - "off_session" - } - CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::De => "de", - CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::En => "en", - CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::Fr => "fr", - CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsBancontact`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - None, - OffSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsBoleto`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::OffSession => { - "off_session" - } - CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCard`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - Manual, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - Month, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::Month => "month", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - fn default() -> Self { - Self::Month - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - FixedCount, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::FixedCount => { - "fixed_count" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - fn default() -> Self { - Self::FixedCount - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCardMandateOptions`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - Fixed, - Maximum, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed", - CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::Maximum => { - "maximum" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCardMandateOptions`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - Day, - Month, - Sporadic, - Week, - Year, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Day => "day", - CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Month => "month", - CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Sporadic => { - "sporadic" - } - CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Week => "week", - CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Year => "year", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCardMandateOptions`'s `supported_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - India, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::India => { - "india" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes -{ - fn default() -> Self { - Self::India - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Amex => "amex", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::CartesBancaires => { - "cartes_bancaires" - } - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Diners => "diners", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Discover => "discover", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Interac => "interac", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Unionpay => "unionpay", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Unknown => "unknown", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Automatic => { - "automatic" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCard`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::OffSession => { - "off_session" - } - CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCashapp`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - Manual, -} - -impl CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCashapp`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::OffSession => { - "off_session" - } - CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer`'s `requested_address_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - Aba, - Iban, - Sepa, - SortCode, - Spei, - Swift, - Zengin, -} - -impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Aba => "aba", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Iban => "iban", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Sepa => "sepa", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::SortCode => "sort_code", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Spei => "spei", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Swift => "swift", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Zengin => "zengin", - } - } -} - -impl AsRef - for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn default() -> Self { - Self::Aba - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { - EuBankTransfer, - GbBankTransfer, - JpBankTransfer, - MxBankTransfer, - UsBankTransfer, -} - -impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::EuBankTransfer => "eu_bank_transfer", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::GbBankTransfer => "gb_bank_transfer", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::JpBankTransfer => "jp_bank_transfer", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::MxBankTransfer => "mx_bank_transfer", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::UsBankTransfer => "us_bank_transfer", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType -{ - fn default() -> Self { - Self::EuBankTransfer - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCustomerBalance`'s `funding_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - BankTransfer, -} - -impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::BankTransfer => { - "bank_transfer" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - fn default() -> Self { - Self::BankTransfer - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCustomerBalance`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsEps`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsFpx`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsGiropay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsGrabpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsIdeal`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - None, - OffSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsKlarna`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - Manual, -} - -impl CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsKlarna`'s `preferred_locale` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - #[serde(rename = "cs-CZ")] - CsCz, - #[serde(rename = "da-DK")] - DaDk, - #[serde(rename = "de-AT")] - DeAt, - #[serde(rename = "de-CH")] - DeCh, - #[serde(rename = "de-DE")] - DeDe, - #[serde(rename = "el-GR")] - ElGr, - #[serde(rename = "en-AT")] - EnAt, - #[serde(rename = "en-AU")] - EnAu, - #[serde(rename = "en-BE")] - EnBe, - #[serde(rename = "en-CA")] - EnCa, - #[serde(rename = "en-CH")] - EnCh, - #[serde(rename = "en-CZ")] - EnCz, - #[serde(rename = "en-DE")] - EnDe, - #[serde(rename = "en-DK")] - EnDk, - #[serde(rename = "en-ES")] - EnEs, - #[serde(rename = "en-FI")] - EnFi, - #[serde(rename = "en-FR")] - EnFr, - #[serde(rename = "en-GB")] - EnGb, - #[serde(rename = "en-GR")] - EnGr, - #[serde(rename = "en-IE")] - EnIe, - #[serde(rename = "en-IT")] - EnIt, - #[serde(rename = "en-NL")] - EnNl, - #[serde(rename = "en-NO")] - EnNo, - #[serde(rename = "en-NZ")] - EnNz, - #[serde(rename = "en-PL")] - EnPl, - #[serde(rename = "en-PT")] - EnPt, - #[serde(rename = "en-SE")] - EnSe, - #[serde(rename = "en-US")] - EnUs, - #[serde(rename = "es-ES")] - EsEs, - #[serde(rename = "es-US")] - EsUs, - #[serde(rename = "fi-FI")] - FiFi, - #[serde(rename = "fr-BE")] - FrBe, - #[serde(rename = "fr-CA")] - FrCa, - #[serde(rename = "fr-CH")] - FrCh, - #[serde(rename = "fr-FR")] - FrFr, - #[serde(rename = "it-CH")] - ItCh, - #[serde(rename = "it-IT")] - ItIt, - #[serde(rename = "nb-NO")] - NbNo, - #[serde(rename = "nl-BE")] - NlBe, - #[serde(rename = "nl-NL")] - NlNl, - #[serde(rename = "pl-PL")] - PlPl, - #[serde(rename = "pt-PT")] - PtPt, - #[serde(rename = "sv-FI")] - SvFi, - #[serde(rename = "sv-SE")] - SvSe, -} - -impl CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::CsCz => "cs-CZ", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::DaDk => "da-DK", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::DeAt => "de-AT", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::DeCh => "de-CH", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::DeDe => "de-DE", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::ElGr => "el-GR", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnAt => "en-AT", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnAu => "en-AU", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnBe => "en-BE", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnCa => "en-CA", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnCh => "en-CH", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnCz => "en-CZ", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnDe => "en-DE", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnDk => "en-DK", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnEs => "en-ES", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnFi => "en-FI", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnFr => "en-FR", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnGb => "en-GB", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnGr => "en-GR", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnIe => "en-IE", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnIt => "en-IT", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnNl => "en-NL", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnNo => "en-NO", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnNz => "en-NZ", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnPl => "en-PL", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnPt => "en-PT", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnSe => "en-SE", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnUs => "en-US", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EsEs => "es-ES", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EsUs => "es-US", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FiFi => "fi-FI", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FrBe => "fr-BE", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FrCa => "fr-CA", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FrCh => "fr-CH", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FrFr => "fr-FR", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::ItCh => "it-CH", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::ItIt => "it-IT", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::NbNo => "nb-NO", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::NlBe => "nl-BE", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::NlNl => "nl-NL", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::PlPl => "pl-PL", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::PtPt => "pt-PT", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::SvFi => "sv-FI", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::SvSe => "sv-SE", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - fn default() -> Self { - Self::CsCz - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsKlarna`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsKonbini`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsLink`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - Manual, -} - -impl CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsLink`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - None, - OffSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsOxxo`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsP24`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsPaynow`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsPaypal`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - Manual, -} - -impl CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsPaypal`'s `preferred_locale` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - #[serde(rename = "cs-CZ")] - CsCz, - #[serde(rename = "da-DK")] - DaDk, - #[serde(rename = "de-AT")] - DeAt, - #[serde(rename = "de-DE")] - DeDe, - #[serde(rename = "de-LU")] - DeLu, - #[serde(rename = "el-GR")] - ElGr, - #[serde(rename = "en-GB")] - EnGb, - #[serde(rename = "en-US")] - EnUs, - #[serde(rename = "es-ES")] - EsEs, - #[serde(rename = "fi-FI")] - FiFi, - #[serde(rename = "fr-BE")] - FrBe, - #[serde(rename = "fr-FR")] - FrFr, - #[serde(rename = "fr-LU")] - FrLu, - #[serde(rename = "hu-HU")] - HuHu, - #[serde(rename = "it-IT")] - ItIt, - #[serde(rename = "nl-BE")] - NlBe, - #[serde(rename = "nl-NL")] - NlNl, - #[serde(rename = "pl-PL")] - PlPl, - #[serde(rename = "pt-PT")] - PtPt, - #[serde(rename = "sk-SK")] - SkSk, - #[serde(rename = "sv-SE")] - SvSe, -} - -impl CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::CsCz => "cs-CZ", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::DaDk => "da-DK", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::DeAt => "de-AT", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::DeDe => "de-DE", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::DeLu => "de-LU", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::ElGr => "el-GR", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::EnGb => "en-GB", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::EnUs => "en-US", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::EsEs => "es-ES", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::FiFi => "fi-FI", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::FrBe => "fr-BE", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::FrFr => "fr-FR", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::FrLu => "fr-LU", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::HuHu => "hu-HU", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::ItIt => "it-IT", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::NlBe => "nl-BE", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::NlNl => "nl-NL", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::PlPl => "pl-PL", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::PtPt => "pt-PT", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::SkSk => "sk-SK", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::SvSe => "sv-SE", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - fn default() -> Self { - Self::CsCz - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsPaypal`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - None, - OffSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsPix`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsPromptpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsSepaDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::OffSession => { - "off_session" - } - CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsSofort`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - De, - En, - Es, - Fr, - It, - Nl, - Pl, -} - -impl CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::De => "de", - CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::En => "en", - CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::Es => "es", - CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::Fr => "fr", - CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::It => "it", - CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::Nl => "nl", - CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::Pl => "pl", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsSofort`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - None, - OffSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - Balances, -} - -impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", - } - } -} - -impl AsRef - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks`'s `requested` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - Ach, - UsDomesticWire, -} - -impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::Ach => "ach", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::UsDomesticWire => "us_domestic_wire", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested -{ - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsUsBankAccount`'s `preferred_settlement_speed` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - Fastest, - Standard, -} - -impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::Fastest => "fastest", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::Standard => "standard", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed -{ - fn default() -> Self { - Self::Fastest - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsUsBankAccount`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::OffSession => { - "off_session" - } - CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => "automatic", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => "microdeposits", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsWechatPay`'s `client` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsWechatPayClient { - Android, - Ios, - Web, -} - -impl CreatePaymentIntentPaymentMethodOptionsWechatPayClient { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsWechatPayClient::Android => "android", - CreatePaymentIntentPaymentMethodOptionsWechatPayClient::Ios => "ios", - CreatePaymentIntentPaymentMethodOptionsWechatPayClient::Web => "web", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsWechatPayClient { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsWechatPayClient { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsWechatPayClient { - fn default() -> Self { - Self::Android - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsWechatPay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsZip`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `FundingInstructionsBankTransferFinancialAddress`'s `supported_networks` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - Bacs, - Fps, - Sepa, - Spei, - Zengin, -} - -impl FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - pub fn as_str(self) -> &'static str { - match self { - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Bacs => "bacs", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Fps => "fps", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Sepa => "sepa", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Spei => "spei", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Zengin => "zengin", - } - } -} - -impl AsRef for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - fn default() -> Self { - Self::Bacs - } -} - -/// An enum representing the possible values of an `FundingInstructionsBankTransferFinancialAddress`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FundingInstructionsBankTransferFinancialAddressType { - Iban, - SortCode, - Spei, - Zengin, -} - -impl FundingInstructionsBankTransferFinancialAddressType { - pub fn as_str(self) -> &'static str { - match self { - FundingInstructionsBankTransferFinancialAddressType::Iban => "iban", - FundingInstructionsBankTransferFinancialAddressType::SortCode => "sort_code", - FundingInstructionsBankTransferFinancialAddressType::Spei => "spei", - FundingInstructionsBankTransferFinancialAddressType::Zengin => "zengin", - } - } -} - -impl AsRef for FundingInstructionsBankTransferFinancialAddressType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FundingInstructionsBankTransferFinancialAddressType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FundingInstructionsBankTransferFinancialAddressType { - fn default() -> Self { - Self::Iban - } -} - -/// An enum representing the possible values of an `PaymentFlowsAutomaticPaymentMethodsPaymentIntent`'s `allow_redirects` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { - Always, - Never, -} - -impl PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { - pub fn as_str(self) -> &'static str { - match self { - PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects::Always => "always", - PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects::Never => "never", - } - } -} - -impl AsRef for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { - fn default() -> Self { - Self::Always - } -} - -/// An enum representing the possible values of an `PaymentIntent`'s `cancellation_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentCancellationReason { - Abandoned, - Automatic, - Duplicate, - FailedInvoice, - Fraudulent, - RequestedByCustomer, - VoidInvoice, -} - -impl PaymentIntentCancellationReason { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentCancellationReason::Abandoned => "abandoned", - PaymentIntentCancellationReason::Automatic => "automatic", - PaymentIntentCancellationReason::Duplicate => "duplicate", - PaymentIntentCancellationReason::FailedInvoice => "failed_invoice", - PaymentIntentCancellationReason::Fraudulent => "fraudulent", - PaymentIntentCancellationReason::RequestedByCustomer => "requested_by_customer", - PaymentIntentCancellationReason::VoidInvoice => "void_invoice", - } - } -} - -impl AsRef for PaymentIntentCancellationReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentCancellationReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentCancellationReason { - fn default() -> Self { - Self::Abandoned - } -} - -/// An enum representing the possible values of an `PaymentIntent`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentCaptureMethod { - Automatic, - AutomaticAsync, - Manual, -} - -impl PaymentIntentCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentCaptureMethod::Automatic => "automatic", - PaymentIntentCaptureMethod::AutomaticAsync => "automatic_async", - PaymentIntentCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentIntentCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentCaptureMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `PaymentIntent`'s `confirmation_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentConfirmationMethod { - Automatic, - Manual, -} - -impl PaymentIntentConfirmationMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentConfirmationMethod::Automatic => "automatic", - PaymentIntentConfirmationMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentIntentConfirmationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentConfirmationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentConfirmationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `PaymentIntentNextActionDisplayBankTransferInstructions`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentNextActionDisplayBankTransferInstructionsType { - EuBankTransfer, - GbBankTransfer, - JpBankTransfer, - MxBankTransfer, - UsBankTransfer, -} - -impl PaymentIntentNextActionDisplayBankTransferInstructionsType { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentNextActionDisplayBankTransferInstructionsType::EuBankTransfer => { - "eu_bank_transfer" - } - PaymentIntentNextActionDisplayBankTransferInstructionsType::GbBankTransfer => { - "gb_bank_transfer" - } - PaymentIntentNextActionDisplayBankTransferInstructionsType::JpBankTransfer => { - "jp_bank_transfer" - } - PaymentIntentNextActionDisplayBankTransferInstructionsType::MxBankTransfer => { - "mx_bank_transfer" - } - PaymentIntentNextActionDisplayBankTransferInstructionsType::UsBankTransfer => { - "us_bank_transfer" - } - } - } -} - -impl AsRef for PaymentIntentNextActionDisplayBankTransferInstructionsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentNextActionDisplayBankTransferInstructionsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentNextActionDisplayBankTransferInstructionsType { - fn default() -> Self { - Self::EuBankTransfer - } -} - -/// An enum representing the possible values of an `PaymentIntentNextActionVerifyWithMicrodeposits`'s `microdeposit_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { - Amounts, - DescriptorCode, -} - -impl PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType::Amounts => "amounts", - PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType::DescriptorCode => { - "descriptor_code" - } - } - } -} - -impl AsRef for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { - fn default() -> Self { - Self::Amounts - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsAcssDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::None => "none", - PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::OffSession => "off_session", - PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => "automatic", - PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant", - PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsAuBecsDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::None => "none", - PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::OffSession => { - "off_session" - } - PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsCard`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsCardCaptureMethod { - Manual, -} - -impl PaymentIntentPaymentMethodOptionsCardCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsCardCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl PaymentIntentPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsCardNetwork::Amex => "amex", - PaymentIntentPaymentMethodOptionsCardNetwork::CartesBancaires => "cartes_bancaires", - PaymentIntentPaymentMethodOptionsCardNetwork::Diners => "diners", - PaymentIntentPaymentMethodOptionsCardNetwork::Discover => "discover", - PaymentIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", - PaymentIntentPaymentMethodOptionsCardNetwork::Interac => "interac", - PaymentIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", - PaymentIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", - PaymentIntentPaymentMethodOptionsCardNetwork::Unionpay => "unionpay", - PaymentIntentPaymentMethodOptionsCardNetwork::Unknown => "unknown", - PaymentIntentPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, - ChallengeOnly, -} - -impl PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::ChallengeOnly => { - "challenge_only" - } - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsCard`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsCardSetupFutureUsage::None => "none", - PaymentIntentPaymentMethodOptionsCardSetupFutureUsage::OffSession => "off_session", - PaymentIntentPaymentMethodOptionsCardSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsEps`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - None, -} - -impl PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsLink`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsLinkCaptureMethod { - Manual, -} - -impl PaymentIntentPaymentMethodOptionsLinkCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsLinkCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsLink`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - None, - OffSession, -} - -impl PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::None => "none", - PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::OffSession => "off_session", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::Combined => { - "combined" - } - PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::Interval => { - "interval" - } - PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::Sporadic => { - "sporadic" - } - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule -{ - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { - Business, - Personal, -} - -impl PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType::Business => { - "business" - } - PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType::Personal => { - "personal" - } - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsSepaDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::None => "none", - PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::OffSession => "off_session", - PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsUsBankAccount`'s `preferred_settlement_speed` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - Fastest, - Standard, -} - -impl PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::Fastest => { - "fastest" - } - PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::Standard => { - "standard" - } - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed -{ - fn default() -> Self { - Self::Fastest - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsUsBankAccount`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::None => "none", - PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::OffSession => { - "off_session" - } - PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => { - "automatic" - } - PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant", - PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `PaymentIntentProcessing`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentProcessingType { - Card, -} - -impl PaymentIntentProcessingType { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentProcessingType::Card => "card", - } - } -} - -impl AsRef for PaymentIntentProcessingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentProcessingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentProcessingType { - fn default() -> Self { - Self::Card - } -} - -/// An enum representing the possible values of an `PaymentIntent`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentSetupFutureUsage { - OffSession, - OnSession, -} - -impl PaymentIntentSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentSetupFutureUsage::OffSession => "off_session", - PaymentIntentSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentIntentSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentSetupFutureUsage { - fn default() -> Self { - Self::OffSession - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntent`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentSetupFutureUsageFilter { - OffSession, - OnSession, -} - -impl PaymentIntentSetupFutureUsageFilter { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentSetupFutureUsageFilter::OffSession => "off_session", - PaymentIntentSetupFutureUsageFilter::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentIntentSetupFutureUsageFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentSetupFutureUsageFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentSetupFutureUsageFilter { - fn default() -> Self { - Self::OffSession - } -} - -/// An enum representing the possible values of an `PaymentIntent`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentStatus { - Canceled, - Processing, - RequiresAction, - RequiresCapture, - RequiresConfirmation, - RequiresPaymentMethod, - Succeeded, -} - -impl PaymentIntentStatus { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentStatus::Canceled => "canceled", - PaymentIntentStatus::Processing => "processing", - PaymentIntentStatus::RequiresAction => "requires_action", - PaymentIntentStatus::RequiresCapture => "requires_capture", - PaymentIntentStatus::RequiresConfirmation => "requires_confirmation", - PaymentIntentStatus::RequiresPaymentMethod => "requires_payment_method", - PaymentIntentStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for PaymentIntentStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentStatus { - fn default() -> Self { - Self::Canceled - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsAffirm`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsAffirmCaptureMethod { - Manual, -} - -impl PaymentMethodOptionsAffirmCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsAffirmCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentMethodOptionsAffirmCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsAffirmCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsAffirmCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsAffirm`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsAffirmSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsAffirmSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsAffirmSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsAffirmSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsAffirmSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsAffirmSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsAfterpayClearpay`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsAfterpayClearpayCaptureMethod { - Manual, -} - -impl PaymentMethodOptionsAfterpayClearpayCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsAfterpayClearpayCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentMethodOptionsAfterpayClearpayCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsAfterpayClearpayCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsAfterpayClearpayCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsAfterpayClearpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - None, -} - -impl PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsAfterpayClearpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsAlipay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsAlipaySetupFutureUsage { - None, - OffSession, -} - -impl PaymentMethodOptionsAlipaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsAlipaySetupFutureUsage::None => "none", - PaymentMethodOptionsAlipaySetupFutureUsage::OffSession => "off_session", - } - } -} - -impl AsRef for PaymentMethodOptionsAlipaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsAlipaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsAlipaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsBacsDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsBacsDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl PaymentMethodOptionsBacsDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsBacsDebitSetupFutureUsage::None => "none", - PaymentMethodOptionsBacsDebitSetupFutureUsage::OffSession => "off_session", - PaymentMethodOptionsBacsDebitSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentMethodOptionsBacsDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsBacsDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsBacsDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl PaymentMethodOptionsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsBancontactPreferredLanguage::De => "de", - PaymentMethodOptionsBancontactPreferredLanguage::En => "en", - PaymentMethodOptionsBancontactPreferredLanguage::Fr => "fr", - PaymentMethodOptionsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef for PaymentMethodOptionsBancontactPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsBancontactPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsBancontactPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsBancontact`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsBancontactSetupFutureUsage { - None, - OffSession, -} - -impl PaymentMethodOptionsBancontactSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsBancontactSetupFutureUsage::None => "none", - PaymentMethodOptionsBancontactSetupFutureUsage::OffSession => "off_session", - } - } -} - -impl AsRef for PaymentMethodOptionsBancontactSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsBancontactSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsBancontactSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsBoleto`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsBoletoSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl PaymentMethodOptionsBoletoSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsBoletoSetupFutureUsage::None => "none", - PaymentMethodOptionsBoletoSetupFutureUsage::OffSession => "off_session", - PaymentMethodOptionsBoletoSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentMethodOptionsBoletoSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsBoletoSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsBoletoSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCardMandateOptions`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCardMandateOptionsAmountType { - Fixed, - Maximum, -} - -impl PaymentMethodOptionsCardMandateOptionsAmountType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed", - PaymentMethodOptionsCardMandateOptionsAmountType::Maximum => "maximum", - } - } -} - -impl AsRef for PaymentMethodOptionsCardMandateOptionsAmountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCardMandateOptionsAmountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCardMandateOptionsAmountType { - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCardMandateOptions`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCardMandateOptionsInterval { - Day, - Month, - Sporadic, - Week, - Year, -} - -impl PaymentMethodOptionsCardMandateOptionsInterval { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCardMandateOptionsInterval::Day => "day", - PaymentMethodOptionsCardMandateOptionsInterval::Month => "month", - PaymentMethodOptionsCardMandateOptionsInterval::Sporadic => "sporadic", - PaymentMethodOptionsCardMandateOptionsInterval::Week => "week", - PaymentMethodOptionsCardMandateOptionsInterval::Year => "year", - } - } -} - -impl AsRef for PaymentMethodOptionsCardMandateOptionsInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCardMandateOptionsInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCardMandateOptionsInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCardMandateOptions`'s `supported_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCardMandateOptionsSupportedTypes { - India, -} - -impl PaymentMethodOptionsCardMandateOptionsSupportedTypes { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCardMandateOptionsSupportedTypes::India => "india", - } - } -} - -impl AsRef for PaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn default() -> Self { - Self::India - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCashapp`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCashappCaptureMethod { - Manual, -} - -impl PaymentMethodOptionsCashappCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCashappCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentMethodOptionsCashappCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCashappCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCashappCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCashapp`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCashappSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl PaymentMethodOptionsCashappSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCashappSetupFutureUsage::None => "none", - PaymentMethodOptionsCashappSetupFutureUsage::OffSession => "off_session", - PaymentMethodOptionsCashappSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentMethodOptionsCashappSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCashappSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCashappSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCustomerBalanceBankTransfer`'s `requested_address_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - Aba, - Iban, - Sepa, - SortCode, - Spei, - Swift, - Zengin, -} - -impl PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Aba => "aba", - PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Iban => "iban", - PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Sepa => "sepa", - PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::SortCode => { - "sort_code" - } - PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Spei => "spei", - PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Swift => "swift", - PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Zengin => { - "zengin" - } - } - } -} - -impl AsRef for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn default() -> Self { - Self::Aba - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCustomerBalanceBankTransfer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCustomerBalanceBankTransferType { - EuBankTransfer, - GbBankTransfer, - JpBankTransfer, - MxBankTransfer, - UsBankTransfer, -} - -impl PaymentMethodOptionsCustomerBalanceBankTransferType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCustomerBalanceBankTransferType::EuBankTransfer => { - "eu_bank_transfer" - } - PaymentMethodOptionsCustomerBalanceBankTransferType::GbBankTransfer => { - "gb_bank_transfer" - } - PaymentMethodOptionsCustomerBalanceBankTransferType::JpBankTransfer => { - "jp_bank_transfer" - } - PaymentMethodOptionsCustomerBalanceBankTransferType::MxBankTransfer => { - "mx_bank_transfer" - } - PaymentMethodOptionsCustomerBalanceBankTransferType::UsBankTransfer => { - "us_bank_transfer" - } - } - } -} - -impl AsRef for PaymentMethodOptionsCustomerBalanceBankTransferType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceBankTransferType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCustomerBalanceBankTransferType { - fn default() -> Self { - Self::EuBankTransfer - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCustomerBalance`'s `funding_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCustomerBalanceFundingType { - BankTransfer, -} - -impl PaymentMethodOptionsCustomerBalanceFundingType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCustomerBalanceFundingType::BankTransfer => "bank_transfer", - } - } -} - -impl AsRef for PaymentMethodOptionsCustomerBalanceFundingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceFundingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCustomerBalanceFundingType { - fn default() -> Self { - Self::BankTransfer - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCustomerBalance`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCustomerBalanceSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsCustomerBalanceSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCustomerBalanceSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsCustomerBalanceSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCustomerBalanceSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsFpx`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsFpxSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsFpxSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsFpxSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsFpxSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsFpxSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsFpxSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsGiropay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsGiropaySetupFutureUsage { - None, -} - -impl PaymentMethodOptionsGiropaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsGiropaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsGiropaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsGiropaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsGiropaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsGrabpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsGrabpaySetupFutureUsage { - None, -} - -impl PaymentMethodOptionsGrabpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsGrabpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsGrabpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsGrabpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsGrabpaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsIdeal`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsIdealSetupFutureUsage { - None, - OffSession, -} - -impl PaymentMethodOptionsIdealSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsIdealSetupFutureUsage::None => "none", - PaymentMethodOptionsIdealSetupFutureUsage::OffSession => "off_session", - } - } -} - -impl AsRef for PaymentMethodOptionsIdealSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsIdealSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsIdealSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsKlarna`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsKlarnaCaptureMethod { - Manual, -} - -impl PaymentMethodOptionsKlarnaCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsKlarnaCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentMethodOptionsKlarnaCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsKlarnaCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsKlarnaCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsKlarna`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsKlarnaSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsKlarnaSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsKlarnaSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsKlarnaSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsKlarnaSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsKlarnaSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsKonbini`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsKonbiniSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsKonbiniSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsKonbiniSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsKonbiniSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsKonbiniSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsKonbiniSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsOxxo`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsOxxoSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsOxxoSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsOxxoSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsOxxoSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsOxxoSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsOxxoSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsP24`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsP24SetupFutureUsage { - None, -} - -impl PaymentMethodOptionsP24SetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsP24SetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsP24SetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsP24SetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsP24SetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsPaynow`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsPaynowSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsPaynowSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsPaynowSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsPaynowSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsPaynowSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsPaynowSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsPaypal`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsPaypalCaptureMethod { - Manual, -} - -impl PaymentMethodOptionsPaypalCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsPaypalCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentMethodOptionsPaypalCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsPaypalCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsPaypalCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsPaypal`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsPaypalSetupFutureUsage { - None, - OffSession, -} - -impl PaymentMethodOptionsPaypalSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsPaypalSetupFutureUsage::None => "none", - PaymentMethodOptionsPaypalSetupFutureUsage::OffSession => "off_session", - } - } -} - -impl AsRef for PaymentMethodOptionsPaypalSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsPaypalSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsPaypalSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsPix`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsPixSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsPixSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsPixSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsPixSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsPixSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsPixSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsPromptpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsPromptpaySetupFutureUsage { - None, -} - -impl PaymentMethodOptionsPromptpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsPromptpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsPromptpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsPromptpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsPromptpaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsSofort`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsSofortPreferredLanguage { - De, - En, - Es, - Fr, - It, - Nl, - Pl, -} - -impl PaymentMethodOptionsSofortPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsSofortPreferredLanguage::De => "de", - PaymentMethodOptionsSofortPreferredLanguage::En => "en", - PaymentMethodOptionsSofortPreferredLanguage::Es => "es", - PaymentMethodOptionsSofortPreferredLanguage::Fr => "fr", - PaymentMethodOptionsSofortPreferredLanguage::It => "it", - PaymentMethodOptionsSofortPreferredLanguage::Nl => "nl", - PaymentMethodOptionsSofortPreferredLanguage::Pl => "pl", - } - } -} - -impl AsRef for PaymentMethodOptionsSofortPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsSofortPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsSofortPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsSofort`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsSofortSetupFutureUsage { - None, - OffSession, -} - -impl PaymentMethodOptionsSofortSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsSofortSetupFutureUsage::None => "none", - PaymentMethodOptionsSofortSetupFutureUsage::OffSession => "off_session", - } - } -} - -impl AsRef for PaymentMethodOptionsSofortSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsSofortSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsSofortSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsWechatPay`'s `client` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsWechatPayClient { - Android, - Ios, - Web, -} - -impl PaymentMethodOptionsWechatPayClient { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsWechatPayClient::Android => "android", - PaymentMethodOptionsWechatPayClient::Ios => "ios", - PaymentMethodOptionsWechatPayClient::Web => "web", - } - } -} - -impl AsRef for PaymentMethodOptionsWechatPayClient { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsWechatPayClient { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsWechatPayClient { - fn default() -> Self { - Self::Android - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsWechatPay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsWechatPaySetupFutureUsage { - None, -} - -impl PaymentMethodOptionsWechatPaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsWechatPaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsWechatPaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsWechatPaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsWechatPaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsZip`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsZipSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsZipSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsZipSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsZipSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsZipSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsZipSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodDataEps`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataEpsBank { - ArzteUndApothekerBank, - AustrianAnadiBankAg, - BankAustria, - BankhausCarlSpangler, - BankhausSchelhammerUndSchatteraAg, - BawagPskAg, - BksBankAg, - BrullKallmusBankAg, - BtvVierLanderBank, - CapitalBankGraweGruppeAg, - DeutscheBankAg, - Dolomitenbank, - EasybankAg, - ErsteBankUndSparkassen, - HypoAlpeadriabankInternationalAg, - HypoBankBurgenlandAktiengesellschaft, - HypoNoeLbFurNiederosterreichUWien, - HypoOberosterreichSalzburgSteiermark, - HypoTirolBankAg, - HypoVorarlbergBankAg, - MarchfelderBank, - OberbankAg, - RaiffeisenBankengruppeOsterreich, - SchoellerbankAg, - SpardaBankWien, - VolksbankGruppe, - VolkskreditbankAg, - VrBankBraunau, -} - -impl UpdatePaymentIntentPaymentMethodDataEpsBank { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataEpsBank::ArzteUndApothekerBank => { - "arzte_und_apotheker_bank" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::AustrianAnadiBankAg => { - "austrian_anadi_bank_ag" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::BankAustria => "bank_austria", - UpdatePaymentIntentPaymentMethodDataEpsBank::BankhausCarlSpangler => { - "bankhaus_carl_spangler" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::BankhausSchelhammerUndSchatteraAg => { - "bankhaus_schelhammer_und_schattera_ag" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::BawagPskAg => "bawag_psk_ag", - UpdatePaymentIntentPaymentMethodDataEpsBank::BksBankAg => "bks_bank_ag", - UpdatePaymentIntentPaymentMethodDataEpsBank::BrullKallmusBankAg => { - "brull_kallmus_bank_ag" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::BtvVierLanderBank => { - "btv_vier_lander_bank" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::CapitalBankGraweGruppeAg => { - "capital_bank_grawe_gruppe_ag" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::DeutscheBankAg => "deutsche_bank_ag", - UpdatePaymentIntentPaymentMethodDataEpsBank::Dolomitenbank => "dolomitenbank", - UpdatePaymentIntentPaymentMethodDataEpsBank::EasybankAg => "easybank_ag", - UpdatePaymentIntentPaymentMethodDataEpsBank::ErsteBankUndSparkassen => { - "erste_bank_und_sparkassen" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::HypoAlpeadriabankInternationalAg => { - "hypo_alpeadriabank_international_ag" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::HypoBankBurgenlandAktiengesellschaft => { - "hypo_bank_burgenland_aktiengesellschaft" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::HypoNoeLbFurNiederosterreichUWien => { - "hypo_noe_lb_fur_niederosterreich_u_wien" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::HypoOberosterreichSalzburgSteiermark => { - "hypo_oberosterreich_salzburg_steiermark" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag", - UpdatePaymentIntentPaymentMethodDataEpsBank::HypoVorarlbergBankAg => { - "hypo_vorarlberg_bank_ag" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::MarchfelderBank => "marchfelder_bank", - UpdatePaymentIntentPaymentMethodDataEpsBank::OberbankAg => "oberbank_ag", - UpdatePaymentIntentPaymentMethodDataEpsBank::RaiffeisenBankengruppeOsterreich => { - "raiffeisen_bankengruppe_osterreich" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::SchoellerbankAg => "schoellerbank_ag", - UpdatePaymentIntentPaymentMethodDataEpsBank::SpardaBankWien => "sparda_bank_wien", - UpdatePaymentIntentPaymentMethodDataEpsBank::VolksbankGruppe => "volksbank_gruppe", - UpdatePaymentIntentPaymentMethodDataEpsBank::VolkskreditbankAg => "volkskreditbank_ag", - UpdatePaymentIntentPaymentMethodDataEpsBank::VrBankBraunau => "vr_bank_braunau", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataEpsBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataEpsBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataEpsBank { - fn default() -> Self { - Self::ArzteUndApothekerBank - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodDataFpx`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { - Company, - Individual, -} - -impl UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType::Company => "company", - UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodDataFpx`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataFpxBank { - AffinBank, - Agrobank, - AllianceBank, - Ambank, - BankIslam, - BankMuamalat, - BankOfChina, - BankRakyat, - Bsn, - Cimb, - DeutscheBank, - HongLeongBank, - Hsbc, - Kfh, - Maybank2e, - Maybank2u, - Ocbc, - PbEnterprise, - PublicBank, - Rhb, - StandardChartered, - Uob, -} - -impl UpdatePaymentIntentPaymentMethodDataFpxBank { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataFpxBank::AffinBank => "affin_bank", - UpdatePaymentIntentPaymentMethodDataFpxBank::Agrobank => "agrobank", - UpdatePaymentIntentPaymentMethodDataFpxBank::AllianceBank => "alliance_bank", - UpdatePaymentIntentPaymentMethodDataFpxBank::Ambank => "ambank", - UpdatePaymentIntentPaymentMethodDataFpxBank::BankIslam => "bank_islam", - UpdatePaymentIntentPaymentMethodDataFpxBank::BankMuamalat => "bank_muamalat", - UpdatePaymentIntentPaymentMethodDataFpxBank::BankOfChina => "bank_of_china", - UpdatePaymentIntentPaymentMethodDataFpxBank::BankRakyat => "bank_rakyat", - UpdatePaymentIntentPaymentMethodDataFpxBank::Bsn => "bsn", - UpdatePaymentIntentPaymentMethodDataFpxBank::Cimb => "cimb", - UpdatePaymentIntentPaymentMethodDataFpxBank::DeutscheBank => "deutsche_bank", - UpdatePaymentIntentPaymentMethodDataFpxBank::HongLeongBank => "hong_leong_bank", - UpdatePaymentIntentPaymentMethodDataFpxBank::Hsbc => "hsbc", - UpdatePaymentIntentPaymentMethodDataFpxBank::Kfh => "kfh", - UpdatePaymentIntentPaymentMethodDataFpxBank::Maybank2e => "maybank2e", - UpdatePaymentIntentPaymentMethodDataFpxBank::Maybank2u => "maybank2u", - UpdatePaymentIntentPaymentMethodDataFpxBank::Ocbc => "ocbc", - UpdatePaymentIntentPaymentMethodDataFpxBank::PbEnterprise => "pb_enterprise", - UpdatePaymentIntentPaymentMethodDataFpxBank::PublicBank => "public_bank", - UpdatePaymentIntentPaymentMethodDataFpxBank::Rhb => "rhb", - UpdatePaymentIntentPaymentMethodDataFpxBank::StandardChartered => "standard_chartered", - UpdatePaymentIntentPaymentMethodDataFpxBank::Uob => "uob", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataFpxBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataFpxBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataFpxBank { - fn default() -> Self { - Self::AffinBank - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodDataIdeal`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataIdealBank { - AbnAmro, - AsnBank, - Bunq, - Handelsbanken, - Ing, - Knab, - Moneyou, - N26, - Rabobank, - Regiobank, - Revolut, - SnsBank, - TriodosBank, - VanLanschot, - Yoursafe, -} - -impl UpdatePaymentIntentPaymentMethodDataIdealBank { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataIdealBank::AbnAmro => "abn_amro", - UpdatePaymentIntentPaymentMethodDataIdealBank::AsnBank => "asn_bank", - UpdatePaymentIntentPaymentMethodDataIdealBank::Bunq => "bunq", - UpdatePaymentIntentPaymentMethodDataIdealBank::Handelsbanken => "handelsbanken", - UpdatePaymentIntentPaymentMethodDataIdealBank::Ing => "ing", - UpdatePaymentIntentPaymentMethodDataIdealBank::Knab => "knab", - UpdatePaymentIntentPaymentMethodDataIdealBank::Moneyou => "moneyou", - UpdatePaymentIntentPaymentMethodDataIdealBank::N26 => "n26", - UpdatePaymentIntentPaymentMethodDataIdealBank::Rabobank => "rabobank", - UpdatePaymentIntentPaymentMethodDataIdealBank::Regiobank => "regiobank", - UpdatePaymentIntentPaymentMethodDataIdealBank::Revolut => "revolut", - UpdatePaymentIntentPaymentMethodDataIdealBank::SnsBank => "sns_bank", - UpdatePaymentIntentPaymentMethodDataIdealBank::TriodosBank => "triodos_bank", - UpdatePaymentIntentPaymentMethodDataIdealBank::VanLanschot => "van_lanschot", - UpdatePaymentIntentPaymentMethodDataIdealBank::Yoursafe => "yoursafe", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataIdealBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataIdealBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataIdealBank { - fn default() -> Self { - Self::AbnAmro - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodDataP24`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataP24Bank { - AliorBank, - BankMillennium, - BankNowyBfgSa, - BankPekaoSa, - BankiSpbdzielcze, - Blik, - BnpParibas, - Boz, - CitiHandlowy, - CreditAgricole, - Envelobank, - EtransferPocztowy24, - GetinBank, - Ideabank, - Ing, - Inteligo, - MbankMtransfer, - NestPrzelew, - NoblePay, - PbacZIpko, - PlusBank, - SantanderPrzelew24, - TmobileUsbugiBankowe, - ToyotaBank, - VolkswagenBank, -} - -impl UpdatePaymentIntentPaymentMethodDataP24Bank { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataP24Bank::AliorBank => "alior_bank", - UpdatePaymentIntentPaymentMethodDataP24Bank::BankMillennium => "bank_millennium", - UpdatePaymentIntentPaymentMethodDataP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa", - UpdatePaymentIntentPaymentMethodDataP24Bank::BankPekaoSa => "bank_pekao_sa", - UpdatePaymentIntentPaymentMethodDataP24Bank::BankiSpbdzielcze => "banki_spbdzielcze", - UpdatePaymentIntentPaymentMethodDataP24Bank::Blik => "blik", - UpdatePaymentIntentPaymentMethodDataP24Bank::BnpParibas => "bnp_paribas", - UpdatePaymentIntentPaymentMethodDataP24Bank::Boz => "boz", - UpdatePaymentIntentPaymentMethodDataP24Bank::CitiHandlowy => "citi_handlowy", - UpdatePaymentIntentPaymentMethodDataP24Bank::CreditAgricole => "credit_agricole", - UpdatePaymentIntentPaymentMethodDataP24Bank::Envelobank => "envelobank", - UpdatePaymentIntentPaymentMethodDataP24Bank::EtransferPocztowy24 => { - "etransfer_pocztowy24" - } - UpdatePaymentIntentPaymentMethodDataP24Bank::GetinBank => "getin_bank", - UpdatePaymentIntentPaymentMethodDataP24Bank::Ideabank => "ideabank", - UpdatePaymentIntentPaymentMethodDataP24Bank::Ing => "ing", - UpdatePaymentIntentPaymentMethodDataP24Bank::Inteligo => "inteligo", - UpdatePaymentIntentPaymentMethodDataP24Bank::MbankMtransfer => "mbank_mtransfer", - UpdatePaymentIntentPaymentMethodDataP24Bank::NestPrzelew => "nest_przelew", - UpdatePaymentIntentPaymentMethodDataP24Bank::NoblePay => "noble_pay", - UpdatePaymentIntentPaymentMethodDataP24Bank::PbacZIpko => "pbac_z_ipko", - UpdatePaymentIntentPaymentMethodDataP24Bank::PlusBank => "plus_bank", - UpdatePaymentIntentPaymentMethodDataP24Bank::SantanderPrzelew24 => { - "santander_przelew24" - } - UpdatePaymentIntentPaymentMethodDataP24Bank::TmobileUsbugiBankowe => { - "tmobile_usbugi_bankowe" - } - UpdatePaymentIntentPaymentMethodDataP24Bank::ToyotaBank => "toyota_bank", - UpdatePaymentIntentPaymentMethodDataP24Bank::VolkswagenBank => "volkswagen_bank", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataP24Bank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataP24Bank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataP24Bank { - fn default() -> Self { - Self::AliorBank - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodDataSofort`'s `country` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataSofortCountry { - #[serde(rename = "AT")] - At, - #[serde(rename = "BE")] - Be, - #[serde(rename = "DE")] - De, - #[serde(rename = "ES")] - Es, - #[serde(rename = "IT")] - It, - #[serde(rename = "NL")] - Nl, -} - -impl UpdatePaymentIntentPaymentMethodDataSofortCountry { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataSofortCountry::At => "AT", - UpdatePaymentIntentPaymentMethodDataSofortCountry::Be => "BE", - UpdatePaymentIntentPaymentMethodDataSofortCountry::De => "DE", - UpdatePaymentIntentPaymentMethodDataSofortCountry::Es => "ES", - UpdatePaymentIntentPaymentMethodDataSofortCountry::It => "IT", - UpdatePaymentIntentPaymentMethodDataSofortCountry::Nl => "NL", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataSofortCountry { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataSofortCountry { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataSofortCountry { - fn default() -> Self { - Self::At - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodData`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataType { - AcssDebit, - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, - Zip, -} - -impl UpdatePaymentIntentPaymentMethodDataType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataType::AcssDebit => "acss_debit", - UpdatePaymentIntentPaymentMethodDataType::Affirm => "affirm", - UpdatePaymentIntentPaymentMethodDataType::AfterpayClearpay => "afterpay_clearpay", - UpdatePaymentIntentPaymentMethodDataType::Alipay => "alipay", - UpdatePaymentIntentPaymentMethodDataType::AuBecsDebit => "au_becs_debit", - UpdatePaymentIntentPaymentMethodDataType::BacsDebit => "bacs_debit", - UpdatePaymentIntentPaymentMethodDataType::Bancontact => "bancontact", - UpdatePaymentIntentPaymentMethodDataType::Blik => "blik", - UpdatePaymentIntentPaymentMethodDataType::Boleto => "boleto", - UpdatePaymentIntentPaymentMethodDataType::Cashapp => "cashapp", - UpdatePaymentIntentPaymentMethodDataType::CustomerBalance => "customer_balance", - UpdatePaymentIntentPaymentMethodDataType::Eps => "eps", - UpdatePaymentIntentPaymentMethodDataType::Fpx => "fpx", - UpdatePaymentIntentPaymentMethodDataType::Giropay => "giropay", - UpdatePaymentIntentPaymentMethodDataType::Grabpay => "grabpay", - UpdatePaymentIntentPaymentMethodDataType::Ideal => "ideal", - UpdatePaymentIntentPaymentMethodDataType::Klarna => "klarna", - UpdatePaymentIntentPaymentMethodDataType::Konbini => "konbini", - UpdatePaymentIntentPaymentMethodDataType::Link => "link", - UpdatePaymentIntentPaymentMethodDataType::Oxxo => "oxxo", - UpdatePaymentIntentPaymentMethodDataType::P24 => "p24", - UpdatePaymentIntentPaymentMethodDataType::Paynow => "paynow", - UpdatePaymentIntentPaymentMethodDataType::Paypal => "paypal", - UpdatePaymentIntentPaymentMethodDataType::Pix => "pix", - UpdatePaymentIntentPaymentMethodDataType::Promptpay => "promptpay", - UpdatePaymentIntentPaymentMethodDataType::SepaDebit => "sepa_debit", - UpdatePaymentIntentPaymentMethodDataType::Sofort => "sofort", - UpdatePaymentIntentPaymentMethodDataType::UsBankAccount => "us_bank_account", - UpdatePaymentIntentPaymentMethodDataType::WechatPay => "wechat_pay", - UpdatePaymentIntentPaymentMethodDataType::Zip => "zip", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataType { - fn default() -> Self { - Self::AcssDebit - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodDataUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::Company => { - "company" - } - UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::Individual => { - "individual" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodDataUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - Checking, - Savings, -} - -impl UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType::Checking => "checking", - UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Combined => "combined", - UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Interval => "interval", - UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Sporadic => "sporadic", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - Business, - Personal, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business", - UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAcssDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::OffSession => { - "off_session" - } - UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => { - "automatic" - } - UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Instant => { - "instant" - } - UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAffirm`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - Manual, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAffirm`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { - Manual, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::Manual => { - "manual" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod -{ - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAlipay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - None, - OffSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::OffSession => { - "off_session" - } - UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsBacsDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::OffSession => { - "off_session" - } - UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::De => "de", - UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::En => "en", - UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::Fr => "fr", - UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsBancontact`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - None, - OffSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsBoleto`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::OffSession => { - "off_session" - } - UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCard`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - Manual, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - Month, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::Month => "month", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - fn default() -> Self { - Self::Month - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - FixedCount, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::FixedCount => { - "fixed_count" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - fn default() -> Self { - Self::FixedCount - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - Fixed, - Maximum, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed", - UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::Maximum => { - "maximum" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - Day, - Month, - Sporadic, - Week, - Year, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Day => "day", - UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Month => "month", - UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Sporadic => { - "sporadic" - } - UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Week => "week", - UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Year => "year", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions`'s `supported_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - India, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::India => { - "india" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes -{ - fn default() -> Self { - Self::India - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Amex => "amex", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::CartesBancaires => { - "cartes_bancaires" - } - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Diners => "diners", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Discover => "discover", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Interac => "interac", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Unionpay => "unionpay", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Unknown => "unknown", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Automatic => { - "automatic" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCard`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::OffSession => { - "off_session" - } - UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCashapp`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - Manual, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCashapp`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::OffSession => { - "off_session" - } - UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer`'s `requested_address_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - Aba, - Iban, - Sepa, - SortCode, - Spei, - Swift, - Zengin, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Aba => "aba", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Iban => "iban", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Sepa => "sepa", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::SortCode => "sort_code", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Spei => "spei", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Swift => "swift", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Zengin => "zengin", - } - } -} - -impl AsRef - for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn default() -> Self { - Self::Aba - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { - EuBankTransfer, - GbBankTransfer, - JpBankTransfer, - MxBankTransfer, - UsBankTransfer, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::EuBankTransfer => "eu_bank_transfer", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::GbBankTransfer => "gb_bank_transfer", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::JpBankTransfer => "jp_bank_transfer", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::MxBankTransfer => "mx_bank_transfer", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::UsBankTransfer => "us_bank_transfer", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType -{ - fn default() -> Self { - Self::EuBankTransfer - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCustomerBalance`'s `funding_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - BankTransfer, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::BankTransfer => { - "bank_transfer" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - fn default() -> Self { - Self::BankTransfer - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCustomerBalance`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsEps`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsFpx`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsGiropay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsGrabpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsIdeal`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - None, - OffSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsKlarna`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - Manual, -} - -impl UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsKlarna`'s `preferred_locale` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - #[serde(rename = "cs-CZ")] - CsCz, - #[serde(rename = "da-DK")] - DaDk, - #[serde(rename = "de-AT")] - DeAt, - #[serde(rename = "de-CH")] - DeCh, - #[serde(rename = "de-DE")] - DeDe, - #[serde(rename = "el-GR")] - ElGr, - #[serde(rename = "en-AT")] - EnAt, - #[serde(rename = "en-AU")] - EnAu, - #[serde(rename = "en-BE")] - EnBe, - #[serde(rename = "en-CA")] - EnCa, - #[serde(rename = "en-CH")] - EnCh, - #[serde(rename = "en-CZ")] - EnCz, - #[serde(rename = "en-DE")] - EnDe, - #[serde(rename = "en-DK")] - EnDk, - #[serde(rename = "en-ES")] - EnEs, - #[serde(rename = "en-FI")] - EnFi, - #[serde(rename = "en-FR")] - EnFr, - #[serde(rename = "en-GB")] - EnGb, - #[serde(rename = "en-GR")] - EnGr, - #[serde(rename = "en-IE")] - EnIe, - #[serde(rename = "en-IT")] - EnIt, - #[serde(rename = "en-NL")] - EnNl, - #[serde(rename = "en-NO")] - EnNo, - #[serde(rename = "en-NZ")] - EnNz, - #[serde(rename = "en-PL")] - EnPl, - #[serde(rename = "en-PT")] - EnPt, - #[serde(rename = "en-SE")] - EnSe, - #[serde(rename = "en-US")] - EnUs, - #[serde(rename = "es-ES")] - EsEs, - #[serde(rename = "es-US")] - EsUs, - #[serde(rename = "fi-FI")] - FiFi, - #[serde(rename = "fr-BE")] - FrBe, - #[serde(rename = "fr-CA")] - FrCa, - #[serde(rename = "fr-CH")] - FrCh, - #[serde(rename = "fr-FR")] - FrFr, - #[serde(rename = "it-CH")] - ItCh, - #[serde(rename = "it-IT")] - ItIt, - #[serde(rename = "nb-NO")] - NbNo, - #[serde(rename = "nl-BE")] - NlBe, - #[serde(rename = "nl-NL")] - NlNl, - #[serde(rename = "pl-PL")] - PlPl, - #[serde(rename = "pt-PT")] - PtPt, - #[serde(rename = "sv-FI")] - SvFi, - #[serde(rename = "sv-SE")] - SvSe, -} - -impl UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::CsCz => "cs-CZ", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::DaDk => "da-DK", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::DeAt => "de-AT", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::DeCh => "de-CH", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::DeDe => "de-DE", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::ElGr => "el-GR", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnAt => "en-AT", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnAu => "en-AU", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnBe => "en-BE", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnCa => "en-CA", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnCh => "en-CH", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnCz => "en-CZ", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnDe => "en-DE", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnDk => "en-DK", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnEs => "en-ES", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnFi => "en-FI", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnFr => "en-FR", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnGb => "en-GB", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnGr => "en-GR", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnIe => "en-IE", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnIt => "en-IT", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnNl => "en-NL", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnNo => "en-NO", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnNz => "en-NZ", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnPl => "en-PL", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnPt => "en-PT", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnSe => "en-SE", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnUs => "en-US", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EsEs => "es-ES", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EsUs => "es-US", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FiFi => "fi-FI", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FrBe => "fr-BE", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FrCa => "fr-CA", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FrCh => "fr-CH", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FrFr => "fr-FR", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::ItCh => "it-CH", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::ItIt => "it-IT", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::NbNo => "nb-NO", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::NlBe => "nl-BE", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::NlNl => "nl-NL", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::PlPl => "pl-PL", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::PtPt => "pt-PT", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::SvFi => "sv-FI", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::SvSe => "sv-SE", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - fn default() -> Self { - Self::CsCz - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsKlarna`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsKonbini`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsLink`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - Manual, -} - -impl UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsLink`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - None, - OffSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsOxxo`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsP24`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsPaynow`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsPaypal`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - Manual, -} - -impl UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsPaypal`'s `preferred_locale` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - #[serde(rename = "cs-CZ")] - CsCz, - #[serde(rename = "da-DK")] - DaDk, - #[serde(rename = "de-AT")] - DeAt, - #[serde(rename = "de-DE")] - DeDe, - #[serde(rename = "de-LU")] - DeLu, - #[serde(rename = "el-GR")] - ElGr, - #[serde(rename = "en-GB")] - EnGb, - #[serde(rename = "en-US")] - EnUs, - #[serde(rename = "es-ES")] - EsEs, - #[serde(rename = "fi-FI")] - FiFi, - #[serde(rename = "fr-BE")] - FrBe, - #[serde(rename = "fr-FR")] - FrFr, - #[serde(rename = "fr-LU")] - FrLu, - #[serde(rename = "hu-HU")] - HuHu, - #[serde(rename = "it-IT")] - ItIt, - #[serde(rename = "nl-BE")] - NlBe, - #[serde(rename = "nl-NL")] - NlNl, - #[serde(rename = "pl-PL")] - PlPl, - #[serde(rename = "pt-PT")] - PtPt, - #[serde(rename = "sk-SK")] - SkSk, - #[serde(rename = "sv-SE")] - SvSe, -} - -impl UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::CsCz => "cs-CZ", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::DaDk => "da-DK", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::DeAt => "de-AT", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::DeDe => "de-DE", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::DeLu => "de-LU", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::ElGr => "el-GR", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::EnGb => "en-GB", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::EnUs => "en-US", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::EsEs => "es-ES", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::FiFi => "fi-FI", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::FrBe => "fr-BE", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::FrFr => "fr-FR", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::FrLu => "fr-LU", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::HuHu => "hu-HU", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::ItIt => "it-IT", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::NlBe => "nl-BE", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::NlNl => "nl-NL", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::PlPl => "pl-PL", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::PtPt => "pt-PT", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::SkSk => "sk-SK", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::SvSe => "sv-SE", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - fn default() -> Self { - Self::CsCz - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsPaypal`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - None, - OffSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsPix`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsPromptpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsSepaDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::OffSession => { - "off_session" - } - UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsSofort`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - De, - En, - Es, - Fr, - It, - Nl, - Pl, -} - -impl UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::De => "de", - UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::En => "en", - UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::Es => "es", - UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::Fr => "fr", - UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::It => "it", - UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::Nl => "nl", - UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::Pl => "pl", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsSofort`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - None, - OffSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances", - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership", - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method", - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - Balances, -} - -impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", - } - } -} - -impl AsRef - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks`'s `requested` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - Ach, - UsDomesticWire, -} - -impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::Ach => "ach", - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::UsDomesticWire => "us_domestic_wire", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested -{ - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsUsBankAccount`'s `preferred_settlement_speed` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - Fastest, - Standard, -} - -impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::Fastest => "fastest", - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::Standard => "standard", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed -{ - fn default() -> Self { - Self::Fastest - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsUsBankAccount`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::OffSession => { - "off_session" - } - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => "automatic", - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant", - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => "microdeposits", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsWechatPay`'s `client` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { - Android, - Ios, - Web, -} - -impl UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::Android => "android", - UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::Ios => "ios", - UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::Web => "web", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { - fn default() -> Self { - Self::Android - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsWechatPay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsZip`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - fn default() -> Self { - Self::None - } -} diff --git a/src/resources/generated/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs b/src/resources/generated/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs deleted file mode 100644 index 029b162ee..000000000 --- a/src/resources/generated/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs +++ /dev/null @@ -1,31 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::params::Timestamp; - -/// The resource representing a Stripe "PaymentIntentNextActionCashappHandleRedirectOrDisplayQrCode". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionCashappHandleRedirectOrDisplayQrCode { - /// The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR code, and supports QR code refreshing on expiration. - pub hosted_instructions_url: String, - - /// The url for mobile redirect based auth. - pub mobile_auth_url: String, - - pub qr_code: PaymentIntentNextActionCashappQrCode, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionCashappQrCode { - /// The date (unix timestamp) when the QR code expires. - pub expires_at: Timestamp, - - /// The image_url_png string used to render QR code. - pub image_url_png: String, - - /// The image_url_svg string used to render QR code. - pub image_url_svg: String, -} diff --git a/src/resources/generated/payment_link.rs b/src/resources/generated/payment_link.rs deleted file mode 100644 index d477cefdc..000000000 --- a/src/resources/generated/payment_link.rs +++ /dev/null @@ -1,4619 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::PaymentLinkId; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable}; -use crate::resources::{ - Account, Application, CheckoutSessionItem, Currency, InvoiceSettingRenderingOptions, - ShippingRate, TaxId, -}; - -/// The resource representing a Stripe "PaymentLink". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLink { - /// Unique identifier for the object. - pub id: PaymentLinkId, - - /// Whether the payment link's `url` is active. - /// - /// If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. - pub active: bool, - - pub after_completion: PaymentLinksResourceAfterCompletion, - - /// Whether user redeemable promotion codes are enabled. - pub allow_promotion_codes: bool, - - /// The ID of the Connect application that created the Payment Link. - pub application: Option>, - - /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - pub application_fee_amount: Option, - - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - pub application_fee_percent: Option, - - pub automatic_tax: PaymentLinksResourceAutomaticTax, - - /// Configuration for collecting the customer's billing address. - pub billing_address_collection: PaymentLinkBillingAddressCollection, - - /// When set, provides configuration to gather active consent from customers. - pub consent_collection: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Collect additional information from your customer using custom fields. - /// - /// Up to 2 fields are supported. - pub custom_fields: Vec, - - pub custom_text: PaymentLinksResourceCustomText, - - /// Configuration for Customer creation during checkout. - pub customer_creation: PaymentLinkCustomerCreation, - - /// Configuration for creating invoice for payment mode payment links. - pub invoice_creation: Option, - - /// The line items representing what is being sold. - #[serde(default)] - pub line_items: List, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// The account on behalf of which to charge. - /// - /// See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. - pub on_behalf_of: Option>, - - /// Indicates the parameters to be passed to PaymentIntent creation during checkout. - pub payment_intent_data: Option, - - /// Configuration for collecting a payment method during checkout. - pub payment_method_collection: PaymentLinkPaymentMethodCollection, - - /// The list of payment method types that customers can use. - /// - /// When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). - pub payment_method_types: Option>, - - pub phone_number_collection: PaymentLinksResourcePhoneNumberCollection, - - /// Configuration for collecting the customer's shipping address. - pub shipping_address_collection: Option, - - /// The shipping rate options applied to the session. - pub shipping_options: Vec, - - /// Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. - pub submit_type: PaymentLinkSubmitType, - - /// When creating a subscription, the specified configuration data will be used. - /// - /// There must be at least one line item with a recurring price to use `subscription_data`. - pub subscription_data: Option, - - pub tax_id_collection: PaymentLinksResourceTaxIdCollection, - - /// The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. - pub transfer_data: Option, - - /// The public URL that can be shared with customers. - pub url: String, -} - -impl PaymentLink { - /// Returns a list of your payment links. - pub fn list(client: &Client, params: &ListPaymentLinks<'_>) -> Response> { - client.get_query("/payment_links", ¶ms) - } - - /// Creates a payment link. - pub fn create(client: &Client, params: CreatePaymentLink<'_>) -> Response { - client.post_form("/payment_links", ¶ms) - } - - /// Retrieve a payment link. - pub fn retrieve(client: &Client, id: &PaymentLinkId, expand: &[&str]) -> Response { - client.get_query(&format!("/payment_links/{}", id), &Expand { expand }) - } - - /// Updates a payment link. - pub fn update( - client: &Client, - id: &PaymentLinkId, - params: UpdatePaymentLink<'_>, - ) -> Response { - client.post_form(&format!("/payment_links/{}", id), ¶ms) - } -} - -impl Object for PaymentLink { - type Id = PaymentLinkId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "payment_link" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceAfterCompletion { - #[serde(skip_serializing_if = "Option::is_none")] - pub hosted_confirmation: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect: Option, - - /// The specified behavior after the purchase is complete. - #[serde(rename = "type")] - pub type_: PaymentLinksResourceAfterCompletionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceAutomaticTax { - /// If `true`, tax will be calculated automatically using the customer's location. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCompletionBehaviorConfirmationPage { - /// The custom message that is displayed to the customer after the purchase is complete. - pub custom_message: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCompletionBehaviorRedirect { - /// The URL the customer will be redirected to after the purchase is complete. - pub url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceConsentCollection { - /// If set to `auto`, enables the collection of customer consent for promotional communications. - pub promotions: Option, - - /// If set to `required`, it requires cutomers to accept the terms of service before being able to pay. - /// - /// If set to `none`, customers won't be shown a checkbox to accept the terms of service. - pub terms_of_service: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCustomFields { - /// Configuration for `type=dropdown` fields. - pub dropdown: Option, - - /// String of your choice that your integration can use to reconcile this field. - /// - /// Must be unique to this field, alphanumeric, and up to 200 characters. - pub key: String, - - pub label: PaymentLinksResourceCustomFieldsLabel, - - /// Configuration for `type=numeric` fields. - pub numeric: Option, - - /// Whether the customer is required to complete the field before completing the Checkout Session. - /// - /// Defaults to `false`. - pub optional: bool, - - /// Configuration for `type=text` fields. - pub text: Option, - - /// The type of the field. - #[serde(rename = "type")] - pub type_: PaymentLinksResourceCustomFieldsType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCustomFieldsDropdown { - /// The options available for the customer to select. - /// - /// Up to 200 options allowed. - pub options: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCustomFieldsDropdownOption { - /// The label for the option, displayed to the customer. - /// - /// Up to 100 characters. - pub label: String, - - /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. - /// - /// Must be unique to this option, alphanumeric, and up to 100 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCustomFieldsLabel { - /// Custom text for the label, displayed to the customer. - /// - /// Up to 50 characters. - pub custom: Option, - - /// The type of the label. - #[serde(rename = "type")] - pub type_: PaymentLinksResourceCustomFieldsLabelType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCustomFieldsNumeric { - /// The maximum character length constraint for the customer's input. - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - pub minimum_length: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCustomFieldsText { - /// The maximum character length constraint for the customer's input. - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - pub minimum_length: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCustomText { - /// Custom text that should be displayed alongside shipping address collection. - pub shipping_address: Option, - - /// Custom text that should be displayed alongside the payment confirmation button. - pub submit: Option, - - /// Custom text that should be displayed in place of the default terms of service agreement text. - pub terms_of_service_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCustomTextPosition { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceInvoiceCreation { - /// Enable creating an invoice on successful payment. - pub enabled: bool, - - /// Configuration for the invoice. - /// - /// Default invoice values will be used if unspecified. - pub invoice_data: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceInvoiceSettings { - /// The account tax IDs associated with the invoice. - pub account_tax_ids: Option>>, - - /// A list of up to 4 custom fields to be displayed on the invoice. - pub custom_fields: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// Footer to be displayed on the invoice. - pub footer: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// Options for invoice PDF rendering. - pub rendering_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceSettingCustomField { - /// The name of the custom field. - pub name: String, - - /// The value of the custom field. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourcePaymentIntentData { - /// Indicates when the funds will be captured from the customer's account. - pub capture_method: Option, - - /// Indicates that you intend to make future payments with the payment method collected during checkout. - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourcePhoneNumberCollection { - /// If `true`, a phone number will be collected during checkout. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceShippingAddressCollection { - /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. - /// - /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. - pub allowed_countries: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceShippingOption { - /// A non-negative integer in cents representing how much to charge. - pub shipping_amount: i64, - - /// The ID of the Shipping Rate to use for this shipping option. - pub shipping_rate: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceSubscriptionData { - /// The subscription's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription. - pub description: Option, - - /// Integer representing the number of trial period days before the customer is charged for the first time. - pub trial_period_days: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceTaxIdCollection { - /// Indicates whether tax ID collection is enabled for the session. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceTransferData { - /// The amount in cents (or local equivalent) that will be transferred to the destination account. - /// - /// By default, the entire amount is transferred to the destination. - pub amount: Option, - - /// The connected account receiving the transfer. - pub destination: Expandable, -} - -/// The parameters for `PaymentLink::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreatePaymentLink<'a> { - /// Behavior after the purchase is complete. - #[serde(skip_serializing_if = "Option::is_none")] - pub after_completion: Option, - - /// Enables user redeemable promotion codes. - #[serde(skip_serializing_if = "Option::is_none")] - pub allow_promotion_codes: Option, - - /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - /// - /// Can only be applied when there are no line items with recurring prices. - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - /// There must be at least 1 line item with a recurring price to use this field. - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_percent: Option, - - /// Configuration for automatic tax collection. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Configuration for collecting the customer's billing address. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_address_collection: Option, - - /// Configure fields to gather active consent from customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub consent_collection: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies) and supported by each line item's price. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Collect additional information from your customer using custom fields. - /// - /// Up to 2 fields are supported. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// Display additional text for your customers using custom text. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_text: Option, - - /// Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_creation: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Generate a post-purchase Invoice for one-time payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_creation: Option, - - /// The line items representing what is being sold. - /// - /// Each line item represents an item being sold. - /// Up to 20 line items are supported. - pub line_items: Vec, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - /// Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The account on behalf of which to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option<&'a str>, - - /// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent_data: Option, - - /// Specify whether Checkout should collect a payment method. - /// - /// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_collection: Option, - - /// The list of payment method types that customers can use. - /// - /// If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, - - /// Controls phone number collection settings during checkout. - /// - /// We recommend that you review your privacy policy and check with your legal contacts. - #[serde(skip_serializing_if = "Option::is_none")] - pub phone_number_collection: Option, - - /// Configuration for collecting the customer's shipping address. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_address_collection: Option, - - /// The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_options: Option>, - - /// Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. - /// - /// Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). - #[serde(skip_serializing_if = "Option::is_none")] - pub submit_type: Option, - - /// When creating a subscription, the specified configuration data will be used. - /// - /// There must be at least one line item with a recurring price to use `subscription_data`. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_data: Option, - - /// Controls tax ID collection during checkout. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_id_collection: Option, - - /// The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, -} - -impl<'a> CreatePaymentLink<'a> { - pub fn new(line_items: Vec) -> Self { - CreatePaymentLink { - after_completion: Default::default(), - allow_promotion_codes: Default::default(), - application_fee_amount: Default::default(), - application_fee_percent: Default::default(), - automatic_tax: Default::default(), - billing_address_collection: Default::default(), - consent_collection: Default::default(), - currency: Default::default(), - custom_fields: Default::default(), - custom_text: Default::default(), - customer_creation: Default::default(), - expand: Default::default(), - invoice_creation: Default::default(), - line_items, - metadata: Default::default(), - on_behalf_of: Default::default(), - payment_intent_data: Default::default(), - payment_method_collection: Default::default(), - payment_method_types: Default::default(), - phone_number_collection: Default::default(), - shipping_address_collection: Default::default(), - shipping_options: Default::default(), - submit_type: Default::default(), - subscription_data: Default::default(), - tax_id_collection: Default::default(), - transfer_data: Default::default(), - } - } -} - -/// The parameters for `PaymentLink::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPaymentLinks<'a> { - /// Only return payment links that are active or inactive (e.g., pass `false` to list all inactive payment links). - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListPaymentLinks<'a> { - pub fn new() -> Self { - ListPaymentLinks { - active: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListPaymentLinks<'_> { - type O = PaymentLink; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `PaymentLink::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePaymentLink<'a> { - /// Whether the payment link's `url` is active. - /// - /// If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Behavior after the purchase is complete. - #[serde(skip_serializing_if = "Option::is_none")] - pub after_completion: Option, - - /// Enables user redeemable promotion codes. - #[serde(skip_serializing_if = "Option::is_none")] - pub allow_promotion_codes: Option, - - /// Configuration for automatic tax collection. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Configuration for collecting the customer's billing address. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_address_collection: Option, - - /// Collect additional information from your customer using custom fields. - /// - /// Up to 2 fields are supported. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// Display additional text for your customers using custom text. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_text: Option, - - /// Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_creation: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Generate a post-purchase Invoice for one-time payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_creation: Option, - - /// The line items representing what is being sold. - /// - /// Each line item represents an item being sold. - /// Up to 20 line items are supported. - #[serde(skip_serializing_if = "Option::is_none")] - pub line_items: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - /// Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Specify whether Checkout should collect a payment method. - /// - /// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_collection: Option, - - /// The list of payment method types that customers can use. - /// - /// Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, - - /// Configuration for collecting the customer's shipping address. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_address_collection: Option, -} - -impl<'a> UpdatePaymentLink<'a> { - pub fn new() -> Self { - UpdatePaymentLink { - active: Default::default(), - after_completion: Default::default(), - allow_promotion_codes: Default::default(), - automatic_tax: Default::default(), - billing_address_collection: Default::default(), - custom_fields: Default::default(), - custom_text: Default::default(), - customer_creation: Default::default(), - expand: Default::default(), - invoice_creation: Default::default(), - line_items: Default::default(), - metadata: Default::default(), - payment_method_collection: Default::default(), - payment_method_types: Default::default(), - shipping_address_collection: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkAfterCompletion { - /// Configuration when `type=hosted_confirmation`. - #[serde(skip_serializing_if = "Option::is_none")] - pub hosted_confirmation: Option, - - /// Configuration when `type=redirect`. - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect: Option, - - /// The specified behavior after the purchase is complete. - /// - /// Either `redirect` or `hosted_confirmation`. - #[serde(rename = "type")] - pub type_: CreatePaymentLinkAfterCompletionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkAutomaticTax { - /// If `true`, tax will be calculated automatically using the customer's location. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkConsentCollection { - /// If set to `auto`, enables the collection of customer consent for promotional communications. - /// - /// The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. - /// Only available to US merchants. - #[serde(skip_serializing_if = "Option::is_none")] - pub promotions: Option, - - /// If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. - /// There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). - #[serde(skip_serializing_if = "Option::is_none")] - pub terms_of_service: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomFields { - /// Configuration for `type=dropdown` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub dropdown: Option, - - /// String of your choice that your integration can use to reconcile this field. - /// - /// Must be unique to this field, alphanumeric, and up to 200 characters. - pub key: String, - - /// The label for the field, displayed to the customer. - pub label: CreatePaymentLinkCustomFieldsLabel, - - /// Configuration for `type=numeric` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub numeric: Option, - - /// Whether the customer is required to complete the field before completing the Checkout Session. - /// - /// Defaults to `false`. - #[serde(skip_serializing_if = "Option::is_none")] - pub optional: Option, - - /// Configuration for `type=text` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub text: Option, - - /// The type of the field. - #[serde(rename = "type")] - pub type_: CreatePaymentLinkCustomFieldsType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomText { - /// Custom text that should be displayed alongside shipping address collection. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_address: Option, - - /// Custom text that should be displayed alongside the payment confirmation button. - #[serde(skip_serializing_if = "Option::is_none")] - pub submit: Option, - - /// Custom text that should be displayed in place of the default terms of service agreement text. - #[serde(skip_serializing_if = "Option::is_none")] - pub terms_of_service_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkInvoiceCreation { - /// Whether the feature is enabled. - pub enabled: bool, - - /// Invoice PDF configuration. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_data: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkLineItems { - /// When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout. - #[serde(skip_serializing_if = "Option::is_none")] - pub adjustable_quantity: Option, - - /// The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. - pub price: String, - - /// The quantity of the line item being purchased. - pub quantity: u64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkPaymentIntentData { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. - /// - /// When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. - /// - /// When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. - /// - /// If a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer. - /// - /// If Checkout does not create a Customer, the payment method is not attached to a Customer. - /// - /// To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkPhoneNumberCollection { - /// Set to `true` to enable phone number collection. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkShippingAddressCollection { - /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for - /// shipping locations. - /// - /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. - pub allowed_countries: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkShippingOptions { - /// The ID of the Shipping Rate to use for this shipping option. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_rate: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkSubscriptionData { - /// The subscription's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Integer representing the number of trial period days before the customer is charged for the first time. - /// - /// Has to be at least 1. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_period_days: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkTaxIdCollection { - /// Set to `true` to enable tax ID collection. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkTransferData { - /// The amount that will be transferred automatically when a charge succeeds. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// If specified, successful charges will be attributed to the destination - /// account for tax reporting, and the funds from charges will be transferred - /// to the destination account. - /// - /// The ID of the resulting transfer will be returned on the successful charge's `transfer` field. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkAfterCompletion { - /// Configuration when `type=hosted_confirmation`. - #[serde(skip_serializing_if = "Option::is_none")] - pub hosted_confirmation: Option, - - /// Configuration when `type=redirect`. - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect: Option, - - /// The specified behavior after the purchase is complete. - /// - /// Either `redirect` or `hosted_confirmation`. - #[serde(rename = "type")] - pub type_: UpdatePaymentLinkAfterCompletionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkAutomaticTax { - /// If `true`, tax will be calculated automatically using the customer's location. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomFields { - /// Configuration for `type=dropdown` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub dropdown: Option, - - /// String of your choice that your integration can use to reconcile this field. - /// - /// Must be unique to this field, alphanumeric, and up to 200 characters. - pub key: String, - - /// The label for the field, displayed to the customer. - pub label: UpdatePaymentLinkCustomFieldsLabel, - - /// Configuration for `type=numeric` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub numeric: Option, - - /// Whether the customer is required to complete the field before completing the Checkout Session. - /// - /// Defaults to `false`. - #[serde(skip_serializing_if = "Option::is_none")] - pub optional: Option, - - /// Configuration for `type=text` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub text: Option, - - /// The type of the field. - #[serde(rename = "type")] - pub type_: UpdatePaymentLinkCustomFieldsType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomText { - /// Custom text that should be displayed alongside shipping address collection. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_address: Option, - - /// Custom text that should be displayed alongside the payment confirmation button. - #[serde(skip_serializing_if = "Option::is_none")] - pub submit: Option, - - /// Custom text that should be displayed in place of the default terms of service agreement text. - #[serde(skip_serializing_if = "Option::is_none")] - pub terms_of_service_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkInvoiceCreation { - /// Whether the feature is enabled. - pub enabled: bool, - - /// Invoice PDF configuration. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_data: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkLineItems { - /// When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout. - #[serde(skip_serializing_if = "Option::is_none")] - pub adjustable_quantity: Option, - - /// The ID of an existing line item on the payment link. - pub id: String, - - /// The quantity of the line item being purchased. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkShippingAddressCollection { - /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for - /// shipping locations. - /// - /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. - pub allowed_countries: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkAfterCompletionHostedConfirmation { - /// A custom message to display to the customer after the purchase is complete. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_message: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkAfterCompletionRedirect { - /// The URL the customer will be redirected to after the purchase is complete. - /// - /// You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included. - pub url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomFieldsDropdown { - /// The options available for the customer to select. - /// - /// Up to 200 options allowed. - pub options: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomFieldsLabel { - /// Custom text for the label, displayed to the customer. - /// - /// Up to 50 characters. - pub custom: String, - - /// The type of the label. - #[serde(rename = "type")] - pub type_: CreatePaymentLinkCustomFieldsLabelType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomFieldsNumeric { - /// The maximum character length constraint for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum_length: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomFieldsText { - /// The maximum character length constraint for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum_length: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomTextShippingAddress { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomTextSubmit { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomTextTermsOfServiceAcceptance { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkInvoiceCreationInvoiceData { - /// The account tax IDs associated with the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_tax_ids: Option>, - - /// Default custom fields to be displayed on invoices for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Default footer to be displayed on invoices for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub footer: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Default options for invoice PDF rendering for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub rendering_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkLineItemsAdjustableQuantity { - /// Set to true if the quantity can be adjusted to any non-negative Integer. - pub enabled: bool, - - /// The maximum quantity the customer can purchase. - /// - /// By default this value is 99. - /// You can specify a value up to 999. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: Option, - - /// The minimum quantity the customer can purchase. - /// - /// By default this value is 0. - /// If there is only one item in the cart then that item's quantity cannot go down to 0. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkAfterCompletionHostedConfirmation { - /// A custom message to display to the customer after the purchase is complete. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_message: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkAfterCompletionRedirect { - /// The URL the customer will be redirected to after the purchase is complete. - /// - /// You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included. - pub url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomFieldsDropdown { - /// The options available for the customer to select. - /// - /// Up to 200 options allowed. - pub options: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomFieldsLabel { - /// Custom text for the label, displayed to the customer. - /// - /// Up to 50 characters. - pub custom: String, - - /// The type of the label. - #[serde(rename = "type")] - pub type_: UpdatePaymentLinkCustomFieldsLabelType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomFieldsNumeric { - /// The maximum character length constraint for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum_length: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomFieldsText { - /// The maximum character length constraint for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum_length: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomTextShippingAddress { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomTextSubmit { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomTextTermsOfServiceAcceptance { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkInvoiceCreationInvoiceData { - /// The account tax IDs associated with the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_tax_ids: Option>, - - /// Default custom fields to be displayed on invoices for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Default footer to be displayed on invoices for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub footer: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Default options for invoice PDF rendering for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub rendering_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkLineItemsAdjustableQuantity { - /// Set to true if the quantity can be adjusted to any non-negative Integer. - pub enabled: bool, - - /// The maximum quantity the customer can purchase. - /// - /// By default this value is 99. - /// You can specify a value up to 999. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: Option, - - /// The minimum quantity the customer can purchase. - /// - /// By default this value is 0. - /// If there is only one item in the cart then that item's quantity cannot go down to 0. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomFieldsDropdownOptions { - /// The label for the option, displayed to the customer. - /// - /// Up to 100 characters. - pub label: String, - - /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. - /// - /// Must be unique to this option, alphanumeric, and up to 100 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkInvoiceCreationInvoiceDataCustomFields { - /// The name of the custom field. - /// - /// This may be up to 30 characters. - pub name: String, - - /// The value of the custom field. - /// - /// This may be up to 30 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { - /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. - /// - /// One of `exclude_tax` or `include_inclusive_tax`. - /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. - /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_tax_display: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomFieldsDropdownOptions { - /// The label for the option, displayed to the customer. - /// - /// Up to 100 characters. - pub label: String, - - /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. - /// - /// Must be unique to this option, alphanumeric, and up to 100 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkInvoiceCreationInvoiceDataCustomFields { - /// The name of the custom field. - /// - /// This may be up to 30 characters. - pub name: String, - - /// The value of the custom field. - /// - /// This may be up to 30 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { - /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. - /// - /// One of `exclude_tax` or `include_inclusive_tax`. - /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. - /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_tax_display: - Option, -} - -/// An enum representing the possible values of an `CreatePaymentLinkAfterCompletion`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkAfterCompletionType { - HostedConfirmation, - Redirect, -} - -impl CreatePaymentLinkAfterCompletionType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkAfterCompletionType::HostedConfirmation => "hosted_confirmation", - CreatePaymentLinkAfterCompletionType::Redirect => "redirect", - } - } -} - -impl AsRef for CreatePaymentLinkAfterCompletionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkAfterCompletionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkAfterCompletionType { - fn default() -> Self { - Self::HostedConfirmation - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkConsentCollection`'s `promotions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkConsentCollectionPromotions { - Auto, - None, -} - -impl CreatePaymentLinkConsentCollectionPromotions { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkConsentCollectionPromotions::Auto => "auto", - CreatePaymentLinkConsentCollectionPromotions::None => "none", - } - } -} - -impl AsRef for CreatePaymentLinkConsentCollectionPromotions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkConsentCollectionPromotions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkConsentCollectionPromotions { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkConsentCollection`'s `terms_of_service` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkConsentCollectionTermsOfService { - None, - Required, -} - -impl CreatePaymentLinkConsentCollectionTermsOfService { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkConsentCollectionTermsOfService::None => "none", - CreatePaymentLinkConsentCollectionTermsOfService::Required => "required", - } - } -} - -impl AsRef for CreatePaymentLinkConsentCollectionTermsOfService { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkConsentCollectionTermsOfService { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkConsentCollectionTermsOfService { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkCustomFieldsLabel`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkCustomFieldsLabelType { - Custom, -} - -impl CreatePaymentLinkCustomFieldsLabelType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkCustomFieldsLabelType::Custom => "custom", - } - } -} - -impl AsRef for CreatePaymentLinkCustomFieldsLabelType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkCustomFieldsLabelType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkCustomFieldsLabelType { - fn default() -> Self { - Self::Custom - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkCustomFields`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkCustomFieldsType { - Dropdown, - Numeric, - Text, -} - -impl CreatePaymentLinkCustomFieldsType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkCustomFieldsType::Dropdown => "dropdown", - CreatePaymentLinkCustomFieldsType::Numeric => "numeric", - CreatePaymentLinkCustomFieldsType::Text => "text", - } - } -} - -impl AsRef for CreatePaymentLinkCustomFieldsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkCustomFieldsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkCustomFieldsType { - fn default() -> Self { - Self::Dropdown - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions`'s `amount_tax_display` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { - ExcludeTax, - IncludeInclusiveTax, -} - -impl CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::ExcludeTax => "exclude_tax", - CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::IncludeInclusiveTax => "include_inclusive_tax", - } - } -} - -impl AsRef for CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay -{ - fn default() -> Self { - Self::ExcludeTax - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkPaymentIntentData`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkPaymentIntentDataCaptureMethod { - Automatic, - AutomaticAsync, - Manual, -} - -impl CreatePaymentLinkPaymentIntentDataCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkPaymentIntentDataCaptureMethod::Automatic => "automatic", - CreatePaymentLinkPaymentIntentDataCaptureMethod::AutomaticAsync => "automatic_async", - CreatePaymentLinkPaymentIntentDataCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreatePaymentLinkPaymentIntentDataCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkPaymentIntentDataCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkPaymentIntentDataCaptureMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkPaymentIntentData`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkPaymentIntentDataSetupFutureUsage { - OffSession, - OnSession, -} - -impl CreatePaymentLinkPaymentIntentDataSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkPaymentIntentDataSetupFutureUsage::OffSession => "off_session", - CreatePaymentLinkPaymentIntentDataSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CreatePaymentLinkPaymentIntentDataSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkPaymentIntentDataSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkPaymentIntentDataSetupFutureUsage { - fn default() -> Self { - Self::OffSession - } -} - -/// An enum representing the possible values of an `CreatePaymentLink`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkPaymentMethodTypes { - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Card, - Cashapp, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, -} - -impl CreatePaymentLinkPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkPaymentMethodTypes::Affirm => "affirm", - CreatePaymentLinkPaymentMethodTypes::AfterpayClearpay => "afterpay_clearpay", - CreatePaymentLinkPaymentMethodTypes::Alipay => "alipay", - CreatePaymentLinkPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - CreatePaymentLinkPaymentMethodTypes::BacsDebit => "bacs_debit", - CreatePaymentLinkPaymentMethodTypes::Bancontact => "bancontact", - CreatePaymentLinkPaymentMethodTypes::Blik => "blik", - CreatePaymentLinkPaymentMethodTypes::Boleto => "boleto", - CreatePaymentLinkPaymentMethodTypes::Card => "card", - CreatePaymentLinkPaymentMethodTypes::Cashapp => "cashapp", - CreatePaymentLinkPaymentMethodTypes::Eps => "eps", - CreatePaymentLinkPaymentMethodTypes::Fpx => "fpx", - CreatePaymentLinkPaymentMethodTypes::Giropay => "giropay", - CreatePaymentLinkPaymentMethodTypes::Grabpay => "grabpay", - CreatePaymentLinkPaymentMethodTypes::Ideal => "ideal", - CreatePaymentLinkPaymentMethodTypes::Klarna => "klarna", - CreatePaymentLinkPaymentMethodTypes::Konbini => "konbini", - CreatePaymentLinkPaymentMethodTypes::Link => "link", - CreatePaymentLinkPaymentMethodTypes::Oxxo => "oxxo", - CreatePaymentLinkPaymentMethodTypes::P24 => "p24", - CreatePaymentLinkPaymentMethodTypes::Paynow => "paynow", - CreatePaymentLinkPaymentMethodTypes::Paypal => "paypal", - CreatePaymentLinkPaymentMethodTypes::Pix => "pix", - CreatePaymentLinkPaymentMethodTypes::Promptpay => "promptpay", - CreatePaymentLinkPaymentMethodTypes::SepaDebit => "sepa_debit", - CreatePaymentLinkPaymentMethodTypes::Sofort => "sofort", - CreatePaymentLinkPaymentMethodTypes::UsBankAccount => "us_bank_account", - CreatePaymentLinkPaymentMethodTypes::WechatPay => "wechat_pay", - } - } -} - -impl AsRef for CreatePaymentLinkPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkPaymentMethodTypes { - fn default() -> Self { - Self::Affirm - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkShippingAddressCollection`'s `allowed_countries` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkShippingAddressCollectionAllowedCountries { - #[serde(rename = "AC")] - Ac, - #[serde(rename = "AD")] - Ad, - #[serde(rename = "AE")] - Ae, - #[serde(rename = "AF")] - Af, - #[serde(rename = "AG")] - Ag, - #[serde(rename = "AI")] - Ai, - #[serde(rename = "AL")] - Al, - #[serde(rename = "AM")] - Am, - #[serde(rename = "AO")] - Ao, - #[serde(rename = "AQ")] - Aq, - #[serde(rename = "AR")] - Ar, - #[serde(rename = "AT")] - At, - #[serde(rename = "AU")] - Au, - #[serde(rename = "AW")] - Aw, - #[serde(rename = "AX")] - Ax, - #[serde(rename = "AZ")] - Az, - #[serde(rename = "BA")] - Ba, - #[serde(rename = "BB")] - Bb, - #[serde(rename = "BD")] - Bd, - #[serde(rename = "BE")] - Be, - #[serde(rename = "BF")] - Bf, - #[serde(rename = "BG")] - Bg, - #[serde(rename = "BH")] - Bh, - #[serde(rename = "BI")] - Bi, - #[serde(rename = "BJ")] - Bj, - #[serde(rename = "BL")] - Bl, - #[serde(rename = "BM")] - Bm, - #[serde(rename = "BN")] - Bn, - #[serde(rename = "BO")] - Bo, - #[serde(rename = "BQ")] - Bq, - #[serde(rename = "BR")] - Br, - #[serde(rename = "BS")] - Bs, - #[serde(rename = "BT")] - Bt, - #[serde(rename = "BV")] - Bv, - #[serde(rename = "BW")] - Bw, - #[serde(rename = "BY")] - By, - #[serde(rename = "BZ")] - Bz, - #[serde(rename = "CA")] - Ca, - #[serde(rename = "CD")] - Cd, - #[serde(rename = "CF")] - Cf, - #[serde(rename = "CG")] - Cg, - #[serde(rename = "CH")] - Ch, - #[serde(rename = "CI")] - Ci, - #[serde(rename = "CK")] - Ck, - #[serde(rename = "CL")] - Cl, - #[serde(rename = "CM")] - Cm, - #[serde(rename = "CN")] - Cn, - #[serde(rename = "CO")] - Co, - #[serde(rename = "CR")] - Cr, - #[serde(rename = "CV")] - Cv, - #[serde(rename = "CW")] - Cw, - #[serde(rename = "CY")] - Cy, - #[serde(rename = "CZ")] - Cz, - #[serde(rename = "DE")] - De, - #[serde(rename = "DJ")] - Dj, - #[serde(rename = "DK")] - Dk, - #[serde(rename = "DM")] - Dm, - #[serde(rename = "DO")] - Do, - #[serde(rename = "DZ")] - Dz, - #[serde(rename = "EC")] - Ec, - #[serde(rename = "EE")] - Ee, - #[serde(rename = "EG")] - Eg, - #[serde(rename = "EH")] - Eh, - #[serde(rename = "ER")] - Er, - #[serde(rename = "ES")] - Es, - #[serde(rename = "ET")] - Et, - #[serde(rename = "FI")] - Fi, - #[serde(rename = "FJ")] - Fj, - #[serde(rename = "FK")] - Fk, - #[serde(rename = "FO")] - Fo, - #[serde(rename = "FR")] - Fr, - #[serde(rename = "GA")] - Ga, - #[serde(rename = "GB")] - Gb, - #[serde(rename = "GD")] - Gd, - #[serde(rename = "GE")] - Ge, - #[serde(rename = "GF")] - Gf, - #[serde(rename = "GG")] - Gg, - #[serde(rename = "GH")] - Gh, - #[serde(rename = "GI")] - Gi, - #[serde(rename = "GL")] - Gl, - #[serde(rename = "GM")] - Gm, - #[serde(rename = "GN")] - Gn, - #[serde(rename = "GP")] - Gp, - #[serde(rename = "GQ")] - Gq, - #[serde(rename = "GR")] - Gr, - #[serde(rename = "GS")] - Gs, - #[serde(rename = "GT")] - Gt, - #[serde(rename = "GU")] - Gu, - #[serde(rename = "GW")] - Gw, - #[serde(rename = "GY")] - Gy, - #[serde(rename = "HK")] - Hk, - #[serde(rename = "HN")] - Hn, - #[serde(rename = "HR")] - Hr, - #[serde(rename = "HT")] - Ht, - #[serde(rename = "HU")] - Hu, - #[serde(rename = "ID")] - Id, - #[serde(rename = "IE")] - Ie, - #[serde(rename = "IL")] - Il, - #[serde(rename = "IM")] - Im, - #[serde(rename = "IN")] - In, - #[serde(rename = "IO")] - Io, - #[serde(rename = "IQ")] - Iq, - #[serde(rename = "IS")] - Is, - #[serde(rename = "IT")] - It, - #[serde(rename = "JE")] - Je, - #[serde(rename = "JM")] - Jm, - #[serde(rename = "JO")] - Jo, - #[serde(rename = "JP")] - Jp, - #[serde(rename = "KE")] - Ke, - #[serde(rename = "KG")] - Kg, - #[serde(rename = "KH")] - Kh, - #[serde(rename = "KI")] - Ki, - #[serde(rename = "KM")] - Km, - #[serde(rename = "KN")] - Kn, - #[serde(rename = "KR")] - Kr, - #[serde(rename = "KW")] - Kw, - #[serde(rename = "KY")] - Ky, - #[serde(rename = "KZ")] - Kz, - #[serde(rename = "LA")] - La, - #[serde(rename = "LB")] - Lb, - #[serde(rename = "LC")] - Lc, - #[serde(rename = "LI")] - Li, - #[serde(rename = "LK")] - Lk, - #[serde(rename = "LR")] - Lr, - #[serde(rename = "LS")] - Ls, - #[serde(rename = "LT")] - Lt, - #[serde(rename = "LU")] - Lu, - #[serde(rename = "LV")] - Lv, - #[serde(rename = "LY")] - Ly, - #[serde(rename = "MA")] - Ma, - #[serde(rename = "MC")] - Mc, - #[serde(rename = "MD")] - Md, - #[serde(rename = "ME")] - Me, - #[serde(rename = "MF")] - Mf, - #[serde(rename = "MG")] - Mg, - #[serde(rename = "MK")] - Mk, - #[serde(rename = "ML")] - Ml, - #[serde(rename = "MM")] - Mm, - #[serde(rename = "MN")] - Mn, - #[serde(rename = "MO")] - Mo, - #[serde(rename = "MQ")] - Mq, - #[serde(rename = "MR")] - Mr, - #[serde(rename = "MS")] - Ms, - #[serde(rename = "MT")] - Mt, - #[serde(rename = "MU")] - Mu, - #[serde(rename = "MV")] - Mv, - #[serde(rename = "MW")] - Mw, - #[serde(rename = "MX")] - Mx, - #[serde(rename = "MY")] - My, - #[serde(rename = "MZ")] - Mz, - #[serde(rename = "NA")] - Na, - #[serde(rename = "NC")] - Nc, - #[serde(rename = "NE")] - Ne, - #[serde(rename = "NG")] - Ng, - #[serde(rename = "NI")] - Ni, - #[serde(rename = "NL")] - Nl, - #[serde(rename = "NO")] - No, - #[serde(rename = "NP")] - Np, - #[serde(rename = "NR")] - Nr, - #[serde(rename = "NU")] - Nu, - #[serde(rename = "NZ")] - Nz, - #[serde(rename = "OM")] - Om, - #[serde(rename = "PA")] - Pa, - #[serde(rename = "PE")] - Pe, - #[serde(rename = "PF")] - Pf, - #[serde(rename = "PG")] - Pg, - #[serde(rename = "PH")] - Ph, - #[serde(rename = "PK")] - Pk, - #[serde(rename = "PL")] - Pl, - #[serde(rename = "PM")] - Pm, - #[serde(rename = "PN")] - Pn, - #[serde(rename = "PR")] - Pr, - #[serde(rename = "PS")] - Ps, - #[serde(rename = "PT")] - Pt, - #[serde(rename = "PY")] - Py, - #[serde(rename = "QA")] - Qa, - #[serde(rename = "RE")] - Re, - #[serde(rename = "RO")] - Ro, - #[serde(rename = "RS")] - Rs, - #[serde(rename = "RU")] - Ru, - #[serde(rename = "RW")] - Rw, - #[serde(rename = "SA")] - Sa, - #[serde(rename = "SB")] - Sb, - #[serde(rename = "SC")] - Sc, - #[serde(rename = "SE")] - Se, - #[serde(rename = "SG")] - Sg, - #[serde(rename = "SH")] - Sh, - #[serde(rename = "SI")] - Si, - #[serde(rename = "SJ")] - Sj, - #[serde(rename = "SK")] - Sk, - #[serde(rename = "SL")] - Sl, - #[serde(rename = "SM")] - Sm, - #[serde(rename = "SN")] - Sn, - #[serde(rename = "SO")] - So, - #[serde(rename = "SR")] - Sr, - #[serde(rename = "SS")] - Ss, - #[serde(rename = "ST")] - St, - #[serde(rename = "SV")] - Sv, - #[serde(rename = "SX")] - Sx, - #[serde(rename = "SZ")] - Sz, - #[serde(rename = "TA")] - Ta, - #[serde(rename = "TC")] - Tc, - #[serde(rename = "TD")] - Td, - #[serde(rename = "TF")] - Tf, - #[serde(rename = "TG")] - Tg, - #[serde(rename = "TH")] - Th, - #[serde(rename = "TJ")] - Tj, - #[serde(rename = "TK")] - Tk, - #[serde(rename = "TL")] - Tl, - #[serde(rename = "TM")] - Tm, - #[serde(rename = "TN")] - Tn, - #[serde(rename = "TO")] - To, - #[serde(rename = "TR")] - Tr, - #[serde(rename = "TT")] - Tt, - #[serde(rename = "TV")] - Tv, - #[serde(rename = "TW")] - Tw, - #[serde(rename = "TZ")] - Tz, - #[serde(rename = "UA")] - Ua, - #[serde(rename = "UG")] - Ug, - #[serde(rename = "US")] - Us, - #[serde(rename = "UY")] - Uy, - #[serde(rename = "UZ")] - Uz, - #[serde(rename = "VA")] - Va, - #[serde(rename = "VC")] - Vc, - #[serde(rename = "VE")] - Ve, - #[serde(rename = "VG")] - Vg, - #[serde(rename = "VN")] - Vn, - #[serde(rename = "VU")] - Vu, - #[serde(rename = "WF")] - Wf, - #[serde(rename = "WS")] - Ws, - #[serde(rename = "XK")] - Xk, - #[serde(rename = "YE")] - Ye, - #[serde(rename = "YT")] - Yt, - #[serde(rename = "ZA")] - Za, - #[serde(rename = "ZM")] - Zm, - #[serde(rename = "ZW")] - Zw, - #[serde(rename = "ZZ")] - Zz, -} - -impl CreatePaymentLinkShippingAddressCollectionAllowedCountries { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ac => "AC", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ad => "AD", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ae => "AE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Af => "AF", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ag => "AG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ai => "AI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Al => "AL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Am => "AM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ao => "AO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Aq => "AQ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ar => "AR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::At => "AT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Au => "AU", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Aw => "AW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ax => "AX", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Az => "AZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ba => "BA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bb => "BB", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bd => "BD", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Be => "BE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bf => "BF", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bg => "BG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bh => "BH", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bi => "BI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bj => "BJ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bl => "BL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bm => "BM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bn => "BN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bo => "BO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bq => "BQ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Br => "BR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bs => "BS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bt => "BT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bv => "BV", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bw => "BW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::By => "BY", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bz => "BZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ca => "CA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cd => "CD", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cf => "CF", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cg => "CG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ch => "CH", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ci => "CI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ck => "CK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cl => "CL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cm => "CM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cn => "CN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Co => "CO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cr => "CR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cv => "CV", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cw => "CW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cy => "CY", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cz => "CZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::De => "DE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Dj => "DJ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Dk => "DK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Dm => "DM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Do => "DO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Dz => "DZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ec => "EC", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ee => "EE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Eg => "EG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Eh => "EH", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Er => "ER", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Es => "ES", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Et => "ET", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Fi => "FI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Fj => "FJ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Fk => "FK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Fo => "FO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Fr => "FR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ga => "GA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gb => "GB", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gd => "GD", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ge => "GE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gf => "GF", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gg => "GG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gh => "GH", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gi => "GI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gl => "GL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gm => "GM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gn => "GN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gp => "GP", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gq => "GQ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gr => "GR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gs => "GS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gt => "GT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gu => "GU", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gw => "GW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gy => "GY", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Hk => "HK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Hn => "HN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Hr => "HR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ht => "HT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Hu => "HU", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Id => "ID", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ie => "IE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Il => "IL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Im => "IM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::In => "IN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Io => "IO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Iq => "IQ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Is => "IS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::It => "IT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Je => "JE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Jm => "JM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Jo => "JO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Jp => "JP", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ke => "KE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Kg => "KG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Kh => "KH", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ki => "KI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Km => "KM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Kn => "KN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Kr => "KR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Kw => "KW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ky => "KY", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Kz => "KZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::La => "LA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Lb => "LB", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Lc => "LC", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Li => "LI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Lk => "LK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Lr => "LR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ls => "LS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Lt => "LT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Lu => "LU", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Lv => "LV", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ly => "LY", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ma => "MA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mc => "MC", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Md => "MD", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Me => "ME", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mf => "MF", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mg => "MG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mk => "MK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ml => "ML", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mm => "MM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mn => "MN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mo => "MO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mq => "MQ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mr => "MR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ms => "MS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mt => "MT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mu => "MU", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mv => "MV", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mw => "MW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mx => "MX", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::My => "MY", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mz => "MZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Na => "NA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Nc => "NC", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ne => "NE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ng => "NG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ni => "NI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Nl => "NL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::No => "NO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Np => "NP", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Nr => "NR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Nu => "NU", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Nz => "NZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Om => "OM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pa => "PA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pe => "PE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pf => "PF", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pg => "PG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ph => "PH", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pk => "PK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pl => "PL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pm => "PM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pn => "PN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pr => "PR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ps => "PS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pt => "PT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Py => "PY", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Qa => "QA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Re => "RE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ro => "RO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Rs => "RS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ru => "RU", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Rw => "RW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sa => "SA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sb => "SB", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sc => "SC", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Se => "SE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sg => "SG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sh => "SH", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Si => "SI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sj => "SJ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sk => "SK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sl => "SL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sm => "SM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sn => "SN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::So => "SO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sr => "SR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ss => "SS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::St => "ST", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sv => "SV", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sx => "SX", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sz => "SZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ta => "TA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tc => "TC", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Td => "TD", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tf => "TF", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tg => "TG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Th => "TH", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tj => "TJ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tk => "TK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tl => "TL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tm => "TM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tn => "TN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::To => "TO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tr => "TR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tt => "TT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tv => "TV", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tw => "TW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tz => "TZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ua => "UA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ug => "UG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Us => "US", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Uy => "UY", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Uz => "UZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Va => "VA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Vc => "VC", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ve => "VE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Vg => "VG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Vn => "VN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Vu => "VU", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Wf => "WF", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ws => "WS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Xk => "XK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ye => "YE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Yt => "YT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Za => "ZA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Zm => "ZM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Zw => "ZW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Zz => "ZZ", - } - } -} - -impl AsRef for CreatePaymentLinkShippingAddressCollectionAllowedCountries { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkShippingAddressCollectionAllowedCountries { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkShippingAddressCollectionAllowedCountries { - fn default() -> Self { - Self::Ac - } -} - -/// An enum representing the possible values of an `PaymentLink`'s `billing_address_collection` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinkBillingAddressCollection { - Auto, - Required, -} - -impl PaymentLinkBillingAddressCollection { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinkBillingAddressCollection::Auto => "auto", - PaymentLinkBillingAddressCollection::Required => "required", - } - } -} - -impl AsRef for PaymentLinkBillingAddressCollection { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinkBillingAddressCollection { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinkBillingAddressCollection { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `PaymentLink`'s `customer_creation` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinkCustomerCreation { - Always, - IfRequired, -} - -impl PaymentLinkCustomerCreation { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinkCustomerCreation::Always => "always", - PaymentLinkCustomerCreation::IfRequired => "if_required", - } - } -} - -impl AsRef for PaymentLinkCustomerCreation { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinkCustomerCreation { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinkCustomerCreation { - fn default() -> Self { - Self::Always - } -} - -/// An enum representing the possible values of an `PaymentLink`'s `payment_method_collection` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinkPaymentMethodCollection { - Always, - IfRequired, -} - -impl PaymentLinkPaymentMethodCollection { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinkPaymentMethodCollection::Always => "always", - PaymentLinkPaymentMethodCollection::IfRequired => "if_required", - } - } -} - -impl AsRef for PaymentLinkPaymentMethodCollection { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinkPaymentMethodCollection { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinkPaymentMethodCollection { - fn default() -> Self { - Self::Always - } -} - -/// An enum representing the possible values of an `PaymentLink`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinkPaymentMethodTypes { - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Card, - Cashapp, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, -} - -impl PaymentLinkPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinkPaymentMethodTypes::Affirm => "affirm", - PaymentLinkPaymentMethodTypes::AfterpayClearpay => "afterpay_clearpay", - PaymentLinkPaymentMethodTypes::Alipay => "alipay", - PaymentLinkPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - PaymentLinkPaymentMethodTypes::BacsDebit => "bacs_debit", - PaymentLinkPaymentMethodTypes::Bancontact => "bancontact", - PaymentLinkPaymentMethodTypes::Blik => "blik", - PaymentLinkPaymentMethodTypes::Boleto => "boleto", - PaymentLinkPaymentMethodTypes::Card => "card", - PaymentLinkPaymentMethodTypes::Cashapp => "cashapp", - PaymentLinkPaymentMethodTypes::Eps => "eps", - PaymentLinkPaymentMethodTypes::Fpx => "fpx", - PaymentLinkPaymentMethodTypes::Giropay => "giropay", - PaymentLinkPaymentMethodTypes::Grabpay => "grabpay", - PaymentLinkPaymentMethodTypes::Ideal => "ideal", - PaymentLinkPaymentMethodTypes::Klarna => "klarna", - PaymentLinkPaymentMethodTypes::Konbini => "konbini", - PaymentLinkPaymentMethodTypes::Link => "link", - PaymentLinkPaymentMethodTypes::Oxxo => "oxxo", - PaymentLinkPaymentMethodTypes::P24 => "p24", - PaymentLinkPaymentMethodTypes::Paynow => "paynow", - PaymentLinkPaymentMethodTypes::Paypal => "paypal", - PaymentLinkPaymentMethodTypes::Pix => "pix", - PaymentLinkPaymentMethodTypes::Promptpay => "promptpay", - PaymentLinkPaymentMethodTypes::SepaDebit => "sepa_debit", - PaymentLinkPaymentMethodTypes::Sofort => "sofort", - PaymentLinkPaymentMethodTypes::UsBankAccount => "us_bank_account", - PaymentLinkPaymentMethodTypes::WechatPay => "wechat_pay", - } - } -} - -impl AsRef for PaymentLinkPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinkPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinkPaymentMethodTypes { - fn default() -> Self { - Self::Affirm - } -} - -/// An enum representing the possible values of an `PaymentLink`'s `submit_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinkSubmitType { - Auto, - Book, - Donate, - Pay, -} - -impl PaymentLinkSubmitType { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinkSubmitType::Auto => "auto", - PaymentLinkSubmitType::Book => "book", - PaymentLinkSubmitType::Donate => "donate", - PaymentLinkSubmitType::Pay => "pay", - } - } -} - -impl AsRef for PaymentLinkSubmitType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinkSubmitType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinkSubmitType { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `PaymentLinksResourceAfterCompletion`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinksResourceAfterCompletionType { - HostedConfirmation, - Redirect, -} - -impl PaymentLinksResourceAfterCompletionType { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinksResourceAfterCompletionType::HostedConfirmation => "hosted_confirmation", - PaymentLinksResourceAfterCompletionType::Redirect => "redirect", - } - } -} - -impl AsRef for PaymentLinksResourceAfterCompletionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinksResourceAfterCompletionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinksResourceAfterCompletionType { - fn default() -> Self { - Self::HostedConfirmation - } -} - -/// An enum representing the possible values of an `PaymentLinksResourceConsentCollection`'s `promotions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinksResourceConsentCollectionPromotions { - Auto, - None, -} - -impl PaymentLinksResourceConsentCollectionPromotions { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinksResourceConsentCollectionPromotions::Auto => "auto", - PaymentLinksResourceConsentCollectionPromotions::None => "none", - } - } -} - -impl AsRef for PaymentLinksResourceConsentCollectionPromotions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinksResourceConsentCollectionPromotions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinksResourceConsentCollectionPromotions { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `PaymentLinksResourceConsentCollection`'s `terms_of_service` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinksResourceConsentCollectionTermsOfService { - None, - Required, -} - -impl PaymentLinksResourceConsentCollectionTermsOfService { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinksResourceConsentCollectionTermsOfService::None => "none", - PaymentLinksResourceConsentCollectionTermsOfService::Required => "required", - } - } -} - -impl AsRef for PaymentLinksResourceConsentCollectionTermsOfService { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinksResourceConsentCollectionTermsOfService { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinksResourceConsentCollectionTermsOfService { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentLinksResourceCustomFieldsLabel`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinksResourceCustomFieldsLabelType { - Custom, -} - -impl PaymentLinksResourceCustomFieldsLabelType { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinksResourceCustomFieldsLabelType::Custom => "custom", - } - } -} - -impl AsRef for PaymentLinksResourceCustomFieldsLabelType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinksResourceCustomFieldsLabelType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinksResourceCustomFieldsLabelType { - fn default() -> Self { - Self::Custom - } -} - -/// An enum representing the possible values of an `PaymentLinksResourceCustomFields`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinksResourceCustomFieldsType { - Dropdown, - Numeric, - Text, -} - -impl PaymentLinksResourceCustomFieldsType { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinksResourceCustomFieldsType::Dropdown => "dropdown", - PaymentLinksResourceCustomFieldsType::Numeric => "numeric", - PaymentLinksResourceCustomFieldsType::Text => "text", - } - } -} - -impl AsRef for PaymentLinksResourceCustomFieldsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinksResourceCustomFieldsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinksResourceCustomFieldsType { - fn default() -> Self { - Self::Dropdown - } -} - -/// An enum representing the possible values of an `PaymentLinksResourcePaymentIntentData`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinksResourcePaymentIntentDataCaptureMethod { - Automatic, - AutomaticAsync, - Manual, -} - -impl PaymentLinksResourcePaymentIntentDataCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinksResourcePaymentIntentDataCaptureMethod::Automatic => "automatic", - PaymentLinksResourcePaymentIntentDataCaptureMethod::AutomaticAsync => "automatic_async", - PaymentLinksResourcePaymentIntentDataCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentLinksResourcePaymentIntentDataCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinksResourcePaymentIntentDataCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinksResourcePaymentIntentDataCaptureMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `PaymentLinksResourcePaymentIntentData`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinksResourcePaymentIntentDataSetupFutureUsage { - OffSession, - OnSession, -} - -impl PaymentLinksResourcePaymentIntentDataSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinksResourcePaymentIntentDataSetupFutureUsage::OffSession => "off_session", - PaymentLinksResourcePaymentIntentDataSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentLinksResourcePaymentIntentDataSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinksResourcePaymentIntentDataSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinksResourcePaymentIntentDataSetupFutureUsage { - fn default() -> Self { - Self::OffSession - } -} - -/// An enum representing the possible values of an `PaymentLinksResourceShippingAddressCollection`'s `allowed_countries` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinksResourceShippingAddressCollectionAllowedCountries { - #[serde(rename = "AC")] - Ac, - #[serde(rename = "AD")] - Ad, - #[serde(rename = "AE")] - Ae, - #[serde(rename = "AF")] - Af, - #[serde(rename = "AG")] - Ag, - #[serde(rename = "AI")] - Ai, - #[serde(rename = "AL")] - Al, - #[serde(rename = "AM")] - Am, - #[serde(rename = "AO")] - Ao, - #[serde(rename = "AQ")] - Aq, - #[serde(rename = "AR")] - Ar, - #[serde(rename = "AT")] - At, - #[serde(rename = "AU")] - Au, - #[serde(rename = "AW")] - Aw, - #[serde(rename = "AX")] - Ax, - #[serde(rename = "AZ")] - Az, - #[serde(rename = "BA")] - Ba, - #[serde(rename = "BB")] - Bb, - #[serde(rename = "BD")] - Bd, - #[serde(rename = "BE")] - Be, - #[serde(rename = "BF")] - Bf, - #[serde(rename = "BG")] - Bg, - #[serde(rename = "BH")] - Bh, - #[serde(rename = "BI")] - Bi, - #[serde(rename = "BJ")] - Bj, - #[serde(rename = "BL")] - Bl, - #[serde(rename = "BM")] - Bm, - #[serde(rename = "BN")] - Bn, - #[serde(rename = "BO")] - Bo, - #[serde(rename = "BQ")] - Bq, - #[serde(rename = "BR")] - Br, - #[serde(rename = "BS")] - Bs, - #[serde(rename = "BT")] - Bt, - #[serde(rename = "BV")] - Bv, - #[serde(rename = "BW")] - Bw, - #[serde(rename = "BY")] - By, - #[serde(rename = "BZ")] - Bz, - #[serde(rename = "CA")] - Ca, - #[serde(rename = "CD")] - Cd, - #[serde(rename = "CF")] - Cf, - #[serde(rename = "CG")] - Cg, - #[serde(rename = "CH")] - Ch, - #[serde(rename = "CI")] - Ci, - #[serde(rename = "CK")] - Ck, - #[serde(rename = "CL")] - Cl, - #[serde(rename = "CM")] - Cm, - #[serde(rename = "CN")] - Cn, - #[serde(rename = "CO")] - Co, - #[serde(rename = "CR")] - Cr, - #[serde(rename = "CV")] - Cv, - #[serde(rename = "CW")] - Cw, - #[serde(rename = "CY")] - Cy, - #[serde(rename = "CZ")] - Cz, - #[serde(rename = "DE")] - De, - #[serde(rename = "DJ")] - Dj, - #[serde(rename = "DK")] - Dk, - #[serde(rename = "DM")] - Dm, - #[serde(rename = "DO")] - Do, - #[serde(rename = "DZ")] - Dz, - #[serde(rename = "EC")] - Ec, - #[serde(rename = "EE")] - Ee, - #[serde(rename = "EG")] - Eg, - #[serde(rename = "EH")] - Eh, - #[serde(rename = "ER")] - Er, - #[serde(rename = "ES")] - Es, - #[serde(rename = "ET")] - Et, - #[serde(rename = "FI")] - Fi, - #[serde(rename = "FJ")] - Fj, - #[serde(rename = "FK")] - Fk, - #[serde(rename = "FO")] - Fo, - #[serde(rename = "FR")] - Fr, - #[serde(rename = "GA")] - Ga, - #[serde(rename = "GB")] - Gb, - #[serde(rename = "GD")] - Gd, - #[serde(rename = "GE")] - Ge, - #[serde(rename = "GF")] - Gf, - #[serde(rename = "GG")] - Gg, - #[serde(rename = "GH")] - Gh, - #[serde(rename = "GI")] - Gi, - #[serde(rename = "GL")] - Gl, - #[serde(rename = "GM")] - Gm, - #[serde(rename = "GN")] - Gn, - #[serde(rename = "GP")] - Gp, - #[serde(rename = "GQ")] - Gq, - #[serde(rename = "GR")] - Gr, - #[serde(rename = "GS")] - Gs, - #[serde(rename = "GT")] - Gt, - #[serde(rename = "GU")] - Gu, - #[serde(rename = "GW")] - Gw, - #[serde(rename = "GY")] - Gy, - #[serde(rename = "HK")] - Hk, - #[serde(rename = "HN")] - Hn, - #[serde(rename = "HR")] - Hr, - #[serde(rename = "HT")] - Ht, - #[serde(rename = "HU")] - Hu, - #[serde(rename = "ID")] - Id, - #[serde(rename = "IE")] - Ie, - #[serde(rename = "IL")] - Il, - #[serde(rename = "IM")] - Im, - #[serde(rename = "IN")] - In, - #[serde(rename = "IO")] - Io, - #[serde(rename = "IQ")] - Iq, - #[serde(rename = "IS")] - Is, - #[serde(rename = "IT")] - It, - #[serde(rename = "JE")] - Je, - #[serde(rename = "JM")] - Jm, - #[serde(rename = "JO")] - Jo, - #[serde(rename = "JP")] - Jp, - #[serde(rename = "KE")] - Ke, - #[serde(rename = "KG")] - Kg, - #[serde(rename = "KH")] - Kh, - #[serde(rename = "KI")] - Ki, - #[serde(rename = "KM")] - Km, - #[serde(rename = "KN")] - Kn, - #[serde(rename = "KR")] - Kr, - #[serde(rename = "KW")] - Kw, - #[serde(rename = "KY")] - Ky, - #[serde(rename = "KZ")] - Kz, - #[serde(rename = "LA")] - La, - #[serde(rename = "LB")] - Lb, - #[serde(rename = "LC")] - Lc, - #[serde(rename = "LI")] - Li, - #[serde(rename = "LK")] - Lk, - #[serde(rename = "LR")] - Lr, - #[serde(rename = "LS")] - Ls, - #[serde(rename = "LT")] - Lt, - #[serde(rename = "LU")] - Lu, - #[serde(rename = "LV")] - Lv, - #[serde(rename = "LY")] - Ly, - #[serde(rename = "MA")] - Ma, - #[serde(rename = "MC")] - Mc, - #[serde(rename = "MD")] - Md, - #[serde(rename = "ME")] - Me, - #[serde(rename = "MF")] - Mf, - #[serde(rename = "MG")] - Mg, - #[serde(rename = "MK")] - Mk, - #[serde(rename = "ML")] - Ml, - #[serde(rename = "MM")] - Mm, - #[serde(rename = "MN")] - Mn, - #[serde(rename = "MO")] - Mo, - #[serde(rename = "MQ")] - Mq, - #[serde(rename = "MR")] - Mr, - #[serde(rename = "MS")] - Ms, - #[serde(rename = "MT")] - Mt, - #[serde(rename = "MU")] - Mu, - #[serde(rename = "MV")] - Mv, - #[serde(rename = "MW")] - Mw, - #[serde(rename = "MX")] - Mx, - #[serde(rename = "MY")] - My, - #[serde(rename = "MZ")] - Mz, - #[serde(rename = "NA")] - Na, - #[serde(rename = "NC")] - Nc, - #[serde(rename = "NE")] - Ne, - #[serde(rename = "NG")] - Ng, - #[serde(rename = "NI")] - Ni, - #[serde(rename = "NL")] - Nl, - #[serde(rename = "NO")] - No, - #[serde(rename = "NP")] - Np, - #[serde(rename = "NR")] - Nr, - #[serde(rename = "NU")] - Nu, - #[serde(rename = "NZ")] - Nz, - #[serde(rename = "OM")] - Om, - #[serde(rename = "PA")] - Pa, - #[serde(rename = "PE")] - Pe, - #[serde(rename = "PF")] - Pf, - #[serde(rename = "PG")] - Pg, - #[serde(rename = "PH")] - Ph, - #[serde(rename = "PK")] - Pk, - #[serde(rename = "PL")] - Pl, - #[serde(rename = "PM")] - Pm, - #[serde(rename = "PN")] - Pn, - #[serde(rename = "PR")] - Pr, - #[serde(rename = "PS")] - Ps, - #[serde(rename = "PT")] - Pt, - #[serde(rename = "PY")] - Py, - #[serde(rename = "QA")] - Qa, - #[serde(rename = "RE")] - Re, - #[serde(rename = "RO")] - Ro, - #[serde(rename = "RS")] - Rs, - #[serde(rename = "RU")] - Ru, - #[serde(rename = "RW")] - Rw, - #[serde(rename = "SA")] - Sa, - #[serde(rename = "SB")] - Sb, - #[serde(rename = "SC")] - Sc, - #[serde(rename = "SE")] - Se, - #[serde(rename = "SG")] - Sg, - #[serde(rename = "SH")] - Sh, - #[serde(rename = "SI")] - Si, - #[serde(rename = "SJ")] - Sj, - #[serde(rename = "SK")] - Sk, - #[serde(rename = "SL")] - Sl, - #[serde(rename = "SM")] - Sm, - #[serde(rename = "SN")] - Sn, - #[serde(rename = "SO")] - So, - #[serde(rename = "SR")] - Sr, - #[serde(rename = "SS")] - Ss, - #[serde(rename = "ST")] - St, - #[serde(rename = "SV")] - Sv, - #[serde(rename = "SX")] - Sx, - #[serde(rename = "SZ")] - Sz, - #[serde(rename = "TA")] - Ta, - #[serde(rename = "TC")] - Tc, - #[serde(rename = "TD")] - Td, - #[serde(rename = "TF")] - Tf, - #[serde(rename = "TG")] - Tg, - #[serde(rename = "TH")] - Th, - #[serde(rename = "TJ")] - Tj, - #[serde(rename = "TK")] - Tk, - #[serde(rename = "TL")] - Tl, - #[serde(rename = "TM")] - Tm, - #[serde(rename = "TN")] - Tn, - #[serde(rename = "TO")] - To, - #[serde(rename = "TR")] - Tr, - #[serde(rename = "TT")] - Tt, - #[serde(rename = "TV")] - Tv, - #[serde(rename = "TW")] - Tw, - #[serde(rename = "TZ")] - Tz, - #[serde(rename = "UA")] - Ua, - #[serde(rename = "UG")] - Ug, - #[serde(rename = "US")] - Us, - #[serde(rename = "UY")] - Uy, - #[serde(rename = "UZ")] - Uz, - #[serde(rename = "VA")] - Va, - #[serde(rename = "VC")] - Vc, - #[serde(rename = "VE")] - Ve, - #[serde(rename = "VG")] - Vg, - #[serde(rename = "VN")] - Vn, - #[serde(rename = "VU")] - Vu, - #[serde(rename = "WF")] - Wf, - #[serde(rename = "WS")] - Ws, - #[serde(rename = "XK")] - Xk, - #[serde(rename = "YE")] - Ye, - #[serde(rename = "YT")] - Yt, - #[serde(rename = "ZA")] - Za, - #[serde(rename = "ZM")] - Zm, - #[serde(rename = "ZW")] - Zw, - #[serde(rename = "ZZ")] - Zz, -} - -impl PaymentLinksResourceShippingAddressCollectionAllowedCountries { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ac => "AC", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ad => "AD", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ae => "AE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Af => "AF", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ag => "AG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ai => "AI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Al => "AL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Am => "AM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ao => "AO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Aq => "AQ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ar => "AR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::At => "AT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Au => "AU", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Aw => "AW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ax => "AX", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Az => "AZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ba => "BA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bb => "BB", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bd => "BD", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Be => "BE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bf => "BF", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bg => "BG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bh => "BH", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bi => "BI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bj => "BJ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bl => "BL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bm => "BM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bn => "BN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bo => "BO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bq => "BQ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Br => "BR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bs => "BS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bt => "BT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bv => "BV", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bw => "BW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::By => "BY", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bz => "BZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ca => "CA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cd => "CD", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cf => "CF", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cg => "CG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ch => "CH", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ci => "CI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ck => "CK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cl => "CL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cm => "CM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cn => "CN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Co => "CO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cr => "CR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cv => "CV", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cw => "CW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cy => "CY", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cz => "CZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::De => "DE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Dj => "DJ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Dk => "DK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Dm => "DM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Do => "DO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Dz => "DZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ec => "EC", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ee => "EE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Eg => "EG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Eh => "EH", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Er => "ER", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Es => "ES", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Et => "ET", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Fi => "FI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Fj => "FJ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Fk => "FK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Fo => "FO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Fr => "FR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ga => "GA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gb => "GB", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gd => "GD", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ge => "GE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gf => "GF", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gg => "GG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gh => "GH", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gi => "GI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gl => "GL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gm => "GM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gn => "GN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gp => "GP", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gq => "GQ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gr => "GR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gs => "GS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gt => "GT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gu => "GU", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gw => "GW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gy => "GY", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Hk => "HK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Hn => "HN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Hr => "HR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ht => "HT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Hu => "HU", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Id => "ID", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ie => "IE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Il => "IL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Im => "IM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::In => "IN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Io => "IO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Iq => "IQ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Is => "IS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::It => "IT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Je => "JE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Jm => "JM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Jo => "JO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Jp => "JP", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ke => "KE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Kg => "KG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Kh => "KH", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ki => "KI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Km => "KM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Kn => "KN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Kr => "KR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Kw => "KW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ky => "KY", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Kz => "KZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::La => "LA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Lb => "LB", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Lc => "LC", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Li => "LI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Lk => "LK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Lr => "LR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ls => "LS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Lt => "LT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Lu => "LU", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Lv => "LV", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ly => "LY", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ma => "MA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mc => "MC", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Md => "MD", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Me => "ME", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mf => "MF", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mg => "MG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mk => "MK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ml => "ML", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mm => "MM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mn => "MN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mo => "MO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mq => "MQ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mr => "MR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ms => "MS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mt => "MT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mu => "MU", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mv => "MV", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mw => "MW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mx => "MX", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::My => "MY", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mz => "MZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Na => "NA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Nc => "NC", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ne => "NE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ng => "NG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ni => "NI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Nl => "NL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::No => "NO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Np => "NP", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Nr => "NR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Nu => "NU", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Nz => "NZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Om => "OM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pa => "PA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pe => "PE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pf => "PF", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pg => "PG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ph => "PH", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pk => "PK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pl => "PL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pm => "PM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pn => "PN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pr => "PR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ps => "PS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pt => "PT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Py => "PY", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Qa => "QA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Re => "RE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ro => "RO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Rs => "RS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ru => "RU", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Rw => "RW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sa => "SA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sb => "SB", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sc => "SC", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Se => "SE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sg => "SG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sh => "SH", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Si => "SI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sj => "SJ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sk => "SK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sl => "SL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sm => "SM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sn => "SN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::So => "SO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sr => "SR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ss => "SS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::St => "ST", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sv => "SV", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sx => "SX", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sz => "SZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ta => "TA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tc => "TC", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Td => "TD", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tf => "TF", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tg => "TG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Th => "TH", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tj => "TJ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tk => "TK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tl => "TL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tm => "TM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tn => "TN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::To => "TO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tr => "TR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tt => "TT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tv => "TV", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tw => "TW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tz => "TZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ua => "UA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ug => "UG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Us => "US", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Uy => "UY", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Uz => "UZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Va => "VA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Vc => "VC", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ve => "VE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Vg => "VG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Vn => "VN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Vu => "VU", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Wf => "WF", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ws => "WS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Xk => "XK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ye => "YE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Yt => "YT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Za => "ZA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Zm => "ZM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Zw => "ZW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Zz => "ZZ", - } - } -} - -impl AsRef for PaymentLinksResourceShippingAddressCollectionAllowedCountries { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinksResourceShippingAddressCollectionAllowedCountries { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinksResourceShippingAddressCollectionAllowedCountries { - fn default() -> Self { - Self::Ac - } -} - -/// An enum representing the possible values of an `UpdatePaymentLinkAfterCompletion`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentLinkAfterCompletionType { - HostedConfirmation, - Redirect, -} - -impl UpdatePaymentLinkAfterCompletionType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentLinkAfterCompletionType::HostedConfirmation => "hosted_confirmation", - UpdatePaymentLinkAfterCompletionType::Redirect => "redirect", - } - } -} - -impl AsRef for UpdatePaymentLinkAfterCompletionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentLinkAfterCompletionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentLinkAfterCompletionType { - fn default() -> Self { - Self::HostedConfirmation - } -} - -/// An enum representing the possible values of an `UpdatePaymentLinkCustomFieldsLabel`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentLinkCustomFieldsLabelType { - Custom, -} - -impl UpdatePaymentLinkCustomFieldsLabelType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentLinkCustomFieldsLabelType::Custom => "custom", - } - } -} - -impl AsRef for UpdatePaymentLinkCustomFieldsLabelType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentLinkCustomFieldsLabelType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentLinkCustomFieldsLabelType { - fn default() -> Self { - Self::Custom - } -} - -/// An enum representing the possible values of an `UpdatePaymentLinkCustomFields`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentLinkCustomFieldsType { - Dropdown, - Numeric, - Text, -} - -impl UpdatePaymentLinkCustomFieldsType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentLinkCustomFieldsType::Dropdown => "dropdown", - UpdatePaymentLinkCustomFieldsType::Numeric => "numeric", - UpdatePaymentLinkCustomFieldsType::Text => "text", - } - } -} - -impl AsRef for UpdatePaymentLinkCustomFieldsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentLinkCustomFieldsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentLinkCustomFieldsType { - fn default() -> Self { - Self::Dropdown - } -} - -/// An enum representing the possible values of an `UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions`'s `amount_tax_display` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { - ExcludeTax, - IncludeInclusiveTax, -} - -impl UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::ExcludeTax => "exclude_tax", - UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::IncludeInclusiveTax => "include_inclusive_tax", - } - } -} - -impl AsRef for UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay -{ - fn default() -> Self { - Self::ExcludeTax - } -} - -/// An enum representing the possible values of an `UpdatePaymentLink`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentLinkPaymentMethodTypes { - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Card, - Cashapp, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, -} - -impl UpdatePaymentLinkPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentLinkPaymentMethodTypes::Affirm => "affirm", - UpdatePaymentLinkPaymentMethodTypes::AfterpayClearpay => "afterpay_clearpay", - UpdatePaymentLinkPaymentMethodTypes::Alipay => "alipay", - UpdatePaymentLinkPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - UpdatePaymentLinkPaymentMethodTypes::BacsDebit => "bacs_debit", - UpdatePaymentLinkPaymentMethodTypes::Bancontact => "bancontact", - UpdatePaymentLinkPaymentMethodTypes::Blik => "blik", - UpdatePaymentLinkPaymentMethodTypes::Boleto => "boleto", - UpdatePaymentLinkPaymentMethodTypes::Card => "card", - UpdatePaymentLinkPaymentMethodTypes::Cashapp => "cashapp", - UpdatePaymentLinkPaymentMethodTypes::Eps => "eps", - UpdatePaymentLinkPaymentMethodTypes::Fpx => "fpx", - UpdatePaymentLinkPaymentMethodTypes::Giropay => "giropay", - UpdatePaymentLinkPaymentMethodTypes::Grabpay => "grabpay", - UpdatePaymentLinkPaymentMethodTypes::Ideal => "ideal", - UpdatePaymentLinkPaymentMethodTypes::Klarna => "klarna", - UpdatePaymentLinkPaymentMethodTypes::Konbini => "konbini", - UpdatePaymentLinkPaymentMethodTypes::Link => "link", - UpdatePaymentLinkPaymentMethodTypes::Oxxo => "oxxo", - UpdatePaymentLinkPaymentMethodTypes::P24 => "p24", - UpdatePaymentLinkPaymentMethodTypes::Paynow => "paynow", - UpdatePaymentLinkPaymentMethodTypes::Paypal => "paypal", - UpdatePaymentLinkPaymentMethodTypes::Pix => "pix", - UpdatePaymentLinkPaymentMethodTypes::Promptpay => "promptpay", - UpdatePaymentLinkPaymentMethodTypes::SepaDebit => "sepa_debit", - UpdatePaymentLinkPaymentMethodTypes::Sofort => "sofort", - UpdatePaymentLinkPaymentMethodTypes::UsBankAccount => "us_bank_account", - UpdatePaymentLinkPaymentMethodTypes::WechatPay => "wechat_pay", - } - } -} - -impl AsRef for UpdatePaymentLinkPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentLinkPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentLinkPaymentMethodTypes { - fn default() -> Self { - Self::Affirm - } -} - -/// An enum representing the possible values of an `UpdatePaymentLinkShippingAddressCollection`'s `allowed_countries` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentLinkShippingAddressCollectionAllowedCountries { - #[serde(rename = "AC")] - Ac, - #[serde(rename = "AD")] - Ad, - #[serde(rename = "AE")] - Ae, - #[serde(rename = "AF")] - Af, - #[serde(rename = "AG")] - Ag, - #[serde(rename = "AI")] - Ai, - #[serde(rename = "AL")] - Al, - #[serde(rename = "AM")] - Am, - #[serde(rename = "AO")] - Ao, - #[serde(rename = "AQ")] - Aq, - #[serde(rename = "AR")] - Ar, - #[serde(rename = "AT")] - At, - #[serde(rename = "AU")] - Au, - #[serde(rename = "AW")] - Aw, - #[serde(rename = "AX")] - Ax, - #[serde(rename = "AZ")] - Az, - #[serde(rename = "BA")] - Ba, - #[serde(rename = "BB")] - Bb, - #[serde(rename = "BD")] - Bd, - #[serde(rename = "BE")] - Be, - #[serde(rename = "BF")] - Bf, - #[serde(rename = "BG")] - Bg, - #[serde(rename = "BH")] - Bh, - #[serde(rename = "BI")] - Bi, - #[serde(rename = "BJ")] - Bj, - #[serde(rename = "BL")] - Bl, - #[serde(rename = "BM")] - Bm, - #[serde(rename = "BN")] - Bn, - #[serde(rename = "BO")] - Bo, - #[serde(rename = "BQ")] - Bq, - #[serde(rename = "BR")] - Br, - #[serde(rename = "BS")] - Bs, - #[serde(rename = "BT")] - Bt, - #[serde(rename = "BV")] - Bv, - #[serde(rename = "BW")] - Bw, - #[serde(rename = "BY")] - By, - #[serde(rename = "BZ")] - Bz, - #[serde(rename = "CA")] - Ca, - #[serde(rename = "CD")] - Cd, - #[serde(rename = "CF")] - Cf, - #[serde(rename = "CG")] - Cg, - #[serde(rename = "CH")] - Ch, - #[serde(rename = "CI")] - Ci, - #[serde(rename = "CK")] - Ck, - #[serde(rename = "CL")] - Cl, - #[serde(rename = "CM")] - Cm, - #[serde(rename = "CN")] - Cn, - #[serde(rename = "CO")] - Co, - #[serde(rename = "CR")] - Cr, - #[serde(rename = "CV")] - Cv, - #[serde(rename = "CW")] - Cw, - #[serde(rename = "CY")] - Cy, - #[serde(rename = "CZ")] - Cz, - #[serde(rename = "DE")] - De, - #[serde(rename = "DJ")] - Dj, - #[serde(rename = "DK")] - Dk, - #[serde(rename = "DM")] - Dm, - #[serde(rename = "DO")] - Do, - #[serde(rename = "DZ")] - Dz, - #[serde(rename = "EC")] - Ec, - #[serde(rename = "EE")] - Ee, - #[serde(rename = "EG")] - Eg, - #[serde(rename = "EH")] - Eh, - #[serde(rename = "ER")] - Er, - #[serde(rename = "ES")] - Es, - #[serde(rename = "ET")] - Et, - #[serde(rename = "FI")] - Fi, - #[serde(rename = "FJ")] - Fj, - #[serde(rename = "FK")] - Fk, - #[serde(rename = "FO")] - Fo, - #[serde(rename = "FR")] - Fr, - #[serde(rename = "GA")] - Ga, - #[serde(rename = "GB")] - Gb, - #[serde(rename = "GD")] - Gd, - #[serde(rename = "GE")] - Ge, - #[serde(rename = "GF")] - Gf, - #[serde(rename = "GG")] - Gg, - #[serde(rename = "GH")] - Gh, - #[serde(rename = "GI")] - Gi, - #[serde(rename = "GL")] - Gl, - #[serde(rename = "GM")] - Gm, - #[serde(rename = "GN")] - Gn, - #[serde(rename = "GP")] - Gp, - #[serde(rename = "GQ")] - Gq, - #[serde(rename = "GR")] - Gr, - #[serde(rename = "GS")] - Gs, - #[serde(rename = "GT")] - Gt, - #[serde(rename = "GU")] - Gu, - #[serde(rename = "GW")] - Gw, - #[serde(rename = "GY")] - Gy, - #[serde(rename = "HK")] - Hk, - #[serde(rename = "HN")] - Hn, - #[serde(rename = "HR")] - Hr, - #[serde(rename = "HT")] - Ht, - #[serde(rename = "HU")] - Hu, - #[serde(rename = "ID")] - Id, - #[serde(rename = "IE")] - Ie, - #[serde(rename = "IL")] - Il, - #[serde(rename = "IM")] - Im, - #[serde(rename = "IN")] - In, - #[serde(rename = "IO")] - Io, - #[serde(rename = "IQ")] - Iq, - #[serde(rename = "IS")] - Is, - #[serde(rename = "IT")] - It, - #[serde(rename = "JE")] - Je, - #[serde(rename = "JM")] - Jm, - #[serde(rename = "JO")] - Jo, - #[serde(rename = "JP")] - Jp, - #[serde(rename = "KE")] - Ke, - #[serde(rename = "KG")] - Kg, - #[serde(rename = "KH")] - Kh, - #[serde(rename = "KI")] - Ki, - #[serde(rename = "KM")] - Km, - #[serde(rename = "KN")] - Kn, - #[serde(rename = "KR")] - Kr, - #[serde(rename = "KW")] - Kw, - #[serde(rename = "KY")] - Ky, - #[serde(rename = "KZ")] - Kz, - #[serde(rename = "LA")] - La, - #[serde(rename = "LB")] - Lb, - #[serde(rename = "LC")] - Lc, - #[serde(rename = "LI")] - Li, - #[serde(rename = "LK")] - Lk, - #[serde(rename = "LR")] - Lr, - #[serde(rename = "LS")] - Ls, - #[serde(rename = "LT")] - Lt, - #[serde(rename = "LU")] - Lu, - #[serde(rename = "LV")] - Lv, - #[serde(rename = "LY")] - Ly, - #[serde(rename = "MA")] - Ma, - #[serde(rename = "MC")] - Mc, - #[serde(rename = "MD")] - Md, - #[serde(rename = "ME")] - Me, - #[serde(rename = "MF")] - Mf, - #[serde(rename = "MG")] - Mg, - #[serde(rename = "MK")] - Mk, - #[serde(rename = "ML")] - Ml, - #[serde(rename = "MM")] - Mm, - #[serde(rename = "MN")] - Mn, - #[serde(rename = "MO")] - Mo, - #[serde(rename = "MQ")] - Mq, - #[serde(rename = "MR")] - Mr, - #[serde(rename = "MS")] - Ms, - #[serde(rename = "MT")] - Mt, - #[serde(rename = "MU")] - Mu, - #[serde(rename = "MV")] - Mv, - #[serde(rename = "MW")] - Mw, - #[serde(rename = "MX")] - Mx, - #[serde(rename = "MY")] - My, - #[serde(rename = "MZ")] - Mz, - #[serde(rename = "NA")] - Na, - #[serde(rename = "NC")] - Nc, - #[serde(rename = "NE")] - Ne, - #[serde(rename = "NG")] - Ng, - #[serde(rename = "NI")] - Ni, - #[serde(rename = "NL")] - Nl, - #[serde(rename = "NO")] - No, - #[serde(rename = "NP")] - Np, - #[serde(rename = "NR")] - Nr, - #[serde(rename = "NU")] - Nu, - #[serde(rename = "NZ")] - Nz, - #[serde(rename = "OM")] - Om, - #[serde(rename = "PA")] - Pa, - #[serde(rename = "PE")] - Pe, - #[serde(rename = "PF")] - Pf, - #[serde(rename = "PG")] - Pg, - #[serde(rename = "PH")] - Ph, - #[serde(rename = "PK")] - Pk, - #[serde(rename = "PL")] - Pl, - #[serde(rename = "PM")] - Pm, - #[serde(rename = "PN")] - Pn, - #[serde(rename = "PR")] - Pr, - #[serde(rename = "PS")] - Ps, - #[serde(rename = "PT")] - Pt, - #[serde(rename = "PY")] - Py, - #[serde(rename = "QA")] - Qa, - #[serde(rename = "RE")] - Re, - #[serde(rename = "RO")] - Ro, - #[serde(rename = "RS")] - Rs, - #[serde(rename = "RU")] - Ru, - #[serde(rename = "RW")] - Rw, - #[serde(rename = "SA")] - Sa, - #[serde(rename = "SB")] - Sb, - #[serde(rename = "SC")] - Sc, - #[serde(rename = "SE")] - Se, - #[serde(rename = "SG")] - Sg, - #[serde(rename = "SH")] - Sh, - #[serde(rename = "SI")] - Si, - #[serde(rename = "SJ")] - Sj, - #[serde(rename = "SK")] - Sk, - #[serde(rename = "SL")] - Sl, - #[serde(rename = "SM")] - Sm, - #[serde(rename = "SN")] - Sn, - #[serde(rename = "SO")] - So, - #[serde(rename = "SR")] - Sr, - #[serde(rename = "SS")] - Ss, - #[serde(rename = "ST")] - St, - #[serde(rename = "SV")] - Sv, - #[serde(rename = "SX")] - Sx, - #[serde(rename = "SZ")] - Sz, - #[serde(rename = "TA")] - Ta, - #[serde(rename = "TC")] - Tc, - #[serde(rename = "TD")] - Td, - #[serde(rename = "TF")] - Tf, - #[serde(rename = "TG")] - Tg, - #[serde(rename = "TH")] - Th, - #[serde(rename = "TJ")] - Tj, - #[serde(rename = "TK")] - Tk, - #[serde(rename = "TL")] - Tl, - #[serde(rename = "TM")] - Tm, - #[serde(rename = "TN")] - Tn, - #[serde(rename = "TO")] - To, - #[serde(rename = "TR")] - Tr, - #[serde(rename = "TT")] - Tt, - #[serde(rename = "TV")] - Tv, - #[serde(rename = "TW")] - Tw, - #[serde(rename = "TZ")] - Tz, - #[serde(rename = "UA")] - Ua, - #[serde(rename = "UG")] - Ug, - #[serde(rename = "US")] - Us, - #[serde(rename = "UY")] - Uy, - #[serde(rename = "UZ")] - Uz, - #[serde(rename = "VA")] - Va, - #[serde(rename = "VC")] - Vc, - #[serde(rename = "VE")] - Ve, - #[serde(rename = "VG")] - Vg, - #[serde(rename = "VN")] - Vn, - #[serde(rename = "VU")] - Vu, - #[serde(rename = "WF")] - Wf, - #[serde(rename = "WS")] - Ws, - #[serde(rename = "XK")] - Xk, - #[serde(rename = "YE")] - Ye, - #[serde(rename = "YT")] - Yt, - #[serde(rename = "ZA")] - Za, - #[serde(rename = "ZM")] - Zm, - #[serde(rename = "ZW")] - Zw, - #[serde(rename = "ZZ")] - Zz, -} - -impl UpdatePaymentLinkShippingAddressCollectionAllowedCountries { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ac => "AC", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ad => "AD", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ae => "AE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Af => "AF", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ag => "AG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ai => "AI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Al => "AL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Am => "AM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ao => "AO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Aq => "AQ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ar => "AR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::At => "AT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Au => "AU", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Aw => "AW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ax => "AX", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Az => "AZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ba => "BA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bb => "BB", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bd => "BD", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Be => "BE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bf => "BF", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bg => "BG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bh => "BH", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bi => "BI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bj => "BJ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bl => "BL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bm => "BM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bn => "BN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bo => "BO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bq => "BQ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Br => "BR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bs => "BS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bt => "BT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bv => "BV", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bw => "BW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::By => "BY", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bz => "BZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ca => "CA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cd => "CD", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cf => "CF", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cg => "CG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ch => "CH", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ci => "CI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ck => "CK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cl => "CL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cm => "CM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cn => "CN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Co => "CO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cr => "CR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cv => "CV", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cw => "CW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cy => "CY", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cz => "CZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::De => "DE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Dj => "DJ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Dk => "DK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Dm => "DM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Do => "DO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Dz => "DZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ec => "EC", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ee => "EE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Eg => "EG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Eh => "EH", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Er => "ER", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Es => "ES", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Et => "ET", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Fi => "FI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Fj => "FJ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Fk => "FK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Fo => "FO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Fr => "FR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ga => "GA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gb => "GB", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gd => "GD", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ge => "GE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gf => "GF", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gg => "GG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gh => "GH", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gi => "GI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gl => "GL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gm => "GM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gn => "GN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gp => "GP", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gq => "GQ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gr => "GR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gs => "GS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gt => "GT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gu => "GU", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gw => "GW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gy => "GY", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Hk => "HK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Hn => "HN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Hr => "HR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ht => "HT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Hu => "HU", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Id => "ID", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ie => "IE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Il => "IL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Im => "IM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::In => "IN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Io => "IO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Iq => "IQ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Is => "IS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::It => "IT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Je => "JE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Jm => "JM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Jo => "JO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Jp => "JP", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ke => "KE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Kg => "KG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Kh => "KH", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ki => "KI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Km => "KM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Kn => "KN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Kr => "KR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Kw => "KW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ky => "KY", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Kz => "KZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::La => "LA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Lb => "LB", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Lc => "LC", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Li => "LI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Lk => "LK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Lr => "LR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ls => "LS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Lt => "LT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Lu => "LU", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Lv => "LV", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ly => "LY", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ma => "MA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mc => "MC", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Md => "MD", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Me => "ME", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mf => "MF", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mg => "MG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mk => "MK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ml => "ML", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mm => "MM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mn => "MN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mo => "MO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mq => "MQ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mr => "MR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ms => "MS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mt => "MT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mu => "MU", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mv => "MV", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mw => "MW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mx => "MX", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::My => "MY", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mz => "MZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Na => "NA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Nc => "NC", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ne => "NE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ng => "NG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ni => "NI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Nl => "NL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::No => "NO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Np => "NP", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Nr => "NR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Nu => "NU", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Nz => "NZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Om => "OM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pa => "PA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pe => "PE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pf => "PF", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pg => "PG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ph => "PH", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pk => "PK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pl => "PL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pm => "PM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pn => "PN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pr => "PR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ps => "PS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pt => "PT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Py => "PY", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Qa => "QA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Re => "RE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ro => "RO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Rs => "RS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ru => "RU", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Rw => "RW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sa => "SA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sb => "SB", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sc => "SC", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Se => "SE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sg => "SG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sh => "SH", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Si => "SI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sj => "SJ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sk => "SK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sl => "SL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sm => "SM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sn => "SN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::So => "SO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sr => "SR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ss => "SS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::St => "ST", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sv => "SV", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sx => "SX", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sz => "SZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ta => "TA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tc => "TC", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Td => "TD", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tf => "TF", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tg => "TG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Th => "TH", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tj => "TJ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tk => "TK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tl => "TL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tm => "TM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tn => "TN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::To => "TO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tr => "TR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tt => "TT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tv => "TV", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tw => "TW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tz => "TZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ua => "UA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ug => "UG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Us => "US", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Uy => "UY", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Uz => "UZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Va => "VA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Vc => "VC", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ve => "VE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Vg => "VG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Vn => "VN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Vu => "VU", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Wf => "WF", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ws => "WS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Xk => "XK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ye => "YE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Yt => "YT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Za => "ZA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Zm => "ZM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Zw => "ZW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Zz => "ZZ", - } - } -} - -impl AsRef for UpdatePaymentLinkShippingAddressCollectionAllowedCountries { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentLinkShippingAddressCollectionAllowedCountries { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentLinkShippingAddressCollectionAllowedCountries { - fn default() -> Self { - Self::Ac - } -} diff --git a/src/resources/generated/payment_method.rs b/src/resources/generated/payment_method.rs deleted file mode 100644 index 8311a0628..000000000 --- a/src/resources/generated/payment_method.rs +++ /dev/null @@ -1,2834 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, PaymentMethodId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, Timestamp}; -use crate::resources::{ - Address, BillingDetails, Charge, Customer, PaymentMethodCardPresentNetworks, RadarRadarOptions, - SetupAttempt, -}; - -/// The resource representing a Stripe "PaymentMethod". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethod { - /// Unique identifier for the object. - pub id: PaymentMethodId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - pub billing_details: BillingDetails, - - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card_present: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The ID of the Customer to which this PaymentMethod is saved. - /// - /// This will not be set when the PaymentMethod has not been saved to a Customer. - pub customer: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// The type of the PaymentMethod. - /// - /// An additional hash is included on the PaymentMethod with a name matching this value. - /// It contains additional information specific to the PaymentMethod type. - #[serde(rename = "type")] - pub type_: PaymentMethodType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -impl PaymentMethod { - /// Returns a list of PaymentMethods for Treasury flows. - /// - /// If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer’s PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. - pub fn list(client: &Client, params: &ListPaymentMethods<'_>) -> Response> { - client.get_query("/payment_methods", ¶ms) - } - - /// Creates a PaymentMethod object. - /// - /// Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents](https://stripe.com/docs/payments/accept-a-payment) API to accept a payment immediately or the [SetupIntent](https://stripe.com/docs/payments/save-and-reuse) API to collect payment method details ahead of a future payment. - pub fn create(client: &Client, params: CreatePaymentMethod<'_>) -> Response { - client.post_form("/payment_methods", ¶ms) - } - - /// Retrieves a PaymentMethod object attached to the StripeAccount. - /// - /// To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer’s PaymentMethods](https://stripe.com/docs/api/payment_methods/customer). - pub fn retrieve( - client: &Client, - id: &PaymentMethodId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/payment_methods/{}", id), &Expand { expand }) - } - - /// Updates a PaymentMethod object. - /// - /// A PaymentMethod must be attached a customer to be updated. - pub fn update( - client: &Client, - id: &PaymentMethodId, - params: UpdatePaymentMethod<'_>, - ) -> Response { - client.post_form(&format!("/payment_methods/{}", id), ¶ms) - } -} - -impl Object for PaymentMethod { - type Id = PaymentMethodId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "payment_method" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsPrivatePaymentMethodsAlipay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodAcssDebit { - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Institution number of the bank account. - pub institution_number: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// Transit number of the bank account. - pub transit_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodAffirm {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodAfterpayClearpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodAuBecsDebit { - /// Six-digit number identifying bank and branch associated with this bank account. - pub bsb_number: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodBacsDebit { - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// Sort code of the bank account. - /// - /// (e.g., `10-20-30`). - pub sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodBancontact {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodBlik {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodBoleto { - /// Uniquely identifies the customer tax id (CNPJ or CPF). - pub tax_id: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CardDetails { - /// Card brand. - /// - /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub brand: String, - - /// Checks on Card address and CVC if provided. - pub checks: Option, - - /// Two-letter ISO code representing the country of the card. - /// - /// You could use this attribute to get a sense of the international breakdown of cards you've collected. - pub country: Option, - - /// A high-level description of the type of cards issued in this range. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Two-digit number representing the card's expiration month. - pub exp_month: i64, - - /// Four-digit number representing the card's expiration year. - pub exp_year: i64, - - /// Uniquely identifies this particular card number. - /// - /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - /// Card funding type. - /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - pub funding: String, - - /// Issuer identification number of the card. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - /// The name of the card's issuing bank. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// The last four digits of the card. - pub last4: String, - - /// Contains information about card networks that can be used to process the payment. - pub networks: Option, - - /// Contains details on how this Card may be used for 3D Secure authentication. - pub three_d_secure_usage: Option, - - /// If this Card is part of a card wallet, this contains the details of the card wallet. - pub wallet: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Networks { - /// All available networks for the card. - pub available: Vec, - - /// The preferred network for the card. - pub preferred: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodCardChecks { - /// If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - pub address_line1_check: Option, - - /// If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - pub address_postal_code_check: Option, - - /// If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - pub cvc_check: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CardPresent { - /// Card brand. - /// - /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub brand: Option, - - /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. - /// - /// May include alphanumeric characters, special characters and first/last name separator (`/`). - /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card. - /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. - pub cardholder_name: Option, - - /// Two-letter ISO code representing the country of the card. - /// - /// You could use this attribute to get a sense of the international breakdown of cards you've collected. - pub country: Option, - - /// A high-level description of the type of cards issued in this range. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Two-digit number representing the card's expiration month. - pub exp_month: i64, - - /// Four-digit number representing the card's expiration year. - pub exp_year: i64, - - /// Uniquely identifies this particular card number. - /// - /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. - pub fingerprint: Option, - - /// Card funding type. - /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - pub funding: Option, - - /// Issuer identification number of the card. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - /// The name of the card's issuing bank. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// The last four digits of the card. - pub last4: Option, - - /// Contains information about card networks that can be used to process the payment. - pub networks: Option, - - /// How card details were read in this transaction. - pub read_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WalletDetails { - #[serde(skip_serializing_if = "Option::is_none")] - pub amex_express_checkout: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub apple_pay: Option, - - /// (For tokenized numbers only.) The last four digits of the device account number. - pub dynamic_last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub google_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub masterpass: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub samsung_pay: Option, - - /// The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. - /// - /// An additional hash is included on the Wallet subhash with a name matching this value. - /// It contains additional information specific to the card wallet type. - #[serde(rename = "type")] - pub type_: WalletDetailsType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub visa_checkout: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WalletAmexExpressCheckout {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WalletApplePay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WalletGooglePay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodCardWalletLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WalletMasterpass { - /// Owner's verified billing address. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub billing_address: Option
, - - /// Owner's verified email. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub email: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub name: Option, - - /// Owner's verified shipping address. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub shipping_address: Option
, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WalletSamsungPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WalletVisaCheckout { - /// Owner's verified billing address. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub billing_address: Option
, - - /// Owner's verified email. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub email: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub name: Option, - - /// Owner's verified shipping address. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub shipping_address: Option
, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodCashapp { - /// A unique and immutable identifier assigned by Cash App to every buyer. - pub buyer_id: Option, - - /// A public identifier for buyers using Cash App. - pub cashtag: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodCustomerBalance {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodEps { - /// The customer's bank. - /// - /// Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodFpx { - /// Account holder type, if provided. - /// - /// Can be one of `individual` or `company`. - pub account_holder_type: Option, - - /// The customer's bank, if provided. - /// - /// Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. - pub bank: PaymentMethodFpxBank, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodGiropay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodGrabpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodIdeal { - /// The customer's bank, if provided. - /// - /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. - pub bank: Option, - - /// The Bank Identifier Code of the customer's bank, if the bank was provided. - pub bic: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodInteracPresent { - /// Card brand. - /// - /// Can be `interac`, `mastercard` or `visa`. - pub brand: Option, - - /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. - /// - /// May include alphanumeric characters, special characters and first/last name separator (`/`). - /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card. - /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. - pub cardholder_name: Option, - - /// Two-letter ISO code representing the country of the card. - /// - /// You could use this attribute to get a sense of the international breakdown of cards you've collected. - pub country: Option, - - /// A high-level description of the type of cards issued in this range. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Two-digit number representing the card's expiration month. - pub exp_month: i64, - - /// Four-digit number representing the card's expiration year. - pub exp_year: i64, - - /// Uniquely identifies this particular card number. - /// - /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. - pub fingerprint: Option, - - /// Card funding type. - /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - pub funding: Option, - - /// Issuer identification number of the card. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - /// The name of the card's issuing bank. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// The last four digits of the card. - pub last4: Option, - - /// Contains information about card networks that can be used to process the payment. - pub networks: Option, - - /// EMV tag 5F2D. - /// - /// Preferred languages specified by the integrated circuit chip. - pub preferred_locales: Option>, - - /// How card details were read in this transaction. - pub read_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodKlarna { - /// The customer's date of birth, if provided. - pub dob: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsPrivatePaymentMethodsKlarnaDob { - /// The day of birth, between 1 and 31. - pub day: Option, - - /// The month of birth, between 1 and 12. - pub month: Option, - - /// The four-digit year of birth. - pub year: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodLink { - /// Account owner's email address. - pub email: Option, - - /// [Deprecated] This is a legacy parameter that no longer has any function. - #[serde(skip_serializing_if = "Option::is_none")] - pub persistent_token: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOxxo {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodP24 { - /// The customer's bank, if provided. - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodPaynow {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodPaypal { - /// Owner's email. - /// - /// Values are provided by PayPal directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - #[serde(skip_serializing_if = "Option::is_none")] - pub payer_email: Option, - - /// PayPal account PayerID. - /// - /// This identifier uniquely identifies the PayPal customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub payer_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodPix {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodPromptpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodSepaDebit { - /// Bank code of bank associated with the bank account. - pub bank_code: Option, - - /// Branch code of bank associated with the bank account. - pub branch_code: Option, - - /// Two-letter ISO code representing the country the bank account is located in. - pub country: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Information about the object that generated this PaymentMethod. - pub generated_from: Option, - - /// Last four characters of the IBAN. - pub last4: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodSofort { - /// Two-letter ISO code representing the country the bank account is located in. - pub country: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodUsBankAccount { - /// Account holder type: individual or company. - pub account_holder_type: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - pub account_type: Option, - - /// The name of the bank. - pub bank_name: Option, - - /// The ID of the Financial Connections Account used to create the payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections_account: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// Contains information about US bank account networks that can be used. - pub networks: Option, - - /// Routing number of the bank account. - pub routing_number: Option, - - /// Contains information about the future reusability of this PaymentMethod. - #[serde(skip_serializing_if = "Option::is_none")] - pub status_details: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodUsBankAccountStatusDetails { - #[serde(skip_serializing_if = "Option::is_none")] - pub blocked: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodUsBankAccountBlocked { - /// The ACH network code that resulted in this block. - pub network_code: Option, - - /// The reason why this PaymentMethod's fingerprint has been blocked. - pub reason: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodWechatPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodZip {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SepaDebitGeneratedFrom { - /// The ID of the Charge that generated this PaymentMethod, if any. - pub charge: Option>, - - /// The ID of the SetupAttempt that generated this PaymentMethod, if any. - pub setup_attempt: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ThreeDSecureUsage { - /// Whether 3D Secure is supported on this card. - pub supported: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UsBankAccountNetworks { - /// The preferred network. - pub preferred: Option, - - /// All supported networks. - pub supported: Vec, -} - -/// The parameters for `PaymentMethod::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreatePaymentMethod<'a> { - /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_details: Option, - - /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// If this is a `card` PaymentMethod, this hash contains the user's card details. - /// - /// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. - /// When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). - /// We strongly recommend using Stripe.js instead of interacting with this API directly. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// The `Customer` to whom the original PaymentMethod is attached. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// The PaymentMethod to share. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// Options to configure Radar. - /// - /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// The type of the PaymentMethod. - /// - /// An additional hash is included on the PaymentMethod with a name matching this value. - /// It contains additional information specific to the PaymentMethod type. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, - - /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -impl<'a> CreatePaymentMethod<'a> { - pub fn new() -> Self { - CreatePaymentMethod { - acss_debit: Default::default(), - affirm: Default::default(), - afterpay_clearpay: Default::default(), - alipay: Default::default(), - au_becs_debit: Default::default(), - bacs_debit: Default::default(), - bancontact: Default::default(), - billing_details: Default::default(), - blik: Default::default(), - boleto: Default::default(), - card: Default::default(), - cashapp: Default::default(), - customer: Default::default(), - customer_balance: Default::default(), - eps: Default::default(), - expand: Default::default(), - fpx: Default::default(), - giropay: Default::default(), - grabpay: Default::default(), - ideal: Default::default(), - interac_present: Default::default(), - klarna: Default::default(), - konbini: Default::default(), - link: Default::default(), - metadata: Default::default(), - oxxo: Default::default(), - p24: Default::default(), - payment_method: Default::default(), - paynow: Default::default(), - paypal: Default::default(), - pix: Default::default(), - promptpay: Default::default(), - radar_options: Default::default(), - sepa_debit: Default::default(), - sofort: Default::default(), - type_: Default::default(), - us_bank_account: Default::default(), - wechat_pay: Default::default(), - zip: Default::default(), - } - } -} - -/// The parameters for `PaymentMethod::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPaymentMethods<'a> { - /// The ID of the customer whose PaymentMethods will be retrieved. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// An optional filter on the list, based on the object `type` field. - /// - /// Without the filter, the list includes all current and future payment method types. - /// If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -impl<'a> ListPaymentMethods<'a> { - pub fn new() -> Self { - ListPaymentMethods { - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - type_: Default::default(), - } - } -} -impl Paginable for ListPaymentMethods<'_> { - type O = PaymentMethod; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `PaymentMethod::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePaymentMethod<'a> { - /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_details: Option, - - /// If this is a `card` PaymentMethod, this hash contains the user's card details. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -impl<'a> UpdatePaymentMethod<'a> { - pub fn new() -> Self { - UpdatePaymentMethod { - billing_details: Default::default(), - card: Default::default(), - expand: Default::default(), - link: Default::default(), - metadata: Default::default(), - us_bank_account: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodAcssDebit { - /// Customer's bank account number. - pub account_number: String, - - /// Institution number of the customer's bank. - pub institution_number: String, - - /// Transit number of the customer's bank. - pub transit_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodAffirm {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodAfterpayClearpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodAlipay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodAuBecsDebit { - /// The account number for the bank account. - pub account_number: String, - - /// Bank-State-Branch number of the bank account. - pub bsb_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodBacsDebit { - /// Account number of the bank account that the funds will be debited from. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Sort code of the bank account. - /// - /// (e.g., `10-20-30`). - #[serde(skip_serializing_if = "Option::is_none")] - pub sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodBancontact {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodBlik {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodBoleto { - /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers). - pub tax_id: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodCashapp {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodCustomerBalance {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodEps { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodFpx { - /// Account holder type for FPX transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: Option, - - /// The customer's bank. - pub bank: CreatePaymentMethodFpxBank, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodGiropay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodGrabpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodIdeal { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodInteracPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodKlarna { - /// Customer's date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub dob: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodOxxo {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodP24 { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodPaynow {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodPaypal {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodPix {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodPromptpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodRadarOptions { - /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub session: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodSepaDebit { - /// IBAN of the bank account. - pub iban: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodSofort { - /// Two-letter ISO code representing the country the bank account is located in. - pub country: CreatePaymentMethodSofortCountry, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodUsBankAccount { - /// Account holder type: individual or company. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: Option, - - /// Account number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_type: Option, - - /// The ID of a Financial Connections Account to use as a payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections_account: Option, - - /// Routing number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodWechatPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodZip {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodUsBankAccount { - /// Bank account type. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodKlarnaDob { - /// The day of birth, between 1 and 31. - pub day: i64, - - /// The month of birth, between 1 and 12. - pub month: i64, - - /// The four-digit year of birth. - pub year: i64, -} - -/// An enum representing the possible values of an `CardPresent`'s `read_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CardPresentReadMethod { - ContactEmv, - ContactlessEmv, - ContactlessMagstripeMode, - MagneticStripeFallback, - MagneticStripeTrack2, -} - -impl CardPresentReadMethod { - pub fn as_str(self) -> &'static str { - match self { - CardPresentReadMethod::ContactEmv => "contact_emv", - CardPresentReadMethod::ContactlessEmv => "contactless_emv", - CardPresentReadMethod::ContactlessMagstripeMode => "contactless_magstripe_mode", - CardPresentReadMethod::MagneticStripeFallback => "magnetic_stripe_fallback", - CardPresentReadMethod::MagneticStripeTrack2 => "magnetic_stripe_track2", - } - } -} - -impl AsRef for CardPresentReadMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CardPresentReadMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CardPresentReadMethod { - fn default() -> Self { - Self::ContactEmv - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodEps`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodEpsBank { - ArzteUndApothekerBank, - AustrianAnadiBankAg, - BankAustria, - BankhausCarlSpangler, - BankhausSchelhammerUndSchatteraAg, - BawagPskAg, - BksBankAg, - BrullKallmusBankAg, - BtvVierLanderBank, - CapitalBankGraweGruppeAg, - DeutscheBankAg, - Dolomitenbank, - EasybankAg, - ErsteBankUndSparkassen, - HypoAlpeadriabankInternationalAg, - HypoBankBurgenlandAktiengesellschaft, - HypoNoeLbFurNiederosterreichUWien, - HypoOberosterreichSalzburgSteiermark, - HypoTirolBankAg, - HypoVorarlbergBankAg, - MarchfelderBank, - OberbankAg, - RaiffeisenBankengruppeOsterreich, - SchoellerbankAg, - SpardaBankWien, - VolksbankGruppe, - VolkskreditbankAg, - VrBankBraunau, -} - -impl CreatePaymentMethodEpsBank { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodEpsBank::ArzteUndApothekerBank => "arzte_und_apotheker_bank", - CreatePaymentMethodEpsBank::AustrianAnadiBankAg => "austrian_anadi_bank_ag", - CreatePaymentMethodEpsBank::BankAustria => "bank_austria", - CreatePaymentMethodEpsBank::BankhausCarlSpangler => "bankhaus_carl_spangler", - CreatePaymentMethodEpsBank::BankhausSchelhammerUndSchatteraAg => { - "bankhaus_schelhammer_und_schattera_ag" - } - CreatePaymentMethodEpsBank::BawagPskAg => "bawag_psk_ag", - CreatePaymentMethodEpsBank::BksBankAg => "bks_bank_ag", - CreatePaymentMethodEpsBank::BrullKallmusBankAg => "brull_kallmus_bank_ag", - CreatePaymentMethodEpsBank::BtvVierLanderBank => "btv_vier_lander_bank", - CreatePaymentMethodEpsBank::CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", - CreatePaymentMethodEpsBank::DeutscheBankAg => "deutsche_bank_ag", - CreatePaymentMethodEpsBank::Dolomitenbank => "dolomitenbank", - CreatePaymentMethodEpsBank::EasybankAg => "easybank_ag", - CreatePaymentMethodEpsBank::ErsteBankUndSparkassen => "erste_bank_und_sparkassen", - CreatePaymentMethodEpsBank::HypoAlpeadriabankInternationalAg => { - "hypo_alpeadriabank_international_ag" - } - CreatePaymentMethodEpsBank::HypoBankBurgenlandAktiengesellschaft => { - "hypo_bank_burgenland_aktiengesellschaft" - } - CreatePaymentMethodEpsBank::HypoNoeLbFurNiederosterreichUWien => { - "hypo_noe_lb_fur_niederosterreich_u_wien" - } - CreatePaymentMethodEpsBank::HypoOberosterreichSalzburgSteiermark => { - "hypo_oberosterreich_salzburg_steiermark" - } - CreatePaymentMethodEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag", - CreatePaymentMethodEpsBank::HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", - CreatePaymentMethodEpsBank::MarchfelderBank => "marchfelder_bank", - CreatePaymentMethodEpsBank::OberbankAg => "oberbank_ag", - CreatePaymentMethodEpsBank::RaiffeisenBankengruppeOsterreich => { - "raiffeisen_bankengruppe_osterreich" - } - CreatePaymentMethodEpsBank::SchoellerbankAg => "schoellerbank_ag", - CreatePaymentMethodEpsBank::SpardaBankWien => "sparda_bank_wien", - CreatePaymentMethodEpsBank::VolksbankGruppe => "volksbank_gruppe", - CreatePaymentMethodEpsBank::VolkskreditbankAg => "volkskreditbank_ag", - CreatePaymentMethodEpsBank::VrBankBraunau => "vr_bank_braunau", - } - } -} - -impl AsRef for CreatePaymentMethodEpsBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodEpsBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodEpsBank { - fn default() -> Self { - Self::ArzteUndApothekerBank - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodFpx`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodFpxAccountHolderType { - Company, - Individual, -} - -impl CreatePaymentMethodFpxAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodFpxAccountHolderType::Company => "company", - CreatePaymentMethodFpxAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for CreatePaymentMethodFpxAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodFpxAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodFpxAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodFpx`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodFpxBank { - AffinBank, - Agrobank, - AllianceBank, - Ambank, - BankIslam, - BankMuamalat, - BankOfChina, - BankRakyat, - Bsn, - Cimb, - DeutscheBank, - HongLeongBank, - Hsbc, - Kfh, - Maybank2e, - Maybank2u, - Ocbc, - PbEnterprise, - PublicBank, - Rhb, - StandardChartered, - Uob, -} - -impl CreatePaymentMethodFpxBank { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodFpxBank::AffinBank => "affin_bank", - CreatePaymentMethodFpxBank::Agrobank => "agrobank", - CreatePaymentMethodFpxBank::AllianceBank => "alliance_bank", - CreatePaymentMethodFpxBank::Ambank => "ambank", - CreatePaymentMethodFpxBank::BankIslam => "bank_islam", - CreatePaymentMethodFpxBank::BankMuamalat => "bank_muamalat", - CreatePaymentMethodFpxBank::BankOfChina => "bank_of_china", - CreatePaymentMethodFpxBank::BankRakyat => "bank_rakyat", - CreatePaymentMethodFpxBank::Bsn => "bsn", - CreatePaymentMethodFpxBank::Cimb => "cimb", - CreatePaymentMethodFpxBank::DeutscheBank => "deutsche_bank", - CreatePaymentMethodFpxBank::HongLeongBank => "hong_leong_bank", - CreatePaymentMethodFpxBank::Hsbc => "hsbc", - CreatePaymentMethodFpxBank::Kfh => "kfh", - CreatePaymentMethodFpxBank::Maybank2e => "maybank2e", - CreatePaymentMethodFpxBank::Maybank2u => "maybank2u", - CreatePaymentMethodFpxBank::Ocbc => "ocbc", - CreatePaymentMethodFpxBank::PbEnterprise => "pb_enterprise", - CreatePaymentMethodFpxBank::PublicBank => "public_bank", - CreatePaymentMethodFpxBank::Rhb => "rhb", - CreatePaymentMethodFpxBank::StandardChartered => "standard_chartered", - CreatePaymentMethodFpxBank::Uob => "uob", - } - } -} - -impl AsRef for CreatePaymentMethodFpxBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodFpxBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodFpxBank { - fn default() -> Self { - Self::AffinBank - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodIdeal`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodIdealBank { - AbnAmro, - AsnBank, - Bunq, - Handelsbanken, - Ing, - Knab, - Moneyou, - N26, - Rabobank, - Regiobank, - Revolut, - SnsBank, - TriodosBank, - VanLanschot, - Yoursafe, -} - -impl CreatePaymentMethodIdealBank { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodIdealBank::AbnAmro => "abn_amro", - CreatePaymentMethodIdealBank::AsnBank => "asn_bank", - CreatePaymentMethodIdealBank::Bunq => "bunq", - CreatePaymentMethodIdealBank::Handelsbanken => "handelsbanken", - CreatePaymentMethodIdealBank::Ing => "ing", - CreatePaymentMethodIdealBank::Knab => "knab", - CreatePaymentMethodIdealBank::Moneyou => "moneyou", - CreatePaymentMethodIdealBank::N26 => "n26", - CreatePaymentMethodIdealBank::Rabobank => "rabobank", - CreatePaymentMethodIdealBank::Regiobank => "regiobank", - CreatePaymentMethodIdealBank::Revolut => "revolut", - CreatePaymentMethodIdealBank::SnsBank => "sns_bank", - CreatePaymentMethodIdealBank::TriodosBank => "triodos_bank", - CreatePaymentMethodIdealBank::VanLanschot => "van_lanschot", - CreatePaymentMethodIdealBank::Yoursafe => "yoursafe", - } - } -} - -impl AsRef for CreatePaymentMethodIdealBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodIdealBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodIdealBank { - fn default() -> Self { - Self::AbnAmro - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodP24`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodP24Bank { - AliorBank, - BankMillennium, - BankNowyBfgSa, - BankPekaoSa, - BankiSpbdzielcze, - Blik, - BnpParibas, - Boz, - CitiHandlowy, - CreditAgricole, - Envelobank, - EtransferPocztowy24, - GetinBank, - Ideabank, - Ing, - Inteligo, - MbankMtransfer, - NestPrzelew, - NoblePay, - PbacZIpko, - PlusBank, - SantanderPrzelew24, - TmobileUsbugiBankowe, - ToyotaBank, - VolkswagenBank, -} - -impl CreatePaymentMethodP24Bank { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodP24Bank::AliorBank => "alior_bank", - CreatePaymentMethodP24Bank::BankMillennium => "bank_millennium", - CreatePaymentMethodP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa", - CreatePaymentMethodP24Bank::BankPekaoSa => "bank_pekao_sa", - CreatePaymentMethodP24Bank::BankiSpbdzielcze => "banki_spbdzielcze", - CreatePaymentMethodP24Bank::Blik => "blik", - CreatePaymentMethodP24Bank::BnpParibas => "bnp_paribas", - CreatePaymentMethodP24Bank::Boz => "boz", - CreatePaymentMethodP24Bank::CitiHandlowy => "citi_handlowy", - CreatePaymentMethodP24Bank::CreditAgricole => "credit_agricole", - CreatePaymentMethodP24Bank::Envelobank => "envelobank", - CreatePaymentMethodP24Bank::EtransferPocztowy24 => "etransfer_pocztowy24", - CreatePaymentMethodP24Bank::GetinBank => "getin_bank", - CreatePaymentMethodP24Bank::Ideabank => "ideabank", - CreatePaymentMethodP24Bank::Ing => "ing", - CreatePaymentMethodP24Bank::Inteligo => "inteligo", - CreatePaymentMethodP24Bank::MbankMtransfer => "mbank_mtransfer", - CreatePaymentMethodP24Bank::NestPrzelew => "nest_przelew", - CreatePaymentMethodP24Bank::NoblePay => "noble_pay", - CreatePaymentMethodP24Bank::PbacZIpko => "pbac_z_ipko", - CreatePaymentMethodP24Bank::PlusBank => "plus_bank", - CreatePaymentMethodP24Bank::SantanderPrzelew24 => "santander_przelew24", - CreatePaymentMethodP24Bank::TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", - CreatePaymentMethodP24Bank::ToyotaBank => "toyota_bank", - CreatePaymentMethodP24Bank::VolkswagenBank => "volkswagen_bank", - } - } -} - -impl AsRef for CreatePaymentMethodP24Bank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodP24Bank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodP24Bank { - fn default() -> Self { - Self::AliorBank - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodSofort`'s `country` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodSofortCountry { - #[serde(rename = "AT")] - At, - #[serde(rename = "BE")] - Be, - #[serde(rename = "DE")] - De, - #[serde(rename = "ES")] - Es, - #[serde(rename = "IT")] - It, - #[serde(rename = "NL")] - Nl, -} - -impl CreatePaymentMethodSofortCountry { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodSofortCountry::At => "AT", - CreatePaymentMethodSofortCountry::Be => "BE", - CreatePaymentMethodSofortCountry::De => "DE", - CreatePaymentMethodSofortCountry::Es => "ES", - CreatePaymentMethodSofortCountry::It => "IT", - CreatePaymentMethodSofortCountry::Nl => "NL", - } - } -} - -impl AsRef for CreatePaymentMethodSofortCountry { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodSofortCountry { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodSofortCountry { - fn default() -> Self { - Self::At - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl CreatePaymentMethodUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodUsBankAccountAccountHolderType::Company => "company", - CreatePaymentMethodUsBankAccountAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for CreatePaymentMethodUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodUsBankAccountAccountType { - Checking, - Savings, -} - -impl CreatePaymentMethodUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodUsBankAccountAccountType::Checking => "checking", - CreatePaymentMethodUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for CreatePaymentMethodUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `PaymentMethodEps`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodEpsBank { - ArzteUndApothekerBank, - AustrianAnadiBankAg, - BankAustria, - BankhausCarlSpangler, - BankhausSchelhammerUndSchatteraAg, - BawagPskAg, - BksBankAg, - BrullKallmusBankAg, - BtvVierLanderBank, - CapitalBankGraweGruppeAg, - DeutscheBankAg, - Dolomitenbank, - EasybankAg, - ErsteBankUndSparkassen, - HypoAlpeadriabankInternationalAg, - HypoBankBurgenlandAktiengesellschaft, - HypoNoeLbFurNiederosterreichUWien, - HypoOberosterreichSalzburgSteiermark, - HypoTirolBankAg, - HypoVorarlbergBankAg, - MarchfelderBank, - OberbankAg, - RaiffeisenBankengruppeOsterreich, - SchoellerbankAg, - SpardaBankWien, - VolksbankGruppe, - VolkskreditbankAg, - VrBankBraunau, -} - -impl PaymentMethodEpsBank { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodEpsBank::ArzteUndApothekerBank => "arzte_und_apotheker_bank", - PaymentMethodEpsBank::AustrianAnadiBankAg => "austrian_anadi_bank_ag", - PaymentMethodEpsBank::BankAustria => "bank_austria", - PaymentMethodEpsBank::BankhausCarlSpangler => "bankhaus_carl_spangler", - PaymentMethodEpsBank::BankhausSchelhammerUndSchatteraAg => { - "bankhaus_schelhammer_und_schattera_ag" - } - PaymentMethodEpsBank::BawagPskAg => "bawag_psk_ag", - PaymentMethodEpsBank::BksBankAg => "bks_bank_ag", - PaymentMethodEpsBank::BrullKallmusBankAg => "brull_kallmus_bank_ag", - PaymentMethodEpsBank::BtvVierLanderBank => "btv_vier_lander_bank", - PaymentMethodEpsBank::CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", - PaymentMethodEpsBank::DeutscheBankAg => "deutsche_bank_ag", - PaymentMethodEpsBank::Dolomitenbank => "dolomitenbank", - PaymentMethodEpsBank::EasybankAg => "easybank_ag", - PaymentMethodEpsBank::ErsteBankUndSparkassen => "erste_bank_und_sparkassen", - PaymentMethodEpsBank::HypoAlpeadriabankInternationalAg => { - "hypo_alpeadriabank_international_ag" - } - PaymentMethodEpsBank::HypoBankBurgenlandAktiengesellschaft => { - "hypo_bank_burgenland_aktiengesellschaft" - } - PaymentMethodEpsBank::HypoNoeLbFurNiederosterreichUWien => { - "hypo_noe_lb_fur_niederosterreich_u_wien" - } - PaymentMethodEpsBank::HypoOberosterreichSalzburgSteiermark => { - "hypo_oberosterreich_salzburg_steiermark" - } - PaymentMethodEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag", - PaymentMethodEpsBank::HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", - PaymentMethodEpsBank::MarchfelderBank => "marchfelder_bank", - PaymentMethodEpsBank::OberbankAg => "oberbank_ag", - PaymentMethodEpsBank::RaiffeisenBankengruppeOsterreich => { - "raiffeisen_bankengruppe_osterreich" - } - PaymentMethodEpsBank::SchoellerbankAg => "schoellerbank_ag", - PaymentMethodEpsBank::SpardaBankWien => "sparda_bank_wien", - PaymentMethodEpsBank::VolksbankGruppe => "volksbank_gruppe", - PaymentMethodEpsBank::VolkskreditbankAg => "volkskreditbank_ag", - PaymentMethodEpsBank::VrBankBraunau => "vr_bank_braunau", - } - } -} - -impl AsRef for PaymentMethodEpsBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodEpsBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodEpsBank { - fn default() -> Self { - Self::ArzteUndApothekerBank - } -} - -/// An enum representing the possible values of an `PaymentMethodFpx`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodFpxAccountHolderType { - Company, - Individual, -} - -impl PaymentMethodFpxAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodFpxAccountHolderType::Company => "company", - PaymentMethodFpxAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for PaymentMethodFpxAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodFpxAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodFpxAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `PaymentMethodFpx`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodFpxBank { - AffinBank, - Agrobank, - AllianceBank, - Ambank, - BankIslam, - BankMuamalat, - BankOfChina, - BankRakyat, - Bsn, - Cimb, - DeutscheBank, - HongLeongBank, - Hsbc, - Kfh, - Maybank2e, - Maybank2u, - Ocbc, - PbEnterprise, - PublicBank, - Rhb, - StandardChartered, - Uob, -} - -impl PaymentMethodFpxBank { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodFpxBank::AffinBank => "affin_bank", - PaymentMethodFpxBank::Agrobank => "agrobank", - PaymentMethodFpxBank::AllianceBank => "alliance_bank", - PaymentMethodFpxBank::Ambank => "ambank", - PaymentMethodFpxBank::BankIslam => "bank_islam", - PaymentMethodFpxBank::BankMuamalat => "bank_muamalat", - PaymentMethodFpxBank::BankOfChina => "bank_of_china", - PaymentMethodFpxBank::BankRakyat => "bank_rakyat", - PaymentMethodFpxBank::Bsn => "bsn", - PaymentMethodFpxBank::Cimb => "cimb", - PaymentMethodFpxBank::DeutscheBank => "deutsche_bank", - PaymentMethodFpxBank::HongLeongBank => "hong_leong_bank", - PaymentMethodFpxBank::Hsbc => "hsbc", - PaymentMethodFpxBank::Kfh => "kfh", - PaymentMethodFpxBank::Maybank2e => "maybank2e", - PaymentMethodFpxBank::Maybank2u => "maybank2u", - PaymentMethodFpxBank::Ocbc => "ocbc", - PaymentMethodFpxBank::PbEnterprise => "pb_enterprise", - PaymentMethodFpxBank::PublicBank => "public_bank", - PaymentMethodFpxBank::Rhb => "rhb", - PaymentMethodFpxBank::StandardChartered => "standard_chartered", - PaymentMethodFpxBank::Uob => "uob", - } - } -} - -impl AsRef for PaymentMethodFpxBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodFpxBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodFpxBank { - fn default() -> Self { - Self::AffinBank - } -} - -/// An enum representing the possible values of an `PaymentMethodIdeal`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodIdealBank { - AbnAmro, - AsnBank, - Bunq, - Handelsbanken, - Ing, - Knab, - Moneyou, - N26, - Rabobank, - Regiobank, - Revolut, - SnsBank, - TriodosBank, - VanLanschot, - Yoursafe, -} - -impl PaymentMethodIdealBank { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodIdealBank::AbnAmro => "abn_amro", - PaymentMethodIdealBank::AsnBank => "asn_bank", - PaymentMethodIdealBank::Bunq => "bunq", - PaymentMethodIdealBank::Handelsbanken => "handelsbanken", - PaymentMethodIdealBank::Ing => "ing", - PaymentMethodIdealBank::Knab => "knab", - PaymentMethodIdealBank::Moneyou => "moneyou", - PaymentMethodIdealBank::N26 => "n26", - PaymentMethodIdealBank::Rabobank => "rabobank", - PaymentMethodIdealBank::Regiobank => "regiobank", - PaymentMethodIdealBank::Revolut => "revolut", - PaymentMethodIdealBank::SnsBank => "sns_bank", - PaymentMethodIdealBank::TriodosBank => "triodos_bank", - PaymentMethodIdealBank::VanLanschot => "van_lanschot", - PaymentMethodIdealBank::Yoursafe => "yoursafe", - } - } -} - -impl AsRef for PaymentMethodIdealBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodIdealBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodIdealBank { - fn default() -> Self { - Self::AbnAmro - } -} - -/// An enum representing the possible values of an `PaymentMethodIdeal`'s `bic` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodIdealBic { - #[serde(rename = "ABNANL2A")] - Abnanl2a, - #[serde(rename = "ASNBNL21")] - Asnbnl21, - #[serde(rename = "BITSNL2A")] - Bitsnl2a, - #[serde(rename = "BUNQNL2A")] - Bunqnl2a, - #[serde(rename = "FVLBNL22")] - Fvlbnl22, - #[serde(rename = "HANDNL2A")] - Handnl2a, - #[serde(rename = "INGBNL2A")] - Ingbnl2a, - #[serde(rename = "KNABNL2H")] - Knabnl2h, - #[serde(rename = "MOYONL21")] - Moyonl21, - #[serde(rename = "NTSBDEB1")] - Ntsbdeb1, - #[serde(rename = "RABONL2U")] - Rabonl2u, - #[serde(rename = "RBRBNL21")] - Rbrbnl21, - #[serde(rename = "REVOIE23")] - Revoie23, - #[serde(rename = "REVOLT21")] - Revolt21, - #[serde(rename = "SNSBNL2A")] - Snsbnl2a, - #[serde(rename = "TRIONL2U")] - Trionl2u, -} - -impl PaymentMethodIdealBic { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodIdealBic::Abnanl2a => "ABNANL2A", - PaymentMethodIdealBic::Asnbnl21 => "ASNBNL21", - PaymentMethodIdealBic::Bitsnl2a => "BITSNL2A", - PaymentMethodIdealBic::Bunqnl2a => "BUNQNL2A", - PaymentMethodIdealBic::Fvlbnl22 => "FVLBNL22", - PaymentMethodIdealBic::Handnl2a => "HANDNL2A", - PaymentMethodIdealBic::Ingbnl2a => "INGBNL2A", - PaymentMethodIdealBic::Knabnl2h => "KNABNL2H", - PaymentMethodIdealBic::Moyonl21 => "MOYONL21", - PaymentMethodIdealBic::Ntsbdeb1 => "NTSBDEB1", - PaymentMethodIdealBic::Rabonl2u => "RABONL2U", - PaymentMethodIdealBic::Rbrbnl21 => "RBRBNL21", - PaymentMethodIdealBic::Revoie23 => "REVOIE23", - PaymentMethodIdealBic::Revolt21 => "REVOLT21", - PaymentMethodIdealBic::Snsbnl2a => "SNSBNL2A", - PaymentMethodIdealBic::Trionl2u => "TRIONL2U", - } - } -} - -impl AsRef for PaymentMethodIdealBic { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodIdealBic { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodIdealBic { - fn default() -> Self { - Self::Abnanl2a - } -} - -/// An enum representing the possible values of an `PaymentMethodInteracPresent`'s `read_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodInteracPresentReadMethod { - ContactEmv, - ContactlessEmv, - ContactlessMagstripeMode, - MagneticStripeFallback, - MagneticStripeTrack2, -} - -impl PaymentMethodInteracPresentReadMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodInteracPresentReadMethod::ContactEmv => "contact_emv", - PaymentMethodInteracPresentReadMethod::ContactlessEmv => "contactless_emv", - PaymentMethodInteracPresentReadMethod::ContactlessMagstripeMode => { - "contactless_magstripe_mode" - } - PaymentMethodInteracPresentReadMethod::MagneticStripeFallback => { - "magnetic_stripe_fallback" - } - PaymentMethodInteracPresentReadMethod::MagneticStripeTrack2 => "magnetic_stripe_track2", - } - } -} - -impl AsRef for PaymentMethodInteracPresentReadMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodInteracPresentReadMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodInteracPresentReadMethod { - fn default() -> Self { - Self::ContactEmv - } -} - -/// An enum representing the possible values of an `PaymentMethodP24`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodP24Bank { - AliorBank, - BankMillennium, - BankNowyBfgSa, - BankPekaoSa, - BankiSpbdzielcze, - Blik, - BnpParibas, - Boz, - CitiHandlowy, - CreditAgricole, - Envelobank, - EtransferPocztowy24, - GetinBank, - Ideabank, - Ing, - Inteligo, - MbankMtransfer, - NestPrzelew, - NoblePay, - PbacZIpko, - PlusBank, - SantanderPrzelew24, - TmobileUsbugiBankowe, - ToyotaBank, - VolkswagenBank, -} - -impl PaymentMethodP24Bank { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodP24Bank::AliorBank => "alior_bank", - PaymentMethodP24Bank::BankMillennium => "bank_millennium", - PaymentMethodP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa", - PaymentMethodP24Bank::BankPekaoSa => "bank_pekao_sa", - PaymentMethodP24Bank::BankiSpbdzielcze => "banki_spbdzielcze", - PaymentMethodP24Bank::Blik => "blik", - PaymentMethodP24Bank::BnpParibas => "bnp_paribas", - PaymentMethodP24Bank::Boz => "boz", - PaymentMethodP24Bank::CitiHandlowy => "citi_handlowy", - PaymentMethodP24Bank::CreditAgricole => "credit_agricole", - PaymentMethodP24Bank::Envelobank => "envelobank", - PaymentMethodP24Bank::EtransferPocztowy24 => "etransfer_pocztowy24", - PaymentMethodP24Bank::GetinBank => "getin_bank", - PaymentMethodP24Bank::Ideabank => "ideabank", - PaymentMethodP24Bank::Ing => "ing", - PaymentMethodP24Bank::Inteligo => "inteligo", - PaymentMethodP24Bank::MbankMtransfer => "mbank_mtransfer", - PaymentMethodP24Bank::NestPrzelew => "nest_przelew", - PaymentMethodP24Bank::NoblePay => "noble_pay", - PaymentMethodP24Bank::PbacZIpko => "pbac_z_ipko", - PaymentMethodP24Bank::PlusBank => "plus_bank", - PaymentMethodP24Bank::SantanderPrzelew24 => "santander_przelew24", - PaymentMethodP24Bank::TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", - PaymentMethodP24Bank::ToyotaBank => "toyota_bank", - PaymentMethodP24Bank::VolkswagenBank => "volkswagen_bank", - } - } -} - -impl AsRef for PaymentMethodP24Bank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodP24Bank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodP24Bank { - fn default() -> Self { - Self::AliorBank - } -} - -/// An enum representing the possible values of an `PaymentMethod`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodType { - AcssDebit, - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Card, - CardPresent, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - InteracPresent, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, - Zip, -} - -impl PaymentMethodType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodType::AcssDebit => "acss_debit", - PaymentMethodType::Affirm => "affirm", - PaymentMethodType::AfterpayClearpay => "afterpay_clearpay", - PaymentMethodType::Alipay => "alipay", - PaymentMethodType::AuBecsDebit => "au_becs_debit", - PaymentMethodType::BacsDebit => "bacs_debit", - PaymentMethodType::Bancontact => "bancontact", - PaymentMethodType::Blik => "blik", - PaymentMethodType::Boleto => "boleto", - PaymentMethodType::Card => "card", - PaymentMethodType::CardPresent => "card_present", - PaymentMethodType::Cashapp => "cashapp", - PaymentMethodType::CustomerBalance => "customer_balance", - PaymentMethodType::Eps => "eps", - PaymentMethodType::Fpx => "fpx", - PaymentMethodType::Giropay => "giropay", - PaymentMethodType::Grabpay => "grabpay", - PaymentMethodType::Ideal => "ideal", - PaymentMethodType::InteracPresent => "interac_present", - PaymentMethodType::Klarna => "klarna", - PaymentMethodType::Konbini => "konbini", - PaymentMethodType::Link => "link", - PaymentMethodType::Oxxo => "oxxo", - PaymentMethodType::P24 => "p24", - PaymentMethodType::Paynow => "paynow", - PaymentMethodType::Paypal => "paypal", - PaymentMethodType::Pix => "pix", - PaymentMethodType::Promptpay => "promptpay", - PaymentMethodType::SepaDebit => "sepa_debit", - PaymentMethodType::Sofort => "sofort", - PaymentMethodType::UsBankAccount => "us_bank_account", - PaymentMethodType::WechatPay => "wechat_pay", - PaymentMethodType::Zip => "zip", - } - } -} - -impl AsRef for PaymentMethodType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodType { - fn default() -> Self { - Self::AcssDebit - } -} - -/// An enum representing the possible values of an `ListPaymentMethods`'s `type_` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodTypeFilter { - AcssDebit, - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Card, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, - Zip, -} - -impl PaymentMethodTypeFilter { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodTypeFilter::AcssDebit => "acss_debit", - PaymentMethodTypeFilter::Affirm => "affirm", - PaymentMethodTypeFilter::AfterpayClearpay => "afterpay_clearpay", - PaymentMethodTypeFilter::Alipay => "alipay", - PaymentMethodTypeFilter::AuBecsDebit => "au_becs_debit", - PaymentMethodTypeFilter::BacsDebit => "bacs_debit", - PaymentMethodTypeFilter::Bancontact => "bancontact", - PaymentMethodTypeFilter::Blik => "blik", - PaymentMethodTypeFilter::Boleto => "boleto", - PaymentMethodTypeFilter::Card => "card", - PaymentMethodTypeFilter::Cashapp => "cashapp", - PaymentMethodTypeFilter::CustomerBalance => "customer_balance", - PaymentMethodTypeFilter::Eps => "eps", - PaymentMethodTypeFilter::Fpx => "fpx", - PaymentMethodTypeFilter::Giropay => "giropay", - PaymentMethodTypeFilter::Grabpay => "grabpay", - PaymentMethodTypeFilter::Ideal => "ideal", - PaymentMethodTypeFilter::Klarna => "klarna", - PaymentMethodTypeFilter::Konbini => "konbini", - PaymentMethodTypeFilter::Link => "link", - PaymentMethodTypeFilter::Oxxo => "oxxo", - PaymentMethodTypeFilter::P24 => "p24", - PaymentMethodTypeFilter::Paynow => "paynow", - PaymentMethodTypeFilter::Paypal => "paypal", - PaymentMethodTypeFilter::Pix => "pix", - PaymentMethodTypeFilter::Promptpay => "promptpay", - PaymentMethodTypeFilter::SepaDebit => "sepa_debit", - PaymentMethodTypeFilter::Sofort => "sofort", - PaymentMethodTypeFilter::UsBankAccount => "us_bank_account", - PaymentMethodTypeFilter::WechatPay => "wechat_pay", - PaymentMethodTypeFilter::Zip => "zip", - } - } -} - -impl AsRef for PaymentMethodTypeFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodTypeFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodTypeFilter { - fn default() -> Self { - Self::AcssDebit - } -} - -/// An enum representing the possible values of an `PaymentMethodUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl PaymentMethodUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodUsBankAccountAccountHolderType::Company => "company", - PaymentMethodUsBankAccountAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for PaymentMethodUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `PaymentMethodUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodUsBankAccountAccountType { - Checking, - Savings, -} - -impl PaymentMethodUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodUsBankAccountAccountType::Checking => "checking", - PaymentMethodUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for PaymentMethodUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `PaymentMethodUsBankAccountBlocked`'s `network_code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodUsBankAccountBlockedNetworkCode { - #[serde(rename = "R02")] - R02, - #[serde(rename = "R03")] - R03, - #[serde(rename = "R04")] - R04, - #[serde(rename = "R05")] - R05, - #[serde(rename = "R07")] - R07, - #[serde(rename = "R08")] - R08, - #[serde(rename = "R10")] - R10, - #[serde(rename = "R11")] - R11, - #[serde(rename = "R16")] - R16, - #[serde(rename = "R20")] - R20, - #[serde(rename = "R29")] - R29, - #[serde(rename = "R31")] - R31, -} - -impl PaymentMethodUsBankAccountBlockedNetworkCode { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodUsBankAccountBlockedNetworkCode::R02 => "R02", - PaymentMethodUsBankAccountBlockedNetworkCode::R03 => "R03", - PaymentMethodUsBankAccountBlockedNetworkCode::R04 => "R04", - PaymentMethodUsBankAccountBlockedNetworkCode::R05 => "R05", - PaymentMethodUsBankAccountBlockedNetworkCode::R07 => "R07", - PaymentMethodUsBankAccountBlockedNetworkCode::R08 => "R08", - PaymentMethodUsBankAccountBlockedNetworkCode::R10 => "R10", - PaymentMethodUsBankAccountBlockedNetworkCode::R11 => "R11", - PaymentMethodUsBankAccountBlockedNetworkCode::R16 => "R16", - PaymentMethodUsBankAccountBlockedNetworkCode::R20 => "R20", - PaymentMethodUsBankAccountBlockedNetworkCode::R29 => "R29", - PaymentMethodUsBankAccountBlockedNetworkCode::R31 => "R31", - } - } -} - -impl AsRef for PaymentMethodUsBankAccountBlockedNetworkCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodUsBankAccountBlockedNetworkCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodUsBankAccountBlockedNetworkCode { - fn default() -> Self { - Self::R02 - } -} - -/// An enum representing the possible values of an `PaymentMethodUsBankAccountBlocked`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodUsBankAccountBlockedReason { - BankAccountClosed, - BankAccountFrozen, - BankAccountInvalidDetails, - BankAccountRestricted, - BankAccountUnusable, - DebitNotAuthorized, -} - -impl PaymentMethodUsBankAccountBlockedReason { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodUsBankAccountBlockedReason::BankAccountClosed => "bank_account_closed", - PaymentMethodUsBankAccountBlockedReason::BankAccountFrozen => "bank_account_frozen", - PaymentMethodUsBankAccountBlockedReason::BankAccountInvalidDetails => { - "bank_account_invalid_details" - } - PaymentMethodUsBankAccountBlockedReason::BankAccountRestricted => { - "bank_account_restricted" - } - PaymentMethodUsBankAccountBlockedReason::BankAccountUnusable => "bank_account_unusable", - PaymentMethodUsBankAccountBlockedReason::DebitNotAuthorized => "debit_not_authorized", - } - } -} - -impl AsRef for PaymentMethodUsBankAccountBlockedReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodUsBankAccountBlockedReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodUsBankAccountBlockedReason { - fn default() -> Self { - Self::BankAccountClosed - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl UpdatePaymentMethodUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodUsBankAccountAccountHolderType::Company => "company", - UpdatePaymentMethodUsBankAccountAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for UpdatePaymentMethodUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `UsBankAccountNetworks`'s `supported` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UsBankAccountNetworksSupported { - Ach, - UsDomesticWire, -} - -impl UsBankAccountNetworksSupported { - pub fn as_str(self) -> &'static str { - match self { - UsBankAccountNetworksSupported::Ach => "ach", - UsBankAccountNetworksSupported::UsDomesticWire => "us_domestic_wire", - } - } -} - -impl AsRef for UsBankAccountNetworksSupported { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UsBankAccountNetworksSupported { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UsBankAccountNetworksSupported { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `WalletDetails`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum WalletDetailsType { - AmexExpressCheckout, - ApplePay, - GooglePay, - Link, - Masterpass, - SamsungPay, - VisaCheckout, -} - -impl WalletDetailsType { - pub fn as_str(self) -> &'static str { - match self { - WalletDetailsType::AmexExpressCheckout => "amex_express_checkout", - WalletDetailsType::ApplePay => "apple_pay", - WalletDetailsType::GooglePay => "google_pay", - WalletDetailsType::Link => "link", - WalletDetailsType::Masterpass => "masterpass", - WalletDetailsType::SamsungPay => "samsung_pay", - WalletDetailsType::VisaCheckout => "visa_checkout", - } - } -} - -impl AsRef for WalletDetailsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for WalletDetailsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for WalletDetailsType { - fn default() -> Self { - Self::AmexExpressCheckout - } -} - -/// If this is a `card` PaymentMethod, this hash contains the user's card details. -/// -/// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. -/// When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). -/// We strongly recommend using Stripe.js instead of interacting with this API directly. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(untagged, rename_all = "snake_case")] -pub enum CreatePaymentMethodCardUnion { - CardDetailsParams(CardDetailsParams), - TokenParams(TokenParams), -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CardDetailsParams { - /// The card's CVC. - /// - /// It is highly recommended to always include this value. - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc: Option, - /// Two-digit number representing the card's expiration month. - pub exp_month: i32, - /// Four-digit number representing the card's expiration year. - pub exp_year: i32, - /// The card number, as a string without any separators. - pub number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TokenParams { - /// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format card: {token: "tok_visa"}. - pub token: String, -} - -/// If this is a `card` PaymentMethod, this hash contains the user's card details. -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateApiParam { - /// Two-digit number representing the card's expiration month. - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_month: Option, - /// Four-digit number representing the card's expiration year. - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_year: Option, -} diff --git a/src/resources/generated/payment_method_card_present_networks.rs b/src/resources/generated/payment_method_card_present_networks.rs deleted file mode 100644 index edc632cd5..000000000 --- a/src/resources/generated/payment_method_card_present_networks.rs +++ /dev/null @@ -1,15 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_method_card_present_networks". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodCardPresentNetworks { - /// All available networks for the card. - pub available: Vec, - - /// The preferred network for the card. - pub preferred: Option, -} diff --git a/src/resources/generated/payment_method_config_biz_payment_method_configuration_details.rs b/src/resources/generated/payment_method_config_biz_payment_method_configuration_details.rs deleted file mode 100644 index 0a18c7e4e..000000000 --- a/src/resources/generated/payment_method_config_biz_payment_method_configuration_details.rs +++ /dev/null @@ -1,12 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "PaymentMethodConfigBizPaymentMethodConfigurationDetails". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodConfigBizPaymentMethodConfigurationDetails { - /// ID of the parent payment method configuration used. - pub parent: Option, -} diff --git a/src/resources/generated/payment_method_configuration.rs b/src/resources/generated/payment_method_configuration.rs deleted file mode 100644 index a0a1859dc..000000000 --- a/src/resources/generated/payment_method_configuration.rs +++ /dev/null @@ -1,4198 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::client::{Client, Response}; -use crate::ids::{PaymentMethodConfigurationId}; -use crate::params::{Expand, List, Object, Paginable}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "PaymentMethodConfigResourcePaymentMethodConfiguration". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodConfiguration { - /// Unique identifier for the object. - pub id: PaymentMethodConfigurationId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// Whether the configuration can be used for new payments. - pub active: bool, - - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub apple_pay: Option, - - /// The Connect application associated with this configuration. - pub application: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cartes_bancaires: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub google_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub id_bank_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// The default configuration is used whenever no payment method configuration is specified. - pub is_default: bool, - - #[serde(skip_serializing_if = "Option::is_none")] - pub jcb: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - #[serde(skip_serializing_if = "Option::is_none")] - pub multibanco: Option, - - /// Configuration name. - pub name: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub netbanking: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// The configuration's parent configuration. - pub parent: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_by_bank: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub upi: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, -} - -impl PaymentMethodConfiguration { - - /// List payment method configurations. -pub fn list(client: &Client, params: &ListPaymentMethodConfigurations<'_>) -> Response> { - client.get_query("/payment_method_configurations", ¶ms) -} - - - /// Creates a payment method configuration. - pub fn create(client: &Client, params: CreatePaymentMethodConfiguration<'_>) -> Response { - client.post_form("/payment_method_configurations", ¶ms) - } - - /// Retrieve payment method configuration. - pub fn retrieve(client: &Client, id: &PaymentMethodConfigurationId, expand: &[&str]) -> Response { - client.get_query(&format!("/payment_method_configurations/{}", id), &Expand { expand }) - } - - /// Update payment method configuration. - pub fn update(client: &Client, id: &PaymentMethodConfigurationId, params: UpdatePaymentMethodConfiguration<'_>) -> Response { - client.post_form(&format!("/payment_method_configurations/{}", id), ¶ms) - } -} - -impl Object for PaymentMethodConfiguration { - type Id = PaymentMethodConfigurationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "payment_method_configuration" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodConfigResourcePaymentMethodProperties { - - /// Whether this payment method may be offered at checkout. - /// - /// True if `display_preference` is `on` and the payment method's capability is active. - pub available: bool, - - pub display_preference: PaymentMethodConfigResourceDisplayPreference, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodConfigResourceDisplayPreference { - - /// For child configurations, whether or not the account's preference will be observed. - /// - /// If `false`, the parent configuration's preference is used. - pub overridable: Option, - - /// The account's display preference. - pub preference: PaymentMethodConfigResourceDisplayPreferencePreference, - - /// The effective display preference value. - pub value: PaymentMethodConfigResourceDisplayPreferenceValue, -} - -/// The parameters for `PaymentMethodConfiguration::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreatePaymentMethodConfiguration<'a> { - - /// Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// [Affirm](https://www.affirm.com/) gives your customers a way to split purchases over a series of payments. - /// - /// Depending on the purchase, they can pay with four interest-free payments (Split Pay) or pay over a longer term (Installments), which might include interest. - /// Check this [page](https://stripe.com/docs/payments/affirm) for more details like country availability. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// Afterpay gives your customers a way to pay for purchases in installments, check this [page](https://stripe.com/docs/payments/afterpay-clearpay) for more details like country availability. - /// - /// Afterpay is particularly popular among businesses selling fashion, beauty, and sports products. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// Alipay is a digital wallet in China that has more than a billion active users worldwide. - /// - /// Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. - /// Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. - /// Check this [page](https://stripe.com/docs/payments/alipay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// Stripe users can accept [Apple Pay](/payments/apple-pay) in iOS applications in iOS 9 and later, and on the web in Safari starting with iOS 10 or macOS Sierra. - /// - /// There are no additional fees to process Apple Pay payments, and the [pricing](/pricing) is the same as other card transactions. - /// Check this [page](https://stripe.com/docs/apple-pay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub apple_pay: Option, - - /// Apple Pay Later, a payment method for customers to buy now and pay later, gives your customers a way to split purchases into four installments across six weeks. - #[serde(skip_serializing_if = "Option::is_none")] - pub apple_pay_later: Option, - - /// Stripe users in Australia can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with an Australian bank account. - /// - /// Check this [page](https://stripe.com/docs/payments/au-becs-debit) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// Stripe users in the UK can accept Bacs Direct Debit payments from customers with a UK bank account, check this [page](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. - /// - /// [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. - /// Check this [page](https://stripe.com/docs/payments/bancontact) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. - /// - /// When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. - /// Check this [page](https://stripe.com/docs/payments/blik) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// Boleto is an official (regulated by the Central Bank of Brazil) payment method in Brazil. - /// - /// Check this [page](https://stripe.com/docs/payments/boleto) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// Cards are a popular way for consumers and businesses to pay online or in person. - /// - /// Stripe supports global and local card networks. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// Cartes Bancaires is France's local card network. - /// - /// More than 95% of these cards are co-branded with either Visa or Mastercard, meaning you can process these cards over either Cartes Bancaires or the Visa or Mastercard networks. - /// Check this [page](https://stripe.com/docs/payments/cartes-bancaires) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub cartes_bancaires: Option, - - /// Cash App is a popular consumer app in the US that allows customers to bank, invest, send, and receive money using their digital wallet. - /// - /// Check this [page](https://stripe.com/docs/payments/cash-app-pay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. - /// - /// EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. - /// Check this [page](https://stripe.com/docs/payments/eps) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Financial Process Exchange (FPX) is a Malaysia-based payment method that allows customers to complete transactions online using their bank credentials. - /// - /// Bank Negara Malaysia (BNM), the Central Bank of Malaysia, and eleven other major Malaysian financial institutions are members of the PayNet Group, which owns and operates FPX. - /// It is one of the most popular online payment methods in Malaysia, with nearly 90 million transactions in 2018 according to BNM. - /// Check this [page](https://stripe.com/docs/payments/fpx) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// giropay is a German payment method based on online banking, introduced in 2006. - /// - /// It allows customers to complete transactions online using their online banking environment, with funds debited from their bank account. - /// Depending on their bank, customers confirm payments on giropay using a second factor of authentication or a PIN. - /// giropay accounts for 10% of online checkouts in Germany. - /// Check this [page](https://stripe.com/docs/payments/giropay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. - /// - /// Use the Google Pay API to request any credit or debit card stored in your customer's Google account. - /// Check this [page](https://stripe.com/docs/google-pay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub google_pay: Option, - - /// GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). - /// - /// GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. - /// Check this [page](https://stripe.com/docs/payments/grabpay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. - /// - /// All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. - /// Check this [page](https://stripe.com/docs/payments/ideal) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// JCB is a credit card company based in Japan. - /// - /// JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in the US, Canada, Australia, New Zealand, UK, and Ireland. - /// Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub jcb: Option, - - /// Klarna gives customers a range of [payment options](https://stripe.com/docs/payments/klarna#payment-options) during checkout. - /// - /// Available payment options vary depending on the customer's billing address and the transaction amount. - /// These payment options make it convenient for customers to purchase items in all price ranges. - /// Check this [page](https://stripe.com/docs/payments/klarna) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// Konbini allows customers in Japan to pay for bills and online purchases at convenience stores with cash. - /// - /// Check this [page](https://stripe.com/docs/payments/konbini) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// [Link](https://stripe.com/docs/payments/link) is a payment method network. - /// - /// With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Configuration name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option<&'a str>, - - /// OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. - /// - /// OXXO allows customers to pay bills and online purchases in-store with cash. - /// Check this [page](https://stripe.com/docs/payments/oxxo) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. - /// - /// Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. - /// Check this [page](https://stripe.com/docs/payments/p24) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// Configuration's parent configuration. - /// - /// Specify to create a child configuration. - #[serde(skip_serializing_if = "Option::is_none")] - pub parent: Option<&'a str>, - - /// PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. - /// - /// Check this [page](https://stripe.com/docs/payments/paynow) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. - /// - /// Check this [page](https://stripe.com/docs/payments/paypal) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. - /// - /// Check this [page](https://stripe.com/docs/payments/promptpay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. - /// - /// SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. - /// - /// Check this [page](https://stripe.com/docs/payments/sofort) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. - /// - /// Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. - /// - /// Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. - /// WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. - /// Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, -} - -impl<'a> CreatePaymentMethodConfiguration<'a> { - pub fn new() -> Self { - CreatePaymentMethodConfiguration { - acss_debit: Default::default(), - affirm: Default::default(), - afterpay_clearpay: Default::default(), - alipay: Default::default(), - apple_pay: Default::default(), - apple_pay_later: Default::default(), - au_becs_debit: Default::default(), - bacs_debit: Default::default(), - bancontact: Default::default(), - blik: Default::default(), - boleto: Default::default(), - card: Default::default(), - cartes_bancaires: Default::default(), - cashapp: Default::default(), - eps: Default::default(), - expand: Default::default(), - fpx: Default::default(), - giropay: Default::default(), - google_pay: Default::default(), - grabpay: Default::default(), - ideal: Default::default(), - jcb: Default::default(), - klarna: Default::default(), - konbini: Default::default(), - link: Default::default(), - name: Default::default(), - oxxo: Default::default(), - p24: Default::default(), - parent: Default::default(), - paynow: Default::default(), - paypal: Default::default(), - promptpay: Default::default(), - sepa_debit: Default::default(), - sofort: Default::default(), - us_bank_account: Default::default(), - wechat_pay: Default::default(), - } - } -} - -/// The parameters for `PaymentMethodConfiguration::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPaymentMethodConfigurations<'a> { - - /// The Connect application to filter by. - #[serde(skip_serializing_if = "Option::is_none")] - pub application: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], -} - -impl<'a> ListPaymentMethodConfigurations<'a> { - pub fn new() -> Self { - ListPaymentMethodConfigurations { - application: Default::default(), - expand: Default::default(), - } - } -} -impl Paginable for ListPaymentMethodConfigurations<'_> { - type O = PaymentMethodConfiguration; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - }} -/// The parameters for `PaymentMethodConfiguration::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePaymentMethodConfiguration<'a> { - - /// Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// Whether the configuration can be used for new payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// [Affirm](https://www.affirm.com/) gives your customers a way to split purchases over a series of payments. - /// - /// Depending on the purchase, they can pay with four interest-free payments (Split Pay) or pay over a longer term (Installments), which might include interest. - /// Check this [page](https://stripe.com/docs/payments/affirm) for more details like country availability. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// Afterpay gives your customers a way to pay for purchases in installments, check this [page](https://stripe.com/docs/payments/afterpay-clearpay) for more details like country availability. - /// - /// Afterpay is particularly popular among businesses selling fashion, beauty, and sports products. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// Alipay is a digital wallet in China that has more than a billion active users worldwide. - /// - /// Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. - /// Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. - /// Check this [page](https://stripe.com/docs/payments/alipay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// Stripe users can accept [Apple Pay](/payments/apple-pay) in iOS applications in iOS 9 and later, and on the web in Safari starting with iOS 10 or macOS Sierra. - /// - /// There are no additional fees to process Apple Pay payments, and the [pricing](/pricing) is the same as other card transactions. - /// Check this [page](https://stripe.com/docs/apple-pay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub apple_pay: Option, - - /// Apple Pay Later, a payment method for customers to buy now and pay later, gives your customers a way to split purchases into four installments across six weeks. - #[serde(skip_serializing_if = "Option::is_none")] - pub apple_pay_later: Option, - - /// Stripe users in Australia can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with an Australian bank account. - /// - /// Check this [page](https://stripe.com/docs/payments/au-becs-debit) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// Stripe users in the UK can accept Bacs Direct Debit payments from customers with a UK bank account, check this [page](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. - /// - /// [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. - /// Check this [page](https://stripe.com/docs/payments/bancontact) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. - /// - /// When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. - /// Check this [page](https://stripe.com/docs/payments/blik) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// Boleto is an official (regulated by the Central Bank of Brazil) payment method in Brazil. - /// - /// Check this [page](https://stripe.com/docs/payments/boleto) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// Cards are a popular way for consumers and businesses to pay online or in person. - /// - /// Stripe supports global and local card networks. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// Cartes Bancaires is France's local card network. - /// - /// More than 95% of these cards are co-branded with either Visa or Mastercard, meaning you can process these cards over either Cartes Bancaires or the Visa or Mastercard networks. - /// Check this [page](https://stripe.com/docs/payments/cartes-bancaires) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub cartes_bancaires: Option, - - /// Cash App is a popular consumer app in the US that allows customers to bank, invest, send, and receive money using their digital wallet. - /// - /// Check this [page](https://stripe.com/docs/payments/cash-app-pay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. - /// - /// EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. - /// Check this [page](https://stripe.com/docs/payments/eps) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Financial Process Exchange (FPX) is a Malaysia-based payment method that allows customers to complete transactions online using their bank credentials. - /// - /// Bank Negara Malaysia (BNM), the Central Bank of Malaysia, and eleven other major Malaysian financial institutions are members of the PayNet Group, which owns and operates FPX. - /// It is one of the most popular online payment methods in Malaysia, with nearly 90 million transactions in 2018 according to BNM. - /// Check this [page](https://stripe.com/docs/payments/fpx) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// giropay is a German payment method based on online banking, introduced in 2006. - /// - /// It allows customers to complete transactions online using their online banking environment, with funds debited from their bank account. - /// Depending on their bank, customers confirm payments on giropay using a second factor of authentication or a PIN. - /// giropay accounts for 10% of online checkouts in Germany. - /// Check this [page](https://stripe.com/docs/payments/giropay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. - /// - /// Use the Google Pay API to request any credit or debit card stored in your customer's Google account. - /// Check this [page](https://stripe.com/docs/google-pay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub google_pay: Option, - - /// GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). - /// - /// GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. - /// Check this [page](https://stripe.com/docs/payments/grabpay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. - /// - /// All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. - /// Check this [page](https://stripe.com/docs/payments/ideal) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// JCB is a credit card company based in Japan. - /// - /// JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in the US, Canada, Australia, New Zealand, UK, and Ireland. - /// Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub jcb: Option, - - /// Klarna gives customers a range of [payment options](https://stripe.com/docs/payments/klarna#payment-options) during checkout. - /// - /// Available payment options vary depending on the customer's billing address and the transaction amount. - /// These payment options make it convenient for customers to purchase items in all price ranges. - /// Check this [page](https://stripe.com/docs/payments/klarna) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// Konbini allows customers in Japan to pay for bills and online purchases at convenience stores with cash. - /// - /// Check this [page](https://stripe.com/docs/payments/konbini) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// [Link](https://stripe.com/docs/payments/link) is a payment method network. - /// - /// With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Configuration name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option<&'a str>, - - /// OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. - /// - /// OXXO allows customers to pay bills and online purchases in-store with cash. - /// Check this [page](https://stripe.com/docs/payments/oxxo) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. - /// - /// Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. - /// Check this [page](https://stripe.com/docs/payments/p24) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. - /// - /// Check this [page](https://stripe.com/docs/payments/paynow) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. - /// - /// Check this [page](https://stripe.com/docs/payments/paypal) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. - /// - /// Check this [page](https://stripe.com/docs/payments/promptpay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. - /// - /// SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. - /// - /// Check this [page](https://stripe.com/docs/payments/sofort) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. - /// - /// Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. - /// - /// Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. - /// WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. - /// Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, -} - -impl<'a> UpdatePaymentMethodConfiguration<'a> { - pub fn new() -> Self { - UpdatePaymentMethodConfiguration { - acss_debit: Default::default(), - active: Default::default(), - affirm: Default::default(), - afterpay_clearpay: Default::default(), - alipay: Default::default(), - apple_pay: Default::default(), - apple_pay_later: Default::default(), - au_becs_debit: Default::default(), - bacs_debit: Default::default(), - bancontact: Default::default(), - blik: Default::default(), - boleto: Default::default(), - card: Default::default(), - cartes_bancaires: Default::default(), - cashapp: Default::default(), - eps: Default::default(), - expand: Default::default(), - fpx: Default::default(), - giropay: Default::default(), - google_pay: Default::default(), - grabpay: Default::default(), - ideal: Default::default(), - jcb: Default::default(), - klarna: Default::default(), - konbini: Default::default(), - link: Default::default(), - name: Default::default(), - oxxo: Default::default(), - p24: Default::default(), - paynow: Default::default(), - paypal: Default::default(), - promptpay: Default::default(), - sepa_debit: Default::default(), - sofort: Default::default(), - us_bank_account: Default::default(), - wechat_pay: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAcssDebit { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAffirm { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAfterpayClearpay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAlipay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationApplePay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationApplePayLater { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAuBecsDebit { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationBacsDebit { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationBancontact { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationBlik { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationBoleto { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationCartesBancaires { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationCashapp { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationEps { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationFpx { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationGiropay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationGooglePay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationGrabpay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationIdeal { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationJcb { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationKlarna { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationKonbini { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationLink { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationOxxo { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationP24 { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationPaynow { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationPaypal { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationPromptpay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationSepaDebit { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationSofort { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationUsBankAccount { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationWechatPay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAcssDebit { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAffirm { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAfterpayClearpay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAlipay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationApplePay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationApplePayLater { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAuBecsDebit { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationBacsDebit { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationBancontact { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationBlik { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationBoleto { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationCartesBancaires { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationCashapp { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationEps { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationFpx { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationGiropay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationGooglePay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationGrabpay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationIdeal { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationJcb { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationKlarna { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationKonbini { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationLink { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationOxxo { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationP24 { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationPaynow { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationPaypal { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationPromptpay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationSepaDebit { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationSofort { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationUsBankAccount { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationWechatPay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAcssDebitDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAffirmDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAlipayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationApplePayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationApplePayLaterDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAuBecsDebitDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationBacsDebitDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationBancontactDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationBlikDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationBoletoDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationCartesBancairesDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationCashappDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationEpsDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationFpxDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationGiropayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationGooglePayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationGrabpayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationIdealDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationJcbDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationKlarnaDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationKonbiniDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationLinkDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationOxxoDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationP24DisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationPaynowDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationPaypalDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationPromptpayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationSepaDebitDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationSofortDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationUsBankAccountDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationWechatPayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAcssDebitDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAffirmDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAlipayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationApplePayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationApplePayLaterDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationBacsDebitDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationBancontactDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationBlikDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationBoletoDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationCartesBancairesDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationCashappDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationEpsDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationFpxDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationGiropayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationGooglePayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationGrabpayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationIdealDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationJcbDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationKlarnaDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationKonbiniDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationLinkDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationOxxoDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationP24DisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationPaynowDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationPaypalDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationPromptpayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationSepaDebitDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationSofortDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationUsBankAccountDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationWechatPayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationAcssDebitDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationAffirmDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationAlipayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationApplePayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationApplePayLaterDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationAuBecsDebitDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationBacsDebitDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationBancontactDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationBlikDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationBlikDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationBlikDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationBlikDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationBlikDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationBlikDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationBlikDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationBlikDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationBlikDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationBoletoDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationCartesBancairesDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationCashappDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationCashappDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationCashappDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationCashappDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationCashappDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationCashappDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationCashappDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationCashappDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationCashappDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationEpsDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationEpsDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationEpsDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationEpsDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationEpsDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationEpsDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationEpsDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationEpsDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationEpsDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationFpxDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationFpxDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationFpxDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationFpxDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationFpxDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationFpxDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationFpxDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationFpxDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationFpxDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationGiropayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationGooglePayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationGrabpayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationIdealDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationIdealDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationIdealDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationIdealDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationIdealDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationIdealDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationIdealDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationIdealDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationIdealDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationJcbDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationJcbDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationJcbDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationJcbDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationJcbDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationJcbDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationJcbDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationJcbDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationJcbDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationKlarnaDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationKonbiniDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationLinkDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationLinkDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationLinkDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationLinkDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationLinkDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationLinkDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationLinkDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationLinkDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationLinkDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationOxxoDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationP24DisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationP24DisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationP24DisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationP24DisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationP24DisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationP24DisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationP24DisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationP24DisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationP24DisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationPaynowDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationPaypalDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationPromptpayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationSepaDebitDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationSofortDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationSofortDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationSofortDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationSofortDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationSofortDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationSofortDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationSofortDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationSofortDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationSofortDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationUsBankAccountDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationWechatPayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodConfigResourceDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodConfigResourceDisplayPreferencePreference { - None, - Off, - On, -} - -impl PaymentMethodConfigResourceDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodConfigResourceDisplayPreferencePreference::None => "none", - PaymentMethodConfigResourceDisplayPreferencePreference::Off => "off", - PaymentMethodConfigResourceDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for PaymentMethodConfigResourceDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodConfigResourceDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodConfigResourceDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodConfigResourceDisplayPreference`'s `value` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodConfigResourceDisplayPreferenceValue { - Off, - On, -} - -impl PaymentMethodConfigResourceDisplayPreferenceValue { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodConfigResourceDisplayPreferenceValue::Off => "off", - PaymentMethodConfigResourceDisplayPreferenceValue::On => "on", - } - } -} - -impl AsRef for PaymentMethodConfigResourceDisplayPreferenceValue { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodConfigResourceDisplayPreferenceValue { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodConfigResourceDisplayPreferenceValue { - fn default() -> Self { - Self::Off - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationAcssDebitDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationAffirmDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationAlipayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationApplePayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationApplePayLaterDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationBacsDebitDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationBancontactDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationBlikDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationBoletoDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationCartesBancairesDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationCashappDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationEpsDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationFpxDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationGiropayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationGooglePayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationGrabpayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationIdealDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationJcbDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationKlarnaDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationKonbiniDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationLinkDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationOxxoDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationP24DisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationP24DisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationP24DisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationP24DisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationP24DisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationP24DisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationP24DisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationP24DisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationP24DisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationPaynowDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationPaypalDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationPromptpayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationSepaDebitDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationSofortDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationUsBankAccountDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationWechatPayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// Cards are a popular way for consumers and businesses to pay online or in person. -/// -/// Stripe supports global and local card networks. -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodParam { - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -/// Whether or not the payment method should be displayed. -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DisplayPreference { - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} diff --git a/src/resources/generated/payment_method_details_card_checks.rs b/src/resources/generated/payment_method_details_card_checks.rs deleted file mode 100644 index d01d16696..000000000 --- a/src/resources/generated/payment_method_details_card_checks.rs +++ /dev/null @@ -1,18 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_method_details_card_checks". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardChecks { - /// If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - pub address_line1_check: Option, - - /// If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - pub address_postal_code_check: Option, - - /// If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - pub cvc_check: Option, -} diff --git a/src/resources/generated/payment_method_details_card_installments_plan.rs b/src/resources/generated/payment_method_details_card_installments_plan.rs deleted file mode 100644 index 14486ab6c..000000000 --- a/src/resources/generated/payment_method_details_card_installments_plan.rs +++ /dev/null @@ -1,85 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_method_details_card_installments_plan". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardInstallmentsPlan { - - /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. - pub count: Option, - - /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. - /// One of `month`. - pub interval: Option, - - /// Type of installment plan, one of `fixed_count`. - #[serde(rename = "type")] - pub type_: PaymentMethodDetailsCardInstallmentsPlanType, -} - -/// An enum representing the possible values of an `PaymentMethodDetailsCardInstallmentsPlan`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsCardInstallmentsPlanInterval { - Month, -} - -impl PaymentMethodDetailsCardInstallmentsPlanInterval { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsCardInstallmentsPlanInterval::Month => "month", - } - } -} - -impl AsRef for PaymentMethodDetailsCardInstallmentsPlanInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsCardInstallmentsPlanInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsCardInstallmentsPlanInterval { - fn default() -> Self { - Self::Month - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsCardInstallmentsPlan`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsCardInstallmentsPlanType { - FixedCount, -} - -impl PaymentMethodDetailsCardInstallmentsPlanType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsCardInstallmentsPlanType::FixedCount => "fixed_count", - } - } -} - -impl AsRef for PaymentMethodDetailsCardInstallmentsPlanType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsCardInstallmentsPlanType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsCardInstallmentsPlanType { - fn default() -> Self { - Self::FixedCount - } -} diff --git a/src/resources/generated/payment_method_details_card_wallet_apple_pay.rs b/src/resources/generated/payment_method_details_card_wallet_apple_pay.rs deleted file mode 100644 index 4785e2e29..000000000 --- a/src/resources/generated/payment_method_details_card_wallet_apple_pay.rs +++ /dev/null @@ -1,9 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_method_details_card_wallet_apple_pay". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWalletApplePay {} diff --git a/src/resources/generated/payment_method_details_card_wallet_google_pay.rs b/src/resources/generated/payment_method_details_card_wallet_google_pay.rs deleted file mode 100644 index 36af4281c..000000000 --- a/src/resources/generated/payment_method_details_card_wallet_google_pay.rs +++ /dev/null @@ -1,9 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_method_details_card_wallet_google_pay". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWalletGooglePay {} diff --git a/src/resources/generated/payment_method_domain.rs b/src/resources/generated/payment_method_domain.rs deleted file mode 100644 index 714568537..000000000 --- a/src/resources/generated/payment_method_domain.rs +++ /dev/null @@ -1,234 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::client::{Client, Response}; -use crate::ids::{PaymentMethodDomainId}; -use crate::params::{Expand, List, Object, Paginable, Timestamp}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "PaymentMethodDomainResourcePaymentMethodDomain". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDomain { - /// Unique identifier for the object. - pub id: PaymentMethodDomainId, - - pub apple_pay: PaymentMethodDomainResourcePaymentMethodStatus, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The domain name that this payment method domain object represents. - pub domain_name: String, - - /// Whether this payment method domain is enabled. - /// - /// If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. - pub enabled: bool, - - pub google_pay: PaymentMethodDomainResourcePaymentMethodStatus, - - pub link: PaymentMethodDomainResourcePaymentMethodStatus, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - pub paypal: PaymentMethodDomainResourcePaymentMethodStatus, -} - -impl PaymentMethodDomain { - - /// Lists the details of existing payment method domains. -pub fn list(client: &Client, params: &ListPaymentMethodDomains<'_>) -> Response> { - client.get_query("/payment_method_domains", ¶ms) -} - - - /// Creates a payment method domain. - pub fn create(client: &Client, params: CreatePaymentMethodDomain<'_>) -> Response { - client.post_form("/payment_method_domains", ¶ms) - } - - /// Retrieves the details of an existing payment method domain. - pub fn retrieve(client: &Client, id: &PaymentMethodDomainId, expand: &[&str]) -> Response { - client.get_query(&format!("/payment_method_domains/{}", id), &Expand { expand }) - } - - /// Updates an existing payment method domain. - pub fn update(client: &Client, id: &PaymentMethodDomainId, params: UpdatePaymentMethodDomain<'_>) -> Response { - client.post_form(&format!("/payment_method_domains/{}", id), ¶ms) - } -} - -impl Object for PaymentMethodDomain { - type Id = PaymentMethodDomainId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "payment_method_domain" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDomainResourcePaymentMethodStatus { - - /// The status of the payment method on the domain. - pub status: PaymentMethodDomainResourcePaymentMethodStatusStatus, - - #[serde(skip_serializing_if = "Option::is_none")] - pub status_details: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDomainResourcePaymentMethodStatusDetails { - - /// The error message associated with the status of the payment method on the domain. - pub error_message: String, -} - -/// The parameters for `PaymentMethodDomain::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreatePaymentMethodDomain<'a> { - - /// The domain name that this payment method domain object represents. - pub domain_name: &'a str, - - /// Whether this payment method domain is enabled. - /// - /// If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], -} - -impl<'a> CreatePaymentMethodDomain<'a> { - pub fn new(domain_name: &'a str) -> Self { - CreatePaymentMethodDomain { - domain_name, - enabled: Default::default(), - expand: Default::default(), - } - } -} - -/// The parameters for `PaymentMethodDomain::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPaymentMethodDomains<'a> { - - /// The domain name that this payment method domain object represents. - #[serde(skip_serializing_if = "Option::is_none")] - pub domain_name: Option<&'a str>, - - /// Whether this payment method domain is enabled. - /// - /// If the domain is not enabled, payment methods will not appear in Elements. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListPaymentMethodDomains<'a> { - pub fn new() -> Self { - ListPaymentMethodDomains { - domain_name: Default::default(), - enabled: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListPaymentMethodDomains<'_> { - type O = PaymentMethodDomain; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - }} -/// The parameters for `PaymentMethodDomain::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePaymentMethodDomain<'a> { - - /// Whether this payment method domain is enabled. - /// - /// If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], -} - -impl<'a> UpdatePaymentMethodDomain<'a> { - pub fn new() -> Self { - UpdatePaymentMethodDomain { - enabled: Default::default(), - expand: Default::default(), - } - } -} - -/// An enum representing the possible values of an `PaymentMethodDomainResourcePaymentMethodStatus`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDomainResourcePaymentMethodStatusStatus { - Active, - Inactive, -} - -impl PaymentMethodDomainResourcePaymentMethodStatusStatus { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDomainResourcePaymentMethodStatusStatus::Active => "active", - PaymentMethodDomainResourcePaymentMethodStatusStatus::Inactive => "inactive", - } - } -} - -impl AsRef for PaymentMethodDomainResourcePaymentMethodStatusStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDomainResourcePaymentMethodStatusStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDomainResourcePaymentMethodStatusStatus { - fn default() -> Self { - Self::Active - } -} diff --git a/src/resources/generated/payment_method_options_customer_balance_eu_bank_account.rs b/src/resources/generated/payment_method_options_customer_balance_eu_bank_account.rs deleted file mode 100644 index 1505af091..000000000 --- a/src/resources/generated/payment_method_options_customer_balance_eu_bank_account.rs +++ /dev/null @@ -1,62 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_method_options_customer_balance_eu_bank_account". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsCustomerBalanceEuBankAccount { - /// The desired country code of the bank account information. - /// - /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. - pub country: PaymentMethodOptionsCustomerBalanceEuBankAccountCountry, -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCustomerBalanceEuBankAccount`'s `country` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { - #[serde(rename = "BE")] - Be, - #[serde(rename = "DE")] - De, - #[serde(rename = "ES")] - Es, - #[serde(rename = "FR")] - Fr, - #[serde(rename = "IE")] - Ie, - #[serde(rename = "NL")] - Nl, -} - -impl PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::Be => "BE", - PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::De => "DE", - PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::Es => "ES", - PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::Fr => "FR", - PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::Ie => "IE", - PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::Nl => "NL", - } - } -} - -impl AsRef for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { - fn default() -> Self { - Self::Be - } -} diff --git a/src/resources/generated/payout.rs b/src/resources/generated/payout.rs deleted file mode 100644 index edb2aa978..000000000 --- a/src/resources/generated/payout.rs +++ /dev/null @@ -1,446 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::PayoutId; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{BalanceTransaction, Currency, PayoutDestinationUnion}; - -/// The resource representing a Stripe "Payout". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Payout { - /// Unique identifier for the object. - pub id: PayoutId, - - /// Amount (in cents (or local equivalent)) to be transferred to your bank account or debit card. - pub amount: i64, - - /// Date the payout is expected to arrive in the bank. - /// - /// This factors in delays like weekends or bank holidays. - pub arrival_date: Timestamp, - - /// Returns `true` if the payout was created by an [automated payout schedule](https://stripe.com/docs/payouts#payout-schedule), and `false` if it was [requested manually](https://stripe.com/docs/payouts#manual-payouts). - pub automatic: bool, - - /// ID of the balance transaction that describes the impact of this payout on your account balance. - pub balance_transaction: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// ID of the bank account or card the payout was sent to. - pub destination: Option>, - - /// If the payout failed or was canceled, this will be the ID of the balance transaction that reversed the initial balance transaction, and puts the funds from the failed payout back in your balance. - pub failure_balance_transaction: Option>, - - /// Error code explaining reason for payout failure if available. - /// - /// See [Types of payout failures](https://stripe.com/docs/api#payout_failures) for a list of failure codes. - pub failure_code: Option, - - /// Message to user further explaining reason for payout failure if available. - pub failure_message: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// The method used to send this payout, which can be `standard` or `instant`. - /// - /// `instant` is supported for payouts to debit cards and bank accounts in certain countries. - /// (See [Bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks) for more information.). - pub method: String, - - /// If the payout reverses another, this is the ID of the original payout. - pub original_payout: Option>, - - /// If `completed`, the [Balance Transactions API](https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout) may be used to list all Balance Transactions that were paid out in this payout. - pub reconciliation_status: PayoutReconciliationStatus, - - /// If the payout was reversed, this is the ID of the payout that reverses this payout. - pub reversed_by: Option>, - - /// The source balance this payout came from. - /// - /// One of `card`, `fpx`, or `bank_account`. - pub source_type: String, - - /// Extra information about a payout to be displayed on the user's bank statement. - pub statement_descriptor: Option, - - /// Current status of the payout: `paid`, `pending`, `in_transit`, `canceled` or `failed`. - /// - /// A payout is `pending` until it is submitted to the bank, when it becomes `in_transit`. - /// The status then changes to `paid` if the transaction goes through, or to `failed` or `canceled` (within 5 business days). - /// Some failed payouts may initially show as `paid` but then change to `failed`. - pub status: String, - - /// Can be `bank_account` or `card`. - #[serde(rename = "type")] - pub type_: PayoutType, -} - -impl Payout { - /// Returns a list of existing payouts sent to third-party bank accounts or that Stripe has sent you. - /// - /// The payouts are returned in sorted order, with the most recently created payouts appearing first. - pub fn list(client: &Client, params: &ListPayouts<'_>) -> Response> { - client.get_query("/payouts", ¶ms) - } - - /// To send funds to your own bank account, you create a new payout object. - /// - /// Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the payout amount, or you’ll receive an “Insufficient Funds” error. If your API key is in test mode, money won’t actually be sent, though everything else will occur as if in live mode. If you are creating a manual payout on a Stripe account that uses multiple payment source types, you’ll need to specify the source type balance that the payout should draw from. - /// The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type. - pub fn create(client: &Client, params: CreatePayout<'_>) -> Response { - client.post_form("/payouts", ¶ms) - } - - /// Retrieves the details of an existing payout. - /// - /// Supply the unique payout ID from either a payout creation request or the payout list, and Stripe will return the corresponding payout information. - pub fn retrieve(client: &Client, id: &PayoutId, expand: &[&str]) -> Response { - client.get_query(&format!("/payouts/{}", id), &Expand { expand }) - } - - /// Updates the specified payout by setting the values of the parameters passed. - /// - /// Any parameters not provided will be left unchanged. - /// This request accepts only the metadata as arguments. - pub fn update(client: &Client, id: &PayoutId, params: UpdatePayout<'_>) -> Response { - client.post_form(&format!("/payouts/{}", id), ¶ms) - } -} - -impl Object for Payout { - type Id = PayoutId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "payout" - } -} - -/// The parameters for `Payout::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreatePayout<'a> { - /// A positive integer in cents representing how much to payout. - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// The ID of a bank account or a card to send the payout to. - /// - /// If no destination is supplied, the default external account for the specified currency will be used. - #[serde(skip_serializing_if = "Option::is_none")] - pub destination: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The method used to send this payout, which can be `standard` or `instant`. - /// - /// `instant` is supported for payouts to debit cards and bank accounts in certain countries. - /// (See [Bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks) for more information.). - #[serde(skip_serializing_if = "Option::is_none")] - pub method: Option, - - /// The balance type of your Stripe balance to draw this payout from. - /// - /// Balances for different payment sources are kept separately. - /// You can find the amounts with the balances API. - /// One of `bank_account`, `card`, or `fpx`. - #[serde(skip_serializing_if = "Option::is_none")] - pub source_type: Option, - - /// A string to be displayed on the recipient's bank or card statement. - /// - /// This may be at most 22 characters. - /// Attempting to use a `statement_descriptor` longer than 22 characters will return an error. - /// Note: Most banks will truncate this information and/or display it inconsistently. - /// Some may not display it at all. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option<&'a str>, -} - -impl<'a> CreatePayout<'a> { - pub fn new(amount: i64, currency: Currency) -> Self { - CreatePayout { - amount, - currency, - description: Default::default(), - destination: Default::default(), - expand: Default::default(), - metadata: Default::default(), - method: Default::default(), - source_type: Default::default(), - statement_descriptor: Default::default(), - } - } -} - -/// The parameters for `Payout::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPayouts<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub arrival_date: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// The ID of an external account - only return payouts sent to this external account. - #[serde(skip_serializing_if = "Option::is_none")] - pub destination: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// Only return payouts that have the given status: `pending`, `paid`, `failed`, or `canceled`. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option<&'a str>, -} - -impl<'a> ListPayouts<'a> { - pub fn new() -> Self { - ListPayouts { - arrival_date: Default::default(), - created: Default::default(), - destination: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - status: Default::default(), - } - } -} -impl Paginable for ListPayouts<'_> { - type O = Payout; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Payout::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePayout<'a> { - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl<'a> UpdatePayout<'a> { - pub fn new() -> Self { - UpdatePayout { expand: Default::default(), metadata: Default::default() } - } -} - -/// An enum representing the possible values of an `CreatePayout`'s `method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PayoutMethod { - Instant, - Standard, -} - -impl PayoutMethod { - pub fn as_str(self) -> &'static str { - match self { - PayoutMethod::Instant => "instant", - PayoutMethod::Standard => "standard", - } - } -} - -impl AsRef for PayoutMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PayoutMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PayoutMethod { - fn default() -> Self { - Self::Instant - } -} - -/// An enum representing the possible values of an `Payout`'s `reconciliation_status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PayoutReconciliationStatus { - Completed, - InProgress, - NotApplicable, -} - -impl PayoutReconciliationStatus { - pub fn as_str(self) -> &'static str { - match self { - PayoutReconciliationStatus::Completed => "completed", - PayoutReconciliationStatus::InProgress => "in_progress", - PayoutReconciliationStatus::NotApplicable => "not_applicable", - } - } -} - -impl AsRef for PayoutReconciliationStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PayoutReconciliationStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PayoutReconciliationStatus { - fn default() -> Self { - Self::Completed - } -} - -/// An enum representing the possible values of an `CreatePayout`'s `source_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PayoutSourceType { - BankAccount, - Card, - Fpx, -} - -impl PayoutSourceType { - pub fn as_str(self) -> &'static str { - match self { - PayoutSourceType::BankAccount => "bank_account", - PayoutSourceType::Card => "card", - PayoutSourceType::Fpx => "fpx", - } - } -} - -impl AsRef for PayoutSourceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PayoutSourceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PayoutSourceType { - fn default() -> Self { - Self::BankAccount - } -} - -/// An enum representing the possible values of an `Payout`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PayoutType { - BankAccount, - Card, -} - -impl PayoutType { - pub fn as_str(self) -> &'static str { - match self { - PayoutType::BankAccount => "bank_account", - PayoutType::Card => "card", - } - } -} - -impl AsRef for PayoutType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PayoutType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PayoutType { - fn default() -> Self { - Self::BankAccount - } -} diff --git a/src/resources/generated/person.rs b/src/resources/generated/person.rs deleted file mode 100644 index 31b1d83f4..000000000 --- a/src/resources/generated/person.rs +++ /dev/null @@ -1,486 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::PersonId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Address, File}; - -/// The resource representing a Stripe "Person". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Person { - /// Unique identifier for the object. - pub id: PersonId, - - /// The account the person is associated with. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// The Kana variation of the person's address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kana: Option
, - - /// The Kanji variation of the person's address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kanji: Option
, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - #[serde(skip_serializing_if = "Option::is_none")] - pub dob: Option, - - /// The person's email address. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// The person's first name. - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name: Option, - - /// The Kana variation of the person's first name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name_kana: Option, - - /// The Kanji variation of the person's first name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name_kanji: Option, - - /// A list of alternate names or aliases that the person is known by. - #[serde(skip_serializing_if = "Option::is_none")] - pub full_name_aliases: Option>, - - /// Information about the [upcoming new requirements for this person](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when. - #[serde(skip_serializing_if = "Option::is_none")] - pub future_requirements: Option, - - /// The person's gender (International regulations require either "male" or "female"). - #[serde(skip_serializing_if = "Option::is_none")] - pub gender: Option, - - /// Whether the person's `id_number` was provided. - /// - /// True if either the full ID number was provided or if only the required part of the ID number was provided (ex. - /// last four of an individual's SSN for the US indicated by `ssn_last_4_provided`). - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number_provided: Option, - - /// Whether the person's `id_number_secondary` was provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number_secondary_provided: Option, - - /// The person's last name. - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name: Option, - - /// The Kana variation of the person's last name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name_kana: Option, - - /// The Kanji variation of the person's last name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name_kanji: Option, - - /// The person's maiden name. - #[serde(skip_serializing_if = "Option::is_none")] - pub maiden_name: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The country where the person is a national. - #[serde(skip_serializing_if = "Option::is_none")] - pub nationality: Option, - - /// The person's phone number. - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - #[serde(skip_serializing_if = "Option::is_none")] - pub political_exposure: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub registered_address: Option
, - - #[serde(skip_serializing_if = "Option::is_none")] - pub relationship: Option, - - /// Information about the requirements for this person, including what information needs to be collected, and by when. - #[serde(skip_serializing_if = "Option::is_none")] - pub requirements: Option, - - /// Whether the last four digits of the person's Social Security number have been provided (U.S. - /// - /// only). - #[serde(skip_serializing_if = "Option::is_none")] - pub ssn_last_4_provided: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub verification: Option, -} - -impl Object for Person { - type Id = PersonId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "person" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LegalEntityDob { - /// The day of birth, between 1 and 31. - pub day: Option, - - /// The month of birth, between 1 and 12. - pub month: Option, - - /// The four-digit year of birth. - pub year: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonVerification { - /// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. - #[serde(skip_serializing_if = "Option::is_none")] - pub additional_document: Option, - - /// A user-displayable string describing the verification state for the person. - /// - /// For example, this may say "Provided identity information could not be verified". - #[serde(skip_serializing_if = "Option::is_none")] - pub details: Option, - - /// One of `document_address_mismatch`, `document_dob_mismatch`, `document_duplicate_type`, `document_id_number_mismatch`, `document_name_mismatch`, `document_nationality_mismatch`, `failed_keyed_identity`, or `failed_other`. - /// - /// A machine-readable code specifying the verification state for the person. - #[serde(skip_serializing_if = "Option::is_none")] - pub details_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub document: Option, - - /// The state of verification for the person. - /// - /// Possible values are `unverified`, `pending`, or `verified`. - pub status: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonVerificationDocument { - /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. - pub back: Option>, - - /// A user-displayable string describing the verification state of this document. - /// - /// For example, if a document is uploaded and the picture is too fuzzy, this may say "Identity document is too unclear to read". - pub details: Option, - - /// One of `document_corrupt`, `document_country_not_supported`, `document_expired`, `document_failed_copy`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_failed_greyscale`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_missing_back`, `document_missing_front`, `document_not_readable`, `document_not_uploaded`, `document_photo_mismatch`, `document_too_large`, or `document_type_not_supported`. - /// - /// A machine-readable code specifying the verification state for this document. - pub details_code: Option, - - /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. - pub front: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonFutureRequirements { - /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. - pub alternatives: Option>, - - /// Fields that need to be collected to keep the person's account enabled. - /// - /// If not collected by the account's `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash, and may immediately become `past_due`, but the account may also be given a grace period depending on the account's enablement state prior to transition. - pub currently_due: Vec, - - /// Fields that are `currently_due` and need to be collected again because validation or verification failed. - pub errors: Vec, - - /// Fields that need to be collected assuming all volume thresholds are reached. - /// - /// As they become required, they appear in `currently_due` as well, and the account's `future_requirements[current_deadline]` becomes set. - pub eventually_due: Vec, - - /// Fields that weren't collected by the account's `requirements.current_deadline`. - /// - /// These fields need to be collected to enable the person's account. - /// New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. - pub past_due: Vec, - - /// Fields that may become required depending on the results of verification or review. - /// - /// Will be an empty array unless an asynchronous verification is pending. - /// If verification fails, these fields move to `eventually_due` or `currently_due`. - pub pending_verification: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountRequirementsAlternative { - /// Fields that can be provided to satisfy all fields in `original_fields_due`. - pub alternative_fields_due: Vec, - - /// Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. - pub original_fields_due: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountRequirementsError { - /// The code for the type of error. - pub code: AccountRequirementsErrorCode, - - /// An informative message that indicates the error type and provides additional details about the error. - pub reason: String, - - /// The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. - pub requirement: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonRelationship { - /// Whether the person is a director of the account's legal entity. - /// - /// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. - pub director: Option, - - /// Whether the person has significant responsibility to control, manage, or direct the organization. - pub executive: Option, - - /// Whether the person is an owner of the account’s legal entity. - pub owner: Option, - - /// The percent owned by the person of the account's legal entity. - pub percent_ownership: Option, - - /// Whether the person is authorized as the primary representative of the account. - /// - /// This is the person nominated by the business to provide information about themselves, and general information about the account. - /// There can only be one representative at any given time. - /// At the time the account is created, this person should be set to the person responsible for opening the account. - pub representative: Option, - - /// The person's title (e.g., CEO, Support Engineer). - pub title: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonRequirements { - /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. - pub alternatives: Option>, - - /// Fields that need to be collected to keep the person's account enabled. - /// - /// If not collected by the account's `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. - pub currently_due: Vec, - - /// Fields that are `currently_due` and need to be collected again because validation or verification failed. - pub errors: Vec, - - /// Fields that need to be collected assuming all volume thresholds are reached. - /// - /// As they become required, they appear in `currently_due` as well, and the account's `current_deadline` becomes set. - pub eventually_due: Vec, - - /// Fields that weren't collected by the account's `current_deadline`. - /// - /// These fields need to be collected to enable the person's account. - pub past_due: Vec, - - /// Fields that may become required depending on the results of verification or review. - /// - /// Will be an empty array unless an asynchronous verification is pending. - /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. - pub pending_verification: Vec, -} - -/// An enum representing the possible values of an `AccountRequirementsError`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountRequirementsErrorCode { - InvalidAddressCityStatePostalCode, - #[serde(rename = "invalid_dob_age_under_18")] - InvalidDobAgeUnder18, - InvalidRepresentativeCountry, - InvalidStreetAddress, - InvalidTosAcceptance, - InvalidValueOther, - VerificationDirectorsMismatch, - VerificationDocumentAddressMismatch, - VerificationDocumentAddressMissing, - VerificationDocumentCorrupt, - VerificationDocumentCountryNotSupported, - VerificationDocumentDirectorsMismatch, - VerificationDocumentDobMismatch, - VerificationDocumentDuplicateType, - VerificationDocumentExpired, - VerificationDocumentFailedCopy, - VerificationDocumentFailedGreyscale, - VerificationDocumentFailedOther, - VerificationDocumentFailedTestMode, - VerificationDocumentFraudulent, - VerificationDocumentIdNumberMismatch, - VerificationDocumentIdNumberMissing, - VerificationDocumentIncomplete, - VerificationDocumentInvalid, - VerificationDocumentIssueOrExpiryDateMissing, - VerificationDocumentManipulated, - VerificationDocumentMissingBack, - VerificationDocumentMissingFront, - VerificationDocumentNameMismatch, - VerificationDocumentNameMissing, - VerificationDocumentNationalityMismatch, - VerificationDocumentNotReadable, - VerificationDocumentNotSigned, - VerificationDocumentNotUploaded, - VerificationDocumentPhotoMismatch, - VerificationDocumentTooLarge, - VerificationDocumentTypeNotSupported, - VerificationExtraneousDirectors, - VerificationFailedAddressMatch, - VerificationFailedBusinessIecNumber, - VerificationFailedDocumentMatch, - VerificationFailedIdNumberMatch, - VerificationFailedKeyedIdentity, - VerificationFailedKeyedMatch, - VerificationFailedNameMatch, - VerificationFailedOther, - VerificationFailedResidentialAddress, - VerificationFailedTaxIdMatch, - VerificationFailedTaxIdNotIssued, - VerificationMissingDirectors, - VerificationMissingExecutives, - VerificationMissingOwners, - VerificationRequiresAdditionalMemorandumOfAssociations, -} - -impl AccountRequirementsErrorCode { - pub fn as_str(self) -> &'static str { - match self { - AccountRequirementsErrorCode::InvalidAddressCityStatePostalCode => "invalid_address_city_state_postal_code", - AccountRequirementsErrorCode::InvalidDobAgeUnder18 => "invalid_dob_age_under_18", - AccountRequirementsErrorCode::InvalidRepresentativeCountry => "invalid_representative_country", - 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", - AccountRequirementsErrorCode::VerificationDocumentFailedCopy => "verification_document_failed_copy", - AccountRequirementsErrorCode::VerificationDocumentFailedGreyscale => "verification_document_failed_greyscale", - AccountRequirementsErrorCode::VerificationDocumentFailedOther => "verification_document_failed_other", - AccountRequirementsErrorCode::VerificationDocumentFailedTestMode => "verification_document_failed_test_mode", - AccountRequirementsErrorCode::VerificationDocumentFraudulent => "verification_document_fraudulent", - AccountRequirementsErrorCode::VerificationDocumentIdNumberMismatch => "verification_document_id_number_mismatch", - AccountRequirementsErrorCode::VerificationDocumentIdNumberMissing => "verification_document_id_number_missing", - AccountRequirementsErrorCode::VerificationDocumentIncomplete => "verification_document_incomplete", - AccountRequirementsErrorCode::VerificationDocumentInvalid => "verification_document_invalid", - AccountRequirementsErrorCode::VerificationDocumentIssueOrExpiryDateMissing => "verification_document_issue_or_expiry_date_missing", - AccountRequirementsErrorCode::VerificationDocumentManipulated => "verification_document_manipulated", - AccountRequirementsErrorCode::VerificationDocumentMissingBack => "verification_document_missing_back", - AccountRequirementsErrorCode::VerificationDocumentMissingFront => "verification_document_missing_front", - AccountRequirementsErrorCode::VerificationDocumentNameMismatch => "verification_document_name_mismatch", - AccountRequirementsErrorCode::VerificationDocumentNameMissing => "verification_document_name_missing", - AccountRequirementsErrorCode::VerificationDocumentNationalityMismatch => "verification_document_nationality_mismatch", - AccountRequirementsErrorCode::VerificationDocumentNotReadable => "verification_document_not_readable", - AccountRequirementsErrorCode::VerificationDocumentNotSigned => "verification_document_not_signed", - AccountRequirementsErrorCode::VerificationDocumentNotUploaded => "verification_document_not_uploaded", - 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", - AccountRequirementsErrorCode::VerificationFailedIdNumberMatch => "verification_failed_id_number_match", - AccountRequirementsErrorCode::VerificationFailedKeyedIdentity => "verification_failed_keyed_identity", - AccountRequirementsErrorCode::VerificationFailedKeyedMatch => "verification_failed_keyed_match", - AccountRequirementsErrorCode::VerificationFailedNameMatch => "verification_failed_name_match", - AccountRequirementsErrorCode::VerificationFailedOther => "verification_failed_other", - 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", - } - } -} - -impl AsRef for AccountRequirementsErrorCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountRequirementsErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountRequirementsErrorCode { - fn default() -> Self { - Self::InvalidAddressCityStatePostalCode - } -} - -/// An enum representing the possible values of an `Person`'s `political_exposure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PersonPoliticalExposure { - Existing, - None, -} - -impl PersonPoliticalExposure { - pub fn as_str(self) -> &'static str { - match self { - PersonPoliticalExposure::Existing => "existing", - PersonPoliticalExposure::None => "none", - } - } -} - -impl AsRef for PersonPoliticalExposure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PersonPoliticalExposure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PersonPoliticalExposure { - fn default() -> Self { - Self::Existing - } -} diff --git a/src/resources/generated/placeholders.rs b/src/resources/generated/placeholders.rs deleted file mode 100644 index 0d00ead63..000000000 --- a/src/resources/generated/placeholders.rs +++ /dev/null @@ -1,582 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::ids::*; -use crate::params::Object; - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Account { - pub id: AccountId, -} - -#[cfg(not(feature = "connect"))] -impl Object for Account { - type Id = AccountId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "account" - } -} - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Application { - pub id: ApplicationId, -} - -#[cfg(not(feature = "connect"))] -impl Object for Application { - type Id = ApplicationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "application" - } -} - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ApplicationFee { - pub id: ApplicationFeeId, -} - -#[cfg(not(feature = "connect"))] -impl Object for ApplicationFee { - type Id = ApplicationFeeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "application_fee" - } -} - -#[cfg(not(feature = "checkout"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutSession { - pub id: CheckoutSessionId, -} - -#[cfg(not(feature = "checkout"))] -impl Object for CheckoutSession { - type Id = CheckoutSessionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "checkout_session" - } -} - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ConnectCollectionTransfer { - pub id: ConnectCollectionTransferId, -} - -#[cfg(not(feature = "connect"))] -impl Object for ConnectCollectionTransfer { - type Id = ConnectCollectionTransferId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "connect_collection_transfer" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Coupon { - pub id: CouponId, -} - -#[cfg(not(feature = "billing"))] -impl Object for Coupon { - type Id = CouponId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "coupon" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Discount { - pub id: DiscountId, -} - -#[cfg(not(feature = "billing"))] -impl Object for Discount { - type Id = DiscountId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "discount" - } -} - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ApplicationFeeRefund { - pub id: ApplicationFeeRefundId, -} - -#[cfg(not(feature = "connect"))] -impl Object for ApplicationFeeRefund { - type Id = ApplicationFeeRefundId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "fee_refund" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Invoice { - pub id: InvoiceId, -} - -#[cfg(not(feature = "billing"))] -impl Object for Invoice { - type Id = InvoiceId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "invoice" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceItem { - pub id: InvoiceItemId, -} - -#[cfg(not(feature = "billing"))] -impl Object for InvoiceItem { - type Id = InvoiceItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "invoiceitem" - } -} - -#[cfg(not(feature = "issuing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorization { - pub id: IssuingAuthorizationId, -} - -#[cfg(not(feature = "issuing"))] -impl Object for IssuingAuthorization { - type Id = IssuingAuthorizationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.authorization" - } -} - -#[cfg(not(feature = "issuing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCard { - pub id: IssuingCardId, -} - -#[cfg(not(feature = "issuing"))] -impl Object for IssuingCard { - type Id = IssuingCardId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.card" - } -} - -#[cfg(not(feature = "issuing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholder { - pub id: IssuingCardholderId, -} - -#[cfg(not(feature = "issuing"))] -impl Object for IssuingCardholder { - type Id = IssuingCardholderId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.cardholder" - } -} - -#[cfg(not(feature = "issuing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDispute { - pub id: IssuingDisputeId, -} - -#[cfg(not(feature = "issuing"))] -impl Object for IssuingDispute { - type Id = IssuingDisputeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.dispute" - } -} - -#[cfg(not(feature = "issuing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransaction { - pub id: IssuingTransactionId, -} - -#[cfg(not(feature = "issuing"))] -impl Object for IssuingTransaction { - type Id = IssuingTransactionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.transaction" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceLineItem { - pub id: InvoiceLineItemId, -} - -#[cfg(not(feature = "billing"))] -impl Object for InvoiceLineItem { - type Id = InvoiceLineItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "line_item" - } -} - -#[cfg(not(feature = "orders"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Order { - pub id: (), -} - -#[cfg(not(feature = "orders"))] -impl Object for Order { - type Id = (); - fn id(&self) -> Self::Id { - self.id - } - fn object(&self) -> &'static str { - "order" - } -} - -#[cfg(not(feature = "orders"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OrderItem { - pub id: (), -} - -#[cfg(not(feature = "orders"))] -impl Object for OrderItem { - type Id = (); - fn id(&self) -> Self::Id { - self.id - } - fn object(&self) -> &'static str { - "order_item" - } -} - -#[cfg(not(feature = "orders"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OrderReturn { - pub id: (), -} - -#[cfg(not(feature = "orders"))] -impl Object for OrderReturn { - type Id = (); - fn id(&self) -> Self::Id { - self.id - } - fn object(&self) -> &'static str { - "order_return" - } -} - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Person { - pub id: PersonId, -} - -#[cfg(not(feature = "connect"))] -impl Object for Person { - type Id = PersonId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "person" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Plan { - pub id: PlanId, -} - -#[cfg(not(feature = "billing"))] -impl Object for Plan { - type Id = PlanId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "plan" - } -} - -#[cfg(not(feature = "fraud"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Review { - pub id: ReviewId, -} - -#[cfg(not(feature = "fraud"))] -impl Object for Review { - type Id = ReviewId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "review" - } -} - -#[cfg(not(feature = "sigma"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ScheduledQueryRun { - pub id: ScheduledQueryRunId, -} - -#[cfg(not(feature = "sigma"))] -impl Object for ScheduledQueryRun { - type Id = ScheduledQueryRunId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "scheduled_query_run" - } -} - -#[cfg(not(feature = "orders"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Sku { - pub id: (), -} - -#[cfg(not(feature = "orders"))] -impl Object for Sku { - type Id = (); - fn id(&self) -> Self::Id { - self.id - } - fn object(&self) -> &'static str { - "sku" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Subscription { - pub id: SubscriptionId, -} - -#[cfg(not(feature = "billing"))] -impl Object for Subscription { - type Id = SubscriptionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "subscription" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionItem { - pub id: SubscriptionItemId, -} - -#[cfg(not(feature = "billing"))] -impl Object for SubscriptionItem { - type Id = SubscriptionItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "subscription_item" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionSchedule { - pub id: SubscriptionScheduleId, -} - -#[cfg(not(feature = "billing"))] -impl Object for SubscriptionSchedule { - type Id = SubscriptionScheduleId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "subscription_schedule" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleRevision { - pub id: (), -} - -#[cfg(not(feature = "billing"))] -impl Object for SubscriptionScheduleRevision { - type Id = (); - fn id(&self) -> Self::Id { - self.id - } - fn object(&self) -> &'static str { - "subscription_schedule_revision" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxId { - pub id: TaxIdId, -} - -#[cfg(not(feature = "billing"))] -impl Object for TaxId { - type Id = TaxIdId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax_id" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxRate { - pub id: TaxRateId, -} - -#[cfg(not(feature = "billing"))] -impl Object for TaxRate { - type Id = TaxRateId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax_rate" - } -} - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Topup { - pub id: TopupId, -} - -#[cfg(not(feature = "connect"))] -impl Object for Topup { - type Id = TopupId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "topup" - } -} - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Transfer { - pub id: TransferId, -} - -#[cfg(not(feature = "connect"))] -impl Object for Transfer { - type Id = TransferId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "transfer" - } -} - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransferReversal { - pub id: TransferReversalId, -} - -#[cfg(not(feature = "connect"))] -impl Object for TransferReversal { - type Id = TransferReversalId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "transfer_reversal" - } -} - -#[cfg(not(feature = "webhook-endpoints"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WebhookEndpoint { - pub id: WebhookEndpointId, -} - -#[cfg(not(feature = "webhook-endpoints"))] -impl Object for WebhookEndpoint { - type Id = WebhookEndpointId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "webhook_endpoint" - } -} diff --git a/src/resources/generated/plan.rs b/src/resources/generated/plan.rs deleted file mode 100644 index 495df6630..000000000 --- a/src/resources/generated/plan.rs +++ /dev/null @@ -1,516 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::PlanId; -use crate::params::{ - Deleted, Expand, Expandable, IdOrCreate, List, Metadata, Object, Paginable, RangeQuery, - Timestamp, -}; -use crate::resources::{CreateProduct, Currency, Product}; - -/// The resource representing a Stripe "Plan". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Plan { - /// Unique identifier for the object. - pub id: PlanId, - - /// Whether the plan can be used for new purchases. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Specifies a usage aggregation strategy for plans of `usage_type=metered`. - /// - /// Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. - /// Defaults to `sum`. - #[serde(skip_serializing_if = "Option::is_none")] - pub aggregate_usage: Option, - - /// The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. - /// - /// Only set if `billing_scheme=per_unit`. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. - /// - /// Only set if `billing_scheme=per_unit`. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_decimal: Option, - - /// Describes how to compute the price per period. - /// - /// Either `per_unit` or `tiered`. - /// `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). - /// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_scheme: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// The frequency at which a subscription is billed. - /// - /// One of `day`, `week`, `month` or `year`. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval: Option, - - /// The number of intervals (specified in the `interval` attribute) between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// A brief description of the plan, hidden from customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub nickname: Option, - - /// The product whose pricing this plan determines. - #[serde(skip_serializing_if = "Option::is_none")] - pub product: Option>, - - /// Each element represents a pricing tier. - /// - /// This parameter requires `billing_scheme` to be set to `tiered`. - /// See also the documentation for `billing_scheme`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers: Option>, - - /// Defines if the tiering price should be `graduated` or `volume` based. - /// - /// In `volume`-based tiering, the maximum quantity within a period determines the per unit price. - /// In `graduated` tiering, pricing can change as the quantity grows. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers_mode: Option, - - /// Apply a transformation to the reported usage or set quantity before computing the amount billed. - /// - /// Cannot be combined with `tiers`. - #[serde(skip_serializing_if = "Option::is_none")] - pub transform_usage: Option, - - /// Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_period_days: Option, - - /// Configures how the quantity per period should be determined. - /// - /// Can be either `metered` or `licensed`. - /// `licensed` automatically bills the `quantity` set when adding it to a subscription. - /// `metered` aggregates the total usage based on usage records. - /// Defaults to `licensed`. - #[serde(skip_serializing_if = "Option::is_none")] - pub usage_type: Option, -} - -impl Plan { - /// Returns a list of your plans. - pub fn list(client: &Client, params: &ListPlans<'_>) -> Response> { - client.get_query("/plans", ¶ms) - } - - /// Retrieves the plan with the given ID. - pub fn retrieve(client: &Client, id: &PlanId, expand: &[&str]) -> Response { - client.get_query(&format!("/plans/{}", id), &Expand { expand }) - } - - /// Updates the specified plan by setting the values of the parameters passed. - /// - /// Any parameters not provided are left unchanged. - /// By design, you cannot change a plan’s ID, amount, currency, or billing cycle. - pub fn update(client: &Client, id: &PlanId, params: UpdatePlan<'_>) -> Response { - client.post_form(&format!("/plans/{}", id), ¶ms) - } - - /// Deleting plans means new subscribers can’t be added. - /// - /// Existing subscribers aren’t affected. - pub fn delete(client: &Client, id: &PlanId) -> Response> { - client.delete(&format!("/plans/{}", id)) - } -} - -impl Object for Plan { - type Id = PlanId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "plan" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PlanTier { - /// Price for the entire tier. - pub flat_amount: Option, - - /// Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. - pub flat_amount_decimal: Option, - - /// Per unit price for units relevant to the tier. - pub unit_amount: Option, - - /// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. - pub unit_amount_decimal: Option, - - /// Up to and including to this quantity will be contained in the tier. - pub up_to: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransformUsage { - /// Divide usage by this number. - pub divide_by: i64, - - /// After division, either round the result `up` or `down`. - pub round: TransformUsageRound, -} - -/// The parameters for `Plan::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPlans<'a> { - /// Only return plans that are active or inactive (e.g., pass `false` to list all inactive plans). - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return plans for the given product. - #[serde(skip_serializing_if = "Option::is_none")] - pub product: Option>>, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListPlans<'a> { - pub fn new() -> Self { - ListPlans { - active: Default::default(), - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - product: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListPlans<'_> { - type O = Plan; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Plan::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePlan<'a> { - /// Whether the plan is currently available for new subscriptions. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// A brief description of the plan, hidden from customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub nickname: Option<&'a str>, - - /// The product the plan belongs to. - /// - /// This cannot be changed once it has been used in a subscription or subscription schedule. - #[serde(skip_serializing_if = "Option::is_none")] - pub product: Option>>, - - /// Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_period_days: Option, -} - -impl<'a> UpdatePlan<'a> { - pub fn new() -> Self { - UpdatePlan { - active: Default::default(), - expand: Default::default(), - metadata: Default::default(), - nickname: Default::default(), - product: Default::default(), - trial_period_days: Default::default(), - } - } -} - -/// An enum representing the possible values of an `Plan`'s `aggregate_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PlanAggregateUsage { - LastDuringPeriod, - LastEver, - Max, - Sum, -} - -impl PlanAggregateUsage { - pub fn as_str(self) -> &'static str { - match self { - PlanAggregateUsage::LastDuringPeriod => "last_during_period", - PlanAggregateUsage::LastEver => "last_ever", - PlanAggregateUsage::Max => "max", - PlanAggregateUsage::Sum => "sum", - } - } -} - -impl AsRef for PlanAggregateUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PlanAggregateUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PlanAggregateUsage { - fn default() -> Self { - Self::LastDuringPeriod - } -} - -/// An enum representing the possible values of an `Plan`'s `billing_scheme` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PlanBillingScheme { - PerUnit, - Tiered, -} - -impl PlanBillingScheme { - pub fn as_str(self) -> &'static str { - match self { - PlanBillingScheme::PerUnit => "per_unit", - PlanBillingScheme::Tiered => "tiered", - } - } -} - -impl AsRef for PlanBillingScheme { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PlanBillingScheme { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PlanBillingScheme { - fn default() -> Self { - Self::PerUnit - } -} - -/// An enum representing the possible values of an `Plan`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PlanInterval { - Day, - Month, - Week, - Year, -} - -impl PlanInterval { - pub fn as_str(self) -> &'static str { - match self { - PlanInterval::Day => "day", - PlanInterval::Month => "month", - PlanInterval::Week => "week", - PlanInterval::Year => "year", - } - } -} - -impl AsRef for PlanInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PlanInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PlanInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `Plan`'s `tiers_mode` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PlanTiersMode { - Graduated, - Volume, -} - -impl PlanTiersMode { - pub fn as_str(self) -> &'static str { - match self { - PlanTiersMode::Graduated => "graduated", - PlanTiersMode::Volume => "volume", - } - } -} - -impl AsRef for PlanTiersMode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PlanTiersMode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PlanTiersMode { - fn default() -> Self { - Self::Graduated - } -} - -/// An enum representing the possible values of an `Plan`'s `usage_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PlanUsageType { - Licensed, - Metered, -} - -impl PlanUsageType { - pub fn as_str(self) -> &'static str { - match self { - PlanUsageType::Licensed => "licensed", - PlanUsageType::Metered => "metered", - } - } -} - -impl AsRef for PlanUsageType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PlanUsageType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PlanUsageType { - fn default() -> Self { - Self::Licensed - } -} - -/// An enum representing the possible values of an `TransformUsage`'s `round` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TransformUsageRound { - Down, - Up, -} - -impl TransformUsageRound { - pub fn as_str(self) -> &'static str { - match self { - TransformUsageRound::Down => "down", - TransformUsageRound::Up => "up", - } - } -} - -impl AsRef for TransformUsageRound { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TransformUsageRound { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TransformUsageRound { - fn default() -> Self { - Self::Down - } -} diff --git a/src/resources/generated/platform_tax_fee.rs b/src/resources/generated/platform_tax_fee.rs deleted file mode 100644 index 816bc53cb..000000000 --- a/src/resources/generated/platform_tax_fee.rs +++ /dev/null @@ -1,35 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::PlatformTaxFeeId; -use crate::params::Object; - -/// The resource representing a Stripe "PlatformTax". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PlatformTaxFee { - /// Unique identifier for the object. - pub id: PlatformTaxFeeId, - - /// The Connected account that incurred this charge. - pub account: String, - - /// The payment object that caused this tax to be inflicted. - pub source_transaction: String, - - /// The type of tax (VAT). - #[serde(rename = "type")] - pub type_: String, -} - -impl Object for PlatformTaxFee { - type Id = PlatformTaxFeeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "platform_tax_fee" - } -} diff --git a/src/resources/generated/price.rs b/src/resources/generated/price.rs deleted file mode 100644 index 58214d451..000000000 --- a/src/resources/generated/price.rs +++ /dev/null @@ -1,1460 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::PriceId; -use crate::params::{ - CurrencyMap, Expand, Expandable, IdOrCreate, List, Metadata, Object, Paginable, RangeQuery, - Timestamp, -}; -use crate::resources::{CreateProduct, Currency, CustomUnitAmount, Product, UpTo}; - -/// The resource representing a Stripe "Price". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Price { - /// Unique identifier for the object. - pub id: PriceId, - - /// Whether the price can be used for new purchases. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Describes how to compute the price per period. - /// - /// Either `per_unit` or `tiered`. - /// `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). - /// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_scheme: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Prices defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, - - /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_unit_amount: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// A lookup key used to retrieve prices dynamically from a static string. - /// - /// This may be up to 200 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub lookup_key: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// A brief description of the price, hidden from customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub nickname: Option, - - /// The ID of the product this price is associated with. - #[serde(skip_serializing_if = "Option::is_none")] - pub product: Option>, - - /// The recurring components of a price such as `interval` and `usage_type`. - #[serde(skip_serializing_if = "Option::is_none")] - pub recurring: Option, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// Each element represents a pricing tier. - /// - /// This parameter requires `billing_scheme` to be set to `tiered`. - /// See also the documentation for `billing_scheme`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers: Option>, - - /// Defines if the tiering price should be `graduated` or `volume` based. - /// - /// In `volume`-based tiering, the maximum quantity within a period determines the per unit price. - /// In `graduated` tiering, pricing can change as the quantity grows. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers_mode: Option, - - /// Apply a transformation to the reported usage or set quantity before computing the amount billed. - /// - /// Cannot be combined with `tiers`. - #[serde(skip_serializing_if = "Option::is_none")] - pub transform_quantity: Option, - - /// One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, - - /// The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. - /// - /// Only set if `billing_scheme=per_unit`. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. - /// - /// Only set if `billing_scheme=per_unit`. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -impl Price { - /// Returns a list of your prices. - pub fn list(client: &Client, params: &ListPrices<'_>) -> Response> { - client.get_query("/prices", ¶ms) - } - - /// Creates a new price for an existing product. - /// - /// The price can be recurring or one-time. - pub fn create(client: &Client, params: CreatePrice<'_>) -> Response { - client.post_form("/prices", ¶ms) - } - - /// Retrieves the price with the given ID. - pub fn retrieve(client: &Client, id: &PriceId, expand: &[&str]) -> Response { - client.get_query(&format!("/prices/{}", id), &Expand { expand }) - } - - /// Updates the specified price by setting the values of the parameters passed. - /// - /// Any parameters not provided are left unchanged. - pub fn update(client: &Client, id: &PriceId, params: UpdatePrice<'_>) -> Response { - client.post_form(&format!("/prices/{}", id), ¶ms) - } -} - -impl Object for Price { - type Id = PriceId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "price" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CurrencyOption { - /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. - pub custom_unit_amount: Option, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - pub tax_behavior: Option, - - /// Each element represents a pricing tier. - /// - /// This parameter requires `billing_scheme` to be set to `tiered`. - /// See also the documentation for `billing_scheme`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers: Option>, - - /// The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. - /// - /// Only set if `billing_scheme=per_unit`. - pub unit_amount: Option, - - /// The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. - /// - /// Only set if `billing_scheme=per_unit`. - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PriceTier { - /// Price for the entire tier. - pub flat_amount: Option, - - /// Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. - pub flat_amount_decimal: Option, - - /// Per unit price for units relevant to the tier. - pub unit_amount: Option, - - /// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. - pub unit_amount_decimal: Option, - - /// Up to and including to this quantity will be contained in the tier. - pub up_to: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Recurring { - /// Specifies a usage aggregation strategy for prices of `usage_type=metered`. - /// - /// Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. - /// Defaults to `sum`. - pub aggregate_usage: Option, - - /// The frequency at which a subscription is billed. - /// - /// One of `day`, `week`, `month` or `year`. - pub interval: RecurringInterval, - - /// The number of intervals (specified in the `interval` attribute) between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - pub interval_count: u64, - - /// Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). - pub trial_period_days: Option, - - /// Configures how the quantity per period should be determined. - /// - /// Can be either `metered` or `licensed`. - /// `licensed` automatically bills the `quantity` set when adding it to a subscription. - /// `metered` aggregates the total usage based on usage records. - /// Defaults to `licensed`. - pub usage_type: RecurringUsageType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransformQuantity { - /// Divide usage by this number. - pub divide_by: i64, - - /// After division, either round the result `up` or `down`. - pub round: TransformQuantityRound, -} - -/// The parameters for `Price::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreatePrice<'a> { - /// Whether the price can be used for new purchases. - /// - /// Defaults to `true`. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Describes how to compute the price per period. - /// - /// Either `per_unit` or `tiered`. - /// `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). - /// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_scheme: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Prices defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, - - /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_unit_amount: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A lookup key used to retrieve prices dynamically from a static string. - /// - /// This may be up to 200 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub lookup_key: Option<&'a str>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// A brief description of the price, hidden from customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub nickname: Option<&'a str>, - - /// The ID of the product that this price will belong to. - #[serde(skip_serializing_if = "Option::is_none")] - pub product: Option>>, - - /// These fields can be used to create a new product that this price will belong to. - #[serde(skip_serializing_if = "Option::is_none")] - pub product_data: Option, - - /// The recurring components of a price such as `interval` and `usage_type`. - #[serde(skip_serializing_if = "Option::is_none")] - pub recurring: Option, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// Each element represents a pricing tier. - /// - /// This parameter requires `billing_scheme` to be set to `tiered`. - /// See also the documentation for `billing_scheme`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers: Option>, - - /// Defines if the tiering price should be `graduated` or `volume` based. - /// - /// In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers_mode: Option, - - /// If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_lookup_key: Option, - - /// Apply a transformation to the reported usage or set quantity before computing the billed price. - /// - /// Cannot be combined with `tiers`. - #[serde(skip_serializing_if = "Option::is_none")] - pub transform_quantity: Option, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - /// - /// One of `unit_amount` or `custom_unit_amount` is required, unless `billing_scheme=tiered`. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option<&'a str>, -} - -impl<'a> CreatePrice<'a> { - pub fn new(currency: Currency) -> Self { - CreatePrice { - active: Default::default(), - billing_scheme: Default::default(), - currency, - currency_options: Default::default(), - custom_unit_amount: Default::default(), - expand: Default::default(), - lookup_key: Default::default(), - metadata: Default::default(), - nickname: Default::default(), - product: Default::default(), - product_data: Default::default(), - recurring: Default::default(), - tax_behavior: Default::default(), - tiers: Default::default(), - tiers_mode: Default::default(), - transfer_lookup_key: Default::default(), - transform_quantity: Default::default(), - unit_amount: Default::default(), - unit_amount_decimal: Default::default(), - } - } -} - -/// The parameters for `Price::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPrices<'a> { - /// Only return prices that are active or inactive (e.g., pass `false` to list all inactive prices). - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return prices for the given currency. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return the price with these lookup_keys, if any exist. - #[serde(skip_serializing_if = "Option::is_none")] - pub lookup_keys: Option>, - - /// Only return prices for the given product. - #[serde(skip_serializing_if = "Option::is_none")] - pub product: Option>>, - - /// Only return prices with these recurring fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub recurring: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// Only return prices of type `recurring` or `one_time`. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -impl<'a> ListPrices<'a> { - pub fn new() -> Self { - ListPrices { - active: Default::default(), - created: Default::default(), - currency: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - lookup_keys: Default::default(), - product: Default::default(), - recurring: Default::default(), - starting_after: Default::default(), - type_: Default::default(), - } - } -} -impl Paginable for ListPrices<'_> { - type O = Price; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Price::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePrice<'a> { - /// Whether the price can be used for new purchases. - /// - /// Defaults to `true`. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Prices defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>>>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A lookup key used to retrieve prices dynamically from a static string. - /// - /// This may be up to 200 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub lookup_key: Option<&'a str>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// A brief description of the price, hidden from customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub nickname: Option<&'a str>, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_lookup_key: Option, -} - -impl<'a> UpdatePrice<'a> { - pub fn new() -> Self { - UpdatePrice { - active: Default::default(), - currency_options: Default::default(), - expand: Default::default(), - lookup_key: Default::default(), - metadata: Default::default(), - nickname: Default::default(), - tax_behavior: Default::default(), - transfer_lookup_key: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePriceCurrencyOptions { - /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_unit_amount: Option, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// Each element represents a pricing tier. - /// - /// This parameter requires `billing_scheme` to be set to `tiered`. - /// See also the documentation for `billing_scheme`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers: Option>, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePriceCustomUnitAmount { - /// Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. - pub enabled: bool, - - /// The maximum unit amount the customer can specify for this item. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: Option, - - /// The minimum unit amount the customer can specify for this item. - /// - /// Must be at least the minimum charge amount. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: Option, - - /// The starting unit amount which can be updated by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub preset: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePriceProductData { - /// Whether the product is currently available for purchase. - /// - /// Defaults to `true`. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// The identifier for the product. - /// - /// Must be unique. - /// If not provided, an identifier will be randomly generated. - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The product's name, meant to be displayable to the customer. - pub name: String, - - /// An arbitrary string to be displayed on your customer's credit card or bank statement. - /// - /// While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. - /// The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. - /// Non-ASCII characters are automatically stripped. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, - - /// A label that represents units of this product. - /// - /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_label: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePriceRecurring { - /// Specifies a usage aggregation strategy for prices of `usage_type=metered`. - /// - /// Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. - /// Defaults to `sum`. - #[serde(skip_serializing_if = "Option::is_none")] - pub aggregate_usage: Option, - - /// Specifies billing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: CreatePriceRecurringInterval, - - /// The number of intervals between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, - - /// Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_period_days: Option, - - /// Configures how the quantity per period should be determined. - /// - /// Can be either `metered` or `licensed`. - /// `licensed` automatically bills the `quantity` set when adding it to a subscription. - /// `metered` aggregates the total usage based on usage records. - /// Defaults to `licensed`. - #[serde(skip_serializing_if = "Option::is_none")] - pub usage_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePriceTiers { - /// The flat billing amount for an entire tier, regardless of the number of units in the tier. - #[serde(skip_serializing_if = "Option::is_none")] - pub flat_amount: Option, - - /// Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. - /// - /// Only one of `flat_amount` and `flat_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub flat_amount_decimal: Option, - - /// The per unit billing amount for each individual unit for which this tier applies. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, - - /// Specifies the upper bound of this tier. - /// - /// The lower bound of a tier is the upper bound of the previous tier adding one. - /// Use `inf` to define a fallback tier. - pub up_to: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePriceTransformQuantity { - /// Divide usage by this number. - pub divide_by: i64, - - /// After division, either round the result `up` or `down`. - pub round: CreatePriceTransformQuantityRound, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ListPricesRecurring { - /// Filter by billing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval: Option, - - /// Filter by the usage type for this price. - /// - /// Can be either `metered` or `licensed`. - #[serde(skip_serializing_if = "Option::is_none")] - pub usage_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePriceCurrencyOptions { - /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_unit_amount: Option, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// Each element represents a pricing tier. - /// - /// This parameter requires `billing_scheme` to be set to `tiered`. - /// See also the documentation for `billing_scheme`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers: Option>, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePriceCurrencyOptionsCustomUnitAmount { - /// Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. - pub enabled: bool, - - /// The maximum unit amount the customer can specify for this item. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: Option, - - /// The minimum unit amount the customer can specify for this item. - /// - /// Must be at least the minimum charge amount. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: Option, - - /// The starting unit amount which can be updated by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub preset: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePriceCurrencyOptionsTiers { - /// The flat billing amount for an entire tier, regardless of the number of units in the tier. - #[serde(skip_serializing_if = "Option::is_none")] - pub flat_amount: Option, - - /// Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. - /// - /// Only one of `flat_amount` and `flat_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub flat_amount_decimal: Option, - - /// The per unit billing amount for each individual unit for which this tier applies. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, - - /// Specifies the upper bound of this tier. - /// - /// The lower bound of a tier is the upper bound of the previous tier adding one. - /// Use `inf` to define a fallback tier. - pub up_to: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePriceCurrencyOptionsCustomUnitAmount { - /// Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. - pub enabled: bool, - - /// The maximum unit amount the customer can specify for this item. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: Option, - - /// The minimum unit amount the customer can specify for this item. - /// - /// Must be at least the minimum charge amount. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: Option, - - /// The starting unit amount which can be updated by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub preset: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePriceCurrencyOptionsTiers { - /// The flat billing amount for an entire tier, regardless of the number of units in the tier. - #[serde(skip_serializing_if = "Option::is_none")] - pub flat_amount: Option, - - /// Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. - /// - /// Only one of `flat_amount` and `flat_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub flat_amount_decimal: Option, - - /// The per unit billing amount for each individual unit for which this tier applies. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, - - /// Specifies the upper bound of this tier. - /// - /// The lower bound of a tier is the upper bound of the previous tier adding one. - /// Use `inf` to define a fallback tier. - pub up_to: Option, -} - -/// An enum representing the possible values of an `CreatePriceCurrencyOptions`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePriceCurrencyOptionsTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreatePriceCurrencyOptionsTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreatePriceCurrencyOptionsTaxBehavior::Exclusive => "exclusive", - CreatePriceCurrencyOptionsTaxBehavior::Inclusive => "inclusive", - CreatePriceCurrencyOptionsTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for CreatePriceCurrencyOptionsTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePriceCurrencyOptionsTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePriceCurrencyOptionsTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreatePriceRecurring`'s `aggregate_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePriceRecurringAggregateUsage { - LastDuringPeriod, - LastEver, - Max, - Sum, -} - -impl CreatePriceRecurringAggregateUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePriceRecurringAggregateUsage::LastDuringPeriod => "last_during_period", - CreatePriceRecurringAggregateUsage::LastEver => "last_ever", - CreatePriceRecurringAggregateUsage::Max => "max", - CreatePriceRecurringAggregateUsage::Sum => "sum", - } - } -} - -impl AsRef for CreatePriceRecurringAggregateUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePriceRecurringAggregateUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePriceRecurringAggregateUsage { - fn default() -> Self { - Self::LastDuringPeriod - } -} - -/// An enum representing the possible values of an `CreatePriceRecurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePriceRecurringInterval { - Day, - Month, - Week, - Year, -} - -impl CreatePriceRecurringInterval { - pub fn as_str(self) -> &'static str { - match self { - CreatePriceRecurringInterval::Day => "day", - CreatePriceRecurringInterval::Month => "month", - CreatePriceRecurringInterval::Week => "week", - CreatePriceRecurringInterval::Year => "year", - } - } -} - -impl AsRef for CreatePriceRecurringInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePriceRecurringInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePriceRecurringInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `CreatePriceRecurring`'s `usage_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePriceRecurringUsageType { - Licensed, - Metered, -} - -impl CreatePriceRecurringUsageType { - pub fn as_str(self) -> &'static str { - match self { - CreatePriceRecurringUsageType::Licensed => "licensed", - CreatePriceRecurringUsageType::Metered => "metered", - } - } -} - -impl AsRef for CreatePriceRecurringUsageType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePriceRecurringUsageType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePriceRecurringUsageType { - fn default() -> Self { - Self::Licensed - } -} - -/// An enum representing the possible values of an `CreatePriceTransformQuantity`'s `round` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePriceTransformQuantityRound { - Down, - Up, -} - -impl CreatePriceTransformQuantityRound { - pub fn as_str(self) -> &'static str { - match self { - CreatePriceTransformQuantityRound::Down => "down", - CreatePriceTransformQuantityRound::Up => "up", - } - } -} - -impl AsRef for CreatePriceTransformQuantityRound { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePriceTransformQuantityRound { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePriceTransformQuantityRound { - fn default() -> Self { - Self::Down - } -} - -/// An enum representing the possible values of an `CurrencyOption`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CurrencyOptionTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CurrencyOptionTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CurrencyOptionTaxBehavior::Exclusive => "exclusive", - CurrencyOptionTaxBehavior::Inclusive => "inclusive", - CurrencyOptionTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for CurrencyOptionTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CurrencyOptionTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CurrencyOptionTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `ListPricesRecurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ListPricesRecurringInterval { - Day, - Month, - Week, - Year, -} - -impl ListPricesRecurringInterval { - pub fn as_str(self) -> &'static str { - match self { - ListPricesRecurringInterval::Day => "day", - ListPricesRecurringInterval::Month => "month", - ListPricesRecurringInterval::Week => "week", - ListPricesRecurringInterval::Year => "year", - } - } -} - -impl AsRef for ListPricesRecurringInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ListPricesRecurringInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ListPricesRecurringInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `ListPricesRecurring`'s `usage_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ListPricesRecurringUsageType { - Licensed, - Metered, -} - -impl ListPricesRecurringUsageType { - pub fn as_str(self) -> &'static str { - match self { - ListPricesRecurringUsageType::Licensed => "licensed", - ListPricesRecurringUsageType::Metered => "metered", - } - } -} - -impl AsRef for ListPricesRecurringUsageType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ListPricesRecurringUsageType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ListPricesRecurringUsageType { - fn default() -> Self { - Self::Licensed - } -} - -/// An enum representing the possible values of an `Price`'s `billing_scheme` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PriceBillingScheme { - PerUnit, - Tiered, -} - -impl PriceBillingScheme { - pub fn as_str(self) -> &'static str { - match self { - PriceBillingScheme::PerUnit => "per_unit", - PriceBillingScheme::Tiered => "tiered", - } - } -} - -impl AsRef for PriceBillingScheme { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PriceBillingScheme { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PriceBillingScheme { - fn default() -> Self { - Self::PerUnit - } -} - -/// An enum representing the possible values of an `Price`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PriceTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl PriceTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - PriceTaxBehavior::Exclusive => "exclusive", - PriceTaxBehavior::Inclusive => "inclusive", - PriceTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for PriceTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PriceTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PriceTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `Price`'s `tiers_mode` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PriceTiersMode { - Graduated, - Volume, -} - -impl PriceTiersMode { - pub fn as_str(self) -> &'static str { - match self { - PriceTiersMode::Graduated => "graduated", - PriceTiersMode::Volume => "volume", - } - } -} - -impl AsRef for PriceTiersMode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PriceTiersMode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PriceTiersMode { - fn default() -> Self { - Self::Graduated - } -} - -/// An enum representing the possible values of an `Price`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PriceType { - OneTime, - Recurring, -} - -impl PriceType { - pub fn as_str(self) -> &'static str { - match self { - PriceType::OneTime => "one_time", - PriceType::Recurring => "recurring", - } - } -} - -impl AsRef for PriceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PriceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PriceType { - fn default() -> Self { - Self::OneTime - } -} - -/// An enum representing the possible values of an `Recurring`'s `aggregate_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum RecurringAggregateUsage { - LastDuringPeriod, - LastEver, - Max, - Sum, -} - -impl RecurringAggregateUsage { - pub fn as_str(self) -> &'static str { - match self { - RecurringAggregateUsage::LastDuringPeriod => "last_during_period", - RecurringAggregateUsage::LastEver => "last_ever", - RecurringAggregateUsage::Max => "max", - RecurringAggregateUsage::Sum => "sum", - } - } -} - -impl AsRef for RecurringAggregateUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for RecurringAggregateUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for RecurringAggregateUsage { - fn default() -> Self { - Self::LastDuringPeriod - } -} - -/// An enum representing the possible values of an `Recurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum RecurringInterval { - Day, - Month, - Week, - Year, -} - -impl RecurringInterval { - pub fn as_str(self) -> &'static str { - match self { - RecurringInterval::Day => "day", - RecurringInterval::Month => "month", - RecurringInterval::Week => "week", - RecurringInterval::Year => "year", - } - } -} - -impl AsRef for RecurringInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for RecurringInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for RecurringInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `Recurring`'s `usage_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum RecurringUsageType { - Licensed, - Metered, -} - -impl RecurringUsageType { - pub fn as_str(self) -> &'static str { - match self { - RecurringUsageType::Licensed => "licensed", - RecurringUsageType::Metered => "metered", - } - } -} - -impl AsRef for RecurringUsageType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for RecurringUsageType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for RecurringUsageType { - fn default() -> Self { - Self::Licensed - } -} - -/// An enum representing the possible values of an `TransformQuantity`'s `round` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TransformQuantityRound { - Down, - Up, -} - -impl TransformQuantityRound { - pub fn as_str(self) -> &'static str { - match self { - TransformQuantityRound::Down => "down", - TransformQuantityRound::Up => "up", - } - } -} - -impl AsRef for TransformQuantityRound { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TransformQuantityRound { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TransformQuantityRound { - fn default() -> Self { - Self::Down - } -} - -/// An enum representing the possible values of an `UpdatePriceCurrencyOptions`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePriceCurrencyOptionsTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl UpdatePriceCurrencyOptionsTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - UpdatePriceCurrencyOptionsTaxBehavior::Exclusive => "exclusive", - UpdatePriceCurrencyOptionsTaxBehavior::Inclusive => "inclusive", - UpdatePriceCurrencyOptionsTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for UpdatePriceCurrencyOptionsTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePriceCurrencyOptionsTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePriceCurrencyOptionsTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} diff --git a/src/resources/generated/product.rs b/src/resources/generated/product.rs deleted file mode 100644 index c51e5bcf0..000000000 --- a/src/resources/generated/product.rs +++ /dev/null @@ -1,763 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ProductId, TaxCodeId}; -use crate::params::{ - CurrencyMap, Deleted, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, - Timestamp, -}; -use crate::resources::{Currency, Price, TaxCode, UpTo}; - -/// The resource representing a Stripe "Product". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Product { - /// Unique identifier for the object. - pub id: ProductId, - - /// Whether the product is currently available for purchase. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_price: Option>, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// The product's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// A list of up to 15 features for this product. - /// - /// These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). - #[serde(skip_serializing_if = "Option::is_none")] - pub features: Option>, - - /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub images: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The product's name, meant to be displayable to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// The dimensions of this product for shipping purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub package_dimensions: Option, - - /// Whether this product is shipped (i.e., physical goods). - #[serde(skip_serializing_if = "Option::is_none")] - pub shippable: Option, - - /// Extra information about a product which will appear on your customer's credit card statement. - /// - /// In the case that multiple products are billed at once, the first statement descriptor will be used. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option>, - - /// The type of the product. - /// - /// The product is either of type `good`, which is eligible for use with Orders and SKUs, or `service`, which is eligible for use with Subscriptions and Plans. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, - - /// A label that represents units of this product. - /// - /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_label: Option, - - /// Time at which the object was last updated. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub updated: Option, - - /// A URL of a publicly-accessible webpage for this product. - #[serde(skip_serializing_if = "Option::is_none")] - pub url: Option, -} - -impl Product { - /// Returns a list of your products. - /// - /// The products are returned sorted by creation date, with the most recently created products appearing first. - pub fn list(client: &Client, params: &ListProducts<'_>) -> Response> { - client.get_query("/products", ¶ms) - } - - /// Creates a new product object. - pub fn create(client: &Client, params: CreateProduct<'_>) -> Response { - client.post_form("/products", ¶ms) - } - - /// Retrieves the details of an existing product. - /// - /// Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information. - pub fn retrieve(client: &Client, id: &ProductId, expand: &[&str]) -> Response { - client.get_query(&format!("/products/{}", id), &Expand { expand }) - } - - /// Updates the specific product by setting the values of the parameters passed. - /// - /// Any parameters not provided will be left unchanged. - pub fn update(client: &Client, id: &ProductId, params: UpdateProduct<'_>) -> Response { - client.post_form(&format!("/products/{}", id), ¶ms) - } - - /// Delete a product. - /// - /// Deleting a product is only possible if it has no prices associated with it. - /// Additionally, deleting a product with `type=good` is only possible if it has no SKUs associated with it. - pub fn delete(client: &Client, id: &ProductId) -> Response> { - client.delete(&format!("/products/{}", id)) - } -} - -impl Object for Product { - type Id = ProductId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "product" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PackageDimensions { - /// Height, in inches. - pub height: f64, - - /// Length, in inches. - pub length: f64, - - /// Weight, in ounces. - pub weight: f64, - - /// Width, in inches. - pub width: f64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ProductFeature { - /// The feature's name. - /// - /// Up to 80 characters long. - pub name: String, -} - -/// The parameters for `Product::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateProduct<'a> { - /// Whether the product is currently available for purchase. - /// - /// Defaults to `true`. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object. - /// - /// This Price will be set as the default price for this product. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_price_data: Option, - - /// The product's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A list of up to 15 features for this product. - /// - /// These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). - #[serde(skip_serializing_if = "Option::is_none")] - pub features: Option>, - - /// An identifier will be randomly generated by Stripe. - /// - /// You can optionally override this ID, but the ID must be unique across all products in your Stripe account. - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option<&'a str>, - - /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub images: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The product's name, meant to be displayable to the customer. - pub name: &'a str, - - /// The dimensions of this product for shipping purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub package_dimensions: Option, - - /// Whether this product is shipped (i.e., physical goods). - #[serde(skip_serializing_if = "Option::is_none")] - pub shippable: Option, - - /// An arbitrary string to be displayed on your customer's credit card or bank statement. - /// - /// While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. - /// The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. - /// Non-ASCII characters are automatically stripped. It must contain at least one letter. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option<&'a str>, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, - - /// The type of the product. - /// - /// Defaults to `service` if not explicitly specified, enabling use of this product with Subscriptions and Plans. - /// Set this parameter to `good` to use this product with Orders and SKUs. - /// On API versions before `2018-02-05`, this field defaults to `good` for compatibility reasons. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, - - /// A label that represents units of this product. - /// - /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_label: Option<&'a str>, - - /// A URL of a publicly-accessible webpage for this product. - #[serde(skip_serializing_if = "Option::is_none")] - pub url: Option<&'a str>, -} - -impl<'a> CreateProduct<'a> { - pub fn new(name: &'a str) -> Self { - CreateProduct { - active: Default::default(), - default_price_data: Default::default(), - description: Default::default(), - expand: Default::default(), - features: Default::default(), - id: Default::default(), - images: Default::default(), - metadata: Default::default(), - name, - package_dimensions: Default::default(), - shippable: Default::default(), - statement_descriptor: Default::default(), - tax_code: Default::default(), - type_: Default::default(), - unit_label: Default::default(), - url: Default::default(), - } - } -} - -/// The parameters for `Product::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListProducts<'a> { - /// Only return products that are active or inactive (e.g., pass `false` to list all inactive products). - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Only return products that were created during the given date interval. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Only return products with the given IDs. - /// - /// Cannot be used with [starting_after](https://stripe.com/docs/api#list_products-starting_after) or [ending_before](https://stripe.com/docs/api#list_products-ending_before). - #[serde(skip_serializing_if = "Option::is_none")] - pub ids: Option>, - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return products that can be shipped (i.e., physical, not digital products). - #[serde(skip_serializing_if = "Option::is_none")] - pub shippable: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// Only return products of this type. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, - - /// Only return products with the given url. - #[serde(skip_serializing_if = "Option::is_none")] - pub url: Option<&'a str>, -} - -impl<'a> ListProducts<'a> { - pub fn new() -> Self { - ListProducts { - active: Default::default(), - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - ids: Default::default(), - limit: Default::default(), - shippable: Default::default(), - starting_after: Default::default(), - type_: Default::default(), - url: Default::default(), - } - } -} -impl Paginable for ListProducts<'_> { - type O = Product; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Product::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateProduct<'a> { - /// Whether the product is available for purchase. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_price: Option<&'a str>, - - /// The product's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A list of up to 15 features for this product. - /// - /// These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). - #[serde(skip_serializing_if = "Option::is_none")] - pub features: Option>, - - /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub images: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The product's name, meant to be displayable to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option<&'a str>, - - /// The dimensions of this product for shipping purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub package_dimensions: Option, - - /// Whether this product is shipped (i.e., physical goods). - #[serde(skip_serializing_if = "Option::is_none")] - pub shippable: Option, - - /// An arbitrary string to be displayed on your customer's credit card or bank statement. - /// - /// While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. - /// The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. - /// Non-ASCII characters are automatically stripped. It must contain at least one letter. - /// May only be set if `type=service`. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option<&'a str>, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, - - /// A label that represents units of this product. - /// - /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. - /// May only be set if `type=service`. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_label: Option, - - /// A URL of a publicly-accessible webpage for this product. - #[serde(skip_serializing_if = "Option::is_none")] - pub url: Option, -} - -impl<'a> UpdateProduct<'a> { - pub fn new() -> Self { - UpdateProduct { - active: Default::default(), - default_price: Default::default(), - description: Default::default(), - expand: Default::default(), - features: Default::default(), - images: Default::default(), - metadata: Default::default(), - name: Default::default(), - package_dimensions: Default::default(), - shippable: Default::default(), - statement_descriptor: Default::default(), - tax_code: Default::default(), - unit_label: Default::default(), - url: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateProductDefaultPriceData { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Prices defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, - - /// The recurring components of a price such as `interval` and `interval_count`. - #[serde(skip_serializing_if = "Option::is_none")] - pub recurring: Option, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - /// - /// One of `unit_amount` or `unit_amount_decimal` is required. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateProductFeatures { - /// The feature's name. - /// - /// Up to 80 characters long. - pub name: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateProductFeatures { - /// The feature's name. - /// - /// Up to 80 characters long. - pub name: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateProductDefaultPriceDataCurrencyOptions { - /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_unit_amount: Option, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// Each element represents a pricing tier. - /// - /// This parameter requires `billing_scheme` to be set to `tiered`. - /// See also the documentation for `billing_scheme`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers: Option>, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateProductDefaultPriceDataRecurring { - /// Specifies billing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: CreateProductDefaultPriceDataRecurringInterval, - - /// The number of intervals between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateProductDefaultPriceDataCurrencyOptionsCustomUnitAmount { - /// Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. - pub enabled: bool, - - /// The maximum unit amount the customer can specify for this item. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: Option, - - /// The minimum unit amount the customer can specify for this item. - /// - /// Must be at least the minimum charge amount. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: Option, - - /// The starting unit amount which can be updated by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub preset: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateProductDefaultPriceDataCurrencyOptionsTiers { - /// The flat billing amount for an entire tier, regardless of the number of units in the tier. - #[serde(skip_serializing_if = "Option::is_none")] - pub flat_amount: Option, - - /// Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. - /// - /// Only one of `flat_amount` and `flat_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub flat_amount_decimal: Option, - - /// The per unit billing amount for each individual unit for which this tier applies. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, - - /// Specifies the upper bound of this tier. - /// - /// The lower bound of a tier is the upper bound of the previous tier adding one. - /// Use `inf` to define a fallback tier. - pub up_to: Option, -} - -/// An enum representing the possible values of an `CreateProductDefaultPriceDataCurrencyOptions`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior::Exclusive => "exclusive", - CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior::Inclusive => "inclusive", - CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreateProductDefaultPriceDataRecurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateProductDefaultPriceDataRecurringInterval { - Day, - Month, - Week, - Year, -} - -impl CreateProductDefaultPriceDataRecurringInterval { - pub fn as_str(self) -> &'static str { - match self { - CreateProductDefaultPriceDataRecurringInterval::Day => "day", - CreateProductDefaultPriceDataRecurringInterval::Month => "month", - CreateProductDefaultPriceDataRecurringInterval::Week => "week", - CreateProductDefaultPriceDataRecurringInterval::Year => "year", - } - } -} - -impl AsRef for CreateProductDefaultPriceDataRecurringInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateProductDefaultPriceDataRecurringInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateProductDefaultPriceDataRecurringInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `CreateProductDefaultPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateProductDefaultPriceDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreateProductDefaultPriceDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateProductDefaultPriceDataTaxBehavior::Exclusive => "exclusive", - CreateProductDefaultPriceDataTaxBehavior::Inclusive => "inclusive", - CreateProductDefaultPriceDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for CreateProductDefaultPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateProductDefaultPriceDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateProductDefaultPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `Product`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ProductType { - Good, - Service, -} - -impl ProductType { - pub fn as_str(self) -> &'static str { - match self { - ProductType::Good => "good", - ProductType::Service => "service", - } - } -} - -impl AsRef for ProductType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ProductType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ProductType { - fn default() -> Self { - Self::Good - } -} diff --git a/src/resources/generated/promotion_code.rs b/src/resources/generated/promotion_code.rs deleted file mode 100644 index c6b3b5b5f..000000000 --- a/src/resources/generated/promotion_code.rs +++ /dev/null @@ -1,247 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CouponId, CustomerId, PromotionCodeId}; -use crate::params::{ - CurrencyMap, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp, -}; -use crate::resources::{Coupon, Currency, Customer}; - -/// The resource representing a Stripe "PromotionCode". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PromotionCode { - /// Unique identifier for the object. - pub id: PromotionCodeId, - - /// Whether the promotion code is currently active. - /// - /// A promotion code is only active if the coupon is also valid. - pub active: bool, - - /// The customer-facing code. - /// - /// Regardless of case, this code must be unique across all active promotion codes for each customer. - pub code: String, - - pub coupon: Coupon, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The customer that this promotion code can be used by. - pub customer: Option>, - - /// Date at which the promotion code can no longer be redeemed. - pub expires_at: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Maximum number of times this promotion code can be redeemed. - pub max_redemptions: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - pub restrictions: PromotionCodesResourceRestrictions, - - /// Number of times this promotion code has been used. - pub times_redeemed: i64, -} - -impl PromotionCode { - /// Returns a list of your promotion codes. - pub fn list(client: &Client, params: &ListPromotionCodes<'_>) -> Response> { - client.get_query("/promotion_codes", ¶ms) - } - - /// Retrieves the promotion code with the given ID. - /// - /// In order to retrieve a promotion code by the customer-facing `code` use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired `code`. - pub fn retrieve( - client: &Client, - id: &PromotionCodeId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/promotion_codes/{}", id), &Expand { expand }) - } - - /// Updates the specified promotion code by setting the values of the parameters passed. - /// - /// Most fields are, by design, not editable. - pub fn update( - client: &Client, - id: &PromotionCodeId, - params: UpdatePromotionCode<'_>, - ) -> Response { - client.post_form(&format!("/promotion_codes/{}", id), ¶ms) - } -} - -impl Object for PromotionCode { - type Id = PromotionCodeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "promotion_code" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PromotionCodesResourceRestrictions { - /// Promotion code restrictions defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, - - /// A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices. - pub first_time_transaction: bool, - - /// Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). - pub minimum_amount: Option, - - /// Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount. - pub minimum_amount_currency: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PromotionCodeCurrencyOption { - /// Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). - pub minimum_amount: i64, -} - -/// The parameters for `PromotionCode::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPromotionCodes<'a> { - /// Filter promotion codes by whether they are active. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Only return promotion codes that have this case-insensitive code. - #[serde(skip_serializing_if = "Option::is_none")] - pub code: Option<&'a str>, - - /// Only return promotion codes for this coupon. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return promotion codes that are restricted to this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListPromotionCodes<'a> { - pub fn new() -> Self { - ListPromotionCodes { - active: Default::default(), - code: Default::default(), - coupon: Default::default(), - created: Default::default(), - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListPromotionCodes<'_> { - type O = PromotionCode; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `PromotionCode::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePromotionCode<'a> { - /// Whether the promotion code is currently active. - /// - /// A promotion code can only be reactivated when the coupon is still valid and the promotion code is otherwise redeemable. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Settings that restrict the redemption of the promotion code. - #[serde(skip_serializing_if = "Option::is_none")] - pub restrictions: Option, -} - -impl<'a> UpdatePromotionCode<'a> { - pub fn new() -> Self { - UpdatePromotionCode { - active: Default::default(), - expand: Default::default(), - metadata: Default::default(), - restrictions: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePromotionCodeRestrictions { - /// Promotion codes defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePromotionCodeRestrictionsCurrencyOptions { - /// Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum_amount: Option, -} diff --git a/src/resources/generated/quote.rs b/src/resources/generated/quote.rs deleted file mode 100644 index 071a6f02b..000000000 --- a/src/resources/generated/quote.rs +++ /dev/null @@ -1,500 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, QuoteId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, Timestamp}; -use crate::resources::{ - Account, Application, CheckoutSessionItem, Currency, Customer, Discount, Invoice, - QuotesResourceTotalDetails, Subscription, SubscriptionSchedule, TaxRate, TestHelpersTestClock, -}; - -/// The resource representing a Stripe "Quote". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Quote { - /// Unique identifier for the object. - pub id: QuoteId, - - /// Total before any discounts or taxes are applied. - pub amount_subtotal: i64, - - /// Total after discounts and taxes are applied. - pub amount_total: i64, - - /// ID of the Connect Application that created the quote. - pub application: Option>, - - /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - /// - /// Only applicable if there are no line items with recurring prices on the quote. - pub application_fee_amount: Option, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - /// Only applicable if there are line items with recurring prices on the quote. - pub application_fee_percent: Option, - - pub automatic_tax: QuotesResourceAutomaticTax, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - /// Defaults to `charge_automatically`. - pub collection_method: QuoteCollectionMethod, - - pub computed: QuotesResourceComputed, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Option, - - /// The customer which this quote belongs to. - /// - /// A customer is required before finalizing the quote. - /// Once specified, it cannot be changed. - pub customer: Option>, - - /// The tax rates applied to this quote. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>>, - - /// A description that will be displayed on the quote PDF. - pub description: Option, - - /// The discounts applied to this quote. - pub discounts: Vec>, - - /// The date on which the quote will be canceled if in `open` or `draft` status. - /// - /// Measured in seconds since the Unix epoch. - pub expires_at: Timestamp, - - /// A footer that will be displayed on the quote PDF. - pub footer: Option, - - /// Details of the quote that was cloned. - /// - /// See the [cloning documentation](https://stripe.com/docs/quotes/clone) for more details. - pub from_quote: Option, - - /// A header that will be displayed on the quote PDF. - pub header: Option, - - /// The invoice that was created from this quote. - pub invoice: Option>, - - /// All invoices will be billed using the specified settings. - pub invoice_settings: Option, - - /// A list of items the customer is being quoted for. - #[serde(default)] - pub line_items: List, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// A unique number that identifies this particular quote. - /// - /// This number is assigned once the quote is [finalized](https://stripe.com/docs/quotes/overview#finalize). - pub number: Option, - - /// The account on behalf of which to charge. - /// - /// See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. - pub on_behalf_of: Option>, - - /// The status of the quote. - pub status: QuoteStatus, - - pub status_transitions: QuotesResourceStatusTransitions, - - /// The subscription that was created or updated from this quote. - pub subscription: Option>, - - pub subscription_data: QuotesResourceSubscriptionDataSubscriptionData, - - /// The subscription schedule that was created or updated from this quote. - pub subscription_schedule: Option>, - - /// ID of the test clock this quote belongs to. - pub test_clock: Option>, - - pub total_details: QuotesResourceTotalDetails, - - /// The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices. - pub transfer_data: Option, -} - -impl Quote { - /// Returns a list of your quotes. - pub fn list(client: &Client, params: &ListQuotes<'_>) -> Response> { - client.get_query("/quotes", ¶ms) - } - - /// Retrieves the quote with the given ID. - pub fn retrieve(client: &Client, id: &QuoteId, expand: &[&str]) -> Response { - client.get_query(&format!("/quotes/{}", id), &Expand { expand }) - } -} - -impl Object for Quote { - type Id = QuoteId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "quote" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceSettingQuoteSetting { - /// Number of days within which a customer must pay invoices generated by this quote. - /// - /// This value will be `null` for quotes where `collection_method=charge_automatically`. - pub days_until_due: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceAutomaticTax { - /// Automatically calculate taxes. - pub enabled: bool, - - /// The status of the most recent automated tax calculation for this quote. - pub status: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceComputed { - /// The definitive totals and line items the customer will be charged on a recurring basis. - /// - /// Takes into account the line items with recurring prices and discounts with `duration=forever` coupons only. - /// Defaults to `null` if no inputted line items with recurring prices. - pub recurring: Option, - - pub upfront: QuotesResourceUpfront, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceFromQuote { - /// Whether this quote is a revision of a different quote. - pub is_revision: bool, - - /// The quote that was cloned. - pub quote: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceRecurring { - /// Total before any discounts or taxes are applied. - pub amount_subtotal: i64, - - /// Total after discounts and taxes are applied. - pub amount_total: i64, - - /// The frequency at which a subscription is billed. - /// - /// One of `day`, `week`, `month` or `year`. - pub interval: QuotesResourceRecurringInterval, - - /// The number of intervals (specified in the `interval` attribute) between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - pub interval_count: u64, - - pub total_details: QuotesResourceTotalDetails, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceStatusTransitions { - /// The time that the quote was accepted. - /// - /// Measured in seconds since Unix epoch. - pub accepted_at: Option, - - /// The time that the quote was canceled. - /// - /// Measured in seconds since Unix epoch. - pub canceled_at: Option, - - /// The time that the quote was finalized. - /// - /// Measured in seconds since Unix epoch. - pub finalized_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceSubscriptionDataSubscriptionData { - /// The subscription's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription. - pub description: Option, - - /// When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. - /// - /// This date is ignored if it is in the past when the quote is accepted. - /// Measured in seconds since the Unix epoch. - pub effective_date: Option, - - /// Integer representing the number of trial period days before the customer is charged for the first time. - pub trial_period_days: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceTransferData { - /// The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. - /// - /// By default, the entire amount is transferred to the destination. - pub amount: Option, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. - /// By default, the entire amount will be transferred to the destination. - pub amount_percent: Option, - - /// The account where funds from the payment will be transferred to upon payment success. - pub destination: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceUpfront { - /// Total before any discounts or taxes are applied. - pub amount_subtotal: i64, - - /// Total after discounts and taxes are applied. - pub amount_total: i64, - - /// The line items that will appear on the next invoice after this quote is accepted. - /// - /// This does not include pending invoice items that exist on the customer but may still be included in the next invoice. - #[serde(default)] - pub line_items: List, - - pub total_details: QuotesResourceTotalDetails, -} - -/// The parameters for `Quote::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListQuotes<'a> { - /// The ID of the customer whose quotes will be retrieved. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// The status of the quote. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, - - /// Provides a list of quotes that are associated with the specified test clock. - /// - /// The response will not include quotes with test clocks if this and the customer parameter is not set. - #[serde(skip_serializing_if = "Option::is_none")] - pub test_clock: Option<&'a str>, -} - -impl<'a> ListQuotes<'a> { - pub fn new() -> Self { - ListQuotes { - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - status: Default::default(), - test_clock: Default::default(), - } - } -} -impl Paginable for ListQuotes<'_> { - type O = Quote; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// An enum representing the possible values of an `Quote`'s `collection_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum QuoteCollectionMethod { - ChargeAutomatically, - SendInvoice, -} - -impl QuoteCollectionMethod { - pub fn as_str(self) -> &'static str { - match self { - QuoteCollectionMethod::ChargeAutomatically => "charge_automatically", - QuoteCollectionMethod::SendInvoice => "send_invoice", - } - } -} - -impl AsRef for QuoteCollectionMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for QuoteCollectionMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for QuoteCollectionMethod { - fn default() -> Self { - Self::ChargeAutomatically - } -} - -/// An enum representing the possible values of an `Quote`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum QuoteStatus { - Accepted, - Canceled, - Draft, - Open, -} - -impl QuoteStatus { - pub fn as_str(self) -> &'static str { - match self { - QuoteStatus::Accepted => "accepted", - QuoteStatus::Canceled => "canceled", - QuoteStatus::Draft => "draft", - QuoteStatus::Open => "open", - } - } -} - -impl AsRef for QuoteStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for QuoteStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for QuoteStatus { - fn default() -> Self { - Self::Accepted - } -} - -/// An enum representing the possible values of an `QuotesResourceAutomaticTax`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum QuotesResourceAutomaticTaxStatus { - Complete, - Failed, - RequiresLocationInputs, -} - -impl QuotesResourceAutomaticTaxStatus { - pub fn as_str(self) -> &'static str { - match self { - QuotesResourceAutomaticTaxStatus::Complete => "complete", - QuotesResourceAutomaticTaxStatus::Failed => "failed", - QuotesResourceAutomaticTaxStatus::RequiresLocationInputs => "requires_location_inputs", - } - } -} - -impl AsRef for QuotesResourceAutomaticTaxStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for QuotesResourceAutomaticTaxStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for QuotesResourceAutomaticTaxStatus { - fn default() -> Self { - Self::Complete - } -} - -/// An enum representing the possible values of an `QuotesResourceRecurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum QuotesResourceRecurringInterval { - Day, - Month, - Week, - Year, -} - -impl QuotesResourceRecurringInterval { - pub fn as_str(self) -> &'static str { - match self { - QuotesResourceRecurringInterval::Day => "day", - QuotesResourceRecurringInterval::Month => "month", - QuotesResourceRecurringInterval::Week => "week", - QuotesResourceRecurringInterval::Year => "year", - } - } -} - -impl AsRef for QuotesResourceRecurringInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for QuotesResourceRecurringInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for QuotesResourceRecurringInterval { - fn default() -> Self { - Self::Day - } -} diff --git a/src/resources/generated/quotes_resource_total_details.rs b/src/resources/generated/quotes_resource_total_details.rs deleted file mode 100644 index 94bf3821b..000000000 --- a/src/resources/generated/quotes_resource_total_details.rs +++ /dev/null @@ -1,116 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::resources::{Discount, TaxRate}; - -/// The resource representing a Stripe "QuotesResourceTotalDetails". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceTotalDetails { - /// This is the sum of all the discounts. - pub amount_discount: i64, - - /// This is the sum of all the shipping amounts. - pub amount_shipping: Option, - - /// This is the sum of all the tax amounts. - pub amount_tax: i64, - - #[serde(skip_serializing_if = "Option::is_none")] - pub breakdown: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceTotalDetailsResourceBreakdown { - /// The aggregated discounts. - pub discounts: Vec, - - /// The aggregated tax amounts by rate. - pub taxes: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LineItemsDiscountAmount { - /// The amount discounted. - pub amount: i64, - - pub discount: Discount, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LineItemsTaxAmount { - /// Amount of tax applied for this rate. - pub amount: i64, - - pub rate: TaxRate, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: Option, - - /// The amount on which tax is calculated, in cents (or local equivalent). - pub taxable_amount: Option, -} - -/// An enum representing the possible values of an `LineItemsTaxAmount`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum LineItemsTaxAmountTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl LineItemsTaxAmountTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - LineItemsTaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - LineItemsTaxAmountTaxabilityReason::NotCollecting => "not_collecting", - LineItemsTaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - LineItemsTaxAmountTaxabilityReason::NotSupported => "not_supported", - LineItemsTaxAmountTaxabilityReason::PortionProductExempt => "portion_product_exempt", - LineItemsTaxAmountTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - LineItemsTaxAmountTaxabilityReason::PortionStandardRated => "portion_standard_rated", - LineItemsTaxAmountTaxabilityReason::ProductExempt => "product_exempt", - LineItemsTaxAmountTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - LineItemsTaxAmountTaxabilityReason::ProportionallyRated => "proportionally_rated", - LineItemsTaxAmountTaxabilityReason::ReducedRated => "reduced_rated", - LineItemsTaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", - LineItemsTaxAmountTaxabilityReason::StandardRated => "standard_rated", - LineItemsTaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - LineItemsTaxAmountTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for LineItemsTaxAmountTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for LineItemsTaxAmountTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for LineItemsTaxAmountTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} diff --git a/src/resources/generated/radar_early_fraud_warning.rs b/src/resources/generated/radar_early_fraud_warning.rs deleted file mode 100644 index 2818d0c4d..000000000 --- a/src/resources/generated/radar_early_fraud_warning.rs +++ /dev/null @@ -1,50 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{RadarEarlyFraudWarningId}; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::{Charge, PaymentIntent}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "RadarEarlyFraudWarning". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RadarEarlyFraudWarning { - /// Unique identifier for the object. - pub id: RadarEarlyFraudWarningId, - - /// An EFW is actionable if it has not received a dispute and has not been fully refunded. - /// - /// You may wish to proactively refund a charge that receives an EFW, in order to avoid receiving a dispute later. - pub actionable: bool, - - /// ID of the charge this early fraud warning is for, optionally expanded. - pub charge: Expandable, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The type of fraud labelled by the issuer. - /// - /// One of `card_never_received`, `fraudulent_card_application`, `made_with_counterfeit_card`, `made_with_lost_card`, `made_with_stolen_card`, `misc`, `unauthorized_use_of_card`. - pub fraud_type: String, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// ID of the Payment Intent this early fraud warning is for, optionally expanded. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option>, -} - -impl Object for RadarEarlyFraudWarning { - type Id = RadarEarlyFraudWarningId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "radar.early_fraud_warning" - } -} diff --git a/src/resources/generated/radar_radar_options.rs b/src/resources/generated/radar_radar_options.rs deleted file mode 100644 index fe16e861e..000000000 --- a/src/resources/generated/radar_radar_options.rs +++ /dev/null @@ -1,13 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "RadarRadarOptions". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RadarRadarOptions { - /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub session: Option, -} diff --git a/src/resources/generated/radar_value_list.rs b/src/resources/generated/radar_value_list.rs deleted file mode 100644 index c8e8f6d03..000000000 --- a/src/resources/generated/radar_value_list.rs +++ /dev/null @@ -1,119 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{RadarValueListId}; -use crate::params::{List, Metadata, Object, Timestamp}; -use crate::resources::{RadarValueListItem}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "RadarListList". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RadarValueList { - /// Unique identifier for the object. - pub id: RadarValueListId, - - /// The name of the value list for use in rules. - #[serde(skip_serializing_if = "Option::is_none")] - pub alias: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// The name or email address of the user who created this value list. - #[serde(skip_serializing_if = "Option::is_none")] - pub created_by: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// The type of items in the value list. - /// - /// One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. - #[serde(skip_serializing_if = "Option::is_none")] - pub item_type: Option, - - /// List of items contained within this value list. - #[serde(default)] - pub list_items: List, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The name of the value list. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl Object for RadarValueList { - type Id = RadarValueListId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "radar.value_list" - } -} - -/// An enum representing the possible values of an `RadarValueList`'s `item_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum RadarValueListItemType { - CardBin, - CardFingerprint, - CaseSensitiveString, - Country, - CustomerId, - Email, - IpAddress, - SepaDebitFingerprint, - String, - UsBankAccountFingerprint, -} - -impl RadarValueListItemType { - pub fn as_str(self) -> &'static str { - match self { - RadarValueListItemType::CardBin => "card_bin", - RadarValueListItemType::CardFingerprint => "card_fingerprint", - RadarValueListItemType::CaseSensitiveString => "case_sensitive_string", - RadarValueListItemType::Country => "country", - RadarValueListItemType::CustomerId => "customer_id", - RadarValueListItemType::Email => "email", - RadarValueListItemType::IpAddress => "ip_address", - RadarValueListItemType::SepaDebitFingerprint => "sepa_debit_fingerprint", - RadarValueListItemType::String => "string", - RadarValueListItemType::UsBankAccountFingerprint => "us_bank_account_fingerprint", - } - } -} - -impl AsRef for RadarValueListItemType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for RadarValueListItemType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for RadarValueListItemType { - fn default() -> Self { - Self::CardBin - } -} diff --git a/src/resources/generated/radar_value_list_item.rs b/src/resources/generated/radar_value_list_item.rs deleted file mode 100644 index 20fb78df1..000000000 --- a/src/resources/generated/radar_value_list_item.rs +++ /dev/null @@ -1,52 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{RadarValueListItemId}; -use crate::params::{Object, Timestamp}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "RadarListListItem". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RadarValueListItem { - /// Unique identifier for the object. - pub id: RadarValueListItemId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// The name or email address of the user who added this item to the value list. - #[serde(skip_serializing_if = "Option::is_none")] - pub created_by: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// The value of the item. - #[serde(skip_serializing_if = "Option::is_none")] - pub value: Option, - - /// The identifier of the value list this item belongs to. - #[serde(skip_serializing_if = "Option::is_none")] - pub value_list: Option, -} - -impl Object for RadarValueListItem { - type Id = RadarValueListItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "radar.value_list_item" - } -} diff --git a/src/resources/generated/refund.rs b/src/resources/generated/refund.rs deleted file mode 100644 index f58537cef..000000000 --- a/src/resources/generated/refund.rs +++ /dev/null @@ -1,416 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ChargeId, CustomerId, PaymentIntentId, RefundId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{BalanceTransaction, Charge, Currency, PaymentIntent, TransferReversal}; - -/// The resource representing a Stripe "Refund". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Refund { - /// Unique identifier for the object. - pub id: RefundId, - - /// Amount, in cents (or local equivalent). - pub amount: i64, - - /// Balance transaction that describes the impact on your account balance. - pub balance_transaction: Option>, - - /// ID of the charge that was refunded. - pub charge: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - /// (Available on non-card refunds only). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// If the refund failed, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub failure_balance_transaction: Option>, - - /// If the refund failed, the reason for refund failure if known. - /// - /// Possible values are `lost_or_stolen_card`, `expired_or_canceled_card`, `charge_for_pending_refund_disputed`, `insufficient_funds`, `declined`, `merchant_request` or `unknown`. - #[serde(skip_serializing_if = "Option::is_none")] - pub failure_reason: Option, - - /// For payment methods without native refund support (e.g., Konbini, PromptPay), email for the customer to receive refund instructions. - #[serde(skip_serializing_if = "Option::is_none")] - pub instructions_email: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub next_action: Option, - - /// ID of the PaymentIntent that was refunded. - pub payment_intent: Option>, - - /// Reason for the refund, either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`). - pub reason: Option, - - /// This is the transaction number that appears on email receipts sent for this refund. - pub receipt_number: Option, - - /// The transfer reversal that is associated with the refund. - /// - /// Only present if the charge came from another Stripe account. - /// See the Connect documentation for details. - pub source_transfer_reversal: Option>, - - /// Status of the refund. - /// - /// For credit card refunds, this can be `pending`, `succeeded`, or `failed`. - /// For other types of refunds, it can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. - /// Refer to our [refunds](https://stripe.com/docs/refunds#failed-refunds) documentation for more details. - pub status: Option, - - /// If the accompanying transfer was reversed, the transfer reversal object. - /// - /// Only applicable if the charge was created using the destination parameter. - pub transfer_reversal: Option>, -} - -impl Refund { - /// Returns a list of all refunds you’ve previously created. - /// - /// The refunds are returned in sorted order, with the most recent refunds appearing first. - /// For convenience, the 10 most recent refunds are always available by default on the charge object. - pub fn list(client: &Client, params: &ListRefunds<'_>) -> Response> { - client.get_query("/refunds", ¶ms) - } - - /// Create a refund. - pub fn create(client: &Client, params: CreateRefund<'_>) -> Response { - client.post_form("/refunds", ¶ms) - } - - /// Retrieves the details of an existing refund. - pub fn retrieve(client: &Client, id: &RefundId, expand: &[&str]) -> Response { - client.get_query(&format!("/refunds/{}", id), &Expand { expand }) - } - - /// Updates the specified refund by setting the values of the parameters passed. - /// - /// Any parameters not provided will be left unchanged. This request only accepts `metadata` as an argument. - pub fn update(client: &Client, id: &RefundId, params: UpdateRefund<'_>) -> Response { - client.post_form(&format!("/refunds/{}", id), ¶ms) - } -} - -impl Object for Refund { - type Id = RefundId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "refund" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RefundNextAction { - /// Contains the refund details. - pub display_details: Option, - - /// Type of the next action to perform. - #[serde(rename = "type")] - pub type_: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RefundNextActionDisplayDetails { - pub email_sent: EmailSent, - - /// The expiry timestamp. - pub expires_at: Timestamp, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct EmailSent { - /// The timestamp when the email was sent. - pub email_sent_at: Timestamp, - - /// The recipient's email address. - pub email_sent_to: String, -} - -/// The parameters for `Refund::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateRefund<'a> { - /// A positive integer representing how much to refund. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub charge: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Customer whose customer balance to refund from. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// For payment methods without native refund support (e.g., Konbini, PromptPay), use this email from the customer to receive refund instructions. - #[serde(skip_serializing_if = "Option::is_none")] - pub instructions_email: Option<&'a str>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Origin of the refund. - #[serde(skip_serializing_if = "Option::is_none")] - pub origin: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub reason: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_application_fee: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub reverse_transfer: Option, -} - -impl<'a> CreateRefund<'a> { - pub fn new() -> Self { - CreateRefund { - amount: Default::default(), - charge: Default::default(), - currency: Default::default(), - customer: Default::default(), - expand: Default::default(), - instructions_email: Default::default(), - metadata: Default::default(), - origin: Default::default(), - payment_intent: Default::default(), - reason: Default::default(), - refund_application_fee: Default::default(), - reverse_transfer: Default::default(), - } - } -} - -/// The parameters for `Refund::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListRefunds<'a> { - /// Only return refunds for the charge specified by this charge ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub charge: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return refunds for the PaymentIntent specified by this ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListRefunds<'a> { - pub fn new() -> Self { - ListRefunds { - charge: Default::default(), - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - payment_intent: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListRefunds<'_> { - type O = Refund; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Refund::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateRefund<'a> { - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl<'a> UpdateRefund<'a> { - pub fn new() -> Self { - UpdateRefund { expand: Default::default(), metadata: Default::default() } - } -} - -/// An enum representing the possible values of an `CreateRefund`'s `origin` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum RefundOrigin { - CustomerBalance, -} - -impl RefundOrigin { - pub fn as_str(self) -> &'static str { - match self { - RefundOrigin::CustomerBalance => "customer_balance", - } - } -} - -impl AsRef for RefundOrigin { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for RefundOrigin { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for RefundOrigin { - fn default() -> Self { - Self::CustomerBalance - } -} - -/// An enum representing the possible values of an `Refund`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum RefundReason { - Duplicate, - ExpiredUncapturedCharge, - Fraudulent, - RequestedByCustomer, -} - -impl RefundReason { - pub fn as_str(self) -> &'static str { - match self { - RefundReason::Duplicate => "duplicate", - RefundReason::ExpiredUncapturedCharge => "expired_uncaptured_charge", - RefundReason::Fraudulent => "fraudulent", - RefundReason::RequestedByCustomer => "requested_by_customer", - } - } -} - -impl AsRef for RefundReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for RefundReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for RefundReason { - fn default() -> Self { - Self::Duplicate - } -} - -/// An enum representing the possible values of an `CreateRefund`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum RefundReasonFilter { - Duplicate, - Fraudulent, - RequestedByCustomer, -} - -impl RefundReasonFilter { - pub fn as_str(self) -> &'static str { - match self { - RefundReasonFilter::Duplicate => "duplicate", - RefundReasonFilter::Fraudulent => "fraudulent", - RefundReasonFilter::RequestedByCustomer => "requested_by_customer", - } - } -} - -impl AsRef for RefundReasonFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for RefundReasonFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for RefundReasonFilter { - fn default() -> Self { - Self::Duplicate - } -} diff --git a/src/resources/generated/reporting_report_run.rs b/src/resources/generated/reporting_report_run.rs deleted file mode 100644 index 12c42f6f2..000000000 --- a/src/resources/generated/reporting_report_run.rs +++ /dev/null @@ -1,103 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{ReportingReportRunId}; -use crate::params::{Object, Timestamp}; -use crate::resources::{Currency, File}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "reporting_report_run". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ReportingReportRun { - /// Unique identifier for the object. - pub id: ReportingReportRunId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// If something should go wrong during the run, a message about the failure (populated when - /// `status=failed`). - pub error: Option, - - /// `true` if the report is run on live mode data and `false` if it is run on test mode data. - pub livemode: bool, - - pub parameters: FinancialReportingFinanceReportRunRunParameters, - - /// The ID of the [report type](https://stripe.com/docs/reports/report-types) to run, such as `"balance.summary.1"`. - pub report_type: String, - - /// The file object representing the result of the report run (populated when - /// `status=succeeded`). - pub result: Option, - - /// Status of this report run. - /// - /// This will be `pending` when the run is initially created. When the run finishes, this will be set to `succeeded` and the `result` field will be populated. Rarely, we may encounter an error, at which point this will be set to `failed` and the `error` field will be populated. - pub status: String, - - /// Timestamp at which this run successfully finished (populated when - /// `status=succeeded`). - /// - /// Measured in seconds since the Unix epoch. - pub succeeded_at: Option, -} - -impl Object for ReportingReportRun { - type Id = ReportingReportRunId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "reporting.report_run" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FinancialReportingFinanceReportRunRunParameters { - - /// The set of output columns requested for inclusion in the report run. - #[serde(skip_serializing_if = "Option::is_none")] - pub columns: Option>, - - /// Connected account ID by which to filter the report run. - #[serde(skip_serializing_if = "Option::is_none")] - pub connected_account: Option, - - /// Currency of objects to be included in the report run. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Ending timestamp of data to be included in the report run. - /// - /// Can be any UTC timestamp between 1 second after the user specified `interval_start` and 1 second before this report's last `data_available_end` value. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_end: Option, - - /// Starting timestamp of data to be included in the report run. - /// - /// Can be any UTC timestamp between 1 second after this report's `data_available_start` and 1 second before the user specified `interval_end` value. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_start: Option, - - /// Payout ID by which to filter the report run. - #[serde(skip_serializing_if = "Option::is_none")] - pub payout: Option, - - /// Category of balance transactions to be included in the report run. - #[serde(skip_serializing_if = "Option::is_none")] - pub reporting_category: Option, - - /// Defaults to `Etc/UTC`. - /// - /// The output timezone for all timestamps in the report. - /// A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). - /// Has no effect on `interval_start` or `interval_end`. - #[serde(skip_serializing_if = "Option::is_none")] - pub timezone: Option, -} diff --git a/src/resources/generated/reporting_report_type.rs b/src/resources/generated/reporting_report_type.rs deleted file mode 100644 index 779b48891..000000000 --- a/src/resources/generated/reporting_report_type.rs +++ /dev/null @@ -1,57 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{ReportingReportTypeId}; -use crate::params::{Object, Timestamp}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "reporting_report_type". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ReportingReportType { - /// The [ID of the Report Type](https://stripe.com/docs/reporting/statements/api#available-report-types), such as `balance.summary.1`. - pub id: ReportingReportTypeId, - - /// Most recent time for which this Report Type is available. - /// - /// Measured in seconds since the Unix epoch. - pub data_available_end: Timestamp, - - /// Earliest time for which this Report Type is available. - /// - /// Measured in seconds since the Unix epoch. - pub data_available_start: Timestamp, - - /// List of column names that are included by default when this Report Type gets run. - /// - /// (If the Report Type doesn't support the `columns` parameter, this will be null.). - pub default_columns: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Human-readable name of the Report Type. - pub name: String, - - /// When this Report Type was latest updated. - /// - /// Measured in seconds since the Unix epoch. - pub updated: Timestamp, - - /// Version of the Report Type. - /// - /// Different versions report with the same ID will have the same purpose, but may take different run parameters or have different result schemas. - pub version: i64, -} - -impl Object for ReportingReportType { - type Id = ReportingReportTypeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "reporting.report_type" - } -} diff --git a/src/resources/generated/reserve_transaction.rs b/src/resources/generated/reserve_transaction.rs deleted file mode 100644 index 6b7b7da93..000000000 --- a/src/resources/generated/reserve_transaction.rs +++ /dev/null @@ -1,38 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::ReserveTransactionId; -use crate::params::Object; -use crate::resources::Currency; - -/// The resource representing a Stripe "ReserveTransaction". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ReserveTransaction { - /// Unique identifier for the object. - pub id: ReserveTransactionId, - - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, -} - -impl Object for ReserveTransaction { - type Id = ReserveTransactionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "reserve_transaction" - } -} diff --git a/src/resources/generated/review.rs b/src/resources/generated/review.rs deleted file mode 100644 index 3cb8a20f3..000000000 --- a/src/resources/generated/review.rs +++ /dev/null @@ -1,245 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::ReviewId; -use crate::params::{Expand, Expandable, List, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{Charge, PaymentIntent, ReviewReason}; - -/// The resource representing a Stripe "RadarReview". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Review { - /// Unique identifier for the object. - pub id: ReviewId, - - /// The ZIP or postal code of the card used, if applicable. - pub billing_zip: Option, - - /// The charge associated with this review. - pub charge: Option>, - - /// The reason the review was closed, or null if it has not yet been closed. - /// - /// One of `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. - pub closed_reason: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The IP address where the payment originated. - pub ip_address: Option, - - /// Information related to the location of the payment. - /// - /// Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address. - pub ip_address_location: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// If `true`, the review needs action. - pub open: bool, - - /// The reason the review was opened. - /// - /// One of `rule` or `manual`. - pub opened_reason: ReviewOpenedReason, - - /// The PaymentIntent ID associated with this review, if one exists. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option>, - - /// The reason the review is currently open or closed. - /// - /// One of `rule`, `manual`, `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. - pub reason: ReviewReason, - - /// Information related to the browsing session of the user who initiated the payment. - pub session: Option, -} - -impl Review { - /// Returns a list of `Review` objects that have `open` set to `true`. - /// - /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. - pub fn list(client: &Client, params: &ListReviews<'_>) -> Response> { - client.get_query("/reviews", ¶ms) - } - - /// Retrieves a `Review` object. - pub fn retrieve(client: &Client, id: &ReviewId, expand: &[&str]) -> Response { - client.get_query(&format!("/reviews/{}", id), &Expand { expand }) - } -} - -impl Object for Review { - type Id = ReviewId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "review" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RadarReviewResourceLocation { - /// The city where the payment originated. - pub city: Option, - - /// Two-letter ISO code representing the country where the payment originated. - pub country: Option, - - /// The geographic latitude where the payment originated. - pub latitude: Option, - - /// The geographic longitude where the payment originated. - pub longitude: Option, - - /// The state/county/province/region where the payment originated. - pub region: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RadarReviewResourceSession { - /// The browser used in this browser session (e.g., `Chrome`). - pub browser: Option, - - /// Information about the device used for the browser session (e.g., `Samsung SM-G930T`). - pub device: Option, - - /// The platform for the browser session (e.g., `Macintosh`). - pub platform: Option, - - /// The version for the browser session (e.g., `61.0.3163.100`). - pub version: Option, -} - -/// The parameters for `Review::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListReviews<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListReviews<'a> { - pub fn new() -> Self { - ListReviews { - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListReviews<'_> { - type O = Review; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// An enum representing the possible values of an `Review`'s `closed_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ReviewClosedReason { - Approved, - Disputed, - Redacted, - Refunded, - RefundedAsFraud, -} - -impl ReviewClosedReason { - pub fn as_str(self) -> &'static str { - match self { - ReviewClosedReason::Approved => "approved", - ReviewClosedReason::Disputed => "disputed", - ReviewClosedReason::Redacted => "redacted", - ReviewClosedReason::Refunded => "refunded", - ReviewClosedReason::RefundedAsFraud => "refunded_as_fraud", - } - } -} - -impl AsRef for ReviewClosedReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ReviewClosedReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ReviewClosedReason { - fn default() -> Self { - Self::Approved - } -} - -/// An enum representing the possible values of an `Review`'s `opened_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ReviewOpenedReason { - Manual, - Rule, -} - -impl ReviewOpenedReason { - pub fn as_str(self) -> &'static str { - match self { - ReviewOpenedReason::Manual => "manual", - ReviewOpenedReason::Rule => "rule", - } - } -} - -impl AsRef for ReviewOpenedReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ReviewOpenedReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ReviewOpenedReason { - fn default() -> Self { - Self::Manual - } -} diff --git a/src/resources/generated/scheduled_query_run.rs b/src/resources/generated/scheduled_query_run.rs deleted file mode 100644 index 0391e91d6..000000000 --- a/src/resources/generated/scheduled_query_run.rs +++ /dev/null @@ -1,63 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::ScheduledQueryRunId; -use crate::params::{Object, Timestamp}; -use crate::resources::File; - -/// The resource representing a Stripe "ScheduledQueryRun". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ScheduledQueryRun { - /// Unique identifier for the object. - pub id: ScheduledQueryRunId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// When the query was run, Sigma contained a snapshot of your Stripe data at this time. - pub data_load_time: Timestamp, - - #[serde(skip_serializing_if = "Option::is_none")] - pub error: Option, - - /// The file object representing the results of the query. - pub file: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Time at which the result expires and is no longer available for download. - pub result_available_until: Timestamp, - - /// SQL for the query. - pub sql: String, - - /// The query's execution status, which will be `completed` for successful runs, and `canceled`, `failed`, or `timed_out` otherwise. - pub status: String, - - /// Title of the query. - pub title: String, -} - -impl Object for ScheduledQueryRun { - type Id = ScheduledQueryRunId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "scheduled_query_run" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SigmaScheduledQueryRunError { - /// Information about the run failure. - pub message: String, -} diff --git a/src/resources/generated/setup_attempt.rs b/src/resources/generated/setup_attempt.rs deleted file mode 100644 index a9b4ca38c..000000000 --- a/src/resources/generated/setup_attempt.rs +++ /dev/null @@ -1,867 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{SetupAttemptId, SetupIntentId}; -use crate::params::{Expand, Expandable, List, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{ - Account, ApiErrors, Application, Customer, Mandate, PaymentMethod, - PaymentMethodDetailsCardChecks, PaymentMethodDetailsCardWalletApplePay, - PaymentMethodDetailsCardWalletGooglePay, SetupIntent, -}; - -/// The resource representing a Stripe "PaymentFlowsSetupIntentSetupAttempt". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttempt { - /// Unique identifier for the object. - pub id: SetupAttemptId, - - /// The value of [application](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-application) on the SetupIntent at the time of this confirmation. - pub application: Option>, - - /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. - /// - /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. - /// - /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub attach_to_self: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The value of [customer](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-customer) on the SetupIntent at the time of this confirmation. - pub customer: Option>, - - /// Indicates the directions of money movement for which this payment method is intended to be used. - /// - /// Include `inbound` if you intend to use the payment method as the origin to pull funds from. - /// - /// Include `outbound` if you intend to use the payment method as the destination to send funds to. - /// You can include both if you intend to use the payment method for both purposes. - pub flow_directions: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The value of [on_behalf_of](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-on_behalf_of) on the SetupIntent at the time of this confirmation. - pub on_behalf_of: Option>, - - /// ID of the payment method used with this SetupAttempt. - pub payment_method: Expandable, - - pub payment_method_details: SetupAttemptPaymentMethodDetails, - - /// The error encountered during this attempt to confirm the SetupIntent, if any. - pub setup_error: Option>, - - /// ID of the SetupIntent that this attempt belongs to. - pub setup_intent: Expandable, - - /// Status of this SetupAttempt, one of `requires_confirmation`, `requires_action`, `processing`, `succeeded`, `failed`, or `abandoned`. - pub status: String, - - /// The value of [usage](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-usage) on the SetupIntent at the time of this confirmation, one of `off_session` or `on_session`. - pub usage: String, -} - -impl SetupAttempt { - /// Returns a list of SetupAttempts associated with a provided SetupIntent. - pub fn list(client: &Client, params: &ListSetupAttempts<'_>) -> Response> { - client.get_query("/setup_attempts", ¶ms) - } -} - -impl Object for SetupAttempt { - type Id = SetupAttemptId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "setup_attempt" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetails { - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card_present: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// The type of the payment method used in the SetupIntent (e.g., `card`). - /// - /// An additional hash is included on `payment_method_details` with a name matching this value. - /// It contains confirmation-specific information for the payment method. - #[serde(rename = "type")] - pub type_: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsAcssDebit {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsAuBecsDebit {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsBacsDebit {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsBancontact { - /// Bank code of bank associated with the bank account. - pub bank_code: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Bank Identifier Code of the bank associated with the bank account. - pub bic: Option, - - /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. - pub generated_sepa_debit: Option>, - - /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. - pub generated_sepa_debit_mandate: Option>, - - /// Last four characters of the IBAN. - pub iban_last4: Option, - - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - /// Can be one of `en`, `de`, `fr`, or `nl`. - pub preferred_language: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by Bancontact directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsBoleto {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsCard { - /// Card brand. - /// - /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub brand: Option, - - /// Check results by Card networks on Card address and CVC at the time of authorization. - pub checks: Option, - - /// Two-letter ISO code representing the country of the card. - /// - /// You could use this attribute to get a sense of the international breakdown of cards you've collected. - pub country: Option, - - /// A high-level description of the type of cards issued in this range. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Two-digit number representing the card's expiration month. - pub exp_month: Option, - - /// Four-digit number representing the card's expiration year. - pub exp_year: Option, - - /// Uniquely identifies this particular card number. - /// - /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - /// Card funding type. - /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - pub funding: Option, - - /// Issuer identification number of the card. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - /// The name of the card's issuing bank. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// The last four digits of the card. - pub last4: Option, - - /// Identifies which network this charge was processed on. - /// - /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub network: Option, - - /// Populated if this authorization used 3D Secure authentication. - pub three_d_secure: Option, - - /// If this Card is part of a card wallet, this contains the details of the card wallet. - pub wallet: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsCardPresent { - /// The ID of the Card PaymentMethod which was generated by this SetupAttempt. - pub generated_card: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsCardWallet { - #[serde(skip_serializing_if = "Option::is_none")] - pub apple_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub google_pay: Option, - - /// The type of the card wallet, one of `apple_pay`, `google_pay`, or `link`. - /// - /// An additional hash is included on the Wallet subhash with a name matching this value. - /// It contains additional information specific to the card wallet type. - #[serde(rename = "type")] - pub type_: SetupAttemptPaymentMethodDetailsCardWalletType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsCashapp {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsIdeal { - /// The customer's bank. - /// - /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. - pub bank: Option, - - /// The Bank Identifier Code of the customer's bank. - pub bic: Option, - - /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. - pub generated_sepa_debit: Option>, - - /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. - pub generated_sepa_debit_mandate: Option>, - - /// Last four characters of the IBAN. - pub iban_last4: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by iDEAL directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsKlarna {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsPaypal {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsSepaDebit {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsSofort { - /// Bank code of bank associated with the bank account. - pub bank_code: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Bank Identifier Code of the bank associated with the bank account. - pub bic: Option, - - /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. - pub generated_sepa_debit: Option>, - - /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. - pub generated_sepa_debit_mandate: Option>, - - /// Last four characters of the IBAN. - pub iban_last4: Option, - - /// Preferred language of the Sofort authorization page that the customer is redirected to. - /// Can be one of `en`, `de`, `fr`, or `nl`. - pub preferred_language: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by Sofort directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsUsBankAccount {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ThreeDSecureDetails { - /// For authenticated transactions: how the customer was authenticated by - /// the issuing bank. - pub authentication_flow: Option, - - /// Indicates the outcome of 3D Secure authentication. - pub result: Option, - - /// Additional information about why 3D Secure succeeded or failed based - /// on the `result`. - pub result_reason: Option, - - /// The version of 3D Secure that was used. - pub version: Option, -} - -/// The parameters for `SetupAttempt::list`. -#[derive(Clone, Debug, Serialize)] -pub struct ListSetupAttempts<'a> { - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return SetupAttempts created by the SetupIntent specified by - /// this ID. - pub setup_intent: SetupIntentId, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListSetupAttempts<'a> { - pub fn new(setup_intent: SetupIntentId) -> Self { - ListSetupAttempts { - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - setup_intent, - starting_after: Default::default(), - } - } -} -impl Paginable for ListSetupAttempts<'_> { - type O = SetupAttempt; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// An enum representing the possible values of an `SetupAttempt`'s `flow_directions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupAttemptFlowDirections { - Inbound, - Outbound, -} - -impl SetupAttemptFlowDirections { - pub fn as_str(self) -> &'static str { - match self { - SetupAttemptFlowDirections::Inbound => "inbound", - SetupAttemptFlowDirections::Outbound => "outbound", - } - } -} - -impl AsRef for SetupAttemptFlowDirections { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupAttemptFlowDirections { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupAttemptFlowDirections { - fn default() -> Self { - Self::Inbound - } -} - -/// An enum representing the possible values of an `SetupAttemptPaymentMethodDetailsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage::De => "de", - SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage::En => "en", - SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage::Fr => "fr", - SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `SetupAttemptPaymentMethodDetailsCardWallet`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupAttemptPaymentMethodDetailsCardWalletType { - ApplePay, - GooglePay, - Link, -} - -impl SetupAttemptPaymentMethodDetailsCardWalletType { - pub fn as_str(self) -> &'static str { - match self { - SetupAttemptPaymentMethodDetailsCardWalletType::ApplePay => "apple_pay", - SetupAttemptPaymentMethodDetailsCardWalletType::GooglePay => "google_pay", - SetupAttemptPaymentMethodDetailsCardWalletType::Link => "link", - } - } -} - -impl AsRef for SetupAttemptPaymentMethodDetailsCardWalletType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupAttemptPaymentMethodDetailsCardWalletType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupAttemptPaymentMethodDetailsCardWalletType { - fn default() -> Self { - Self::ApplePay - } -} - -/// An enum representing the possible values of an `SetupAttemptPaymentMethodDetailsIdeal`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupAttemptPaymentMethodDetailsIdealBank { - AbnAmro, - AsnBank, - Bunq, - Handelsbanken, - Ing, - Knab, - Moneyou, - N26, - Rabobank, - Regiobank, - Revolut, - SnsBank, - TriodosBank, - VanLanschot, - Yoursafe, -} - -impl SetupAttemptPaymentMethodDetailsIdealBank { - pub fn as_str(self) -> &'static str { - match self { - SetupAttemptPaymentMethodDetailsIdealBank::AbnAmro => "abn_amro", - SetupAttemptPaymentMethodDetailsIdealBank::AsnBank => "asn_bank", - SetupAttemptPaymentMethodDetailsIdealBank::Bunq => "bunq", - SetupAttemptPaymentMethodDetailsIdealBank::Handelsbanken => "handelsbanken", - SetupAttemptPaymentMethodDetailsIdealBank::Ing => "ing", - SetupAttemptPaymentMethodDetailsIdealBank::Knab => "knab", - SetupAttemptPaymentMethodDetailsIdealBank::Moneyou => "moneyou", - SetupAttemptPaymentMethodDetailsIdealBank::N26 => "n26", - SetupAttemptPaymentMethodDetailsIdealBank::Rabobank => "rabobank", - SetupAttemptPaymentMethodDetailsIdealBank::Regiobank => "regiobank", - SetupAttemptPaymentMethodDetailsIdealBank::Revolut => "revolut", - SetupAttemptPaymentMethodDetailsIdealBank::SnsBank => "sns_bank", - SetupAttemptPaymentMethodDetailsIdealBank::TriodosBank => "triodos_bank", - SetupAttemptPaymentMethodDetailsIdealBank::VanLanschot => "van_lanschot", - SetupAttemptPaymentMethodDetailsIdealBank::Yoursafe => "yoursafe", - } - } -} - -impl AsRef for SetupAttemptPaymentMethodDetailsIdealBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupAttemptPaymentMethodDetailsIdealBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupAttemptPaymentMethodDetailsIdealBank { - fn default() -> Self { - Self::AbnAmro - } -} - -/// An enum representing the possible values of an `SetupAttemptPaymentMethodDetailsIdeal`'s `bic` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupAttemptPaymentMethodDetailsIdealBic { - #[serde(rename = "ABNANL2A")] - Abnanl2a, - #[serde(rename = "ASNBNL21")] - Asnbnl21, - #[serde(rename = "BITSNL2A")] - Bitsnl2a, - #[serde(rename = "BUNQNL2A")] - Bunqnl2a, - #[serde(rename = "FVLBNL22")] - Fvlbnl22, - #[serde(rename = "HANDNL2A")] - Handnl2a, - #[serde(rename = "INGBNL2A")] - Ingbnl2a, - #[serde(rename = "KNABNL2H")] - Knabnl2h, - #[serde(rename = "MOYONL21")] - Moyonl21, - #[serde(rename = "NTSBDEB1")] - Ntsbdeb1, - #[serde(rename = "RABONL2U")] - Rabonl2u, - #[serde(rename = "RBRBNL21")] - Rbrbnl21, - #[serde(rename = "REVOIE23")] - Revoie23, - #[serde(rename = "REVOLT21")] - Revolt21, - #[serde(rename = "SNSBNL2A")] - Snsbnl2a, - #[serde(rename = "TRIONL2U")] - Trionl2u, -} - -impl SetupAttemptPaymentMethodDetailsIdealBic { - pub fn as_str(self) -> &'static str { - match self { - SetupAttemptPaymentMethodDetailsIdealBic::Abnanl2a => "ABNANL2A", - SetupAttemptPaymentMethodDetailsIdealBic::Asnbnl21 => "ASNBNL21", - SetupAttemptPaymentMethodDetailsIdealBic::Bitsnl2a => "BITSNL2A", - SetupAttemptPaymentMethodDetailsIdealBic::Bunqnl2a => "BUNQNL2A", - SetupAttemptPaymentMethodDetailsIdealBic::Fvlbnl22 => "FVLBNL22", - SetupAttemptPaymentMethodDetailsIdealBic::Handnl2a => "HANDNL2A", - SetupAttemptPaymentMethodDetailsIdealBic::Ingbnl2a => "INGBNL2A", - SetupAttemptPaymentMethodDetailsIdealBic::Knabnl2h => "KNABNL2H", - SetupAttemptPaymentMethodDetailsIdealBic::Moyonl21 => "MOYONL21", - SetupAttemptPaymentMethodDetailsIdealBic::Ntsbdeb1 => "NTSBDEB1", - SetupAttemptPaymentMethodDetailsIdealBic::Rabonl2u => "RABONL2U", - SetupAttemptPaymentMethodDetailsIdealBic::Rbrbnl21 => "RBRBNL21", - SetupAttemptPaymentMethodDetailsIdealBic::Revoie23 => "REVOIE23", - SetupAttemptPaymentMethodDetailsIdealBic::Revolt21 => "REVOLT21", - SetupAttemptPaymentMethodDetailsIdealBic::Snsbnl2a => "SNSBNL2A", - SetupAttemptPaymentMethodDetailsIdealBic::Trionl2u => "TRIONL2U", - } - } -} - -impl AsRef for SetupAttemptPaymentMethodDetailsIdealBic { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupAttemptPaymentMethodDetailsIdealBic { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupAttemptPaymentMethodDetailsIdealBic { - fn default() -> Self { - Self::Abnanl2a - } -} - -/// An enum representing the possible values of an `SetupAttemptPaymentMethodDetailsSofort`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - SetupAttemptPaymentMethodDetailsSofortPreferredLanguage::De => "de", - SetupAttemptPaymentMethodDetailsSofortPreferredLanguage::En => "en", - SetupAttemptPaymentMethodDetailsSofortPreferredLanguage::Fr => "fr", - SetupAttemptPaymentMethodDetailsSofortPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetails`'s `authentication_flow` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsAuthenticationFlow { - Challenge, - Frictionless, -} - -impl ThreeDSecureDetailsAuthenticationFlow { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsAuthenticationFlow::Challenge => "challenge", - ThreeDSecureDetailsAuthenticationFlow::Frictionless => "frictionless", - } - } -} - -impl AsRef for ThreeDSecureDetailsAuthenticationFlow { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsAuthenticationFlow { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsAuthenticationFlow { - fn default() -> Self { - Self::Challenge - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetails`'s `result` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsResult { - AttemptAcknowledged, - Authenticated, - Exempted, - Failed, - NotSupported, - ProcessingError, -} - -impl ThreeDSecureDetailsResult { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsResult::AttemptAcknowledged => "attempt_acknowledged", - ThreeDSecureDetailsResult::Authenticated => "authenticated", - ThreeDSecureDetailsResult::Exempted => "exempted", - ThreeDSecureDetailsResult::Failed => "failed", - ThreeDSecureDetailsResult::NotSupported => "not_supported", - ThreeDSecureDetailsResult::ProcessingError => "processing_error", - } - } -} - -impl AsRef for ThreeDSecureDetailsResult { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsResult { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsResult { - fn default() -> Self { - Self::AttemptAcknowledged - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetails`'s `result_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsResultReason { - Abandoned, - Bypassed, - Canceled, - CardNotEnrolled, - NetworkNotSupported, - ProtocolError, - Rejected, -} - -impl ThreeDSecureDetailsResultReason { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsResultReason::Abandoned => "abandoned", - ThreeDSecureDetailsResultReason::Bypassed => "bypassed", - ThreeDSecureDetailsResultReason::Canceled => "canceled", - ThreeDSecureDetailsResultReason::CardNotEnrolled => "card_not_enrolled", - ThreeDSecureDetailsResultReason::NetworkNotSupported => "network_not_supported", - ThreeDSecureDetailsResultReason::ProtocolError => "protocol_error", - ThreeDSecureDetailsResultReason::Rejected => "rejected", - } - } -} - -impl AsRef for ThreeDSecureDetailsResultReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsResultReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsResultReason { - fn default() -> Self { - Self::Abandoned - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetails`'s `version` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsVersion { - #[serde(rename = "1.0.2")] - V1_0_2, - #[serde(rename = "2.1.0")] - V2_1_0, - #[serde(rename = "2.2.0")] - V2_2_0, -} - -impl ThreeDSecureDetailsVersion { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsVersion::V1_0_2 => "1.0.2", - ThreeDSecureDetailsVersion::V2_1_0 => "2.1.0", - ThreeDSecureDetailsVersion::V2_2_0 => "2.2.0", - } - } -} - -impl AsRef for ThreeDSecureDetailsVersion { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsVersion { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsVersion { - fn default() -> Self { - Self::V1_0_2 - } -} diff --git a/src/resources/generated/setup_intent.rs b/src/resources/generated/setup_intent.rs deleted file mode 100644 index bcd2ec8be..000000000 --- a/src/resources/generated/setup_intent.rs +++ /dev/null @@ -1,4874 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, PaymentMethodConfigurationId, PaymentMethodId, SetupIntentId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{ - Account, ApiErrors, Application, Currency, Customer, LinkedAccountOptionsUsBankAccount, - Mandate, PaymentIntentNextActionCashappHandleRedirectOrDisplayQrCode, PaymentMethod, - PaymentMethodConfigBizPaymentMethodConfigurationDetails, SetupAttempt, -}; - -/// The resource representing a Stripe "SetupIntent". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntent { - /// Unique identifier for the object. - pub id: SetupIntentId, - - /// ID of the Connect application that created the SetupIntent. - pub application: Option>, - - /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. - /// - /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. - /// - /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub attach_to_self: Option, - - /// Settings for dynamic payment methods compatible with this Setup Intent. - pub automatic_payment_methods: Option, - - /// Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. - pub cancellation_reason: Option, - - /// The client secret of this SetupIntent. - /// - /// Used for client-side retrieval using a publishable key. The client secret can be used to complete payment setup from your frontend. - /// It should not be stored, logged, or exposed to anyone other than the customer. - /// Make sure that you have TLS enabled on any page that includes the client secret. - pub client_secret: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// ID of the Customer this SetupIntent belongs to, if one exists. - /// - /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup. - /// - /// Payment methods attached to other Customers cannot be used with this SetupIntent. - pub customer: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// Indicates the directions of money movement for which this payment method is intended to be used. - /// - /// Include `inbound` if you intend to use the payment method as the origin to pull funds from. - /// - /// Include `outbound` if you intend to use the payment method as the destination to send funds to. - /// You can include both if you intend to use the payment method for both purposes. - pub flow_directions: Option>, - - /// The error encountered in the previous SetupIntent confirmation. - pub last_setup_error: Option>, - - /// The most recent SetupAttempt for this SetupIntent. - pub latest_attempt: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// ID of the multi use Mandate generated by the SetupIntent. - pub mandate: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// If present, this property tells you what actions you need to take in order for your customer to continue payment setup. - pub next_action: Option, - - /// The account (if any) for which the setup is intended. - pub on_behalf_of: Option>, - - /// ID of the payment method used with this SetupIntent. - pub payment_method: Option>, - - /// Information about the payment method configuration used for this Setup Intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_configuration_details: - Option, - - /// Payment-method-specific configuration for this SetupIntent. - pub payment_method_options: Option, - - /// The list of payment method types (e.g. - /// - /// card) that this SetupIntent is allowed to set up. - pub payment_method_types: Vec, - - /// ID of the single_use Mandate generated by the SetupIntent. - pub single_use_mandate: Option>, - - /// [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. - pub status: SetupIntentStatus, - - /// Indicates how the payment method is intended to be used in the future. - /// - /// Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. - /// - /// Use `off_session` if your customer may or may not be in your checkout flow. - /// If not provided, this value defaults to `off_session`. - pub usage: String, -} - -impl SetupIntent { - /// Returns a list of SetupIntents. - pub fn list(client: &Client, params: &ListSetupIntents<'_>) -> Response> { - client.get_query("/setup_intents", ¶ms) - } - - /// Creates a SetupIntent object. - /// - /// After the SetupIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm) - /// to collect any required permissions to charge the payment method later. - pub fn create(client: &Client, params: CreateSetupIntent<'_>) -> Response { - client.post_form("/setup_intents", ¶ms) - } - - /// Retrieves the details of a SetupIntent that has previously been created. - /// - /// Client-side retrieval using a publishable key is allowed when the `client_secret` is provided in the query string. - /// When retrieved with a publishable key, only a subset of properties will be returned. - /// Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details. - pub fn retrieve(client: &Client, id: &SetupIntentId, expand: &[&str]) -> Response { - client.get_query(&format!("/setup_intents/{}", id), &Expand { expand }) - } - - /// Updates a SetupIntent object. - pub fn update( - client: &Client, - id: &SetupIntentId, - params: UpdateSetupIntent<'_>, - ) -> Response { - client.post_form(&format!("/setup_intents/{}", id), ¶ms) - } -} - -impl Object for SetupIntent { - type Id = SetupIntentId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "setup_intent" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsAutomaticPaymentMethodsSetupIntent { - /// Controls whether this SetupIntent will accept redirect-based payment methods. - /// - /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. - /// - /// To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. - #[serde(skip_serializing_if = "Option::is_none")] - pub allow_redirects: Option, - - /// Automatically calculates compatible payment methods. - pub enabled: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentNextAction { - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp_handle_redirect_or_display_qr_code: - Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect_to_url: Option, - - /// Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. - #[serde(rename = "type")] - pub type_: String, - - /// When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. - /// - /// The shape of the contents is subject to change and is only intended to be used by Stripe.js. - #[serde(skip_serializing_if = "Option::is_none")] - pub use_stripe_sdk: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub verify_with_microdeposits: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentNextActionRedirectToUrl { - /// If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. - pub return_url: Option, - - /// The URL you must redirect your customer to in order to authenticate. - pub url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentNextActionVerifyWithMicrodeposits { - /// The timestamp when the microdeposits are expected to land. - pub arrival_date: Timestamp, - - /// The URL for the hosted verification page, which allows customers to verify their bank account. - pub hosted_verification_url: String, - - /// The type of the microdeposit sent to the customer. - /// - /// Used to distinguish between different verification methods. - pub microdeposit_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptions { - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsAcssDebit { - /// Currency supported by the bank account. - pub currency: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsCard { - /// Configuration options for setting up an eMandate for cards issued in India. - pub mandate_options: Option, - - /// Selected network to process this SetupIntent on. - /// - /// Depends on the available networks of the card attached to the setup intent. - /// Can be only set confirm-time. - pub network: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Permitted values include: `automatic` or `any`. - /// If not provided, defaults to `automatic`. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - pub request_three_d_secure: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsCardMandateOptions { - /// Amount to be charged for future payments. - pub amount: i64, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - pub amount_type: SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - pub description: Option, - - /// End date of the mandate or subscription. - /// - /// If not provided, the mandate will be active until canceled. - /// If provided, end date should be after start date. - pub end_date: Option, - - /// Specifies payment frequency. - /// - /// One of `day`, `week`, `month`, `year`, or `sporadic`. - pub interval: SetupIntentPaymentMethodOptionsCardMandateOptionsInterval, - - /// The number of intervals between payments. - /// - /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - /// This parameter is optional when `interval=sporadic`. - pub interval_count: Option, - - /// Unique identifier for the mandate or subscription. - pub reference: String, - - /// Start date of the mandate or subscription. - /// - /// Start date should not be lesser than yesterday. - pub start_date: Timestamp, - - /// Specifies the type of mandates supported. - /// - /// Possible values are `india`. - pub supported_types: - Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsLink { - /// [Deprecated] This is a legacy parameter that no longer has any function. - pub persistent_token: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit { - /// A URL for custom mandate text. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_mandate_url: Option, - - /// List of Stripe products where this mandate can be selected automatically. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_for: Option>, - - /// Description of the interval. - /// - /// Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. - pub interval_description: Option, - - /// Payment schedule for the mandate. - pub payment_schedule: - Option, - - /// Transaction type of the mandate. - pub transaction_type: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsPaypal { - /// The PayPal Billing Agreement ID (BAID). - /// - /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer. - pub billing_agreement_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsSepaDebit { - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsMandateOptionsSepaDebit {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsUsBankAccount { - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option, -} - -/// The parameters for `SetupIntent::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateSetupIntent<'a> { - /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. - /// - /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. - /// - /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub attach_to_self: Option, - - /// When enabled, this SetupIntent will accept payment methods that you have enabled in the Dashboard and are compatible with this SetupIntent's other parameters. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_payment_methods: Option, - - /// Set to `true` to attempt to confirm this SetupIntent immediately. - /// - /// This parameter defaults to `false`. - /// If the payment method attached is a card, a return_url may be provided in case additional authentication is required. - #[serde(skip_serializing_if = "Option::is_none")] - pub confirm: Option, - - /// ID of the Customer this SetupIntent belongs to, if one exists. - /// - /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup. - /// - /// Payment methods attached to other Customers cannot be used with this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Indicates the directions of money movement for which this payment method is intended to be used. - /// - /// Include `inbound` if you intend to use the payment method as the origin to pull funds from. - /// - /// Include `outbound` if you intend to use the payment method as the destination to send funds to. - /// You can include both if you intend to use the payment method for both purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub flow_directions: Option>, - - /// This hash contains details about the Mandate to create. - /// - /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_data: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The Stripe account ID for which this SetupIntent is created. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option<&'a str>, - - /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - /// The ID of the payment method configuration to use with this Setup Intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_configuration: Option, - - /// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) - /// value in the SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_data: Option, - - /// Payment-method-specific configuration for this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_options: Option, - - /// The list of payment method types (e.g. - /// - /// card) that this SetupIntent is allowed to use. - /// If this is not provided, defaults to ["card"]. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, - - /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. - /// - /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. - /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option<&'a str>, - - /// If this hash is populated, this SetupIntent will generate a single_use Mandate on success. - #[serde(skip_serializing_if = "Option::is_none")] - pub single_use: Option, - - /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. - #[serde(skip_serializing_if = "Option::is_none")] - pub use_stripe_sdk: Option, -} - -impl<'a> CreateSetupIntent<'a> { - pub fn new() -> Self { - CreateSetupIntent { - attach_to_self: Default::default(), - automatic_payment_methods: Default::default(), - confirm: Default::default(), - customer: Default::default(), - description: Default::default(), - expand: Default::default(), - flow_directions: Default::default(), - mandate_data: Default::default(), - metadata: Default::default(), - on_behalf_of: Default::default(), - payment_method: Default::default(), - payment_method_configuration: Default::default(), - payment_method_data: Default::default(), - payment_method_options: Default::default(), - payment_method_types: Default::default(), - return_url: Default::default(), - single_use: Default::default(), - use_stripe_sdk: Default::default(), - } - } -} - -/// The parameters for `SetupIntent::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListSetupIntents<'a> { - /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. - /// - /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. - /// - /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub attach_to_self: Option, - - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return SetupIntents for the customer specified by this customer ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return SetupIntents associated with the specified payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListSetupIntents<'a> { - pub fn new() -> Self { - ListSetupIntents { - attach_to_self: Default::default(), - created: Default::default(), - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - payment_method: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListSetupIntents<'_> { - type O = SetupIntent; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `SetupIntent::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateSetupIntent<'a> { - /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. - /// - /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. - /// - /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub attach_to_self: Option, - - /// ID of the Customer this SetupIntent belongs to, if one exists. - /// - /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup. - /// - /// Payment methods attached to other Customers cannot be used with this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Indicates the directions of money movement for which this payment method is intended to be used. - /// - /// Include `inbound` if you intend to use the payment method as the origin to pull funds from. - /// - /// Include `outbound` if you intend to use the payment method as the destination to send funds to. - /// You can include both if you intend to use the payment method for both purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub flow_directions: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - /// The ID of the payment method configuration to use with this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_configuration: Option, - - /// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) - /// value in the SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_data: Option, - - /// Payment-method-specific configuration for this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_options: Option, - - /// The list of payment method types (e.g. - /// - /// card) that this SetupIntent is allowed to set up. - /// If this is not provided, defaults to ["card"]. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, -} - -impl<'a> UpdateSetupIntent<'a> { - pub fn new() -> Self { - UpdateSetupIntent { - attach_to_self: Default::default(), - customer: Default::default(), - description: Default::default(), - expand: Default::default(), - flow_directions: Default::default(), - metadata: Default::default(), - payment_method: Default::default(), - payment_method_configuration: Default::default(), - payment_method_data: Default::default(), - payment_method_options: Default::default(), - payment_method_types: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentAutomaticPaymentMethods { - /// Controls whether this SetupIntent will accept redirect-based payment methods. - /// - /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. - /// - /// To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. - #[serde(skip_serializing_if = "Option::is_none")] - pub allow_redirects: Option, - - /// Whether this feature is enabled. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentMandateData { - /// This hash contains details about the customer acceptance of the Mandate. - pub customer_acceptance: CreateSetupIntentMandateDataCustomerAcceptance, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodData { - /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_details: Option, - - /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// Options to configure Radar. - /// - /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// The type of the PaymentMethod. - /// - /// An additional hash is included on the PaymentMethod with a name matching this value. - /// It contains additional information specific to the PaymentMethod type. - #[serde(rename = "type")] - pub type_: CreateSetupIntentPaymentMethodDataType, - - /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptions { - /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// Configuration for any card setup attempted on this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentSingleUse { - /// Amount the customer is granting permission to collect later. - /// - /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodData { - /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_details: Option, - - /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// Options to configure Radar. - /// - /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// The type of the PaymentMethod. - /// - /// An additional hash is included on the PaymentMethod with a name matching this value. - /// It contains additional information specific to the PaymentMethod type. - #[serde(rename = "type")] - pub type_: UpdateSetupIntentPaymentMethodDataType, - - /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptions { - /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// Configuration for any card setup attempted on this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentMandateDataCustomerAcceptance { - /// The time at which the customer accepted the Mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub accepted_at: Option, - - /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance. - #[serde(skip_serializing_if = "Option::is_none")] - pub offline: Option, - - /// If this is a Mandate accepted online, this hash contains details about the online acceptance. - #[serde(skip_serializing_if = "Option::is_none")] - pub online: Option, - - /// The type of customer acceptance information included with the Mandate. - /// - /// One of `online` or `offline`. - #[serde(rename = "type")] - pub type_: CreateSetupIntentMandateDataCustomerAcceptanceType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataAcssDebit { - /// Customer's bank account number. - pub account_number: String, - - /// Institution number of the customer's bank. - pub institution_number: String, - - /// Transit number of the customer's bank. - pub transit_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataAffirm {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataAfterpayClearpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataAlipay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataAuBecsDebit { - /// The account number for the bank account. - pub account_number: String, - - /// Bank-State-Branch number of the bank account. - pub bsb_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataBacsDebit { - /// Account number of the bank account that the funds will be debited from. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Sort code of the bank account. - /// - /// (e.g., `10-20-30`). - #[serde(skip_serializing_if = "Option::is_none")] - pub sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataBancontact {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataBillingDetails { - /// Billing address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option, - - /// Email address. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// Full name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Billing phone number (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataBlik {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataBoleto { - /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers). - pub tax_id: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataCashapp {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataCustomerBalance {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataEps { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataFpx { - /// Account holder type for FPX transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: Option, - - /// The customer's bank. - pub bank: CreateSetupIntentPaymentMethodDataFpxBank, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataGiropay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataGrabpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataIdeal { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataInteracPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataKlarna { - /// Customer's date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub dob: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataOxxo {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataP24 { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataPaynow {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataPaypal {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataPix {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataPromptpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataRadarOptions { - /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub session: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataSepaDebit { - /// IBAN of the bank account. - pub iban: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataSofort { - /// Two-letter ISO code representing the country the bank account is located in. - pub country: CreateSetupIntentPaymentMethodDataSofortCountry, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataUsBankAccount { - /// Account holder type: individual or company. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: - Option, - - /// Account number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_type: Option, - - /// The ID of a Financial Connections Account to use as a payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections_account: Option, - - /// Routing number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataWechatPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataZip {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsAcssDebit { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsCard { - /// Configuration options for setting up an eMandate for cards issued in India. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// When specified, this parameter signals that a card has been collected - /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. - /// - /// This parameter can only be provided during confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub moto: Option, - - /// Selected network to process this SetupIntent on. - /// - /// Depends on the available networks of the card attached to the SetupIntent. - /// Can be only set confirm-time. - #[serde(skip_serializing_if = "Option::is_none")] - pub network: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Permitted values include: `automatic` or `any`. - /// If not provided, defaults to `automatic`. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_three_d_secure: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsLink { - /// [Deprecated] This is a legacy parameter that no longer has any function. - #[serde(skip_serializing_if = "Option::is_none")] - pub persistent_token: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsPaypal { - /// The PayPal Billing Agreement ID (BAID). - /// - /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_agreement_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsSepaDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccount { - /// Additional fields for Financial Connections Session creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: - Option, - - /// Additional fields for network related functions. - #[serde(skip_serializing_if = "Option::is_none")] - pub networks: Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataAcssDebit { - /// Customer's bank account number. - pub account_number: String, - - /// Institution number of the customer's bank. - pub institution_number: String, - - /// Transit number of the customer's bank. - pub transit_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataAffirm {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataAfterpayClearpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataAlipay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataAuBecsDebit { - /// The account number for the bank account. - pub account_number: String, - - /// Bank-State-Branch number of the bank account. - pub bsb_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataBacsDebit { - /// Account number of the bank account that the funds will be debited from. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Sort code of the bank account. - /// - /// (e.g., `10-20-30`). - #[serde(skip_serializing_if = "Option::is_none")] - pub sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataBancontact {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataBillingDetails { - /// Billing address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option, - - /// Email address. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// Full name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Billing phone number (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataBlik {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataBoleto { - /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers). - pub tax_id: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataCashapp {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataCustomerBalance {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataEps { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataFpx { - /// Account holder type for FPX transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: Option, - - /// The customer's bank. - pub bank: UpdateSetupIntentPaymentMethodDataFpxBank, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataGiropay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataGrabpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataIdeal { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataInteracPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataKlarna { - /// Customer's date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub dob: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataOxxo {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataP24 { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataPaynow {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataPaypal {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataPix {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataPromptpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataRadarOptions { - /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub session: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataSepaDebit { - /// IBAN of the bank account. - pub iban: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataSofort { - /// Two-letter ISO code representing the country the bank account is located in. - pub country: UpdateSetupIntentPaymentMethodDataSofortCountry, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataUsBankAccount { - /// Account holder type: individual or company. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: - Option, - - /// Account number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_type: Option, - - /// The ID of a Financial Connections Account to use as a payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections_account: Option, - - /// Routing number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataWechatPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataZip {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebit { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsCard { - /// Configuration options for setting up an eMandate for cards issued in India. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// When specified, this parameter signals that a card has been collected - /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. - /// - /// This parameter can only be provided during confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub moto: Option, - - /// Selected network to process this SetupIntent on. - /// - /// Depends on the available networks of the card attached to the SetupIntent. - /// Can be only set confirm-time. - #[serde(skip_serializing_if = "Option::is_none")] - pub network: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Permitted values include: `automatic` or `any`. - /// If not provided, defaults to `automatic`. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_three_d_secure: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsLink { - /// [Deprecated] This is a legacy parameter that no longer has any function. - #[serde(skip_serializing_if = "Option::is_none")] - pub persistent_token: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsPaypal { - /// The PayPal Billing Agreement ID (BAID). - /// - /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_agreement_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccount { - /// Additional fields for Financial Connections Session creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: - Option, - - /// Additional fields for network related functions. - #[serde(skip_serializing_if = "Option::is_none")] - pub networks: Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentMandateDataCustomerAcceptanceOffline {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentMandateDataCustomerAcceptanceOnline { - /// The IP address from which the Mandate was accepted by the customer. - pub ip_address: String, - - /// The user agent of the browser from which the Mandate was accepted by the customer. - pub user_agent: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataBillingDetailsAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataKlarnaDob { - /// The day of birth, between 1 and 31. - pub day: i64, - - /// The month of birth, between 1 and 12. - pub month: i64, - - /// The four-digit year of birth. - pub year: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions { - /// A URL for custom mandate text to render during confirmation step. - /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_mandate_url: Option, - - /// List of Stripe products where this mandate can be selected automatically. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_for: - Option>, - - /// Description of the mandate interval. - /// - /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_description: Option, - - /// Payment schedule for the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_schedule: - Option, - - /// Transaction type of the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_type: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsCardMandateOptions { - /// Amount to be charged for future payments. - pub amount: i64, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - pub amount_type: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, - - /// Currency in which future payments will be charged. - /// - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// End date of the mandate or subscription. - /// - /// If not provided, the mandate will be active until canceled. - /// If provided, end date should be after start date. - #[serde(skip_serializing_if = "Option::is_none")] - pub end_date: Option, - - /// Specifies payment frequency. - /// - /// One of `day`, `week`, `month`, `year`, or `sporadic`. - pub interval: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval, - - /// The number of intervals between payments. - /// - /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - /// This parameter is optional when `interval=sporadic`. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, - - /// Unique identifier for the mandate or subscription. - pub reference: String, - - /// Start date of the mandate or subscription. - /// - /// Start date should not be lesser than yesterday. - pub start_date: Timestamp, - - /// Specifies the type of mandates supported. - /// - /// Possible values are `india`. - #[serde(skip_serializing_if = "Option::is_none")] - pub supported_types: - Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections { - /// The list of permissions to request. - /// - /// If this parameter is passed, the `payment_method` permission must be included. - /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option< - Vec, - >, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: - Option>, - - /// For webview integrations only. - /// - /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks { - /// Triggers validations to run across the selected networks. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataBillingDetailsAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataKlarnaDob { - /// The day of birth, between 1 and 31. - pub day: i64, - - /// The month of birth, between 1 and 12. - pub month: i64, - - /// The four-digit year of birth. - pub year: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions { - /// A URL for custom mandate text to render during confirmation step. - /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_mandate_url: Option, - - /// List of Stripe products where this mandate can be selected automatically. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_for: - Option>, - - /// Description of the mandate interval. - /// - /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_description: Option, - - /// Payment schedule for the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_schedule: - Option, - - /// Transaction type of the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_type: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsCardMandateOptions { - /// Amount to be charged for future payments. - pub amount: i64, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - pub amount_type: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, - - /// Currency in which future payments will be charged. - /// - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// End date of the mandate or subscription. - /// - /// If not provided, the mandate will be active until canceled. - /// If provided, end date should be after start date. - #[serde(skip_serializing_if = "Option::is_none")] - pub end_date: Option, - - /// Specifies payment frequency. - /// - /// One of `day`, `week`, `month`, `year`, or `sporadic`. - pub interval: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval, - - /// The number of intervals between payments. - /// - /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - /// This parameter is optional when `interval=sporadic`. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, - - /// Unique identifier for the mandate or subscription. - pub reference: String, - - /// Start date of the mandate or subscription. - /// - /// Start date should not be lesser than yesterday. - pub start_date: Timestamp, - - /// Specifies the type of mandates supported. - /// - /// Possible values are `india`. - #[serde(skip_serializing_if = "Option::is_none")] - pub supported_types: - Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections { - /// The list of permissions to request. - /// - /// If this parameter is passed, the `payment_method` permission must be included. - /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option< - Vec, - >, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: - Option>, - - /// For webview integrations only. - /// - /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks { - /// Triggers validations to run across the selected networks. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option>, -} - -/// An enum representing the possible values of an `CreateSetupIntentAutomaticPaymentMethods`'s `allow_redirects` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { - Always, - Never, -} - -impl CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::Always => "always", - CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::Never => "never", - } - } -} - -impl AsRef for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { - fn default() -> Self { - Self::Always - } -} - -/// An enum representing the possible values of an `CreateSetupIntent`'s `flow_directions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentFlowDirections { - Inbound, - Outbound, -} - -impl CreateSetupIntentFlowDirections { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentFlowDirections::Inbound => "inbound", - CreateSetupIntentFlowDirections::Outbound => "outbound", - } - } -} - -impl AsRef for CreateSetupIntentFlowDirections { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentFlowDirections { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentFlowDirections { - fn default() -> Self { - Self::Inbound - } -} - -/// An enum representing the possible values of an `CreateSetupIntentMandateDataCustomerAcceptance`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentMandateDataCustomerAcceptanceType { - Offline, - Online, -} - -impl CreateSetupIntentMandateDataCustomerAcceptanceType { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentMandateDataCustomerAcceptanceType::Offline => "offline", - CreateSetupIntentMandateDataCustomerAcceptanceType::Online => "online", - } - } -} - -impl AsRef for CreateSetupIntentMandateDataCustomerAcceptanceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentMandateDataCustomerAcceptanceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentMandateDataCustomerAcceptanceType { - fn default() -> Self { - Self::Offline - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodDataEps`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataEpsBank { - ArzteUndApothekerBank, - AustrianAnadiBankAg, - BankAustria, - BankhausCarlSpangler, - BankhausSchelhammerUndSchatteraAg, - BawagPskAg, - BksBankAg, - BrullKallmusBankAg, - BtvVierLanderBank, - CapitalBankGraweGruppeAg, - DeutscheBankAg, - Dolomitenbank, - EasybankAg, - ErsteBankUndSparkassen, - HypoAlpeadriabankInternationalAg, - HypoBankBurgenlandAktiengesellschaft, - HypoNoeLbFurNiederosterreichUWien, - HypoOberosterreichSalzburgSteiermark, - HypoTirolBankAg, - HypoVorarlbergBankAg, - MarchfelderBank, - OberbankAg, - RaiffeisenBankengruppeOsterreich, - SchoellerbankAg, - SpardaBankWien, - VolksbankGruppe, - VolkskreditbankAg, - VrBankBraunau, -} - -impl CreateSetupIntentPaymentMethodDataEpsBank { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataEpsBank::ArzteUndApothekerBank => { - "arzte_und_apotheker_bank" - } - CreateSetupIntentPaymentMethodDataEpsBank::AustrianAnadiBankAg => { - "austrian_anadi_bank_ag" - } - CreateSetupIntentPaymentMethodDataEpsBank::BankAustria => "bank_austria", - CreateSetupIntentPaymentMethodDataEpsBank::BankhausCarlSpangler => { - "bankhaus_carl_spangler" - } - CreateSetupIntentPaymentMethodDataEpsBank::BankhausSchelhammerUndSchatteraAg => { - "bankhaus_schelhammer_und_schattera_ag" - } - CreateSetupIntentPaymentMethodDataEpsBank::BawagPskAg => "bawag_psk_ag", - CreateSetupIntentPaymentMethodDataEpsBank::BksBankAg => "bks_bank_ag", - CreateSetupIntentPaymentMethodDataEpsBank::BrullKallmusBankAg => { - "brull_kallmus_bank_ag" - } - CreateSetupIntentPaymentMethodDataEpsBank::BtvVierLanderBank => "btv_vier_lander_bank", - CreateSetupIntentPaymentMethodDataEpsBank::CapitalBankGraweGruppeAg => { - "capital_bank_grawe_gruppe_ag" - } - CreateSetupIntentPaymentMethodDataEpsBank::DeutscheBankAg => "deutsche_bank_ag", - CreateSetupIntentPaymentMethodDataEpsBank::Dolomitenbank => "dolomitenbank", - CreateSetupIntentPaymentMethodDataEpsBank::EasybankAg => "easybank_ag", - CreateSetupIntentPaymentMethodDataEpsBank::ErsteBankUndSparkassen => { - "erste_bank_und_sparkassen" - } - CreateSetupIntentPaymentMethodDataEpsBank::HypoAlpeadriabankInternationalAg => { - "hypo_alpeadriabank_international_ag" - } - CreateSetupIntentPaymentMethodDataEpsBank::HypoBankBurgenlandAktiengesellschaft => { - "hypo_bank_burgenland_aktiengesellschaft" - } - CreateSetupIntentPaymentMethodDataEpsBank::HypoNoeLbFurNiederosterreichUWien => { - "hypo_noe_lb_fur_niederosterreich_u_wien" - } - CreateSetupIntentPaymentMethodDataEpsBank::HypoOberosterreichSalzburgSteiermark => { - "hypo_oberosterreich_salzburg_steiermark" - } - CreateSetupIntentPaymentMethodDataEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag", - CreateSetupIntentPaymentMethodDataEpsBank::HypoVorarlbergBankAg => { - "hypo_vorarlberg_bank_ag" - } - CreateSetupIntentPaymentMethodDataEpsBank::MarchfelderBank => "marchfelder_bank", - CreateSetupIntentPaymentMethodDataEpsBank::OberbankAg => "oberbank_ag", - CreateSetupIntentPaymentMethodDataEpsBank::RaiffeisenBankengruppeOsterreich => { - "raiffeisen_bankengruppe_osterreich" - } - CreateSetupIntentPaymentMethodDataEpsBank::SchoellerbankAg => "schoellerbank_ag", - CreateSetupIntentPaymentMethodDataEpsBank::SpardaBankWien => "sparda_bank_wien", - CreateSetupIntentPaymentMethodDataEpsBank::VolksbankGruppe => "volksbank_gruppe", - CreateSetupIntentPaymentMethodDataEpsBank::VolkskreditbankAg => "volkskreditbank_ag", - CreateSetupIntentPaymentMethodDataEpsBank::VrBankBraunau => "vr_bank_braunau", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataEpsBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataEpsBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataEpsBank { - fn default() -> Self { - Self::ArzteUndApothekerBank - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodDataFpx`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataFpxAccountHolderType { - Company, - Individual, -} - -impl CreateSetupIntentPaymentMethodDataFpxAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataFpxAccountHolderType::Company => "company", - CreateSetupIntentPaymentMethodDataFpxAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataFpxAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataFpxAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodDataFpx`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataFpxBank { - AffinBank, - Agrobank, - AllianceBank, - Ambank, - BankIslam, - BankMuamalat, - BankOfChina, - BankRakyat, - Bsn, - Cimb, - DeutscheBank, - HongLeongBank, - Hsbc, - Kfh, - Maybank2e, - Maybank2u, - Ocbc, - PbEnterprise, - PublicBank, - Rhb, - StandardChartered, - Uob, -} - -impl CreateSetupIntentPaymentMethodDataFpxBank { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataFpxBank::AffinBank => "affin_bank", - CreateSetupIntentPaymentMethodDataFpxBank::Agrobank => "agrobank", - CreateSetupIntentPaymentMethodDataFpxBank::AllianceBank => "alliance_bank", - CreateSetupIntentPaymentMethodDataFpxBank::Ambank => "ambank", - CreateSetupIntentPaymentMethodDataFpxBank::BankIslam => "bank_islam", - CreateSetupIntentPaymentMethodDataFpxBank::BankMuamalat => "bank_muamalat", - CreateSetupIntentPaymentMethodDataFpxBank::BankOfChina => "bank_of_china", - CreateSetupIntentPaymentMethodDataFpxBank::BankRakyat => "bank_rakyat", - CreateSetupIntentPaymentMethodDataFpxBank::Bsn => "bsn", - CreateSetupIntentPaymentMethodDataFpxBank::Cimb => "cimb", - CreateSetupIntentPaymentMethodDataFpxBank::DeutscheBank => "deutsche_bank", - CreateSetupIntentPaymentMethodDataFpxBank::HongLeongBank => "hong_leong_bank", - CreateSetupIntentPaymentMethodDataFpxBank::Hsbc => "hsbc", - CreateSetupIntentPaymentMethodDataFpxBank::Kfh => "kfh", - CreateSetupIntentPaymentMethodDataFpxBank::Maybank2e => "maybank2e", - CreateSetupIntentPaymentMethodDataFpxBank::Maybank2u => "maybank2u", - CreateSetupIntentPaymentMethodDataFpxBank::Ocbc => "ocbc", - CreateSetupIntentPaymentMethodDataFpxBank::PbEnterprise => "pb_enterprise", - CreateSetupIntentPaymentMethodDataFpxBank::PublicBank => "public_bank", - CreateSetupIntentPaymentMethodDataFpxBank::Rhb => "rhb", - CreateSetupIntentPaymentMethodDataFpxBank::StandardChartered => "standard_chartered", - CreateSetupIntentPaymentMethodDataFpxBank::Uob => "uob", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataFpxBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataFpxBank { - fn default() -> Self { - Self::AffinBank - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodDataIdeal`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataIdealBank { - AbnAmro, - AsnBank, - Bunq, - Handelsbanken, - Ing, - Knab, - Moneyou, - N26, - Rabobank, - Regiobank, - Revolut, - SnsBank, - TriodosBank, - VanLanschot, - Yoursafe, -} - -impl CreateSetupIntentPaymentMethodDataIdealBank { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataIdealBank::AbnAmro => "abn_amro", - CreateSetupIntentPaymentMethodDataIdealBank::AsnBank => "asn_bank", - CreateSetupIntentPaymentMethodDataIdealBank::Bunq => "bunq", - CreateSetupIntentPaymentMethodDataIdealBank::Handelsbanken => "handelsbanken", - CreateSetupIntentPaymentMethodDataIdealBank::Ing => "ing", - CreateSetupIntentPaymentMethodDataIdealBank::Knab => "knab", - CreateSetupIntentPaymentMethodDataIdealBank::Moneyou => "moneyou", - CreateSetupIntentPaymentMethodDataIdealBank::N26 => "n26", - CreateSetupIntentPaymentMethodDataIdealBank::Rabobank => "rabobank", - CreateSetupIntentPaymentMethodDataIdealBank::Regiobank => "regiobank", - CreateSetupIntentPaymentMethodDataIdealBank::Revolut => "revolut", - CreateSetupIntentPaymentMethodDataIdealBank::SnsBank => "sns_bank", - CreateSetupIntentPaymentMethodDataIdealBank::TriodosBank => "triodos_bank", - CreateSetupIntentPaymentMethodDataIdealBank::VanLanschot => "van_lanschot", - CreateSetupIntentPaymentMethodDataIdealBank::Yoursafe => "yoursafe", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataIdealBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataIdealBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataIdealBank { - fn default() -> Self { - Self::AbnAmro - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodDataP24`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataP24Bank { - AliorBank, - BankMillennium, - BankNowyBfgSa, - BankPekaoSa, - BankiSpbdzielcze, - Blik, - BnpParibas, - Boz, - CitiHandlowy, - CreditAgricole, - Envelobank, - EtransferPocztowy24, - GetinBank, - Ideabank, - Ing, - Inteligo, - MbankMtransfer, - NestPrzelew, - NoblePay, - PbacZIpko, - PlusBank, - SantanderPrzelew24, - TmobileUsbugiBankowe, - ToyotaBank, - VolkswagenBank, -} - -impl CreateSetupIntentPaymentMethodDataP24Bank { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataP24Bank::AliorBank => "alior_bank", - CreateSetupIntentPaymentMethodDataP24Bank::BankMillennium => "bank_millennium", - CreateSetupIntentPaymentMethodDataP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa", - CreateSetupIntentPaymentMethodDataP24Bank::BankPekaoSa => "bank_pekao_sa", - CreateSetupIntentPaymentMethodDataP24Bank::BankiSpbdzielcze => "banki_spbdzielcze", - CreateSetupIntentPaymentMethodDataP24Bank::Blik => "blik", - CreateSetupIntentPaymentMethodDataP24Bank::BnpParibas => "bnp_paribas", - CreateSetupIntentPaymentMethodDataP24Bank::Boz => "boz", - CreateSetupIntentPaymentMethodDataP24Bank::CitiHandlowy => "citi_handlowy", - CreateSetupIntentPaymentMethodDataP24Bank::CreditAgricole => "credit_agricole", - CreateSetupIntentPaymentMethodDataP24Bank::Envelobank => "envelobank", - CreateSetupIntentPaymentMethodDataP24Bank::EtransferPocztowy24 => { - "etransfer_pocztowy24" - } - CreateSetupIntentPaymentMethodDataP24Bank::GetinBank => "getin_bank", - CreateSetupIntentPaymentMethodDataP24Bank::Ideabank => "ideabank", - CreateSetupIntentPaymentMethodDataP24Bank::Ing => "ing", - CreateSetupIntentPaymentMethodDataP24Bank::Inteligo => "inteligo", - CreateSetupIntentPaymentMethodDataP24Bank::MbankMtransfer => "mbank_mtransfer", - CreateSetupIntentPaymentMethodDataP24Bank::NestPrzelew => "nest_przelew", - CreateSetupIntentPaymentMethodDataP24Bank::NoblePay => "noble_pay", - CreateSetupIntentPaymentMethodDataP24Bank::PbacZIpko => "pbac_z_ipko", - CreateSetupIntentPaymentMethodDataP24Bank::PlusBank => "plus_bank", - CreateSetupIntentPaymentMethodDataP24Bank::SantanderPrzelew24 => "santander_przelew24", - CreateSetupIntentPaymentMethodDataP24Bank::TmobileUsbugiBankowe => { - "tmobile_usbugi_bankowe" - } - CreateSetupIntentPaymentMethodDataP24Bank::ToyotaBank => "toyota_bank", - CreateSetupIntentPaymentMethodDataP24Bank::VolkswagenBank => "volkswagen_bank", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataP24Bank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataP24Bank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataP24Bank { - fn default() -> Self { - Self::AliorBank - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodDataSofort`'s `country` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataSofortCountry { - #[serde(rename = "AT")] - At, - #[serde(rename = "BE")] - Be, - #[serde(rename = "DE")] - De, - #[serde(rename = "ES")] - Es, - #[serde(rename = "IT")] - It, - #[serde(rename = "NL")] - Nl, -} - -impl CreateSetupIntentPaymentMethodDataSofortCountry { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataSofortCountry::At => "AT", - CreateSetupIntentPaymentMethodDataSofortCountry::Be => "BE", - CreateSetupIntentPaymentMethodDataSofortCountry::De => "DE", - CreateSetupIntentPaymentMethodDataSofortCountry::Es => "ES", - CreateSetupIntentPaymentMethodDataSofortCountry::It => "IT", - CreateSetupIntentPaymentMethodDataSofortCountry::Nl => "NL", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataSofortCountry { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataSofortCountry { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataSofortCountry { - fn default() -> Self { - Self::At - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodData`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataType { - AcssDebit, - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, - Zip, -} - -impl CreateSetupIntentPaymentMethodDataType { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataType::AcssDebit => "acss_debit", - CreateSetupIntentPaymentMethodDataType::Affirm => "affirm", - CreateSetupIntentPaymentMethodDataType::AfterpayClearpay => "afterpay_clearpay", - CreateSetupIntentPaymentMethodDataType::Alipay => "alipay", - CreateSetupIntentPaymentMethodDataType::AuBecsDebit => "au_becs_debit", - CreateSetupIntentPaymentMethodDataType::BacsDebit => "bacs_debit", - CreateSetupIntentPaymentMethodDataType::Bancontact => "bancontact", - CreateSetupIntentPaymentMethodDataType::Blik => "blik", - CreateSetupIntentPaymentMethodDataType::Boleto => "boleto", - CreateSetupIntentPaymentMethodDataType::Cashapp => "cashapp", - CreateSetupIntentPaymentMethodDataType::CustomerBalance => "customer_balance", - CreateSetupIntentPaymentMethodDataType::Eps => "eps", - CreateSetupIntentPaymentMethodDataType::Fpx => "fpx", - CreateSetupIntentPaymentMethodDataType::Giropay => "giropay", - CreateSetupIntentPaymentMethodDataType::Grabpay => "grabpay", - CreateSetupIntentPaymentMethodDataType::Ideal => "ideal", - CreateSetupIntentPaymentMethodDataType::Klarna => "klarna", - CreateSetupIntentPaymentMethodDataType::Konbini => "konbini", - CreateSetupIntentPaymentMethodDataType::Link => "link", - CreateSetupIntentPaymentMethodDataType::Oxxo => "oxxo", - CreateSetupIntentPaymentMethodDataType::P24 => "p24", - CreateSetupIntentPaymentMethodDataType::Paynow => "paynow", - CreateSetupIntentPaymentMethodDataType::Paypal => "paypal", - CreateSetupIntentPaymentMethodDataType::Pix => "pix", - CreateSetupIntentPaymentMethodDataType::Promptpay => "promptpay", - CreateSetupIntentPaymentMethodDataType::SepaDebit => "sepa_debit", - CreateSetupIntentPaymentMethodDataType::Sofort => "sofort", - CreateSetupIntentPaymentMethodDataType::UsBankAccount => "us_bank_account", - CreateSetupIntentPaymentMethodDataType::WechatPay => "wechat_pay", - CreateSetupIntentPaymentMethodDataType::Zip => "zip", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataType { - fn default() -> Self { - Self::AcssDebit - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodDataUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::Company => "company", - CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::Individual => { - "individual" - } - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodDataUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { - Checking, - Savings, -} - -impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::Checking => "checking", - CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `default_for` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - Invoice, - Subscription, -} - -impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::Invoice => "invoice", - CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::Subscription => "subscription", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor -{ - fn default() -> Self { - Self::Invoice - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Combined => "combined", - CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Interval => "interval", - CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Sporadic => "sporadic", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - Business, - Personal, -} - -impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business", - CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => { - "automatic" - } - CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant", - CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsCardMandateOptions`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - Fixed, - Maximum, -} - -impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed", - CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::Maximum => "maximum", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsCardMandateOptions`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - Day, - Month, - Sporadic, - Week, - Year, -} - -impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Day => "day", - CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Month => "month", - CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Sporadic => "sporadic", - CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Week => "week", - CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Year => "year", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsCardMandateOptions`'s `supported_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - India, -} - -impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::India => "india", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes -{ - fn default() -> Self { - Self::India - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl CreateSetupIntentPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsCardNetwork::Amex => "amex", - CreateSetupIntentPaymentMethodOptionsCardNetwork::CartesBancaires => "cartes_bancaires", - CreateSetupIntentPaymentMethodOptionsCardNetwork::Diners => "diners", - CreateSetupIntentPaymentMethodOptionsCardNetwork::Discover => "discover", - CreateSetupIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", - CreateSetupIntentPaymentMethodOptionsCardNetwork::Interac => "interac", - CreateSetupIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", - CreateSetupIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", - CreateSetupIntentPaymentMethodOptionsCardNetwork::Unionpay => "unionpay", - CreateSetupIntentPaymentMethodOptionsCardNetwork::Unknown => "unknown", - CreateSetupIntentPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, -} - -impl CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances", - CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership", - CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method", - CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef - for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - Balances, -} - -impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks`'s `requested` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - Ach, - UsDomesticWire, -} - -impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::Ach => "ach", - CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::UsDomesticWire => { - "us_domestic_wire" - } - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => { - "automatic" - } - CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => { - "instant" - } - CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `PaymentFlowsAutomaticPaymentMethodsSetupIntent`'s `allow_redirects` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { - Always, - Never, -} - -impl PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { - pub fn as_str(self) -> &'static str { - match self { - PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects::Always => "always", - PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects::Never => "never", - } - } -} - -impl AsRef for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { - fn default() -> Self { - Self::Always - } -} - -/// An enum representing the possible values of an `SetupIntent`'s `cancellation_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentCancellationReason { - Abandoned, - Duplicate, - RequestedByCustomer, -} - -impl SetupIntentCancellationReason { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentCancellationReason::Abandoned => "abandoned", - SetupIntentCancellationReason::Duplicate => "duplicate", - SetupIntentCancellationReason::RequestedByCustomer => "requested_by_customer", - } - } -} - -impl AsRef for SetupIntentCancellationReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentCancellationReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentCancellationReason { - fn default() -> Self { - Self::Abandoned - } -} - -/// An enum representing the possible values of an `SetupIntent`'s `flow_directions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentFlowDirections { - Inbound, - Outbound, -} - -impl SetupIntentFlowDirections { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentFlowDirections::Inbound => "inbound", - SetupIntentFlowDirections::Outbound => "outbound", - } - } -} - -impl AsRef for SetupIntentFlowDirections { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentFlowDirections { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentFlowDirections { - fn default() -> Self { - Self::Inbound - } -} - -/// An enum representing the possible values of an `SetupIntentNextActionVerifyWithMicrodeposits`'s `microdeposit_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { - Amounts, - DescriptorCode, -} - -impl SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType::Amounts => "amounts", - SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType::DescriptorCode => { - "descriptor_code" - } - } - } -} - -impl AsRef for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { - fn default() -> Self { - Self::Amounts - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => "automatic", - SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant", - SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsCardMandateOptions`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - Fixed, - Maximum, -} - -impl SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed", - SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::Maximum => "maximum", - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsCardMandateOptions`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - Day, - Month, - Sporadic, - Week, - Year, -} - -impl SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Day => "day", - SetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Month => "month", - SetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Sporadic => "sporadic", - SetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Week => "week", - SetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Year => "year", - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsCardMandateOptions`'s `supported_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - India, -} - -impl SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::India => "india", - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn default() -> Self { - Self::India - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl SetupIntentPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsCardNetwork::Amex => "amex", - SetupIntentPaymentMethodOptionsCardNetwork::CartesBancaires => "cartes_bancaires", - SetupIntentPaymentMethodOptionsCardNetwork::Diners => "diners", - SetupIntentPaymentMethodOptionsCardNetwork::Discover => "discover", - SetupIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", - SetupIntentPaymentMethodOptionsCardNetwork::Interac => "interac", - SetupIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", - SetupIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", - SetupIntentPaymentMethodOptionsCardNetwork::Unionpay => "unionpay", - SetupIntentPaymentMethodOptionsCardNetwork::Unknown => "unknown", - SetupIntentPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, - ChallengeOnly, -} - -impl SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - SetupIntentPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", - SetupIntentPaymentMethodOptionsCardRequestThreeDSecure::ChallengeOnly => { - "challenge_only" - } - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit`'s `default_for` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { - Invoice, - Subscription, -} - -impl SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor::Invoice => "invoice", - SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor::Subscription => { - "subscription" - } - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { - fn default() -> Self { - Self::Invoice - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::Combined => { - "combined" - } - SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::Interval => { - "interval" - } - SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::Sporadic => { - "sporadic" - } - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule -{ - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { - Business, - Personal, -} - -impl SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType::Business => { - "business" - } - SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType::Personal => { - "personal" - } - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => { - "automatic" - } - SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant", - SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `SetupIntent`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentStatus { - Canceled, - Processing, - RequiresAction, - RequiresConfirmation, - RequiresPaymentMethod, - Succeeded, -} - -impl SetupIntentStatus { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentStatus::Canceled => "canceled", - SetupIntentStatus::Processing => "processing", - SetupIntentStatus::RequiresAction => "requires_action", - SetupIntentStatus::RequiresConfirmation => "requires_confirmation", - SetupIntentStatus::RequiresPaymentMethod => "requires_payment_method", - SetupIntentStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for SetupIntentStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentStatus { - fn default() -> Self { - Self::Canceled - } -} - -/// An enum representing the possible values of an `UpdateSetupIntent`'s `flow_directions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentFlowDirections { - Inbound, - Outbound, -} - -impl UpdateSetupIntentFlowDirections { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentFlowDirections::Inbound => "inbound", - UpdateSetupIntentFlowDirections::Outbound => "outbound", - } - } -} - -impl AsRef for UpdateSetupIntentFlowDirections { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentFlowDirections { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentFlowDirections { - fn default() -> Self { - Self::Inbound - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodDataEps`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataEpsBank { - ArzteUndApothekerBank, - AustrianAnadiBankAg, - BankAustria, - BankhausCarlSpangler, - BankhausSchelhammerUndSchatteraAg, - BawagPskAg, - BksBankAg, - BrullKallmusBankAg, - BtvVierLanderBank, - CapitalBankGraweGruppeAg, - DeutscheBankAg, - Dolomitenbank, - EasybankAg, - ErsteBankUndSparkassen, - HypoAlpeadriabankInternationalAg, - HypoBankBurgenlandAktiengesellschaft, - HypoNoeLbFurNiederosterreichUWien, - HypoOberosterreichSalzburgSteiermark, - HypoTirolBankAg, - HypoVorarlbergBankAg, - MarchfelderBank, - OberbankAg, - RaiffeisenBankengruppeOsterreich, - SchoellerbankAg, - SpardaBankWien, - VolksbankGruppe, - VolkskreditbankAg, - VrBankBraunau, -} - -impl UpdateSetupIntentPaymentMethodDataEpsBank { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataEpsBank::ArzteUndApothekerBank => { - "arzte_und_apotheker_bank" - } - UpdateSetupIntentPaymentMethodDataEpsBank::AustrianAnadiBankAg => { - "austrian_anadi_bank_ag" - } - UpdateSetupIntentPaymentMethodDataEpsBank::BankAustria => "bank_austria", - UpdateSetupIntentPaymentMethodDataEpsBank::BankhausCarlSpangler => { - "bankhaus_carl_spangler" - } - UpdateSetupIntentPaymentMethodDataEpsBank::BankhausSchelhammerUndSchatteraAg => { - "bankhaus_schelhammer_und_schattera_ag" - } - UpdateSetupIntentPaymentMethodDataEpsBank::BawagPskAg => "bawag_psk_ag", - UpdateSetupIntentPaymentMethodDataEpsBank::BksBankAg => "bks_bank_ag", - UpdateSetupIntentPaymentMethodDataEpsBank::BrullKallmusBankAg => { - "brull_kallmus_bank_ag" - } - UpdateSetupIntentPaymentMethodDataEpsBank::BtvVierLanderBank => "btv_vier_lander_bank", - UpdateSetupIntentPaymentMethodDataEpsBank::CapitalBankGraweGruppeAg => { - "capital_bank_grawe_gruppe_ag" - } - UpdateSetupIntentPaymentMethodDataEpsBank::DeutscheBankAg => "deutsche_bank_ag", - UpdateSetupIntentPaymentMethodDataEpsBank::Dolomitenbank => "dolomitenbank", - UpdateSetupIntentPaymentMethodDataEpsBank::EasybankAg => "easybank_ag", - UpdateSetupIntentPaymentMethodDataEpsBank::ErsteBankUndSparkassen => { - "erste_bank_und_sparkassen" - } - UpdateSetupIntentPaymentMethodDataEpsBank::HypoAlpeadriabankInternationalAg => { - "hypo_alpeadriabank_international_ag" - } - UpdateSetupIntentPaymentMethodDataEpsBank::HypoBankBurgenlandAktiengesellschaft => { - "hypo_bank_burgenland_aktiengesellschaft" - } - UpdateSetupIntentPaymentMethodDataEpsBank::HypoNoeLbFurNiederosterreichUWien => { - "hypo_noe_lb_fur_niederosterreich_u_wien" - } - UpdateSetupIntentPaymentMethodDataEpsBank::HypoOberosterreichSalzburgSteiermark => { - "hypo_oberosterreich_salzburg_steiermark" - } - UpdateSetupIntentPaymentMethodDataEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag", - UpdateSetupIntentPaymentMethodDataEpsBank::HypoVorarlbergBankAg => { - "hypo_vorarlberg_bank_ag" - } - UpdateSetupIntentPaymentMethodDataEpsBank::MarchfelderBank => "marchfelder_bank", - UpdateSetupIntentPaymentMethodDataEpsBank::OberbankAg => "oberbank_ag", - UpdateSetupIntentPaymentMethodDataEpsBank::RaiffeisenBankengruppeOsterreich => { - "raiffeisen_bankengruppe_osterreich" - } - UpdateSetupIntentPaymentMethodDataEpsBank::SchoellerbankAg => "schoellerbank_ag", - UpdateSetupIntentPaymentMethodDataEpsBank::SpardaBankWien => "sparda_bank_wien", - UpdateSetupIntentPaymentMethodDataEpsBank::VolksbankGruppe => "volksbank_gruppe", - UpdateSetupIntentPaymentMethodDataEpsBank::VolkskreditbankAg => "volkskreditbank_ag", - UpdateSetupIntentPaymentMethodDataEpsBank::VrBankBraunau => "vr_bank_braunau", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataEpsBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataEpsBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataEpsBank { - fn default() -> Self { - Self::ArzteUndApothekerBank - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodDataFpx`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { - Company, - Individual, -} - -impl UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::Company => "company", - UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodDataFpx`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataFpxBank { - AffinBank, - Agrobank, - AllianceBank, - Ambank, - BankIslam, - BankMuamalat, - BankOfChina, - BankRakyat, - Bsn, - Cimb, - DeutscheBank, - HongLeongBank, - Hsbc, - Kfh, - Maybank2e, - Maybank2u, - Ocbc, - PbEnterprise, - PublicBank, - Rhb, - StandardChartered, - Uob, -} - -impl UpdateSetupIntentPaymentMethodDataFpxBank { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataFpxBank::AffinBank => "affin_bank", - UpdateSetupIntentPaymentMethodDataFpxBank::Agrobank => "agrobank", - UpdateSetupIntentPaymentMethodDataFpxBank::AllianceBank => "alliance_bank", - UpdateSetupIntentPaymentMethodDataFpxBank::Ambank => "ambank", - UpdateSetupIntentPaymentMethodDataFpxBank::BankIslam => "bank_islam", - UpdateSetupIntentPaymentMethodDataFpxBank::BankMuamalat => "bank_muamalat", - UpdateSetupIntentPaymentMethodDataFpxBank::BankOfChina => "bank_of_china", - UpdateSetupIntentPaymentMethodDataFpxBank::BankRakyat => "bank_rakyat", - UpdateSetupIntentPaymentMethodDataFpxBank::Bsn => "bsn", - UpdateSetupIntentPaymentMethodDataFpxBank::Cimb => "cimb", - UpdateSetupIntentPaymentMethodDataFpxBank::DeutscheBank => "deutsche_bank", - UpdateSetupIntentPaymentMethodDataFpxBank::HongLeongBank => "hong_leong_bank", - UpdateSetupIntentPaymentMethodDataFpxBank::Hsbc => "hsbc", - UpdateSetupIntentPaymentMethodDataFpxBank::Kfh => "kfh", - UpdateSetupIntentPaymentMethodDataFpxBank::Maybank2e => "maybank2e", - UpdateSetupIntentPaymentMethodDataFpxBank::Maybank2u => "maybank2u", - UpdateSetupIntentPaymentMethodDataFpxBank::Ocbc => "ocbc", - UpdateSetupIntentPaymentMethodDataFpxBank::PbEnterprise => "pb_enterprise", - UpdateSetupIntentPaymentMethodDataFpxBank::PublicBank => "public_bank", - UpdateSetupIntentPaymentMethodDataFpxBank::Rhb => "rhb", - UpdateSetupIntentPaymentMethodDataFpxBank::StandardChartered => "standard_chartered", - UpdateSetupIntentPaymentMethodDataFpxBank::Uob => "uob", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataFpxBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataFpxBank { - fn default() -> Self { - Self::AffinBank - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodDataIdeal`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataIdealBank { - AbnAmro, - AsnBank, - Bunq, - Handelsbanken, - Ing, - Knab, - Moneyou, - N26, - Rabobank, - Regiobank, - Revolut, - SnsBank, - TriodosBank, - VanLanschot, - Yoursafe, -} - -impl UpdateSetupIntentPaymentMethodDataIdealBank { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataIdealBank::AbnAmro => "abn_amro", - UpdateSetupIntentPaymentMethodDataIdealBank::AsnBank => "asn_bank", - UpdateSetupIntentPaymentMethodDataIdealBank::Bunq => "bunq", - UpdateSetupIntentPaymentMethodDataIdealBank::Handelsbanken => "handelsbanken", - UpdateSetupIntentPaymentMethodDataIdealBank::Ing => "ing", - UpdateSetupIntentPaymentMethodDataIdealBank::Knab => "knab", - UpdateSetupIntentPaymentMethodDataIdealBank::Moneyou => "moneyou", - UpdateSetupIntentPaymentMethodDataIdealBank::N26 => "n26", - UpdateSetupIntentPaymentMethodDataIdealBank::Rabobank => "rabobank", - UpdateSetupIntentPaymentMethodDataIdealBank::Regiobank => "regiobank", - UpdateSetupIntentPaymentMethodDataIdealBank::Revolut => "revolut", - UpdateSetupIntentPaymentMethodDataIdealBank::SnsBank => "sns_bank", - UpdateSetupIntentPaymentMethodDataIdealBank::TriodosBank => "triodos_bank", - UpdateSetupIntentPaymentMethodDataIdealBank::VanLanschot => "van_lanschot", - UpdateSetupIntentPaymentMethodDataIdealBank::Yoursafe => "yoursafe", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataIdealBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataIdealBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataIdealBank { - fn default() -> Self { - Self::AbnAmro - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodDataP24`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataP24Bank { - AliorBank, - BankMillennium, - BankNowyBfgSa, - BankPekaoSa, - BankiSpbdzielcze, - Blik, - BnpParibas, - Boz, - CitiHandlowy, - CreditAgricole, - Envelobank, - EtransferPocztowy24, - GetinBank, - Ideabank, - Ing, - Inteligo, - MbankMtransfer, - NestPrzelew, - NoblePay, - PbacZIpko, - PlusBank, - SantanderPrzelew24, - TmobileUsbugiBankowe, - ToyotaBank, - VolkswagenBank, -} - -impl UpdateSetupIntentPaymentMethodDataP24Bank { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataP24Bank::AliorBank => "alior_bank", - UpdateSetupIntentPaymentMethodDataP24Bank::BankMillennium => "bank_millennium", - UpdateSetupIntentPaymentMethodDataP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa", - UpdateSetupIntentPaymentMethodDataP24Bank::BankPekaoSa => "bank_pekao_sa", - UpdateSetupIntentPaymentMethodDataP24Bank::BankiSpbdzielcze => "banki_spbdzielcze", - UpdateSetupIntentPaymentMethodDataP24Bank::Blik => "blik", - UpdateSetupIntentPaymentMethodDataP24Bank::BnpParibas => "bnp_paribas", - UpdateSetupIntentPaymentMethodDataP24Bank::Boz => "boz", - UpdateSetupIntentPaymentMethodDataP24Bank::CitiHandlowy => "citi_handlowy", - UpdateSetupIntentPaymentMethodDataP24Bank::CreditAgricole => "credit_agricole", - UpdateSetupIntentPaymentMethodDataP24Bank::Envelobank => "envelobank", - UpdateSetupIntentPaymentMethodDataP24Bank::EtransferPocztowy24 => { - "etransfer_pocztowy24" - } - UpdateSetupIntentPaymentMethodDataP24Bank::GetinBank => "getin_bank", - UpdateSetupIntentPaymentMethodDataP24Bank::Ideabank => "ideabank", - UpdateSetupIntentPaymentMethodDataP24Bank::Ing => "ing", - UpdateSetupIntentPaymentMethodDataP24Bank::Inteligo => "inteligo", - UpdateSetupIntentPaymentMethodDataP24Bank::MbankMtransfer => "mbank_mtransfer", - UpdateSetupIntentPaymentMethodDataP24Bank::NestPrzelew => "nest_przelew", - UpdateSetupIntentPaymentMethodDataP24Bank::NoblePay => "noble_pay", - UpdateSetupIntentPaymentMethodDataP24Bank::PbacZIpko => "pbac_z_ipko", - UpdateSetupIntentPaymentMethodDataP24Bank::PlusBank => "plus_bank", - UpdateSetupIntentPaymentMethodDataP24Bank::SantanderPrzelew24 => "santander_przelew24", - UpdateSetupIntentPaymentMethodDataP24Bank::TmobileUsbugiBankowe => { - "tmobile_usbugi_bankowe" - } - UpdateSetupIntentPaymentMethodDataP24Bank::ToyotaBank => "toyota_bank", - UpdateSetupIntentPaymentMethodDataP24Bank::VolkswagenBank => "volkswagen_bank", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataP24Bank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataP24Bank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataP24Bank { - fn default() -> Self { - Self::AliorBank - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodDataSofort`'s `country` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataSofortCountry { - #[serde(rename = "AT")] - At, - #[serde(rename = "BE")] - Be, - #[serde(rename = "DE")] - De, - #[serde(rename = "ES")] - Es, - #[serde(rename = "IT")] - It, - #[serde(rename = "NL")] - Nl, -} - -impl UpdateSetupIntentPaymentMethodDataSofortCountry { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataSofortCountry::At => "AT", - UpdateSetupIntentPaymentMethodDataSofortCountry::Be => "BE", - UpdateSetupIntentPaymentMethodDataSofortCountry::De => "DE", - UpdateSetupIntentPaymentMethodDataSofortCountry::Es => "ES", - UpdateSetupIntentPaymentMethodDataSofortCountry::It => "IT", - UpdateSetupIntentPaymentMethodDataSofortCountry::Nl => "NL", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataSofortCountry { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataSofortCountry { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataSofortCountry { - fn default() -> Self { - Self::At - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodData`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataType { - AcssDebit, - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, - Zip, -} - -impl UpdateSetupIntentPaymentMethodDataType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataType::AcssDebit => "acss_debit", - UpdateSetupIntentPaymentMethodDataType::Affirm => "affirm", - UpdateSetupIntentPaymentMethodDataType::AfterpayClearpay => "afterpay_clearpay", - UpdateSetupIntentPaymentMethodDataType::Alipay => "alipay", - UpdateSetupIntentPaymentMethodDataType::AuBecsDebit => "au_becs_debit", - UpdateSetupIntentPaymentMethodDataType::BacsDebit => "bacs_debit", - UpdateSetupIntentPaymentMethodDataType::Bancontact => "bancontact", - UpdateSetupIntentPaymentMethodDataType::Blik => "blik", - UpdateSetupIntentPaymentMethodDataType::Boleto => "boleto", - UpdateSetupIntentPaymentMethodDataType::Cashapp => "cashapp", - UpdateSetupIntentPaymentMethodDataType::CustomerBalance => "customer_balance", - UpdateSetupIntentPaymentMethodDataType::Eps => "eps", - UpdateSetupIntentPaymentMethodDataType::Fpx => "fpx", - UpdateSetupIntentPaymentMethodDataType::Giropay => "giropay", - UpdateSetupIntentPaymentMethodDataType::Grabpay => "grabpay", - UpdateSetupIntentPaymentMethodDataType::Ideal => "ideal", - UpdateSetupIntentPaymentMethodDataType::Klarna => "klarna", - UpdateSetupIntentPaymentMethodDataType::Konbini => "konbini", - UpdateSetupIntentPaymentMethodDataType::Link => "link", - UpdateSetupIntentPaymentMethodDataType::Oxxo => "oxxo", - UpdateSetupIntentPaymentMethodDataType::P24 => "p24", - UpdateSetupIntentPaymentMethodDataType::Paynow => "paynow", - UpdateSetupIntentPaymentMethodDataType::Paypal => "paypal", - UpdateSetupIntentPaymentMethodDataType::Pix => "pix", - UpdateSetupIntentPaymentMethodDataType::Promptpay => "promptpay", - UpdateSetupIntentPaymentMethodDataType::SepaDebit => "sepa_debit", - UpdateSetupIntentPaymentMethodDataType::Sofort => "sofort", - UpdateSetupIntentPaymentMethodDataType::UsBankAccount => "us_bank_account", - UpdateSetupIntentPaymentMethodDataType::WechatPay => "wechat_pay", - UpdateSetupIntentPaymentMethodDataType::Zip => "zip", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataType { - fn default() -> Self { - Self::AcssDebit - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodDataUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::Company => "company", - UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::Individual => { - "individual" - } - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodDataUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { - Checking, - Savings, -} - -impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::Checking => "checking", - UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `default_for` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - Invoice, - Subscription, -} - -impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::Invoice => "invoice", - UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::Subscription => "subscription", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor -{ - fn default() -> Self { - Self::Invoice - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Combined => "combined", - UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Interval => "interval", - UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Sporadic => "sporadic", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - Business, - Personal, -} - -impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business", - UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => { - "automatic" - } - UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant", - UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsCardMandateOptions`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - Fixed, - Maximum, -} - -impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed", - UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::Maximum => "maximum", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsCardMandateOptions`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - Day, - Month, - Sporadic, - Week, - Year, -} - -impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Day => "day", - UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Month => "month", - UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Sporadic => "sporadic", - UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Week => "week", - UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Year => "year", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsCardMandateOptions`'s `supported_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - India, -} - -impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::India => "india", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes -{ - fn default() -> Self { - Self::India - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl UpdateSetupIntentPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Amex => "amex", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::CartesBancaires => "cartes_bancaires", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Diners => "diners", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Discover => "discover", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Interac => "interac", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Unionpay => "unionpay", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Unknown => "unknown", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, -} - -impl UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances", - UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership", - UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method", - UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef - for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - Balances, -} - -impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks`'s `requested` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - Ach, - UsDomesticWire, -} - -impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::Ach => "ach", - UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::UsDomesticWire => { - "us_domestic_wire" - } - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => { - "automatic" - } - UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => { - "instant" - } - UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} diff --git a/src/resources/generated/shipping.rs b/src/resources/generated/shipping.rs deleted file mode 100644 index 37ec84939..000000000 --- a/src/resources/generated/shipping.rs +++ /dev/null @@ -1,32 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::resources::Address; - -/// The resource representing a Stripe "Shipping". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Shipping { - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - #[serde(skip_serializing_if = "Option::is_none")] - pub carrier: Option, - - /// Recipient name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Recipient phone (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// The tracking number for a physical product, obtained from the delivery service. - /// - /// If multiple tracking numbers were generated for this purchase, please separate them with commas. - #[serde(skip_serializing_if = "Option::is_none")] - pub tracking_number: Option, -} diff --git a/src/resources/generated/shipping_rate.rs b/src/resources/generated/shipping_rate.rs deleted file mode 100644 index 62ead279e..000000000 --- a/src/resources/generated/shipping_rate.rs +++ /dev/null @@ -1,712 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ShippingRateId, TaxCodeId}; -use crate::params::{ - CurrencyMap, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp, -}; -use crate::resources::{Currency, TaxCode}; - -/// The resource representing a Stripe "ShippingRate". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ShippingRate { - /// Unique identifier for the object. - pub id: ShippingRateId, - - /// Whether the shipping rate can be used for new purchases. - /// - /// Defaults to `true`. - pub active: bool, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The estimated range for how long shipping will take, meant to be displayable to the customer. - /// - /// This will appear on CheckoutSessions. - pub delivery_estimate: Option, - - /// The name of the shipping rate, meant to be displayable to the customer. - /// - /// This will appear on CheckoutSessions. - pub display_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amount: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - pub tax_behavior: Option, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - /// - /// The Shipping tax code is `txcd_92010001`. - pub tax_code: Option>, - - /// The type of calculation to use on the shipping rate. - /// - /// Can only be `fixed_amount` for now. - #[serde(rename = "type")] - pub type_: ShippingRateType, -} - -impl ShippingRate { - /// Returns a list of your shipping rates. - pub fn list(client: &Client, params: &ListShippingRates<'_>) -> Response> { - client.get_query("/shipping_rates", ¶ms) - } - - /// Creates a new shipping rate object. - pub fn create(client: &Client, params: CreateShippingRate<'_>) -> Response { - client.post_form("/shipping_rates", ¶ms) - } - - /// Returns the shipping rate object with the given ID. - pub fn retrieve( - client: &Client, - id: &ShippingRateId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/shipping_rates/{}", id), &Expand { expand }) - } - - /// Updates an existing shipping rate object. - pub fn update( - client: &Client, - id: &ShippingRateId, - params: UpdateShippingRate<'_>, - ) -> Response { - client.post_form(&format!("/shipping_rates/{}", id), ¶ms) - } -} - -impl Object for ShippingRate { - type Id = ShippingRateId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "shipping_rate" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ShippingRateDeliveryEstimate { - /// The upper bound of the estimated range. - /// - /// If empty, represents no upper bound i.e., infinite. - pub maximum: Option, - - /// The lower bound of the estimated range. - /// - /// If empty, represents no lower bound. - pub minimum: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ShippingRateDeliveryEstimateBound { - /// A unit of time. - pub unit: ShippingRateDeliveryEstimateBoundUnit, - - /// Must be greater than 0. - pub value: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ShippingRateFixedAmount { - /// A non-negative integer in cents representing how much to charge. - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Shipping rates defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ShippingRateCurrencyOption { - /// A non-negative integer in cents representing how much to charge. - pub amount: i64, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - pub tax_behavior: ShippingRateCurrencyOptionTaxBehavior, -} - -/// The parameters for `ShippingRate::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateShippingRate<'a> { - /// The estimated range for how long shipping will take, meant to be displayable to the customer. - /// - /// This will appear on CheckoutSessions. - #[serde(skip_serializing_if = "Option::is_none")] - pub delivery_estimate: Option, - - /// The name of the shipping rate, meant to be displayable to the customer. - /// - /// This will appear on CheckoutSessions. - pub display_name: &'a str, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Describes a fixed amount to charge for shipping. - /// - /// Must be present if type is `fixed_amount`. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amount: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - /// - /// The Shipping tax code is `txcd_92010001`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, - - /// The type of calculation to use on the shipping rate. - /// - /// Can only be `fixed_amount` for now. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -impl<'a> CreateShippingRate<'a> { - pub fn new(display_name: &'a str) -> Self { - CreateShippingRate { - delivery_estimate: Default::default(), - display_name, - expand: Default::default(), - fixed_amount: Default::default(), - metadata: Default::default(), - tax_behavior: Default::default(), - tax_code: Default::default(), - type_: Default::default(), - } - } -} - -/// The parameters for `ShippingRate::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListShippingRates<'a> { - /// Only return shipping rates that are active or inactive. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return shipping rates for the given currency. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListShippingRates<'a> { - pub fn new() -> Self { - ListShippingRates { - active: Default::default(), - created: Default::default(), - currency: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListShippingRates<'_> { - type O = ShippingRate; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `ShippingRate::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateShippingRate<'a> { - /// Whether the shipping rate can be used for new purchases. - /// - /// Defaults to `true`. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Describes a fixed amount to charge for shipping. - /// - /// Must be present if type is `fixed_amount`. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amount: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, -} - -impl<'a> UpdateShippingRate<'a> { - pub fn new() -> Self { - UpdateShippingRate { - active: Default::default(), - expand: Default::default(), - fixed_amount: Default::default(), - metadata: Default::default(), - tax_behavior: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateShippingRateDeliveryEstimate { - /// The upper bound of the estimated range. - /// - /// If empty, represents no upper bound i.e., infinite. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: Option, - - /// The lower bound of the estimated range. - /// - /// If empty, represents no lower bound. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateShippingRateFixedAmount { - /// A non-negative integer in cents representing how much to charge. - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Shipping rates defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateShippingRateFixedAmount { - /// Shipping rates defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateShippingRateDeliveryEstimateMaximum { - /// A unit of time. - pub unit: CreateShippingRateDeliveryEstimateMaximumUnit, - - /// Must be greater than 0. - pub value: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateShippingRateDeliveryEstimateMinimum { - /// A unit of time. - pub unit: CreateShippingRateDeliveryEstimateMinimumUnit, - - /// Must be greater than 0. - pub value: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateShippingRateFixedAmountCurrencyOptions { - /// A non-negative integer in cents representing how much to charge. - pub amount: i64, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateShippingRateFixedAmountCurrencyOptions { - /// A non-negative integer in cents representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, -} - -/// An enum representing the possible values of an `CreateShippingRateDeliveryEstimateMaximum`'s `unit` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateShippingRateDeliveryEstimateMaximumUnit { - BusinessDay, - Day, - Hour, - Month, - Week, -} - -impl CreateShippingRateDeliveryEstimateMaximumUnit { - pub fn as_str(self) -> &'static str { - match self { - CreateShippingRateDeliveryEstimateMaximumUnit::BusinessDay => "business_day", - CreateShippingRateDeliveryEstimateMaximumUnit::Day => "day", - CreateShippingRateDeliveryEstimateMaximumUnit::Hour => "hour", - CreateShippingRateDeliveryEstimateMaximumUnit::Month => "month", - CreateShippingRateDeliveryEstimateMaximumUnit::Week => "week", - } - } -} - -impl AsRef for CreateShippingRateDeliveryEstimateMaximumUnit { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateShippingRateDeliveryEstimateMaximumUnit { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateShippingRateDeliveryEstimateMaximumUnit { - fn default() -> Self { - Self::BusinessDay - } -} - -/// An enum representing the possible values of an `CreateShippingRateDeliveryEstimateMinimum`'s `unit` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateShippingRateDeliveryEstimateMinimumUnit { - BusinessDay, - Day, - Hour, - Month, - Week, -} - -impl CreateShippingRateDeliveryEstimateMinimumUnit { - pub fn as_str(self) -> &'static str { - match self { - CreateShippingRateDeliveryEstimateMinimumUnit::BusinessDay => "business_day", - CreateShippingRateDeliveryEstimateMinimumUnit::Day => "day", - CreateShippingRateDeliveryEstimateMinimumUnit::Hour => "hour", - CreateShippingRateDeliveryEstimateMinimumUnit::Month => "month", - CreateShippingRateDeliveryEstimateMinimumUnit::Week => "week", - } - } -} - -impl AsRef for CreateShippingRateDeliveryEstimateMinimumUnit { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateShippingRateDeliveryEstimateMinimumUnit { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateShippingRateDeliveryEstimateMinimumUnit { - fn default() -> Self { - Self::BusinessDay - } -} - -/// An enum representing the possible values of an `CreateShippingRateFixedAmountCurrencyOptions`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior::Exclusive => "exclusive", - CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior::Inclusive => "inclusive", - CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `ShippingRateCurrencyOption`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ShippingRateCurrencyOptionTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl ShippingRateCurrencyOptionTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - ShippingRateCurrencyOptionTaxBehavior::Exclusive => "exclusive", - ShippingRateCurrencyOptionTaxBehavior::Inclusive => "inclusive", - ShippingRateCurrencyOptionTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for ShippingRateCurrencyOptionTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ShippingRateCurrencyOptionTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ShippingRateCurrencyOptionTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `ShippingRateDeliveryEstimateBound`'s `unit` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ShippingRateDeliveryEstimateBoundUnit { - BusinessDay, - Day, - Hour, - Month, - Week, -} - -impl ShippingRateDeliveryEstimateBoundUnit { - pub fn as_str(self) -> &'static str { - match self { - ShippingRateDeliveryEstimateBoundUnit::BusinessDay => "business_day", - ShippingRateDeliveryEstimateBoundUnit::Day => "day", - ShippingRateDeliveryEstimateBoundUnit::Hour => "hour", - ShippingRateDeliveryEstimateBoundUnit::Month => "month", - ShippingRateDeliveryEstimateBoundUnit::Week => "week", - } - } -} - -impl AsRef for ShippingRateDeliveryEstimateBoundUnit { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ShippingRateDeliveryEstimateBoundUnit { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ShippingRateDeliveryEstimateBoundUnit { - fn default() -> Self { - Self::BusinessDay - } -} - -/// An enum representing the possible values of an `ShippingRate`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ShippingRateTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl ShippingRateTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - ShippingRateTaxBehavior::Exclusive => "exclusive", - ShippingRateTaxBehavior::Inclusive => "inclusive", - ShippingRateTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for ShippingRateTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ShippingRateTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ShippingRateTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `ShippingRate`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ShippingRateType { - FixedAmount, -} - -impl ShippingRateType { - pub fn as_str(self) -> &'static str { - match self { - ShippingRateType::FixedAmount => "fixed_amount", - } - } -} - -impl AsRef for ShippingRateType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ShippingRateType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ShippingRateType { - fn default() -> Self { - Self::FixedAmount - } -} - -/// An enum representing the possible values of an `UpdateShippingRateFixedAmountCurrencyOptions`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior::Exclusive => "exclusive", - UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior::Inclusive => "inclusive", - UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} diff --git a/src/resources/generated/source.rs b/src/resources/generated/source.rs deleted file mode 100644 index 612b2f5a5..000000000 --- a/src/resources/generated/source.rs +++ /dev/null @@ -1,1780 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, SourceId, TokenId}; -use crate::params::{Expand, List, Metadata, Object, Paginable, Timestamp}; -use crate::resources::{ - Address, BillingDetails, Currency, Shipping, SourceRedirectFlowFailureReason, - SourceRedirectFlowStatus, SourceStatus, SourceUsage, -}; - -/// The resource representing a Stripe "Source". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Source { - /// Unique identifier for the object. - pub id: SourceId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ach_credit_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ach_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. - /// - /// This is the amount for which the source will be chargeable once ready. - /// Required for `single_use` sources. - pub amount: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card_present: Option, - - /// The client secret of the source. - /// - /// Used for client-side retrieval using a publishable key. - pub client_secret: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub code_verification: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. - /// - /// This is the currency for which the source will be chargeable once ready. - /// Required for `single_use` sources. - pub currency: Option, - - /// The ID of the customer to which this source is attached. - /// - /// This will not be present when the source has not been attached to a customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// The authentication `flow` of the source. - /// - /// `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. - pub flow: SourceFlow, - - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub multibanco: Option, - - /// Information about the owner of the payment instrument that may be used or required by particular source types. - pub owner: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub receiver: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_credit_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub source_order: Option, - - /// Extra information about a source. - /// - /// This will appear on your customer's statement every time you charge the source. - pub statement_descriptor: Option, - - /// The status of the source, one of `canceled`, `chargeable`, `consumed`, `failed`, or `pending`. - /// - /// Only `chargeable` sources can be used to create a charge. - pub status: SourceStatus, - - #[serde(skip_serializing_if = "Option::is_none")] - pub three_d_secure: Option, - - /// The `type` of the source. - /// - /// The `type` is a payment method, one of `ach_credit_transfer`, `ach_debit`, `alipay`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `multibanco`, `klarna`, `p24`, `sepa_debit`, `sofort`, `three_d_secure`, or `wechat`. - /// An additional hash is included on the source with a name matching this value. - /// It contains additional information specific to the [payment method](https://stripe.com/docs/sources) used. - #[serde(rename = "type")] - pub type_: SourceType, - - /// Either `reusable` or `single_use`. - /// - /// Whether this source should be reusable or not. - /// Some source types may or may not be reusable by construction, while others may leave the option at creation. - /// If an incompatible value is passed, an error will be returned. - pub usage: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat: Option, -} - -impl Source { - /// List source transactions for a given source. - pub fn list(client: &Client, params: &ListSources<'_>) -> Response> { - client.get_query("/sources/{source}/source_transactions", ¶ms) - } - - /// Creates a new source object. - pub fn create(client: &Client, params: CreateSource<'_>) -> Response { - client.post_form("/sources", ¶ms) - } - - /// Retrieves an existing source object. - /// - /// Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. - pub fn retrieve(client: &Client, id: &SourceId, expand: &[&str]) -> Response { - client.get_query(&format!("/sources/{}", id), &Expand { expand }) - } - - /// Updates the specified source by setting the values of the parameters passed. - /// - /// Any parameters not provided will be left unchanged. This request accepts the `metadata` and `owner` as arguments. - /// It is also possible to update type specific information for selected payment methods. - /// Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. - pub fn update(client: &Client, id: &SourceId, params: UpdateSource<'_>) -> Response { - client.post_form(&format!("/sources/{}", id), ¶ms) - } -} - -impl Object for Source { - type Id = SourceId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "source" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceCodeVerificationFlow { - /// The number of attempts remaining to authenticate the source object with a verification code. - pub attempts_remaining: i64, - - /// The status of the code verification, either `pending` (awaiting verification, `attempts_remaining` should be greater than 0), `succeeded` (successful verification) or `failed` (failed verification, cannot be verified anymore as `attempts_remaining` should be 0). - pub status: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceOrder { - /// A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order. - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The email address of the customer placing the order. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// List of items constituting the order. - pub items: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceOrderItem { - /// The amount (price) for this order item. - pub amount: Option, - - /// This currency of this order item. - /// - /// Required when `amount` is present. - pub currency: Option, - - /// Human-readable description for this order item. - pub description: Option, - - /// The ID of the associated object for this line item. - /// - /// Expandable if not null (e.g., expandable to a SKU). - pub parent: Option, - - /// The quantity of this order item. - /// - /// When type is `sku`, this is the number of instances of the SKU to be ordered. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The type of this order item. - /// - /// Must be `sku`, `tax`, or `shipping`. - #[serde(rename = "type")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceOwner { - /// Owner's address. - pub address: Option
, - - /// Owner's email address. - pub email: Option, - - /// Owner's full name. - pub name: Option, - - /// Owner's phone number (including extension). - pub phone: Option, - - /// Verified owner's address. - /// - /// Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_address: Option
, - - /// Verified owner's email address. - /// - /// Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_email: Option, - - /// Verified owner's full name. - /// - /// Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_name: Option, - - /// Verified owner's phone number (including extension). - /// - /// Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_phone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceReceiverFlow { - /// The address of the receiver source. - /// - /// This is the value that should be communicated to the customer to send their funds to. - pub address: Option, - - /// The total amount that was moved to your balance. - /// - /// This is almost always equal to the amount charged. - /// In rare cases when customers deposit excess funds and we are unable to refund those, those funds get moved to your balance and show up in amount_charged as well. - /// The amount charged is expressed in the source's currency. - pub amount_charged: i64, - - /// The total amount received by the receiver source. - /// - /// `amount_received = amount_returned + amount_charged` should be true for consumed sources unless customers deposit excess funds. - /// The amount received is expressed in the source's currency. - pub amount_received: i64, - - /// The total amount that was returned to the customer. - /// - /// The amount returned is expressed in the source's currency. - pub amount_returned: i64, - - /// Type of refund attribute method, one of `email`, `manual`, or `none`. - pub refund_attributes_method: String, - - /// Type of refund attribute status, one of `missing`, `requested`, or `available`. - pub refund_attributes_status: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceRedirectFlow { - /// The failure reason for the redirect, either `user_abort` (the customer aborted or dropped out of the redirect flow), `declined` (the authentication failed or the transaction was declined), or `processing_error` (the redirect failed due to a technical error). - /// - /// Present only if the redirect status is `failed`. - pub failure_reason: Option, - - /// The URL you provide to redirect the customer to after they authenticated their payment. - pub return_url: String, - - /// The status of the redirect, either `pending` (ready to be used by your customer to authenticate the transaction), `succeeded` (succesful authentication, cannot be reused) or `not_required` (redirect should not be used) or `failed` (failed authentication, cannot be reused). - pub status: SourceRedirectFlowStatus, - - /// The URL provided to you to redirect a customer to as part of a `redirect` authentication flow. - pub url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeAchCreditTransfer { - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_type: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_routing_number: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub swift_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeAchDebit { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, - - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeAcssDebit { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_address_city: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_address_line_1: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_address_line_2: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_address_postal_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub category: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeAlipay { - #[serde(skip_serializing_if = "Option::is_none")] - pub data_string: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub native_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeAuBecsDebit { - #[serde(skip_serializing_if = "Option::is_none")] - pub bsb_number: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeBancontact { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bic: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub iban_last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeCard { - #[serde(skip_serializing_if = "Option::is_none")] - pub address_line1_check: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub address_zip_check: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub brand: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc_check: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub dynamic_last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_month: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_year: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub funding: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub three_d_secure: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub tokenization_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeCardPresent { - #[serde(skip_serializing_if = "Option::is_none")] - pub application_cryptogram: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub application_preferred_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub authorization_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub authorization_response_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub brand: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cvm_type: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub data_type: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub dedicated_file_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub emv_auth_data: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub evidence_customer_signature: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub evidence_transaction_certificate: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_month: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_year: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub funding: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pos_device_id: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pos_entry_mode: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub read_method: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub reader: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub terminal_verification_results: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_status_information: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeEps { - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeGiropay { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bic: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeIdeal { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bic: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub iban_last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeKlarna { - #[serde(skip_serializing_if = "Option::is_none")] - pub background_image_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub client_token: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub locale: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub logo_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub page_title: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_later_asset_urls_descriptive: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_later_asset_urls_standard: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_later_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_later_redirect_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_now_asset_urls_descriptive: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_now_asset_urls_standard: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_now_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_now_redirect_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_over_time_asset_urls_descriptive: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_over_time_asset_urls_standard: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_over_time_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_over_time_redirect_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_categories: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub purchase_country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub purchase_type: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_delay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_first_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_last_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeMultibanco { - #[serde(skip_serializing_if = "Option::is_none")] - pub entity: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_city: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_line1: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_line2: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_postal_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_state: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_iban: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeP24 { - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeSepaCreditTransfer { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bic: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub iban: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_city: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_line1: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_line2: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_postal_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_state: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_iban: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeSepaDebit { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub branch_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_reference: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeSofort { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bic: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub iban_last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeThreeDSecure { - #[serde(skip_serializing_if = "Option::is_none")] - pub address_line1_check: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub address_zip_check: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub authenticated: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub brand: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc_check: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub dynamic_last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_month: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_year: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub funding: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub three_d_secure: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub tokenization_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeWechat { - #[serde(skip_serializing_if = "Option::is_none")] - pub prepay_id: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub qr_code_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -/// The parameters for `Source::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateSource<'a> { - /// Amount associated with the source. - /// - /// This is the amount for which the source will be chargeable once ready. - /// Required for `single_use` sources. - /// Not supported for `receiver` type sources, where charge amount may not be specified until funds land. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. - /// - /// This is the currency for which the source will be chargeable once ready. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// The `Customer` to whom the original source is attached to. - /// - /// Must be set when the original source is not a `Source` (e.g., `Card`). - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The authentication `flow` of the source to create. - /// - /// `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. - /// It is generally inferred unless a type supports multiple flows. - #[serde(skip_serializing_if = "Option::is_none")] - pub flow: Option, - - /// Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The source to share. - #[serde(skip_serializing_if = "Option::is_none")] - pub original_source: Option<&'a str>, - - /// Information about the owner of the payment instrument that may be used or required by particular source types. - #[serde(skip_serializing_if = "Option::is_none")] - pub owner: Option, - - /// Optional parameters for the receiver flow. - /// - /// Can be set only if the source is a receiver (`flow` is `receiver`). - #[serde(skip_serializing_if = "Option::is_none")] - pub receiver: Option, - - /// Parameters required for the redirect flow. - /// - /// Required if the source is authenticated by a redirect (`flow` is `redirect`). - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect: Option, - - /// Information about the items and shipping associated with the source. - /// - /// Required for transactional credit (for example Klarna) sources before you can charge it. - #[serde(skip_serializing_if = "Option::is_none")] - pub source_order: Option, - - /// An arbitrary string to be displayed on your customer's statement. - /// - /// As an example, if your website is `RunClub` and the item you're charging for is a race ticket, you may want to specify a `statement_descriptor` of `RunClub 5K race ticket.` While many payment types will display this information, some may not display it at all. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option<&'a str>, - - /// An optional token used to create the source. - /// - /// When passed, token properties will override source parameters. - #[serde(skip_serializing_if = "Option::is_none")] - pub token: Option, - - /// The `type` of the source to create. - /// - /// Required unless `customer` and `original_source` are specified (see the [Cloning card Sources](https://stripe.com/docs/sources/connect#cloning-card-sources) guide). - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option<&'a str>, -} - -impl<'a> CreateSource<'a> { - pub fn new() -> Self { - CreateSource { - amount: Default::default(), - currency: Default::default(), - customer: Default::default(), - expand: Default::default(), - flow: Default::default(), - mandate: Default::default(), - metadata: Default::default(), - original_source: Default::default(), - owner: Default::default(), - receiver: Default::default(), - redirect: Default::default(), - source_order: Default::default(), - statement_descriptor: Default::default(), - token: Default::default(), - type_: Default::default(), - } - } -} - -/// The parameters for `Source::list`. -#[derive(Clone, Debug, Serialize)] -pub struct ListSources<'a> { - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListSources<'a> { - pub fn new() -> Self { - ListSources { - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListSources<'_> { - type O = Source; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Source::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateSource<'a> { - /// Amount associated with the source. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Information about the owner of the payment instrument that may be used or required by particular source types. - #[serde(skip_serializing_if = "Option::is_none")] - pub owner: Option, - - /// Information about the items and shipping associated with the source. - /// - /// Required for transactional credit (for example Klarna) sources before you can charge it. - #[serde(skip_serializing_if = "Option::is_none")] - pub source_order: Option, -} - -impl<'a> UpdateSource<'a> { - pub fn new() -> Self { - UpdateSource { - amount: Default::default(), - expand: Default::default(), - mandate: Default::default(), - metadata: Default::default(), - owner: Default::default(), - source_order: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSourceReceiver { - /// The method Stripe should use to request information needed to process a refund or mispayment. - /// - /// Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). - /// Refer to each payment method's documentation to learn which refund attributes may be required. - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_attributes_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSourceRedirect { - /// The URL you provide to redirect the customer back to you after they authenticated their payment. - /// - /// It can use your application URI scheme in the context of a mobile application. - pub return_url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSourceSourceOrder { - /// List of items constituting the order. - #[serde(skip_serializing_if = "Option::is_none")] - pub items: Option>, - - /// Shipping address for the order. - /// - /// Required if any of the SKUs are for products that have `shippable` set to true. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceMandateParams { - /// The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub acceptance: Option, - - /// The amount specified by the mandate. - /// - /// (Leave null for a mandate covering all amounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// The currency specified by the mandate. - /// - /// (Must match `currency` of the source). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// The interval of debits permitted by the mandate. - /// - /// Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval: Option, - - /// The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. - /// - /// Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). - #[serde(skip_serializing_if = "Option::is_none")] - pub notification_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSourceSourceOrder { - /// List of items constituting the order. - #[serde(skip_serializing_if = "Option::is_none")] - pub items: Option>, - - /// Shipping address for the order. - /// - /// Required if any of the SKUs are for products that have `shippable` set to true. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSourceSourceOrderItems { - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// The ID of the SKU being ordered. - #[serde(skip_serializing_if = "Option::is_none")] - pub parent: Option, - - /// The quantity of this order item. - /// - /// When type is `sku`, this is the number of instances of the SKU to be ordered. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSourceSourceOrderShipping { - /// Shipping address. - pub address: CreateSourceSourceOrderShippingAddress, - - /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - #[serde(skip_serializing_if = "Option::is_none")] - pub carrier: Option, - - /// Recipient name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Recipient phone (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// The tracking number for a physical product, obtained from the delivery service. - /// - /// If multiple tracking numbers were generated for this purchase, please separate them with commas. - #[serde(skip_serializing_if = "Option::is_none")] - pub tracking_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceAcceptanceParams { - /// The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub date: Option, - - /// The IP address from which the mandate was accepted or refused by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip: Option, - - /// The parameters required to store a mandate accepted offline. - /// - /// Should only be set if `mandate[type]` is `offline`. - #[serde(skip_serializing_if = "Option::is_none")] - pub offline: Option, - - /// The parameters required to store a mandate accepted online. - /// - /// Should only be set if `mandate[type]` is `online`. - #[serde(skip_serializing_if = "Option::is_none")] - pub online: Option, - - /// The status of the mandate acceptance. - /// - /// Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). - pub status: SourceAcceptanceParamsStatus, - - /// The type of acceptance information included with the mandate. - /// - /// Either `online` or `offline`. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, - - /// The user agent of the browser from which the mandate was accepted or refused by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSourceSourceOrderItems { - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// The ID of the SKU being ordered. - #[serde(skip_serializing_if = "Option::is_none")] - pub parent: Option, - - /// The quantity of this order item. - /// - /// When type is `sku`, this is the number of instances of the SKU to be ordered. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSourceSourceOrderShipping { - /// Shipping address. - pub address: UpdateSourceSourceOrderShippingAddress, - - /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - #[serde(skip_serializing_if = "Option::is_none")] - pub carrier: Option, - - /// Recipient name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Recipient phone (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// The tracking number for a physical product, obtained from the delivery service. - /// - /// If multiple tracking numbers were generated for this purchase, please separate them with commas. - #[serde(skip_serializing_if = "Option::is_none")] - pub tracking_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSourceSourceOrderShippingAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - pub line1: String, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceAcceptanceOfflineParams { - /// An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`. - pub contact_email: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceAcceptanceOnlineParams { - /// The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub date: Option, - - /// The IP address from which the mandate was accepted or refused by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip: Option, - - /// The user agent of the browser from which the mandate was accepted or refused by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSourceSourceOrderShippingAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - pub line1: String, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -/// An enum representing the possible values of an `CreateSourceSourceOrderItems`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSourceSourceOrderItemsType { - Discount, - Shipping, - Sku, - Tax, -} - -impl CreateSourceSourceOrderItemsType { - pub fn as_str(self) -> &'static str { - match self { - CreateSourceSourceOrderItemsType::Discount => "discount", - CreateSourceSourceOrderItemsType::Shipping => "shipping", - CreateSourceSourceOrderItemsType::Sku => "sku", - CreateSourceSourceOrderItemsType::Tax => "tax", - } - } -} - -impl AsRef for CreateSourceSourceOrderItemsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSourceSourceOrderItemsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSourceSourceOrderItemsType { - fn default() -> Self { - Self::Discount - } -} - -/// An enum representing the possible values of an `SourceAcceptanceParams`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceAcceptanceParamsStatus { - Accepted, - Pending, - Refused, - Revoked, -} - -impl SourceAcceptanceParamsStatus { - pub fn as_str(self) -> &'static str { - match self { - SourceAcceptanceParamsStatus::Accepted => "accepted", - SourceAcceptanceParamsStatus::Pending => "pending", - SourceAcceptanceParamsStatus::Refused => "refused", - SourceAcceptanceParamsStatus::Revoked => "revoked", - } - } -} - -impl AsRef for SourceAcceptanceParamsStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceAcceptanceParamsStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SourceAcceptanceParamsStatus { - fn default() -> Self { - Self::Accepted - } -} - -/// An enum representing the possible values of an `SourceAcceptanceParams`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceAcceptanceParamsType { - Offline, - Online, -} - -impl SourceAcceptanceParamsType { - pub fn as_str(self) -> &'static str { - match self { - SourceAcceptanceParamsType::Offline => "offline", - SourceAcceptanceParamsType::Online => "online", - } - } -} - -impl AsRef for SourceAcceptanceParamsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceAcceptanceParamsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SourceAcceptanceParamsType { - fn default() -> Self { - Self::Offline - } -} - -/// An enum representing the possible values of an `CreateSource`'s `flow` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceFlow { - CodeVerification, - None, - Receiver, - Redirect, -} - -impl SourceFlow { - pub fn as_str(self) -> &'static str { - match self { - SourceFlow::CodeVerification => "code_verification", - SourceFlow::None => "none", - SourceFlow::Receiver => "receiver", - SourceFlow::Redirect => "redirect", - } - } -} - -impl AsRef for SourceFlow { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceFlow { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SourceFlow { - fn default() -> Self { - Self::CodeVerification - } -} - -/// An enum representing the possible values of an `SourceMandateParams`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceMandateInterval { - OneTime, - Scheduled, - Variable, -} - -impl SourceMandateInterval { - pub fn as_str(self) -> &'static str { - match self { - SourceMandateInterval::OneTime => "one_time", - SourceMandateInterval::Scheduled => "scheduled", - SourceMandateInterval::Variable => "variable", - } - } -} - -impl AsRef for SourceMandateInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceMandateInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SourceMandateInterval { - fn default() -> Self { - Self::OneTime - } -} - -/// An enum representing the possible values of an `SourceMandateParams`'s `notification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceMandateNotificationMethod { - DeprecatedNone, - Email, - Manual, - None, - StripeEmail, -} - -impl SourceMandateNotificationMethod { - pub fn as_str(self) -> &'static str { - match self { - SourceMandateNotificationMethod::DeprecatedNone => "deprecated_none", - SourceMandateNotificationMethod::Email => "email", - SourceMandateNotificationMethod::Manual => "manual", - SourceMandateNotificationMethod::None => "none", - SourceMandateNotificationMethod::StripeEmail => "stripe_email", - } - } -} - -impl AsRef for SourceMandateNotificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceMandateNotificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SourceMandateNotificationMethod { - fn default() -> Self { - Self::DeprecatedNone - } -} - -/// An enum representing the possible values of an `CreateSourceReceiver`'s `refund_attributes_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceRefundNotificationMethod { - Email, - Manual, - None, -} - -impl SourceRefundNotificationMethod { - pub fn as_str(self) -> &'static str { - match self { - SourceRefundNotificationMethod::Email => "email", - SourceRefundNotificationMethod::Manual => "manual", - SourceRefundNotificationMethod::None => "none", - } - } -} - -impl AsRef for SourceRefundNotificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceRefundNotificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SourceRefundNotificationMethod { - fn default() -> Self { - Self::Email - } -} - -/// An enum representing the possible values of an `Source`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceType { - AchCreditTransfer, - AchDebit, - AcssDebit, - Alipay, - AuBecsDebit, - Bancontact, - Card, - CardPresent, - Eps, - Giropay, - Ideal, - Klarna, - Multibanco, - P24, - SepaCreditTransfer, - SepaDebit, - Sofort, - ThreeDSecure, - Wechat, -} - -impl SourceType { - pub fn as_str(self) -> &'static str { - match self { - SourceType::AchCreditTransfer => "ach_credit_transfer", - SourceType::AchDebit => "ach_debit", - SourceType::AcssDebit => "acss_debit", - SourceType::Alipay => "alipay", - SourceType::AuBecsDebit => "au_becs_debit", - SourceType::Bancontact => "bancontact", - SourceType::Card => "card", - SourceType::CardPresent => "card_present", - SourceType::Eps => "eps", - SourceType::Giropay => "giropay", - SourceType::Ideal => "ideal", - SourceType::Klarna => "klarna", - SourceType::Multibanco => "multibanco", - SourceType::P24 => "p24", - SourceType::SepaCreditTransfer => "sepa_credit_transfer", - SourceType::SepaDebit => "sepa_debit", - SourceType::Sofort => "sofort", - SourceType::ThreeDSecure => "three_d_secure", - SourceType::Wechat => "wechat", - } - } -} - -impl AsRef for SourceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SourceType { - fn default() -> Self { - Self::AchCreditTransfer - } -} - -/// An enum representing the possible values of an `UpdateSourceSourceOrderItems`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSourceSourceOrderItemsType { - Discount, - Shipping, - Sku, - Tax, -} - -impl UpdateSourceSourceOrderItemsType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSourceSourceOrderItemsType::Discount => "discount", - UpdateSourceSourceOrderItemsType::Shipping => "shipping", - UpdateSourceSourceOrderItemsType::Sku => "sku", - UpdateSourceSourceOrderItemsType::Tax => "tax", - } - } -} - -impl AsRef for UpdateSourceSourceOrderItemsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSourceSourceOrderItemsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSourceSourceOrderItemsType { - fn default() -> Self { - Self::Discount - } -} diff --git a/src/resources/generated/source_mandate_notification.rs b/src/resources/generated/source_mandate_notification.rs deleted file mode 100644 index fb669fef4..000000000 --- a/src/resources/generated/source_mandate_notification.rs +++ /dev/null @@ -1,98 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{SourceMandateNotificationId}; -use crate::params::{Object, Timestamp}; -use crate::resources::{Source}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "SourceMandateNotification". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceMandateNotification { - /// Unique identifier for the object. - pub id: SourceMandateNotificationId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the amount associated with the mandate notification. - /// - /// The amount is expressed in the currency of the underlying source. - /// Required if the notification type is `debit_initiated`. - pub amount: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The reason of the mandate notification. - /// - /// Valid reasons are `mandate_confirmed` or `debit_initiated`. - pub reason: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - pub source: Source, - - /// The status of the mandate notification. - /// - /// Valid statuses are `pending` or `submitted`. - pub status: String, - - /// The type of source this mandate notification is attached to. - /// - /// Should be the source type identifier code for the payment method, such as `three_d_secure`. - #[serde(rename = "type")] - pub type_: String, -} - -impl Object for SourceMandateNotification { - type Id = SourceMandateNotificationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "source_mandate_notification" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceMandateNotificationAcssDebitData { - - /// The statement descriptor associate with the debit. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceMandateNotificationBacsDebitData { - - /// Last 4 digits of the account number associated with the debit. - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceMandateNotificationSepaDebitData { - - /// SEPA creditor ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub creditor_identifier: Option, - - /// Last 4 digits of the account number associated with the debit. - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - /// Mandate reference associated with the debit. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_reference: Option, -} diff --git a/src/resources/generated/source_transaction.rs b/src/resources/generated/source_transaction.rs deleted file mode 100644 index 1528d0a27..000000000 --- a/src/resources/generated/source_transaction.rs +++ /dev/null @@ -1,237 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{ChargeId}; -use crate::params::{Object, Timestamp}; -use crate::resources::{Currency}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "SourceTransaction". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTransaction { - /// Unique identifier for the object. - pub id: ChargeId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ach_credit_transfer: Option, - - /// A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the amount your customer has pushed to the receiver. - pub amount: i64, - - #[serde(skip_serializing_if = "Option::is_none")] - pub chf_credit_transfer: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - #[serde(skip_serializing_if = "Option::is_none")] - pub gbp_credit_transfer: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paper_check: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_credit_transfer: Option, - - /// The ID of the source this transaction is attached to. - pub source: String, - - /// The status of the transaction, one of `succeeded`, `pending`, or `failed`. - pub status: String, - - /// The type of source this transaction is attached to. - #[serde(rename = "type")] - pub type_: SourceTransactionType, -} - -impl Object for SourceTransaction { - type Id = ChargeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "source_transaction" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTransactionAchCreditTransferData { - - /// Customer data associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_data: Option, - - /// Bank account fingerprint associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - /// Last 4 digits of the account number associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - /// Routing number associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTransactionChfCreditTransferData { - - /// Reference associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// Sender's country address. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_address_country: Option, - - /// Sender's line 1 address. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_address_line1: Option, - - /// Sender's bank account IBAN. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_iban: Option, - - /// Sender's name. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTransactionGbpCreditTransferData { - - /// Bank account fingerprint associated with the Stripe owned bank account receiving the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - /// The credit transfer rails the sender used to push this transfer. - /// - /// The possible rails are: Faster Payments, BACS, CHAPS, and wire transfers. - /// Currently only Faster Payments is supported. - #[serde(skip_serializing_if = "Option::is_none")] - pub funding_method: Option, - - /// Last 4 digits of sender account number associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - /// Sender entered arbitrary information about the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// Sender account number associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_account_number: Option, - - /// Sender name associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_name: Option, - - /// Sender sort code associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTransactionPaperCheckData { - - /// Time at which the deposited funds will be available for use. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub available_at: Option, - - /// Comma-separated list of invoice IDs associated with the paper check. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoices: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTransactionSepaCreditTransferData { - - /// Reference associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// Sender's bank account IBAN. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_iban: Option, - - /// Sender's name. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_name: Option, -} - -/// An enum representing the possible values of an `SourceTransaction`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceTransactionType { - AchCreditTransfer, - AchDebit, - Alipay, - Bancontact, - Card, - CardPresent, - Eps, - Giropay, - Ideal, - Klarna, - Multibanco, - P24, - SepaDebit, - Sofort, - ThreeDSecure, - Wechat, -} - -impl SourceTransactionType { - pub fn as_str(self) -> &'static str { - match self { - SourceTransactionType::AchCreditTransfer => "ach_credit_transfer", - SourceTransactionType::AchDebit => "ach_debit", - SourceTransactionType::Alipay => "alipay", - SourceTransactionType::Bancontact => "bancontact", - SourceTransactionType::Card => "card", - SourceTransactionType::CardPresent => "card_present", - SourceTransactionType::Eps => "eps", - SourceTransactionType::Giropay => "giropay", - SourceTransactionType::Ideal => "ideal", - SourceTransactionType::Klarna => "klarna", - SourceTransactionType::Multibanco => "multibanco", - SourceTransactionType::P24 => "p24", - SourceTransactionType::SepaDebit => "sepa_debit", - SourceTransactionType::Sofort => "sofort", - SourceTransactionType::ThreeDSecure => "three_d_secure", - SourceTransactionType::Wechat => "wechat", - } - } -} - -impl AsRef for SourceTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SourceTransactionType { - fn default() -> Self { - Self::AchCreditTransfer - } -} diff --git a/src/resources/generated/subscription.rs b/src/resources/generated/subscription.rs deleted file mode 100644 index 771129d25..000000000 --- a/src/resources/generated/subscription.rs +++ /dev/null @@ -1,3581 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CouponId, CustomerId, PlanId, PriceId, PromotionCodeId, SubscriptionId}; -use crate::params::{ - Deleted, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp, -}; -use crate::resources::{ - Account, Application, CollectionMethod, Currency, Customer, Discount, Invoice, - InvoicePaymentMethodOptionsAcssDebit, InvoicePaymentMethodOptionsBancontact, - InvoicePaymentMethodOptionsCustomerBalance, InvoicePaymentMethodOptionsKonbini, - InvoicePaymentMethodOptionsUsBankAccount, PaymentMethod, PaymentSource, Scheduled, SetupIntent, - SubscriptionBillingThresholds, SubscriptionItem, SubscriptionItemBillingThresholds, - SubscriptionSchedule, SubscriptionTransferData, TaxRate, TestHelpersTestClock, -}; - -/// The resource representing a Stripe "Subscription". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Subscription { - /// Unique identifier for the object. - pub id: SubscriptionId, - - /// ID of the Connect Application that created the subscription. - pub application: Option>, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - pub application_fee_percent: Option, - - pub automatic_tax: SubscriptionAutomaticTax, - - /// Determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. - /// - /// The timestamp is in UTC format. - pub billing_cycle_anchor: Timestamp, - - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - pub billing_thresholds: Option, - - /// A date in the future at which the subscription will automatically get canceled. - pub cancel_at: Option, - - /// If the subscription has been canceled with the `at_period_end` flag set to `true`, `cancel_at_period_end` on the subscription will be true. - /// - /// You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period. - pub cancel_at_period_end: bool, - - /// If the subscription has been canceled, the date of that cancellation. - /// - /// If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state. - pub canceled_at: Option, - - /// Details about why this subscription was cancelled. - pub cancellation_details: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - pub collection_method: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// End of the current period that the subscription has been invoiced for. - /// - /// At the end of this period, a new invoice will be created. - pub current_period_end: Timestamp, - - /// Start of the current period that the subscription has been invoiced for. - pub current_period_start: Timestamp, - - /// ID of the customer who owns the subscription. - pub customer: Expandable, - - /// Number of days a customer has to pay invoices generated by this subscription. - /// - /// This value will be `null` for subscriptions where `collection_method=charge_automatically`. - pub days_until_due: Option, - - /// ID of the default payment method for the subscription. - /// - /// It must belong to the customer associated with the subscription. - /// This takes precedence over `default_source`. - /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - pub default_payment_method: Option>, - - /// ID of the default payment source for the subscription. - /// - /// It must belong to the customer associated with the subscription and be in a chargeable state. - /// If `default_payment_method` is also set, `default_payment_method` will take precedence. - /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - pub default_source: Option>, - - /// The tax rates that will apply to any subscription item that does not have `tax_rates` set. - /// - /// Invoices created will have their `default_tax_rates` populated from the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - /// The subscription's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces. - pub description: Option, - - /// Describes the current discount applied to this subscription, if there is one. - /// - /// When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. - pub discount: Option, - - /// If the subscription has ended, the date the subscription ended. - pub ended_at: Option, - - /// List of subscription items, each with an attached price. - pub items: List, - - /// The most recent invoice this subscription has generated. - pub latest_invoice: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`. - pub next_pending_invoice_item_invoice: Option, - - /// The account (if any) the charge was made on behalf of for charges associated with this subscription. - /// - /// See the Connect documentation for details. - pub on_behalf_of: Option>, - - /// If specified, payment collection for this subscription will be paused. - pub pause_collection: Option, - - /// Payment settings passed on to invoices created by the subscription. - pub payment_settings: Option, - - /// Specifies an interval for how often to bill for any pending invoice items. - /// - /// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. - pub pending_invoice_item_interval: Option, - - /// You can use this [SetupIntent](https://stripe.com/docs/api/setup_intents) to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. - /// - /// Learn more in the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication#scenario-2). - pub pending_setup_intent: Option>, - - /// If specified, [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid. - pub pending_update: Option, - - /// The schedule attached to the subscription. - pub schedule: Option>, - - /// Date when the subscription was first created. - /// - /// The date might differ from the `created` date due to backdating. - pub start_date: Timestamp, - - /// Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, or `unpaid`. - /// - /// For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. - /// A subscription in this state can only have metadata and default_source updated. - /// Once the first invoice is paid, the subscription moves into an `active` state. - /// If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. - /// This is a terminal state, the open invoice will be voided and no further invoices will be generated. - /// A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. - /// If subscription `collection_method=charge_automatically`, it becomes `past_due` when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). - /// Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings). - /// If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. - /// Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). - /// After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices. - pub status: SubscriptionStatus, - - /// ID of the test clock this subscription belongs to. - pub test_clock: Option>, - - /// The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. - pub transfer_data: Option, - - /// If the subscription has a trial, the end of that trial. - pub trial_end: Option, - - /// Settings related to subscription trials. - pub trial_settings: Option, - - /// If the subscription has a trial, the beginning of that trial. - pub trial_start: Option, -} - -impl Subscription { - /// By default, returns a list of subscriptions that have not been canceled. - /// - /// In order to list canceled subscriptions, specify `status=canceled`. - pub fn list(client: &Client, params: &ListSubscriptions<'_>) -> Response> { - client.get_query("/subscriptions", ¶ms) - } - - /// Creates a new subscription on an existing customer. - /// - /// Each customer can have up to 500 active or scheduled subscriptions. When you create a subscription with `collection_method=charge_automatically`, the first invoice is finalized as part of the request. The `payment_behavior` parameter determines the exact behavior of the initial payment. To start subscriptions where the first invoice always begins in a `draft` status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead. Schedules provide the flexibility to model more complex billing configurations that change over time. - pub fn create(client: &Client, params: CreateSubscription<'_>) -> Response { - client.post_form("/subscriptions", ¶ms) - } - - /// Retrieves the subscription with the given ID. - pub fn retrieve( - client: &Client, - id: &SubscriptionId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/subscriptions/{}", id), &Expand { expand }) - } - - /// Updates an existing subscription on a customer to match the specified parameters. - /// - /// When changing plans or quantities, we will optionally prorate the price we charge next month to make up for any price changes. - /// To preview how the proration will be calculated, use the [upcoming invoice](https://stripe.com/docs/api#upcoming_invoice) endpoint. - pub fn update( - client: &Client, - id: &SubscriptionId, - params: UpdateSubscription<'_>, - ) -> Response { - client.post_form(&format!("/subscriptions/{}", id), ¶ms) - } - - /// Cancels a customer’s subscription immediately. - /// - /// The customer will not be charged again for the subscription. Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). - /// If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. - /// But if the subscription is set to cancel immediately, pending prorations will be removed. By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. - /// This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. - /// However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. - /// Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. - pub fn delete(client: &Client, id: &SubscriptionId) -> Response> { - client.delete(&format!("/subscriptions/{}", id)) - } -} - -impl Object for Subscription { - type Id = SubscriptionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "subscription" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CancellationDetails { - /// Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. - pub comment: Option, - - /// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. - pub feedback: Option, - - /// Why this subscription was canceled. - pub reason: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionAutomaticTax { - /// Whether Stripe automatically computes tax on this subscription. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionPendingInvoiceItemInterval { - /// Specifies invoicing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: PlanInterval, - - /// The number of intervals between invoices. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - pub interval_count: u64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionsResourcePauseCollection { - /// The payment collection behavior for this subscription while paused. - /// - /// One of `keep_as_draft`, `mark_uncollectible`, or `void`. - pub behavior: SubscriptionsResourcePauseCollectionBehavior, - - /// The time after which the subscription will resume collecting payments. - pub resumes_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionsResourcePaymentSettings { - /// Payment-method-specific configuration to provide to invoices created by the subscription. - pub payment_method_options: Option, - - /// The list of payment method types to provide to every invoice created by the subscription. - /// - /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). - pub payment_method_types: Option>, - - /// Either `off`, or `on_subscription`. - /// - /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. - pub save_default_payment_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionsResourcePaymentMethodOptions { - /// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to invoices created by the subscription. - pub acss_debit: Option, - - /// This sub-hash contains details about the Bancontact payment method options to pass to invoices created by the subscription. - pub bancontact: Option, - - /// This sub-hash contains details about the Card payment method options to pass to invoices created by the subscription. - pub card: Option, - - /// This sub-hash contains details about the Bank transfer payment method options to pass to invoices created by the subscription. - pub customer_balance: Option, - - /// This sub-hash contains details about the Konbini payment method options to pass to invoices created by the subscription. - pub konbini: Option, - - /// This sub-hash contains details about the ACH direct debit payment method options to pass to invoices created by the subscription. - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionPaymentMethodOptionsCard { - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Selected network to process this Subscription on. - /// - /// Depends on the available networks of the card attached to the Subscription. - /// Can be only set confirm-time. - pub network: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - pub request_three_d_secure: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceMandateOptionsCard { - /// Amount to be charged for future payments. - pub amount: Option, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - pub amount_type: Option, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - pub description: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionsResourcePendingUpdate { - /// If the update is applied, determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. - /// - /// The timestamp is in UTC format. - pub billing_cycle_anchor: Option, - - /// The point after which the changes reflected by this update will be discarded and no longer applied. - pub expires_at: Timestamp, - - /// List of subscription items, each with an attached plan, that will be set if the update is applied. - pub subscription_items: Option>, - - /// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time, if the update is applied. - pub trial_end: Option, - - /// Indicates if a plan's `trial_period_days` should be applied to the subscription. - /// - /// Setting `trial_end` per subscription is preferred, and this defaults to `false`. - /// Setting this flag to `true` together with `trial_end` is not allowed. - /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - pub trial_from_plan: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionsTrialsResourceTrialSettings { - pub end_behavior: SubscriptionsTrialsResourceEndBehavior, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionsTrialsResourceEndBehavior { - /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. - pub missing_payment_method: SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod, -} - -/// The parameters for `Subscription::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateSubscription<'a> { - /// A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. - /// - /// You may pass up to 20 items. - #[serde(skip_serializing_if = "Option::is_none")] - pub add_invoice_items: Option>, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - /// The request must be made by a platform account on a connected account in order to set an application fee percentage. - /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_percent: Option, - - /// Automatic tax settings for this subscription. - /// - /// We recommend you only include this parameter when the existing value is being changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// For new subscriptions, a past timestamp to backdate the subscription's start date to. - /// - /// If set, the first invoice will contain a proration for the timespan between the start date and the current time. - /// Can be combined with trials and the billing cycle anchor. - #[serde(skip_serializing_if = "Option::is_none")] - pub backdate_start_date: Option, - - /// A future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). - /// - /// This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. - /// The timestamp is in UTC format. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_cycle_anchor: Option, - - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// Pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// A timestamp at which the subscription should cancel. - /// - /// If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. - /// If set during a future period, this will always cause a proration for that period. - #[serde(skip_serializing_if = "Option::is_none")] - pub cancel_at: Option, - - /// Boolean indicating whether this subscription should cancel at the end of the current period. - #[serde(skip_serializing_if = "Option::is_none")] - pub cancel_at_period_end: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - /// Defaults to `charge_automatically`. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - /// The ID of the coupon to apply to this subscription. - /// - /// A coupon applied to a subscription will only affect invoices created for that particular subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// The identifier of the customer to subscribe. - pub customer: CustomerId, - - /// Number of days a customer has to pay invoices generated by this subscription. - /// - /// Valid only for subscriptions where `collection_method` is set to `send_invoice`. - #[serde(skip_serializing_if = "Option::is_none")] - pub days_until_due: Option, - - /// ID of the default payment method for the subscription. - /// - /// It must belong to the customer associated with the subscription. - /// This takes precedence over `default_source`. - /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - #[serde(skip_serializing_if = "Option::is_none")] - pub default_payment_method: Option<&'a str>, - - /// ID of the default payment source for the subscription. - /// - /// It must belong to the customer associated with the subscription and be in a chargeable state. - /// If `default_payment_method` is also set, `default_payment_method` will take precedence. - /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - #[serde(skip_serializing_if = "Option::is_none")] - pub default_source: Option<&'a str>, - - /// The tax rates that will apply to any subscription item that does not have `tax_rates` set. - /// - /// Invoices created will have their `default_tax_rates` populated from the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - /// The subscription's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A list of up to 20 subscription items, each with an attached price. - #[serde(skip_serializing_if = "Option::is_none")] - pub items: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Indicates if a customer is on or off-session while an invoice payment is attempted. - #[serde(skip_serializing_if = "Option::is_none")] - pub off_session: Option, - - /// The account on behalf of which to charge, for each of the subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, - - /// Only applies to subscriptions with `collection_method=charge_automatically`. - /// - /// Use `allow_incomplete` to create subscriptions with `status=incomplete` if the first invoice cannot be paid. - /// - /// Creating subscriptions with this status allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. - /// For example, SCA regulation may require 3DS authentication to complete payment. - /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. - /// This is the default behavior. Use `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. - /// Subscriptions transition to `status=active` when successfully confirming the payment intent on the first invoice. - /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. - /// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. - /// If the payment intent is not confirmed within 23 hours subscriptions transition to `status=incomplete_expired`, which is a terminal state. Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice cannot be paid. - /// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not create a subscription and returns an error instead. - /// This was the default behavior for API versions prior to 2019-03-14. - /// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. `pending_if_incomplete` is only used with updates and cannot be passed when creating a subscription. Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first invoice status. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_behavior: Option, - - /// Payment settings to pass to invoices created by the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_settings: Option, - - /// Specifies an interval for how often to bill for any pending invoice items. - /// - /// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. - #[serde(skip_serializing_if = "Option::is_none")] - pub pending_invoice_item_interval: Option, - - /// The API ID of a promotion code to apply to this subscription. - /// - /// A promotion code applied to a subscription will only affect invoices created for that particular subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub promotion_code: Option, - - /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) resulting from the `billing_cycle_anchor`. - /// - /// If no value is passed, the default is `create_prorations`. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_behavior: Option, - - /// If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. - /// - /// If set, trial_end will override the default trial period of the plan the customer is being subscribed to. - /// The special value `now` can be provided to end the customer's trial immediately. - /// Can be at most two years from `billing_cycle_anchor`. - /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_end: Option, - - /// Indicates if a plan's `trial_period_days` should be applied to the subscription. - /// - /// Setting `trial_end` per subscription is preferred, and this defaults to `false`. - /// Setting this flag to `true` together with `trial_end` is not allowed. - /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_from_plan: Option, - - /// Integer representing the number of trial period days before the customer is charged for the first time. - /// - /// This will always overwrite any trials that might apply via a subscribed plan. - /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_period_days: Option, - - /// Settings related to subscription trials. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_settings: Option, -} - -impl<'a> CreateSubscription<'a> { - pub fn new(customer: CustomerId) -> Self { - CreateSubscription { - add_invoice_items: Default::default(), - application_fee_percent: Default::default(), - automatic_tax: Default::default(), - backdate_start_date: Default::default(), - billing_cycle_anchor: Default::default(), - billing_thresholds: Default::default(), - cancel_at: Default::default(), - cancel_at_period_end: Default::default(), - collection_method: Default::default(), - coupon: Default::default(), - currency: Default::default(), - customer, - days_until_due: Default::default(), - default_payment_method: Default::default(), - default_source: Default::default(), - default_tax_rates: Default::default(), - description: Default::default(), - expand: Default::default(), - items: Default::default(), - metadata: Default::default(), - off_session: Default::default(), - on_behalf_of: Default::default(), - payment_behavior: Default::default(), - payment_settings: Default::default(), - pending_invoice_item_interval: Default::default(), - promotion_code: Default::default(), - proration_behavior: Default::default(), - transfer_data: Default::default(), - trial_end: Default::default(), - trial_from_plan: Default::default(), - trial_period_days: Default::default(), - trial_settings: Default::default(), - } - } -} - -/// The parameters for `Subscription::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListSubscriptions<'a> { - /// Filter subscriptions by their automatic tax settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// The collection method of the subscriptions to retrieve. - /// - /// Either `charge_automatically` or `send_invoice`. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub current_period_end: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub current_period_start: Option>, - - /// The ID of the customer whose subscriptions will be retrieved. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// The ID of the plan whose subscriptions will be retrieved. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - /// Filter for subscriptions that contain this recurring price ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// The status of the subscriptions to retrieve. - /// - /// Passing in a value of `canceled` will return all canceled subscriptions, including those belonging to deleted customers. - /// Pass `ended` to find subscriptions that are canceled and subscriptions that are expired due to [incomplete payment](https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses). - /// Passing in a value of `all` will return subscriptions of all statuses. - /// If no value is supplied, all subscriptions that have not been canceled are returned. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, - - /// Filter for subscriptions that are associated with the specified test clock. - /// - /// The response will not include subscriptions with test clocks if this and the customer parameter is not set. - #[serde(skip_serializing_if = "Option::is_none")] - pub test_clock: Option<&'a str>, -} - -impl<'a> ListSubscriptions<'a> { - pub fn new() -> Self { - ListSubscriptions { - automatic_tax: Default::default(), - collection_method: Default::default(), - created: Default::default(), - current_period_end: Default::default(), - current_period_start: Default::default(), - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - plan: Default::default(), - price: Default::default(), - starting_after: Default::default(), - status: Default::default(), - test_clock: Default::default(), - } - } -} -impl Paginable for ListSubscriptions<'_> { - type O = Subscription; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Subscription::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateSubscription<'a> { - /// A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. - /// - /// You may pass up to 20 items. - #[serde(skip_serializing_if = "Option::is_none")] - pub add_invoice_items: Option>, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - /// The request must be made by a platform account on a connected account in order to set an application fee percentage. - /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_percent: Option, - - /// Automatic tax settings for this subscription. - /// - /// We recommend you only include this parameter when the existing value is being changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Either `now` or `unchanged`. - /// - /// Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). - /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_cycle_anchor: Option, - - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// Pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// A timestamp at which the subscription should cancel. - /// - /// If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. - /// If set during a future period, this will always cause a proration for that period. - #[serde(skip_serializing_if = "Option::is_none")] - pub cancel_at: Option, - - /// Boolean indicating whether this subscription should cancel at the end of the current period. - #[serde(skip_serializing_if = "Option::is_none")] - pub cancel_at_period_end: Option, - - /// Details about why this subscription was cancelled. - #[serde(skip_serializing_if = "Option::is_none")] - pub cancellation_details: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - /// Defaults to `charge_automatically`. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - /// The ID of the coupon to apply to this subscription. - /// - /// A coupon applied to a subscription will only affect invoices created for that particular subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// Number of days a customer has to pay invoices generated by this subscription. - /// - /// Valid only for subscriptions where `collection_method` is set to `send_invoice`. - #[serde(skip_serializing_if = "Option::is_none")] - pub days_until_due: Option, - - /// ID of the default payment method for the subscription. - /// - /// It must belong to the customer associated with the subscription. - /// This takes precedence over `default_source`. - /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - #[serde(skip_serializing_if = "Option::is_none")] - pub default_payment_method: Option<&'a str>, - - /// ID of the default payment source for the subscription. - /// - /// It must belong to the customer associated with the subscription and be in a chargeable state. - /// If `default_payment_method` is also set, `default_payment_method` will take precedence. - /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - #[serde(skip_serializing_if = "Option::is_none")] - pub default_source: Option, - - /// The tax rates that will apply to any subscription item that does not have `tax_rates` set. - /// - /// Invoices created will have their `default_tax_rates` populated from the subscription. - /// Pass an empty string to remove previously-defined tax rates. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - /// The subscription's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A list of up to 20 subscription items, each with an attached price. - #[serde(skip_serializing_if = "Option::is_none")] - pub items: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Indicates if a customer is on or off-session while an invoice payment is attempted. - #[serde(skip_serializing_if = "Option::is_none")] - pub off_session: Option, - - /// The account on behalf of which to charge, for each of the subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, - - /// If specified, payment collection for this subscription will be paused. - #[serde(skip_serializing_if = "Option::is_none")] - pub pause_collection: Option, - - /// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. - /// - /// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. - /// For example, SCA regulation may require 3DS authentication to complete payment. - /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. - /// This is the default behavior. Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. - /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. - /// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). - /// When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. - /// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. - /// This was the default behavior for API versions prior to 2019-03-14. - /// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_behavior: Option, - - /// Payment settings to pass to invoices created by the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_settings: Option, - - /// Specifies an interval for how often to bill for any pending invoice items. - /// - /// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. - #[serde(skip_serializing_if = "Option::is_none")] - pub pending_invoice_item_interval: Option, - - /// The promotion code to apply to this subscription. - /// - /// A promotion code applied to a subscription will only affect invoices created for that particular subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub promotion_code: Option, - - /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. - /// - /// The default value is `create_prorations`. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_behavior: Option, - - /// If set, the proration will be calculated as though the subscription was updated at the given time. - /// - /// This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#upcoming_invoice) endpoint. - /// It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_date: Option, - - /// If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. - /// - /// This will be unset if you POST an empty value. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. - /// - /// This will always overwrite any trials that might apply via a subscribed plan. - /// If set, trial_end will override the default trial period of the plan the customer is being subscribed to. - /// The special value `now` can be provided to end the customer's trial immediately. - /// Can be at most two years from `billing_cycle_anchor`. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_end: Option, - - /// Indicates if a plan's `trial_period_days` should be applied to the subscription. - /// - /// Setting `trial_end` per subscription is preferred, and this defaults to `false`. - /// Setting this flag to `true` together with `trial_end` is not allowed. - /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_from_plan: Option, - - /// Settings related to subscription trials. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_settings: Option, -} - -impl<'a> UpdateSubscription<'a> { - pub fn new() -> Self { - UpdateSubscription { - add_invoice_items: Default::default(), - application_fee_percent: Default::default(), - automatic_tax: Default::default(), - billing_cycle_anchor: Default::default(), - billing_thresholds: Default::default(), - cancel_at: Default::default(), - cancel_at_period_end: Default::default(), - cancellation_details: Default::default(), - collection_method: Default::default(), - coupon: Default::default(), - days_until_due: Default::default(), - default_payment_method: Default::default(), - default_source: Default::default(), - default_tax_rates: Default::default(), - description: Default::default(), - expand: Default::default(), - items: Default::default(), - metadata: Default::default(), - off_session: Default::default(), - on_behalf_of: Default::default(), - pause_collection: Default::default(), - payment_behavior: Default::default(), - payment_settings: Default::default(), - pending_invoice_item_interval: Default::default(), - promotion_code: Default::default(), - proration_behavior: Default::default(), - proration_date: Default::default(), - transfer_data: Default::default(), - trial_end: Default::default(), - trial_from_plan: Default::default(), - trial_settings: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AddInvoiceItems { - /// The ID of the price object. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Quantity for this item. - /// - /// Defaults to 1. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The tax rates which apply to the item. - /// - /// When set, the `default_tax_rates` do not apply to this item. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionAutomaticTax { - /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionItems { - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// When updating, pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Plan ID for this item, as a string. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - /// The ID of the price object. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Quantity for this item. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. - /// - /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. - /// When updating, pass an empty string to remove previously-defined tax rates. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettings { - /// Payment-method-specific configuration to provide to invoices created by the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_options: Option, - - /// The list of payment method types (e.g. - /// - /// card) to provide to the invoice’s PaymentIntent. - /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, - - /// Either `off`, or `on_subscription`. - /// - /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. - #[serde(skip_serializing_if = "Option::is_none")] - pub save_default_payment_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPendingInvoiceItemInterval { - /// Specifies invoicing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: PlanInterval, - - /// The number of intervals between invoices. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionTransferData { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. - /// By default, the entire amount is transferred to the destination. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_percent: Option, - - /// ID of an existing, connected Stripe account. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionTrialSettings { - /// Defines how the subscription should behave when the user's free trial ends. - pub end_behavior: CreateSubscriptionTrialSettingsEndBehavior, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ListSubscriptionsAutomaticTax { - /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionAutomaticTax { - /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionCancellationDetails { - /// Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. - #[serde(skip_serializing_if = "Option::is_none")] - pub comment: Option, - - /// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. - #[serde(skip_serializing_if = "Option::is_none")] - pub feedback: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionItems { - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// When updating, pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Delete all usage for a given subscription item. - /// - /// Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. - #[serde(skip_serializing_if = "Option::is_none")] - pub clear_usage: Option, - - /// A flag that, if set to `true`, will delete the specified item. - #[serde(skip_serializing_if = "Option::is_none")] - pub deleted: Option, - - /// Subscription item to update. - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Plan ID for this item, as a string. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - /// The ID of the price object. - /// - /// When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Quantity for this item. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. - /// - /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. - /// When updating, pass an empty string to remove previously-defined tax rates. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPauseCollection { - /// The payment collection behavior for this subscription while paused. - /// - /// One of `keep_as_draft`, `mark_uncollectible`, or `void`. - pub behavior: UpdateSubscriptionPauseCollectionBehavior, - - /// The time after which the subscription will resume collecting payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub resumes_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettings { - /// Payment-method-specific configuration to provide to invoices created by the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_options: Option, - - /// The list of payment method types (e.g. - /// - /// card) to provide to the invoice’s PaymentIntent. - /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, - - /// Either `off`, or `on_subscription`. - /// - /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. - #[serde(skip_serializing_if = "Option::is_none")] - pub save_default_payment_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPendingInvoiceItemInterval { - /// Specifies invoicing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: PlanInterval, - - /// The number of intervals between invoices. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionTransferData { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. - /// By default, the entire amount is transferred to the destination. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_percent: Option, - - /// ID of an existing, connected Stripe account. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionTrialSettings { - /// Defines how the subscription should behave when the user's free trial ends. - pub end_behavior: UpdateSubscriptionTrialSettingsEndBehavior, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionItemsBillingThresholds { - /// Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)). - pub usage_gte: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptions { - /// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: - Option, - - /// This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionTrialSettingsEndBehavior { - /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. - pub missing_payment_method: CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceItemPriceData { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of the product that this price will belong to. - pub product: String, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionItemPriceData { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of the product that this price will belong to. - pub product: String, - - /// The recurring components of a price such as `interval` and `interval_count`. - pub recurring: SubscriptionItemPriceDataRecurring, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptions { - /// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: - Option, - - /// This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionTrialSettingsEndBehavior { - /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. - pub missing_payment_method: UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: - Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact { - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCard { - /// Configuration options for setting up an eMandate for cards issued in India. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: - Option, - - /// Selected network to process this Subscription on. - /// - /// Depends on the available networks of the card attached to the Subscription. - /// Can be only set confirm-time. - #[serde(skip_serializing_if = "Option::is_none")] - pub network: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_three_d_secure: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalance { - /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: - Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub funding_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount { - /// Additional fields for Financial Connections Session creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: Option< - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections, - >, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option< - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod, - >, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionItemPriceDataRecurring { - /// Specifies billing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: PlanInterval, - - /// The number of intervals between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: - Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact { - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCard { - /// Configuration options for setting up an eMandate for cards issued in India. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: - Option, - - /// Selected network to process this Subscription on. - /// - /// Depends on the available networks of the card attached to the Subscription. - /// Can be only set confirm-time. - #[serde(skip_serializing_if = "Option::is_none")] - pub network: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_three_d_secure: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalance { - /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: - Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub funding_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount { - /// Additional fields for Financial Connections Session creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: Option< - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections, - >, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option< - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod, - >, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { - /// Transaction type of the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_type: Option< - CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType, - >, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions { - /// Amount to be charged for future payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_type: - Option, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer { - - /// Configuration for eu_bank_transfer funding type. - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: Option, - - /// The bank transfer type that can be used for funding. - /// - /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections { - - /// The list of permissions to request. - /// - /// If this parameter is passed, the `payment_method` permission must be included. - /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option>, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { - /// Transaction type of the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_type: Option< - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType, - >, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions { - /// Amount to be charged for future payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_type: - Option, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer { - - /// Configuration for eu_bank_transfer funding type. - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: Option, - - /// The bank transfer type that can be used for funding. - /// - /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections { - - /// The list of permissions to request. - /// - /// If this parameter is passed, the `payment_method` permission must be included. - /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option>, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer -{ - /// The desired country code of the bank account information. - /// - /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. - pub country: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer -{ - /// The desired country code of the bank account information. - /// - /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. - pub country: String, -} - -/// An enum representing the possible values of an `CancellationDetails`'s `feedback` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CancellationDetailsFeedback { - CustomerService, - LowQuality, - MissingFeatures, - Other, - SwitchedService, - TooComplex, - TooExpensive, - Unused, -} - -impl CancellationDetailsFeedback { - pub fn as_str(self) -> &'static str { - match self { - CancellationDetailsFeedback::CustomerService => "customer_service", - CancellationDetailsFeedback::LowQuality => "low_quality", - CancellationDetailsFeedback::MissingFeatures => "missing_features", - CancellationDetailsFeedback::Other => "other", - CancellationDetailsFeedback::SwitchedService => "switched_service", - CancellationDetailsFeedback::TooComplex => "too_complex", - CancellationDetailsFeedback::TooExpensive => "too_expensive", - CancellationDetailsFeedback::Unused => "unused", - } - } -} - -impl AsRef for CancellationDetailsFeedback { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CancellationDetailsFeedback { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CancellationDetailsFeedback { - fn default() -> Self { - Self::CustomerService - } -} - -/// An enum representing the possible values of an `CancellationDetails`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CancellationDetailsReason { - CancellationRequested, - PaymentDisputed, - PaymentFailed, -} - -impl CancellationDetailsReason { - pub fn as_str(self) -> &'static str { - match self { - CancellationDetailsReason::CancellationRequested => "cancellation_requested", - CancellationDetailsReason::PaymentDisputed => "payment_disputed", - CancellationDetailsReason::PaymentFailed => "payment_failed", - } - } -} - -impl AsRef for CancellationDetailsReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CancellationDetailsReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CancellationDetailsReason { - fn default() -> Self { - Self::CancellationRequested - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - Business, - Personal, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => "automatic", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => "microdeposits", - } - } -} - -impl AsRef - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::De => "de", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::En => "en", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::Fr => "fr", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage -{ - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType { - Fixed, - Maximum, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::Maximum => "maximum", - } - } -} - -impl AsRef - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType -{ - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Amex => "amex", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::CartesBancaires => { - "cartes_bancaires" - } - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Diners => "diners", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Discover => { - "discover" - } - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::EftposAu => { - "eftpos_au" - } - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Interac => "interac", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Jcb => "jcb", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Mastercard => { - "mastercard" - } - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Unionpay => { - "unionpay" - } - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Unknown => "unknown", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", - } - } -} - -impl AsRef for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure -{ - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - Balances, -} - -impl - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", - } - } -} - -impl AsRef for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => "automatic", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => "microdeposits", - } - } -} - -impl AsRef - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettings`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodTypes { - AchCreditTransfer, - AchDebit, - AcssDebit, - AuBecsDebit, - BacsDebit, - Bancontact, - Boleto, - Card, - Cashapp, - CustomerBalance, - Fpx, - Giropay, - Grabpay, - Ideal, - Konbini, - Link, - Paynow, - Paypal, - Promptpay, - SepaCreditTransfer, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodTypes::AchCreditTransfer => { - "ach_credit_transfer" - } - CreateSubscriptionPaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Boleto => "boleto", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Card => "card", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Cashapp => "cashapp", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::CustomerBalance => { - "customer_balance" - } - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Fpx => "fpx", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Giropay => "giropay", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Grabpay => "grabpay", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Ideal => "ideal", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Konbini => "konbini", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Link => "link", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Paynow => "paynow", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Paypal => "paypal", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Promptpay => "promptpay", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::SepaCreditTransfer => { - "sepa_credit_transfer" - } - CreateSubscriptionPaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Sofort => "sofort", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::UsBankAccount => "us_bank_account", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::WechatPay => "wechat_pay", - } - } -} - -impl AsRef for CreateSubscriptionPaymentSettingsPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionPaymentSettingsPaymentMethodTypes { - fn default() -> Self { - Self::AchCreditTransfer - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettings`'s `save_default_payment_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - Off, - OnSubscription, -} - -impl CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::Off => "off", - CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::OnSubscription => { - "on_subscription" - } - } - } -} - -impl AsRef for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - fn default() -> Self { - Self::Off - } -} - -/// An enum representing the possible values of an `CreateSubscriptionTrialSettingsEndBehavior`'s `missing_payment_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - Cancel, - CreateInvoice, - Pause, -} - -impl CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::Cancel => "cancel", - CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::CreateInvoice => { - "create_invoice" - } - CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::Pause => "pause", - } - } -} - -impl AsRef for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - fn default() -> Self { - Self::Cancel - } -} - -/// An enum representing the possible values of an `InvoiceItemPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceItemPriceDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl InvoiceItemPriceDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - InvoiceItemPriceDataTaxBehavior::Exclusive => "exclusive", - InvoiceItemPriceDataTaxBehavior::Inclusive => "inclusive", - InvoiceItemPriceDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for InvoiceItemPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceItemPriceDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceItemPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `InvoiceMandateOptionsCard`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceMandateOptionsCardAmountType { - Fixed, - Maximum, -} - -impl InvoiceMandateOptionsCardAmountType { - pub fn as_str(self) -> &'static str { - match self { - InvoiceMandateOptionsCardAmountType::Fixed => "fixed", - InvoiceMandateOptionsCardAmountType::Maximum => "maximum", - } - } -} - -impl AsRef for InvoiceMandateOptionsCardAmountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceMandateOptionsCardAmountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceMandateOptionsCardAmountType { - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `SubscriptionPendingInvoiceItemInterval`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PlanInterval { - Day, - Month, - Week, - Year, -} - -impl PlanInterval { - pub fn as_str(self) -> &'static str { - match self { - PlanInterval::Day => "day", - PlanInterval::Month => "month", - PlanInterval::Week => "week", - PlanInterval::Year => "year", - } - } -} - -impl AsRef for PlanInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PlanInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PlanInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `UpdateSubscription`'s `billing_cycle_anchor` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionBillingCycleAnchor { - Now, - Unchanged, -} - -impl SubscriptionBillingCycleAnchor { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionBillingCycleAnchor::Now => "now", - SubscriptionBillingCycleAnchor::Unchanged => "unchanged", - } - } -} - -impl AsRef for SubscriptionBillingCycleAnchor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionBillingCycleAnchor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionBillingCycleAnchor { - fn default() -> Self { - Self::Now - } -} - -/// An enum representing the possible values of an `SubscriptionItemPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionItemPriceDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl SubscriptionItemPriceDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionItemPriceDataTaxBehavior::Exclusive => "exclusive", - SubscriptionItemPriceDataTaxBehavior::Inclusive => "inclusive", - SubscriptionItemPriceDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for SubscriptionItemPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionItemPriceDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionItemPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreateSubscription`'s `payment_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionPaymentBehavior { - AllowIncomplete, - DefaultIncomplete, - ErrorIfIncomplete, - PendingIfIncomplete, -} - -impl SubscriptionPaymentBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionPaymentBehavior::AllowIncomplete => "allow_incomplete", - SubscriptionPaymentBehavior::DefaultIncomplete => "default_incomplete", - SubscriptionPaymentBehavior::ErrorIfIncomplete => "error_if_incomplete", - SubscriptionPaymentBehavior::PendingIfIncomplete => "pending_if_incomplete", - } - } -} - -impl AsRef for SubscriptionPaymentBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionPaymentBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionPaymentBehavior { - fn default() -> Self { - Self::AllowIncomplete - } -} - -/// An enum representing the possible values of an `SubscriptionPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl SubscriptionPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionPaymentMethodOptionsCardNetwork::Amex => "amex", - SubscriptionPaymentMethodOptionsCardNetwork::CartesBancaires => "cartes_bancaires", - SubscriptionPaymentMethodOptionsCardNetwork::Diners => "diners", - SubscriptionPaymentMethodOptionsCardNetwork::Discover => "discover", - SubscriptionPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", - SubscriptionPaymentMethodOptionsCardNetwork::Interac => "interac", - SubscriptionPaymentMethodOptionsCardNetwork::Jcb => "jcb", - SubscriptionPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", - SubscriptionPaymentMethodOptionsCardNetwork::Unionpay => "unionpay", - SubscriptionPaymentMethodOptionsCardNetwork::Unknown => "unknown", - SubscriptionPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for SubscriptionPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `SubscriptionPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, -} - -impl SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - SubscriptionPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", - } - } -} - -impl AsRef for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `CreateSubscription`'s `proration_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionProrationBehavior { - AlwaysInvoice, - CreateProrations, - None, -} - -impl SubscriptionProrationBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionProrationBehavior::AlwaysInvoice => "always_invoice", - SubscriptionProrationBehavior::CreateProrations => "create_prorations", - SubscriptionProrationBehavior::None => "none", - } - } -} - -impl AsRef for SubscriptionProrationBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionProrationBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionProrationBehavior { - fn default() -> Self { - Self::AlwaysInvoice - } -} - -/// An enum representing the possible values of an `Subscription`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionStatus { - Active, - Canceled, - Incomplete, - IncompleteExpired, - PastDue, - Paused, - Trialing, - Unpaid, -} - -impl SubscriptionStatus { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionStatus::Active => "active", - SubscriptionStatus::Canceled => "canceled", - SubscriptionStatus::Incomplete => "incomplete", - SubscriptionStatus::IncompleteExpired => "incomplete_expired", - SubscriptionStatus::PastDue => "past_due", - SubscriptionStatus::Paused => "paused", - SubscriptionStatus::Trialing => "trialing", - SubscriptionStatus::Unpaid => "unpaid", - } - } -} - -impl AsRef for SubscriptionStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `ListSubscriptions`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionStatusFilter { - Active, - All, - Canceled, - Ended, - Incomplete, - IncompleteExpired, - PastDue, - Paused, - Trialing, - Unpaid, -} - -impl SubscriptionStatusFilter { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionStatusFilter::Active => "active", - SubscriptionStatusFilter::All => "all", - SubscriptionStatusFilter::Canceled => "canceled", - SubscriptionStatusFilter::Ended => "ended", - SubscriptionStatusFilter::Incomplete => "incomplete", - SubscriptionStatusFilter::IncompleteExpired => "incomplete_expired", - SubscriptionStatusFilter::PastDue => "past_due", - SubscriptionStatusFilter::Paused => "paused", - SubscriptionStatusFilter::Trialing => "trialing", - SubscriptionStatusFilter::Unpaid => "unpaid", - } - } -} - -impl AsRef for SubscriptionStatusFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionStatusFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionStatusFilter { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `SubscriptionsResourcePauseCollection`'s `behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionsResourcePauseCollectionBehavior { - KeepAsDraft, - MarkUncollectible, - Void, -} - -impl SubscriptionsResourcePauseCollectionBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionsResourcePauseCollectionBehavior::KeepAsDraft => "keep_as_draft", - SubscriptionsResourcePauseCollectionBehavior::MarkUncollectible => "mark_uncollectible", - SubscriptionsResourcePauseCollectionBehavior::Void => "void", - } - } -} - -impl AsRef for SubscriptionsResourcePauseCollectionBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionsResourcePauseCollectionBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionsResourcePauseCollectionBehavior { - fn default() -> Self { - Self::KeepAsDraft - } -} - -/// An enum representing the possible values of an `SubscriptionsResourcePaymentSettings`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionsResourcePaymentSettingsPaymentMethodTypes { - AchCreditTransfer, - AchDebit, - AcssDebit, - AuBecsDebit, - BacsDebit, - Bancontact, - Boleto, - Card, - Cashapp, - CustomerBalance, - Fpx, - Giropay, - Grabpay, - Ideal, - Konbini, - Link, - Paynow, - Paypal, - Promptpay, - SepaCreditTransfer, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, -} - -impl SubscriptionsResourcePaymentSettingsPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::AchCreditTransfer => { - "ach_credit_transfer" - } - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Boleto => "boleto", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Card => "card", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Cashapp => "cashapp", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::CustomerBalance => { - "customer_balance" - } - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Fpx => "fpx", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Giropay => "giropay", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Grabpay => "grabpay", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Ideal => "ideal", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Konbini => "konbini", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Link => "link", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Paynow => "paynow", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Paypal => "paypal", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Promptpay => "promptpay", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::SepaCreditTransfer => { - "sepa_credit_transfer" - } - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Sofort => "sofort", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::UsBankAccount => { - "us_bank_account" - } - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::WechatPay => "wechat_pay", - } - } -} - -impl AsRef for SubscriptionsResourcePaymentSettingsPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionsResourcePaymentSettingsPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionsResourcePaymentSettingsPaymentMethodTypes { - fn default() -> Self { - Self::AchCreditTransfer - } -} - -/// An enum representing the possible values of an `SubscriptionsResourcePaymentSettings`'s `save_default_payment_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { - Off, - OnSubscription, -} - -impl SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod::Off => "off", - SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod::OnSubscription => { - "on_subscription" - } - } - } -} - -impl AsRef for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { - fn default() -> Self { - Self::Off - } -} - -/// An enum representing the possible values of an `SubscriptionsTrialsResourceEndBehavior`'s `missing_payment_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { - Cancel, - CreateInvoice, - Pause, -} - -impl SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::Cancel => "cancel", - SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::CreateInvoice => { - "create_invoice" - } - SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::Pause => "pause", - } - } -} - -impl AsRef for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { - fn default() -> Self { - Self::Cancel - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionCancellationDetails`'s `feedback` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionCancellationDetailsFeedback { - CustomerService, - LowQuality, - MissingFeatures, - Other, - SwitchedService, - TooComplex, - TooExpensive, - Unused, -} - -impl UpdateSubscriptionCancellationDetailsFeedback { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionCancellationDetailsFeedback::CustomerService => "customer_service", - UpdateSubscriptionCancellationDetailsFeedback::LowQuality => "low_quality", - UpdateSubscriptionCancellationDetailsFeedback::MissingFeatures => "missing_features", - UpdateSubscriptionCancellationDetailsFeedback::Other => "other", - UpdateSubscriptionCancellationDetailsFeedback::SwitchedService => "switched_service", - UpdateSubscriptionCancellationDetailsFeedback::TooComplex => "too_complex", - UpdateSubscriptionCancellationDetailsFeedback::TooExpensive => "too_expensive", - UpdateSubscriptionCancellationDetailsFeedback::Unused => "unused", - } - } -} - -impl AsRef for UpdateSubscriptionCancellationDetailsFeedback { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionCancellationDetailsFeedback { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionCancellationDetailsFeedback { - fn default() -> Self { - Self::CustomerService - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPauseCollection`'s `behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPauseCollectionBehavior { - KeepAsDraft, - MarkUncollectible, - Void, -} - -impl UpdateSubscriptionPauseCollectionBehavior { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPauseCollectionBehavior::KeepAsDraft => "keep_as_draft", - UpdateSubscriptionPauseCollectionBehavior::MarkUncollectible => "mark_uncollectible", - UpdateSubscriptionPauseCollectionBehavior::Void => "void", - } - } -} - -impl AsRef for UpdateSubscriptionPauseCollectionBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionPauseCollectionBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionPauseCollectionBehavior { - fn default() -> Self { - Self::KeepAsDraft - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - Business, - Personal, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => "automatic", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => "microdeposits", - } - } -} - -impl AsRef - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::De => "de", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::En => "en", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::Fr => "fr", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage -{ - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType { - Fixed, - Maximum, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::Maximum => "maximum", - } - } -} - -impl AsRef - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType -{ - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Amex => "amex", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::CartesBancaires => { - "cartes_bancaires" - } - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Diners => "diners", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Discover => { - "discover" - } - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::EftposAu => { - "eftpos_au" - } - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Interac => "interac", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Jcb => "jcb", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Mastercard => { - "mastercard" - } - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Unionpay => { - "unionpay" - } - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Unknown => "unknown", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", - } - } -} - -impl AsRef for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure -{ - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - Balances, -} - -impl - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", - } - } -} - -impl AsRef for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => "automatic", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => "microdeposits", - } - } -} - -impl AsRef - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettings`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodTypes { - AchCreditTransfer, - AchDebit, - AcssDebit, - AuBecsDebit, - BacsDebit, - Bancontact, - Boleto, - Card, - Cashapp, - CustomerBalance, - Fpx, - Giropay, - Grabpay, - Ideal, - Konbini, - Link, - Paynow, - Paypal, - Promptpay, - SepaCreditTransfer, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::AchCreditTransfer => { - "ach_credit_transfer" - } - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Boleto => "boleto", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Card => "card", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Cashapp => "cashapp", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::CustomerBalance => { - "customer_balance" - } - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Fpx => "fpx", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Giropay => "giropay", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Grabpay => "grabpay", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Ideal => "ideal", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Konbini => "konbini", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Link => "link", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Paynow => "paynow", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Paypal => "paypal", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Promptpay => "promptpay", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::SepaCreditTransfer => { - "sepa_credit_transfer" - } - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Sofort => "sofort", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::UsBankAccount => "us_bank_account", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::WechatPay => "wechat_pay", - } - } -} - -impl AsRef for UpdateSubscriptionPaymentSettingsPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionPaymentSettingsPaymentMethodTypes { - fn default() -> Self { - Self::AchCreditTransfer - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettings`'s `save_default_payment_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - Off, - OnSubscription, -} - -impl UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::Off => "off", - UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::OnSubscription => { - "on_subscription" - } - } - } -} - -impl AsRef for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - fn default() -> Self { - Self::Off - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionTrialSettingsEndBehavior`'s `missing_payment_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - Cancel, - CreateInvoice, - Pause, -} - -impl UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::Cancel => "cancel", - UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::CreateInvoice => { - "create_invoice" - } - UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::Pause => "pause", - } - } -} - -impl AsRef for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - fn default() -> Self { - Self::Cancel - } -} diff --git a/src/resources/generated/subscription_billing_thresholds.rs b/src/resources/generated/subscription_billing_thresholds.rs deleted file mode 100644 index e4ec6bd85..000000000 --- a/src/resources/generated/subscription_billing_thresholds.rs +++ /dev/null @@ -1,18 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "SubscriptionBillingThresholds". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionBillingThresholds { - /// Monetary threshold that triggers the subscription to create an invoice. - pub amount_gte: Option, - - /// Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. - /// - /// If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - /// This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. - pub reset_billing_cycle_anchor: Option, -} diff --git a/src/resources/generated/subscription_item.rs b/src/resources/generated/subscription_item.rs deleted file mode 100644 index 9a61c08b1..000000000 --- a/src/resources/generated/subscription_item.rs +++ /dev/null @@ -1,551 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{PlanId, PriceId, SubscriptionId, SubscriptionItemId}; -use crate::params::{Deleted, Expand, List, Metadata, Object, Paginable, Timestamp}; -use crate::resources::{Currency, Plan, Price, SubscriptionItemBillingThresholds, TaxRate}; - -/// The resource representing a Stripe "SubscriptionItem". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionItem { - /// Unique identifier for the object. - pub id: SubscriptionItemId, - - /// Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// The [quantity](https://stripe.com/docs/subscriptions/quantities) of the plan to which the customer should be subscribed. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The `subscription` this `subscription_item` belongs to. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option, - - /// The tax rates which apply to this `subscription_item`. - /// - /// When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -impl SubscriptionItem { - /// Returns a list of your subscription items for a given subscription. - pub fn list( - client: &Client, - params: &ListSubscriptionItems<'_>, - ) -> Response> { - client.get_query("/subscription_items", ¶ms) - } - - /// Adds a new item to an existing subscription. - /// - /// No existing items will be changed or replaced. - pub fn create( - client: &Client, - params: CreateSubscriptionItem<'_>, - ) -> Response { - client.post_form("/subscription_items", ¶ms) - } - - /// Retrieves the subscription item with the given ID. - pub fn retrieve( - client: &Client, - id: &SubscriptionItemId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/subscription_items/{}", id), &Expand { expand }) - } - - /// Updates the plan or quantity of an item on a current subscription. - pub fn update( - client: &Client, - id: &SubscriptionItemId, - params: UpdateSubscriptionItem<'_>, - ) -> Response { - client.post_form(&format!("/subscription_items/{}", id), ¶ms) - } - - /// Deletes an item from the subscription. - /// - /// Removing a subscription item from a subscription will not cancel the subscription. - pub fn delete( - client: &Client, - id: &SubscriptionItemId, - ) -> Response> { - client.delete(&format!("/subscription_items/{}", id)) - } -} - -impl Object for SubscriptionItem { - type Id = SubscriptionItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "subscription_item" - } -} - -/// The parameters for `SubscriptionItem::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateSubscriptionItem<'a> { - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// When updating, pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. - /// - /// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. - /// For example, SCA regulation may require 3DS authentication to complete payment. - /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. - /// This is the default behavior. Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. - /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. - /// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). - /// When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. - /// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. - /// This was the default behavior for API versions prior to 2019-03-14. - /// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_behavior: Option, - - /// The identifier of the plan to add to the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - /// The ID of the price object. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. - /// - /// The default value is `create_prorations`. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_behavior: Option, - - /// If set, the proration will be calculated as though the subscription was updated at the given time. - /// - /// This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_date: Option, - - /// The quantity you'd like to apply to the subscription item you're creating. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The identifier of the subscription to modify. - pub subscription: SubscriptionId, - - /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. - /// - /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. - /// When updating, pass an empty string to remove previously-defined tax rates. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -impl<'a> CreateSubscriptionItem<'a> { - pub fn new(subscription: SubscriptionId) -> Self { - CreateSubscriptionItem { - billing_thresholds: Default::default(), - expand: Default::default(), - metadata: Default::default(), - payment_behavior: Default::default(), - plan: Default::default(), - price: Default::default(), - price_data: Default::default(), - proration_behavior: Default::default(), - proration_date: Default::default(), - quantity: Default::default(), - subscription, - tax_rates: Default::default(), - } - } -} - -/// The parameters for `SubscriptionItem::list`. -#[derive(Clone, Debug, Serialize)] -pub struct ListSubscriptionItems<'a> { - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// The ID of the subscription whose items will be retrieved. - pub subscription: SubscriptionId, -} - -impl<'a> ListSubscriptionItems<'a> { - pub fn new(subscription: SubscriptionId) -> Self { - ListSubscriptionItems { - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - subscription, - } - } -} -impl Paginable for ListSubscriptionItems<'_> { - type O = SubscriptionItem; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `SubscriptionItem::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateSubscriptionItem<'a> { - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// When updating, pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Indicates if a customer is on or off-session while an invoice payment is attempted. - #[serde(skip_serializing_if = "Option::is_none")] - pub off_session: Option, - - /// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. - /// - /// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. - /// For example, SCA regulation may require 3DS authentication to complete payment. - /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. - /// This is the default behavior. Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. - /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. - /// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). - /// When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. - /// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. - /// This was the default behavior for API versions prior to 2019-03-14. - /// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_behavior: Option, - - /// The identifier of the new plan for this subscription item. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - /// The ID of the price object. - /// - /// When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. - /// - /// The default value is `create_prorations`. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_behavior: Option, - - /// If set, the proration will be calculated as though the subscription was updated at the given time. - /// - /// This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_date: Option, - - /// The quantity you'd like to apply to the subscription item you're creating. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. - /// - /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. - /// When updating, pass an empty string to remove previously-defined tax rates. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -impl<'a> UpdateSubscriptionItem<'a> { - pub fn new() -> Self { - UpdateSubscriptionItem { - billing_thresholds: Default::default(), - expand: Default::default(), - metadata: Default::default(), - off_session: Default::default(), - payment_behavior: Default::default(), - plan: Default::default(), - price: Default::default(), - price_data: Default::default(), - proration_behavior: Default::default(), - proration_date: Default::default(), - quantity: Default::default(), - tax_rates: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionItemPriceData { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of the product that this price will belong to. - pub product: String, - - /// The recurring components of a price such as `interval` and `interval_count`. - pub recurring: SubscriptionItemPriceDataRecurring, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionItemPriceDataRecurring { - /// Specifies billing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: PlanInterval, - - /// The number of intervals between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, -} - -/// An enum representing the possible values of an `SubscriptionItemPriceDataRecurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PlanInterval { - Day, - Month, - Week, - Year, -} - -impl PlanInterval { - pub fn as_str(self) -> &'static str { - match self { - PlanInterval::Day => "day", - PlanInterval::Month => "month", - PlanInterval::Week => "week", - PlanInterval::Year => "year", - } - } -} - -impl AsRef for PlanInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PlanInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PlanInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `SubscriptionItemPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionItemPriceDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl SubscriptionItemPriceDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionItemPriceDataTaxBehavior::Exclusive => "exclusive", - SubscriptionItemPriceDataTaxBehavior::Inclusive => "inclusive", - SubscriptionItemPriceDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for SubscriptionItemPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionItemPriceDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionItemPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreateSubscriptionItem`'s `payment_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionPaymentBehavior { - AllowIncomplete, - DefaultIncomplete, - ErrorIfIncomplete, - PendingIfIncomplete, -} - -impl SubscriptionPaymentBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionPaymentBehavior::AllowIncomplete => "allow_incomplete", - SubscriptionPaymentBehavior::DefaultIncomplete => "default_incomplete", - SubscriptionPaymentBehavior::ErrorIfIncomplete => "error_if_incomplete", - SubscriptionPaymentBehavior::PendingIfIncomplete => "pending_if_incomplete", - } - } -} - -impl AsRef for SubscriptionPaymentBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionPaymentBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionPaymentBehavior { - fn default() -> Self { - Self::AllowIncomplete - } -} - -/// An enum representing the possible values of an `CreateSubscriptionItem`'s `proration_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionProrationBehavior { - AlwaysInvoice, - CreateProrations, - None, -} - -impl SubscriptionProrationBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionProrationBehavior::AlwaysInvoice => "always_invoice", - SubscriptionProrationBehavior::CreateProrations => "create_prorations", - SubscriptionProrationBehavior::None => "none", - } - } -} - -impl AsRef for SubscriptionProrationBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionProrationBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionProrationBehavior { - fn default() -> Self { - Self::AlwaysInvoice - } -} diff --git a/src/resources/generated/subscription_item_billing_thresholds.rs b/src/resources/generated/subscription_item_billing_thresholds.rs deleted file mode 100644 index 39cefc434..000000000 --- a/src/resources/generated/subscription_item_billing_thresholds.rs +++ /dev/null @@ -1,12 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "SubscriptionItemBillingThresholds". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionItemBillingThresholds { - /// Usage threshold that triggers the subscription to create an invoice. - pub usage_gte: Option, -} diff --git a/src/resources/generated/subscription_schedule.rs b/src/resources/generated/subscription_schedule.rs deleted file mode 100644 index 8da4729d7..000000000 --- a/src/resources/generated/subscription_schedule.rs +++ /dev/null @@ -1,1686 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, SubscriptionScheduleId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{ - Account, Application, CollectionMethod, Coupon, Currency, Customer, PaymentMethod, Plan, Price, - Scheduled, Subscription, SubscriptionBillingThresholds, SubscriptionItemBillingThresholds, - SubscriptionTransferData, TaxRate, TestHelpersTestClock, -}; - -/// The resource representing a Stripe "SubscriptionSchedule". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionSchedule { - /// Unique identifier for the object. - pub id: SubscriptionScheduleId, - - /// ID of the Connect Application that created the schedule. - pub application: Option>, - - /// Time at which the subscription schedule was canceled. - /// - /// Measured in seconds since the Unix epoch. - pub canceled_at: Option, - - /// Time at which the subscription schedule was completed. - /// - /// Measured in seconds since the Unix epoch. - pub completed_at: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Object representing the start and end dates for the current phase of the subscription schedule, if it is `active`. - pub current_phase: Option, - - /// ID of the customer who owns the subscription schedule. - pub customer: Expandable, - - pub default_settings: SubscriptionScheduleDefaultSettings, - - /// Behavior of the subscription schedule and underlying subscription when it ends. - /// - /// Possible values are `release` or `cancel` with the default being `release`. - /// `release` will end the subscription schedule and keep the underlying subscription running.`cancel` will end the subscription schedule and cancel the underlying subscription. - pub end_behavior: SubscriptionScheduleEndBehavior, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// Configuration for the subscription schedule's phases. - pub phases: Vec, - - /// Time at which the subscription schedule was released. - /// - /// Measured in seconds since the Unix epoch. - pub released_at: Option, - - /// ID of the subscription once managed by the subscription schedule (if it is released). - pub released_subscription: Option, - - /// The present status of the subscription schedule. - /// - /// Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. - /// You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules). - pub status: SubscriptionScheduleStatus, - - /// ID of the subscription managed by the subscription schedule. - pub subscription: Option>, - - /// ID of the test clock this subscription schedule belongs to. - pub test_clock: Option>, -} - -impl SubscriptionSchedule { - /// Retrieves the list of your subscription schedules. - pub fn list( - client: &Client, - params: &ListSubscriptionSchedules<'_>, - ) -> Response> { - client.get_query("/subscription_schedules", ¶ms) - } - - /// Creates a new subscription schedule object. - /// - /// Each customer can have up to 500 active or scheduled subscriptions. - pub fn create( - client: &Client, - params: CreateSubscriptionSchedule<'_>, - ) -> Response { - client.post_form("/subscription_schedules", ¶ms) - } - - /// Retrieves the details of an existing subscription schedule. - /// - /// You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation. - pub fn retrieve( - client: &Client, - id: &SubscriptionScheduleId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/subscription_schedules/{}", id), &Expand { expand }) - } - - /// Updates an existing subscription schedule. - pub fn update( - client: &Client, - id: &SubscriptionScheduleId, - params: UpdateSubscriptionSchedule<'_>, - ) -> Response { - client.post_form(&format!("/subscription_schedules/{}", id), ¶ms) - } -} - -impl Object for SubscriptionSchedule { - type Id = SubscriptionScheduleId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "subscription_schedule" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleCurrentPhase { - /// The end of this phase of the subscription schedule. - pub end_date: Timestamp, - - /// The start of this phase of the subscription schedule. - pub start_date: Timestamp, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionSchedulePhaseConfiguration { - /// A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. - pub add_invoice_items: Vec, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. - pub application_fee_percent: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Possible values are `phase_start` or `automatic`. - /// - /// If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. - /// If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. - /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - pub billing_cycle_anchor: Option, - - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - pub billing_thresholds: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - pub collection_method: Option, - - /// ID of the coupon to use during this phase of the subscription schedule. - pub coupon: Option>, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// ID of the default payment method for the subscription schedule. - /// - /// It must belong to the customer associated with the subscription schedule. - /// If not set, invoices will use the default payment method in the customer's invoice settings. - pub default_payment_method: Option>, - - /// The default tax rates to apply to the subscription during this phase of the subscription schedule. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - /// Subscription description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription. - pub description: Option, - - /// The end of this phase of the subscription schedule. - pub end_date: Timestamp, - - /// The invoice settings applicable during this phase. - pub invoice_settings: Option, - - /// Subscription items to configure the subscription to during this phase of the subscription schedule. - pub items: Vec, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. - /// - /// Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered. - /// Updating the underlying subscription's `metadata` directly will not affect the current phase's `metadata`. - pub metadata: Option, - - /// The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. - /// - /// See the Connect documentation for details. - pub on_behalf_of: Option>, - - /// If the subscription schedule will prorate when transitioning to this phase. - /// - /// Possible values are `create_prorations` and `none`. - pub proration_behavior: SubscriptionProrationBehavior, - - /// The start of this phase of the subscription schedule. - pub start_date: Timestamp, - - /// The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. - pub transfer_data: Option, - - /// When the trial ends within the phase. - pub trial_end: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceSettingSubscriptionSchedulePhaseSetting { - /// Number of days within which a customer must pay invoices generated by this subscription schedule. - /// - /// This value will be `null` for subscription schedules where `billing=charge_automatically`. - pub days_until_due: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SchedulesPhaseAutomaticTax { - /// Whether Stripe automatically computes tax on invoices created during this phase. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleAddInvoiceItem { - /// ID of the price used to generate the invoice item. - pub price: Expandable, - - /// The quantity of the invoice item. - pub quantity: Option, - - /// The tax rates which apply to the item. - /// - /// When set, the `default_tax_rates` do not apply to this item. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleConfigurationItem { - /// Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period. - pub billing_thresholds: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. - /// - /// Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. - pub metadata: Option, - - /// ID of the plan to which the customer should be subscribed. - pub plan: Expandable, - - /// ID of the price to which the customer should be subscribed. - pub price: Expandable, - - /// Quantity of the plan to which the customer should be subscribed. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The tax rates which apply to this `phase_item`. - /// - /// When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleDefaultSettings { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. - pub application_fee_percent: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Possible values are `phase_start` or `automatic`. - /// - /// If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. - /// If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. - /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - pub billing_cycle_anchor: SubscriptionScheduleDefaultSettingsBillingCycleAnchor, - - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - pub billing_thresholds: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - pub collection_method: Option, - - /// ID of the default payment method for the subscription schedule. - /// - /// If not set, invoices will use the default payment method in the customer's invoice settings. - pub default_payment_method: Option>, - - /// Subscription description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription. - pub description: Option, - - /// The subscription schedule's default invoice settings. - pub invoice_settings: Option, - - /// The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. - /// - /// See the Connect documentation for details. - pub on_behalf_of: Option>, - - /// The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. - pub transfer_data: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionSchedulesResourceDefaultSettingsAutomaticTax { - /// Whether Stripe automatically computes tax on invoices created during this phase. - pub enabled: bool, -} - -/// The parameters for `SubscriptionSchedule::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateSubscriptionSchedule<'a> { - /// The identifier of the customer to create the subscription schedule for. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// Object representing the subscription schedule's default settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_settings: Option, - - /// Behavior of the subscription schedule and underlying subscription when it ends. - /// - /// Possible values are `release` or `cancel` with the default being `release`. - /// `release` will end the subscription schedule and keep the underlying subscription running.`cancel` will end the subscription schedule and cancel the underlying subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub end_behavior: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Migrate an existing subscription to be managed by a subscription schedule. - /// - /// If this parameter is set, a subscription schedule will be created using the subscription's item(s), set to auto-renew using the subscription's interval. - /// When using this parameter, other parameters (such as phase values) cannot be set. - /// To create a subscription schedule with other modifications, we recommend making two separate API calls. - #[serde(skip_serializing_if = "Option::is_none")] - pub from_subscription: Option<&'a str>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// List representing phases of the subscription schedule. - /// - /// Each phase can be customized to have different durations, plans, and coupons. - /// If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. - #[serde(skip_serializing_if = "Option::is_none")] - pub phases: Option>, - - /// When the subscription schedule starts. - /// - /// We recommend using `now` so that it starts the subscription immediately. - /// You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. - #[serde(skip_serializing_if = "Option::is_none")] - pub start_date: Option, -} - -impl<'a> CreateSubscriptionSchedule<'a> { - pub fn new() -> Self { - CreateSubscriptionSchedule { - customer: Default::default(), - default_settings: Default::default(), - end_behavior: Default::default(), - expand: Default::default(), - from_subscription: Default::default(), - metadata: Default::default(), - phases: Default::default(), - start_date: Default::default(), - } - } -} - -/// The parameters for `SubscriptionSchedule::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListSubscriptionSchedules<'a> { - /// Only return subscription schedules that were created canceled the given date interval. - #[serde(skip_serializing_if = "Option::is_none")] - pub canceled_at: Option>, - - /// Only return subscription schedules that completed during the given date interval. - #[serde(skip_serializing_if = "Option::is_none")] - pub completed_at: Option>, - - /// Only return subscription schedules that were created during the given date interval. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return subscription schedules for the given customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return subscription schedules that were released during the given date interval. - #[serde(skip_serializing_if = "Option::is_none")] - pub released_at: Option>, - - /// Only return subscription schedules that have not started yet. - #[serde(skip_serializing_if = "Option::is_none")] - pub scheduled: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListSubscriptionSchedules<'a> { - pub fn new() -> Self { - ListSubscriptionSchedules { - canceled_at: Default::default(), - completed_at: Default::default(), - created: Default::default(), - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - released_at: Default::default(), - scheduled: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListSubscriptionSchedules<'_> { - type O = SubscriptionSchedule; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `SubscriptionSchedule::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateSubscriptionSchedule<'a> { - /// Object representing the subscription schedule's default settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_settings: Option, - - /// Behavior of the subscription schedule and underlying subscription when it ends. - /// - /// Possible values are `release` or `cancel` with the default being `release`. - /// `release` will end the subscription schedule and keep the underlying subscription running.`cancel` will end the subscription schedule and cancel the underlying subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub end_behavior: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// List representing phases of the subscription schedule. - /// - /// Each phase can be customized to have different durations, plans, and coupons. - /// If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. - /// Note that past phases can be omitted. - #[serde(skip_serializing_if = "Option::is_none")] - pub phases: Option>, - - /// If the update changes the current phase, indicates whether the changes should be prorated. - /// - /// The default value is `create_prorations`. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_behavior: Option, -} - -impl<'a> UpdateSubscriptionSchedule<'a> { - pub fn new() -> Self { - UpdateSubscriptionSchedule { - default_settings: Default::default(), - end_behavior: Default::default(), - expand: Default::default(), - metadata: Default::default(), - phases: Default::default(), - proration_behavior: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionSchedulePhases { - /// A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. - /// - /// You may pass up to 20 items. - #[serde(skip_serializing_if = "Option::is_none")] - pub add_invoice_items: Option>, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - /// The request must be made by a platform account on a connected account in order to set an application fee percentage. - /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_percent: Option, - - /// Automatic tax settings for this phase. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. - /// - /// Cannot be set to `phase_start` if this phase specifies a trial. - /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_cycle_anchor: Option, - - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// Pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - /// Defaults to `charge_automatically` on creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - /// The identifier of the coupon to apply to this phase of the subscription schedule. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// ID of the default payment method for the subscription schedule. - /// - /// It must belong to the customer associated with the subscription schedule. - /// If not set, invoices will use the default payment method in the customer's invoice settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_payment_method: Option, - - /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. - /// - /// These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - /// Subscription description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// The date at which this phase of the subscription schedule ends. - /// - /// If set, `iterations` must not be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub end_date: Option, - - /// All invoices will be billed using the specified settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_settings: Option, - - /// List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. - pub items: Vec, - - /// Integer representing the multiplier applied to the price interval. - /// - /// For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. - /// If set, `end_date` must not be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub iterations: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. - /// - /// Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. - /// Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. - /// To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The account on behalf of which to charge, for each of the associated subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, - - /// Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. - /// - /// The default value is `create_prorations`. - /// This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. - /// It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_behavior: Option, - - /// The data with which to automatically create a Transfer for each of the associated subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial: Option, - - /// Sets the phase to trialing from the start date to this date. - /// - /// Must be before the phase end date, can not be combined with `trial`. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_end: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleDefaultSettingsParams { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - /// The request must be made by a platform account on a connected account in order to set an application fee percentage. - /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_percent: Option, - - /// Default settings for automatic tax computation. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. - /// - /// Cannot be set to `phase_start` if this phase specifies a trial. - /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_cycle_anchor: Option, - - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// Pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - /// Defaults to `charge_automatically` on creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - /// ID of the default payment method for the subscription schedule. - /// - /// It must belong to the customer associated with the subscription schedule. - /// If not set, invoices will use the default payment method in the customer's invoice settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_payment_method: Option, - - /// Subscription description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// All invoices will be billed using the specified settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_settings: Option, - - /// The account on behalf of which to charge, for each of the associated subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, - - /// The data with which to automatically create a Transfer for each of the associated subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionSchedulePhases { - /// A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. - /// - /// You may pass up to 20 items. - #[serde(skip_serializing_if = "Option::is_none")] - pub add_invoice_items: Option>, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - /// The request must be made by a platform account on a connected account in order to set an application fee percentage. - /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_percent: Option, - - /// Automatic tax settings for this phase. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. - /// - /// Cannot be set to `phase_start` if this phase specifies a trial. - /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_cycle_anchor: Option, - - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// Pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - /// Defaults to `charge_automatically` on creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - /// The identifier of the coupon to apply to this phase of the subscription schedule. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// ID of the default payment method for the subscription schedule. - /// - /// It must belong to the customer associated with the subscription schedule. - /// If not set, invoices will use the default payment method in the customer's invoice settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_payment_method: Option, - - /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. - /// - /// These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - /// Subscription description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// The date at which this phase of the subscription schedule ends. - /// - /// If set, `iterations` must not be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub end_date: Option, - - /// All invoices will be billed using the specified settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_settings: Option, - - /// List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. - pub items: Vec, - - /// Integer representing the multiplier applied to the price interval. - /// - /// For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. - /// If set, `end_date` must not be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub iterations: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. - /// - /// Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. - /// Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. - /// To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The account on behalf of which to charge, for each of the associated subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, - - /// Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. - /// - /// The default value is `create_prorations`. - /// This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. - /// It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_behavior: Option, - - /// The date at which this phase of the subscription schedule starts or `now`. - /// - /// Must be set on the first phase. - #[serde(skip_serializing_if = "Option::is_none")] - pub start_date: Option, - - /// The data with which to automatically create a Transfer for each of the associated subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial: Option, - - /// Sets the phase to trialing from the start date to this date. - /// - /// Must be before the phase end date, can not be combined with `trial`. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_end: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AddInvoiceItems { - /// The ID of the price object. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Quantity for this item. - /// - /// Defaults to 1. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The tax rates which apply to the item. - /// - /// When set, the `default_tax_rates` do not apply to this item. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionSchedulePhasesAutomaticTax { - /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionSchedulePhasesItems { - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// When updating, pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. - /// - /// Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. - /// Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. - /// To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The plan ID to subscribe to. - /// - /// You may specify the same ID in `plan` and `price`. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - /// The ID of the price object. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Quantity for the given price. - /// - /// Can be set only if the price's `usage_type` is `licensed` and not `metered`. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. - /// - /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. - /// When updating, pass an empty string to remove previously-defined tax rates. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionSchedulePhasesTransferData { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. - /// By default, the entire amount is transferred to the destination. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_percent: Option, - - /// ID of an existing, connected Stripe account. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleBillingThresholds { - /// Monetary threshold that triggers the subscription to advance to a new billing period. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_gte: Option, - - /// Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. - /// - /// If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - #[serde(skip_serializing_if = "Option::is_none")] - pub reset_billing_cycle_anchor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleDefaultSettingsParamsAutomaticTax { - /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleDefaultSettingsParamsTransferData { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. - /// By default, the entire amount is transferred to the destination. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_percent: Option, - - /// ID of an existing, connected Stripe account. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleInvoiceSettings { - /// Number of days within which a customer must pay invoices generated by this subscription schedule. - /// - /// This value will be `null` for subscription schedules where `billing=charge_automatically`. - #[serde(skip_serializing_if = "Option::is_none")] - pub days_until_due: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionSchedulePhasesAutomaticTax { - /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionSchedulePhasesItems { - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// When updating, pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. - /// - /// Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. - /// Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. - /// To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The plan ID to subscribe to. - /// - /// You may specify the same ID in `plan` and `price`. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - /// The ID of the price object. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Quantity for the given price. - /// - /// Can be set only if the price's `usage_type` is `licensed` and not `metered`. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. - /// - /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. - /// When updating, pass an empty string to remove previously-defined tax rates. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionSchedulePhasesTransferData { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. - /// By default, the entire amount is transferred to the destination. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_percent: Option, - - /// ID of an existing, connected Stripe account. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionSchedulePhasesItemsBillingThresholds { - /// Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)). - pub usage_gte: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionSchedulePhasesItemsPriceData { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of the product that this price will belong to. - pub product: String, - - /// The recurring components of a price such as `interval` and `interval_count`. - pub recurring: CreateSubscriptionSchedulePhasesItemsPriceDataRecurring, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceItemPriceData { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of the product that this price will belong to. - pub product: String, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionSchedulePhasesItemsBillingThresholds { - /// Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)). - pub usage_gte: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionSchedulePhasesItemsPriceData { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of the product that this price will belong to. - pub product: String, - - /// The recurring components of a price such as `interval` and `interval_count`. - pub recurring: UpdateSubscriptionSchedulePhasesItemsPriceDataRecurring, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionSchedulePhasesItemsPriceDataRecurring { - /// Specifies billing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval, - - /// The number of intervals between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionSchedulePhasesItemsPriceDataRecurring { - /// Specifies billing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval, - - /// The number of intervals between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, -} - -/// An enum representing the possible values of an `CreateSubscriptionSchedulePhases`'s `billing_cycle_anchor` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionSchedulePhasesBillingCycleAnchor { - Automatic, - PhaseStart, -} - -impl CreateSubscriptionSchedulePhasesBillingCycleAnchor { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionSchedulePhasesBillingCycleAnchor::Automatic => "automatic", - CreateSubscriptionSchedulePhasesBillingCycleAnchor::PhaseStart => "phase_start", - } - } -} - -impl AsRef for CreateSubscriptionSchedulePhasesBillingCycleAnchor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionSchedulePhasesBillingCycleAnchor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionSchedulePhasesBillingCycleAnchor { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateSubscriptionSchedulePhasesItemsPriceDataRecurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - Day, - Month, - Week, - Year, -} - -impl CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::Day => "day", - CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::Month => "month", - CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::Week => "week", - CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::Year => "year", - } - } -} - -impl AsRef for CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `CreateSubscriptionSchedulePhasesItemsPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::Exclusive => "exclusive", - CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::Inclusive => "inclusive", - CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `InvoiceItemPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceItemPriceDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl InvoiceItemPriceDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - InvoiceItemPriceDataTaxBehavior::Exclusive => "exclusive", - InvoiceItemPriceDataTaxBehavior::Inclusive => "inclusive", - InvoiceItemPriceDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for InvoiceItemPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceItemPriceDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceItemPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `SubscriptionSchedulePhaseConfiguration`'s `proration_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionProrationBehavior { - AlwaysInvoice, - CreateProrations, - None, -} - -impl SubscriptionProrationBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionProrationBehavior::AlwaysInvoice => "always_invoice", - SubscriptionProrationBehavior::CreateProrations => "create_prorations", - SubscriptionProrationBehavior::None => "none", - } - } -} - -impl AsRef for SubscriptionProrationBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionProrationBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionProrationBehavior { - fn default() -> Self { - Self::AlwaysInvoice - } -} - -/// An enum representing the possible values of an `SubscriptionScheduleDefaultSettings`'s `billing_cycle_anchor` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionScheduleDefaultSettingsBillingCycleAnchor { - Automatic, - PhaseStart, -} - -impl SubscriptionScheduleDefaultSettingsBillingCycleAnchor { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionScheduleDefaultSettingsBillingCycleAnchor::Automatic => "automatic", - SubscriptionScheduleDefaultSettingsBillingCycleAnchor::PhaseStart => "phase_start", - } - } -} - -impl AsRef for SubscriptionScheduleDefaultSettingsBillingCycleAnchor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionScheduleDefaultSettingsBillingCycleAnchor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionScheduleDefaultSettingsBillingCycleAnchor { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `SubscriptionScheduleDefaultSettings`'s `collection_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionScheduleDefaultSettingsCollectionMethod { - ChargeAutomatically, - SendInvoice, -} - -impl SubscriptionScheduleDefaultSettingsCollectionMethod { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionScheduleDefaultSettingsCollectionMethod::ChargeAutomatically => { - "charge_automatically" - } - SubscriptionScheduleDefaultSettingsCollectionMethod::SendInvoice => "send_invoice", - } - } -} - -impl AsRef for SubscriptionScheduleDefaultSettingsCollectionMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionScheduleDefaultSettingsCollectionMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionScheduleDefaultSettingsCollectionMethod { - fn default() -> Self { - Self::ChargeAutomatically - } -} - -/// An enum representing the possible values of an `SubscriptionScheduleDefaultSettingsParams`'s `billing_cycle_anchor` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionScheduleDefaultSettingsParamsBillingCycleAnchor { - Automatic, - PhaseStart, -} - -impl SubscriptionScheduleDefaultSettingsParamsBillingCycleAnchor { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionScheduleDefaultSettingsParamsBillingCycleAnchor::Automatic => "automatic", - SubscriptionScheduleDefaultSettingsParamsBillingCycleAnchor::PhaseStart => { - "phase_start" - } - } - } -} - -impl AsRef for SubscriptionScheduleDefaultSettingsParamsBillingCycleAnchor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionScheduleDefaultSettingsParamsBillingCycleAnchor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionScheduleDefaultSettingsParamsBillingCycleAnchor { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `SubscriptionSchedule`'s `end_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionScheduleEndBehavior { - Cancel, - None, - Release, - Renew, -} - -impl SubscriptionScheduleEndBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionScheduleEndBehavior::Cancel => "cancel", - SubscriptionScheduleEndBehavior::None => "none", - SubscriptionScheduleEndBehavior::Release => "release", - SubscriptionScheduleEndBehavior::Renew => "renew", - } - } -} - -impl AsRef for SubscriptionScheduleEndBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionScheduleEndBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionScheduleEndBehavior { - fn default() -> Self { - Self::Cancel - } -} - -/// An enum representing the possible values of an `SubscriptionSchedulePhaseConfiguration`'s `billing_cycle_anchor` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { - Automatic, - PhaseStart, -} - -impl SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionSchedulePhaseConfigurationBillingCycleAnchor::Automatic => "automatic", - SubscriptionSchedulePhaseConfigurationBillingCycleAnchor::PhaseStart => "phase_start", - } - } -} - -impl AsRef for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `SubscriptionSchedule`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionScheduleStatus { - Active, - Canceled, - Completed, - NotStarted, - Released, -} - -impl SubscriptionScheduleStatus { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionScheduleStatus::Active => "active", - SubscriptionScheduleStatus::Canceled => "canceled", - SubscriptionScheduleStatus::Completed => "completed", - SubscriptionScheduleStatus::NotStarted => "not_started", - SubscriptionScheduleStatus::Released => "released", - } - } -} - -impl AsRef for SubscriptionScheduleStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionScheduleStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionScheduleStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionSchedulePhases`'s `billing_cycle_anchor` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionSchedulePhasesBillingCycleAnchor { - Automatic, - PhaseStart, -} - -impl UpdateSubscriptionSchedulePhasesBillingCycleAnchor { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionSchedulePhasesBillingCycleAnchor::Automatic => "automatic", - UpdateSubscriptionSchedulePhasesBillingCycleAnchor::PhaseStart => "phase_start", - } - } -} - -impl AsRef for UpdateSubscriptionSchedulePhasesBillingCycleAnchor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionSchedulePhasesBillingCycleAnchor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionSchedulePhasesBillingCycleAnchor { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionSchedulePhasesItemsPriceDataRecurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - Day, - Month, - Week, - Year, -} - -impl UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::Day => "day", - UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::Month => "month", - UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::Week => "week", - UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::Year => "year", - } - } -} - -impl AsRef for UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionSchedulePhasesItemsPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::Exclusive => "exclusive", - UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::Inclusive => "inclusive", - UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} diff --git a/src/resources/generated/subscription_transfer_data.rs b/src/resources/generated/subscription_transfer_data.rs deleted file mode 100644 index 15cc9ddfe..000000000 --- a/src/resources/generated/subscription_transfer_data.rs +++ /dev/null @@ -1,21 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::params::{Expandable}; -use crate::resources::{Account}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "SubscriptionTransferData". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionTransferData { - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. - /// By default, the entire amount is transferred to the destination. - pub amount_percent: Option, - - /// The account where funds from the payment will be transferred to upon payment success. - pub destination: Expandable, -} diff --git a/src/resources/generated/tax_calculation.rs b/src/resources/generated/tax_calculation.rs deleted file mode 100644 index 9223d376e..000000000 --- a/src/resources/generated/tax_calculation.rs +++ /dev/null @@ -1,560 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::TaxCalculationId; -use crate::params::{List, Object, Timestamp}; -use crate::resources::{Currency, TaxCalculationLineItem, TaxProductResourceCustomerDetails}; - -/// The resource representing a Stripe "TaxProductResourceTaxCalculation". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxCalculation { - /// Unique identifier for the calculation. - pub id: TaxCalculationId, - - /// Total after taxes. - pub amount_total: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource. - pub customer: Option, - - pub customer_details: TaxProductResourceCustomerDetails, - - /// Timestamp of date at which the tax calculation will expire. - pub expires_at: Option, - - /// The list of items the customer is purchasing. - pub line_items: List, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The shipping cost details for the calculation. - pub shipping_cost: Option, - - /// The amount of tax to be collected on top of the line item prices. - pub tax_amount_exclusive: i64, - - /// The amount of tax already included in the line item prices. - pub tax_amount_inclusive: i64, - - /// Breakdown of individual tax amounts that add up to the total. - pub tax_breakdown: Vec, - - /// Timestamp of date at which the tax rules and rates in effect applies for the calculation. - pub tax_date: Timestamp, -} - -impl Object for TaxCalculation { - type Id = TaxCalculationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax.calculation" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxBreakdown { - /// The amount of tax, in integer cents. - pub amount: i64, - - /// Specifies whether the tax amount is included in the line item amount. - pub inclusive: bool, - - pub tax_rate_details: TaxProductResourceTaxRateDetails, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// We might extend the possible values for this field to support new tax rules. - pub taxability_reason: TaxProductResourceTaxBreakdownTaxabilityReason, - - /// The amount on which tax is calculated, in integer cents. - pub taxable_amount: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxCalculationShippingCost { - /// The shipping amount in integer cents. - /// - /// If `tax_behavior=inclusive`, then this amount includes taxes. - /// Otherwise, taxes were calculated on top of this amount. - pub amount: i64, - - /// The amount of tax calculated for shipping, in integer cents. - pub amount_tax: i64, - - /// The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_rate: Option, - - /// Specifies whether the `amount` includes taxes. - /// - /// If `tax_behavior=inclusive`, then the amount includes taxes. - pub tax_behavior: TaxProductResourceTaxCalculationShippingCostTaxBehavior, - - /// Detailed account of taxes relevant to shipping cost. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_breakdown: Option>, - - /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for shipping. - pub tax_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceLineItemTaxBreakdown { - /// The amount of tax, in integer cents. - pub amount: i64, - - pub jurisdiction: TaxProductResourceJurisdiction, - - /// Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). - pub sourcing: TaxProductResourceLineItemTaxBreakdownSourcing, - - /// Details regarding the rate for this tax. - /// - /// This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. - pub tax_rate_details: Option, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: TaxProductResourceLineItemTaxBreakdownTaxabilityReason, - - /// The amount on which tax is calculated, in integer cents. - pub taxable_amount: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceJurisdiction { - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: String, - - /// A human-readable name for the jurisdiction imposing the tax. - pub display_name: String, - - /// Indicates the level of the jurisdiction imposing the tax. - pub level: TaxProductResourceJurisdictionLevel, - - /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. - /// - /// For example, "NY" for New York, United States. - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceLineItemTaxRateDetails { - /// A localized display name for tax type, intended to be human-readable. - /// - /// For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". - pub display_name: String, - - /// The tax rate percentage as a string. - /// - /// For example, 8.5% is represented as "8.5". - pub percentage_decimal: String, - - /// The tax type, such as `vat` or `sales_tax`. - pub tax_type: TaxProductResourceLineItemTaxRateDetailsTaxType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxRateDetails { - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: Option, - - /// The tax rate percentage as a string. - /// - /// For example, 8.5% is represented as `"8.5"`. - pub percentage_decimal: String, - - /// State, county, province, or region. - pub state: Option, - - /// The tax type, such as `vat` or `sales_tax`. - pub tax_type: Option, -} - -/// An enum representing the possible values of an `TaxProductResourceJurisdiction`'s `level` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceJurisdictionLevel { - City, - Country, - County, - District, - State, -} - -impl TaxProductResourceJurisdictionLevel { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceJurisdictionLevel::City => "city", - TaxProductResourceJurisdictionLevel::Country => "country", - TaxProductResourceJurisdictionLevel::County => "county", - TaxProductResourceJurisdictionLevel::District => "district", - TaxProductResourceJurisdictionLevel::State => "state", - } - } -} - -impl AsRef for TaxProductResourceJurisdictionLevel { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceJurisdictionLevel { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceJurisdictionLevel { - fn default() -> Self { - Self::City - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxBreakdown`'s `sourcing` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxBreakdownSourcing { - Destination, - Origin, -} - -impl TaxProductResourceLineItemTaxBreakdownSourcing { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxBreakdownSourcing::Destination => "destination", - TaxProductResourceLineItemTaxBreakdownSourcing::Origin => "origin", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxBreakdownSourcing { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownSourcing { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxBreakdownSourcing { - fn default() -> Self { - Self::Destination - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxBreakdown`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::CustomerExempt => { - "customer_exempt" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotCollecting => { - "not_collecting" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotSubjectToTax => { - "not_subject_to_tax" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotSupported => "not_supported", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionProductExempt => { - "portion_product_exempt" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionReducedRated => { - "portion_reduced_rated" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionStandardRated => { - "portion_standard_rated" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProductExempt => { - "product_exempt" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProductExemptHoliday => { - "product_exempt_holiday" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProportionallyRated => { - "proportionally_rated" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ReducedRated => "reduced_rated", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ReverseCharge => { - "reverse_charge" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::StandardRated => { - "standard_rated" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::TaxableBasisReduced => { - "taxable_basis_reduced" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxRateDetails`'s `tax_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxRateDetailsTaxType { - AmusementTax, - CommunicationsTax, - Gst, - Hst, - Igst, - Jct, - LeaseTax, - Pst, - Qst, - Rst, - SalesTax, - Vat, -} - -impl TaxProductResourceLineItemTaxRateDetailsTaxType { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxRateDetailsTaxType::AmusementTax => "amusement_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::CommunicationsTax => { - "communications_tax" - } - TaxProductResourceLineItemTaxRateDetailsTaxType::Gst => "gst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Hst => "hst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Igst => "igst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Jct => "jct", - TaxProductResourceLineItemTaxRateDetailsTaxType::LeaseTax => "lease_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::Pst => "pst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Qst => "qst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Rst => "rst", - TaxProductResourceLineItemTaxRateDetailsTaxType::SalesTax => "sales_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::Vat => "vat", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn default() -> Self { - Self::AmusementTax - } -} - -/// An enum representing the possible values of an `TaxProductResourceTaxBreakdown`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceTaxBreakdownTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl TaxProductResourceTaxBreakdownTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceTaxBreakdownTaxabilityReason::CustomerExempt => "customer_exempt", - TaxProductResourceTaxBreakdownTaxabilityReason::NotCollecting => "not_collecting", - TaxProductResourceTaxBreakdownTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - TaxProductResourceTaxBreakdownTaxabilityReason::NotSupported => "not_supported", - TaxProductResourceTaxBreakdownTaxabilityReason::PortionProductExempt => { - "portion_product_exempt" - } - TaxProductResourceTaxBreakdownTaxabilityReason::PortionReducedRated => { - "portion_reduced_rated" - } - TaxProductResourceTaxBreakdownTaxabilityReason::PortionStandardRated => { - "portion_standard_rated" - } - TaxProductResourceTaxBreakdownTaxabilityReason::ProductExempt => "product_exempt", - TaxProductResourceTaxBreakdownTaxabilityReason::ProductExemptHoliday => { - "product_exempt_holiday" - } - TaxProductResourceTaxBreakdownTaxabilityReason::ProportionallyRated => { - "proportionally_rated" - } - TaxProductResourceTaxBreakdownTaxabilityReason::ReducedRated => "reduced_rated", - TaxProductResourceTaxBreakdownTaxabilityReason::ReverseCharge => "reverse_charge", - TaxProductResourceTaxBreakdownTaxabilityReason::StandardRated => "standard_rated", - TaxProductResourceTaxBreakdownTaxabilityReason::TaxableBasisReduced => { - "taxable_basis_reduced" - } - TaxProductResourceTaxBreakdownTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for TaxProductResourceTaxBreakdownTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceTaxBreakdownTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceTaxBreakdownTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} - -/// An enum representing the possible values of an `TaxProductResourceTaxCalculationShippingCost`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceTaxCalculationShippingCostTaxBehavior { - Exclusive, - Inclusive, -} - -impl TaxProductResourceTaxCalculationShippingCostTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceTaxCalculationShippingCostTaxBehavior::Exclusive => "exclusive", - TaxProductResourceTaxCalculationShippingCostTaxBehavior::Inclusive => "inclusive", - } - } -} - -impl AsRef for TaxProductResourceTaxCalculationShippingCostTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceTaxCalculationShippingCostTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceTaxCalculationShippingCostTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `TaxProductResourceTaxRateDetails`'s `tax_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceTaxRateDetailsTaxType { - AmusementTax, - CommunicationsTax, - Gst, - Hst, - Igst, - Jct, - LeaseTax, - Pst, - Qst, - Rst, - SalesTax, - Vat, -} - -impl TaxProductResourceTaxRateDetailsTaxType { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceTaxRateDetailsTaxType::AmusementTax => "amusement_tax", - TaxProductResourceTaxRateDetailsTaxType::CommunicationsTax => "communications_tax", - TaxProductResourceTaxRateDetailsTaxType::Gst => "gst", - TaxProductResourceTaxRateDetailsTaxType::Hst => "hst", - TaxProductResourceTaxRateDetailsTaxType::Igst => "igst", - TaxProductResourceTaxRateDetailsTaxType::Jct => "jct", - TaxProductResourceTaxRateDetailsTaxType::LeaseTax => "lease_tax", - TaxProductResourceTaxRateDetailsTaxType::Pst => "pst", - TaxProductResourceTaxRateDetailsTaxType::Qst => "qst", - TaxProductResourceTaxRateDetailsTaxType::Rst => "rst", - TaxProductResourceTaxRateDetailsTaxType::SalesTax => "sales_tax", - TaxProductResourceTaxRateDetailsTaxType::Vat => "vat", - } - } -} - -impl AsRef for TaxProductResourceTaxRateDetailsTaxType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceTaxRateDetailsTaxType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceTaxRateDetailsTaxType { - fn default() -> Self { - Self::AmusementTax - } -} diff --git a/src/resources/generated/tax_calculation_line_item.rs b/src/resources/generated/tax_calculation_line_item.rs deleted file mode 100644 index f8135e39d..000000000 --- a/src/resources/generated/tax_calculation_line_item.rs +++ /dev/null @@ -1,364 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::TaxCalculationLineItemId; -use crate::params::Object; - -/// The resource representing a Stripe "TaxProductResourceTaxCalculationLineItem". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxCalculationLineItem { - /// Unique identifier for the object. - pub id: TaxCalculationLineItemId, - - /// The line item amount in integer cents. - /// - /// If `tax_behavior=inclusive`, then this amount includes taxes. - /// Otherwise, taxes were calculated on top of this amount. - pub amount: i64, - - /// The amount of tax calculated for this line item, in integer cents. - pub amount_tax: i64, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The ID of an existing [Product](https://stripe.com/docs/api/products/object). - pub product: Option, - - /// The number of units of the item being purchased. - /// - /// For reversals, this is the quantity reversed. - pub quantity: u64, - - /// A custom identifier for this line item. - pub reference: Option, - - /// Specifies whether the `amount` includes taxes. - /// - /// If `tax_behavior=inclusive`, then the amount includes taxes. - pub tax_behavior: TaxCalculationLineItemTaxBehavior, - - /// Detailed account of taxes relevant to this line item. - pub tax_breakdown: Option>, - - /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource. - pub tax_code: String, -} - -impl Object for TaxCalculationLineItem { - type Id = TaxCalculationLineItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax.calculation_line_item" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceLineItemTaxBreakdown { - /// The amount of tax, in integer cents. - pub amount: i64, - - pub jurisdiction: TaxProductResourceJurisdiction, - - /// Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). - pub sourcing: TaxProductResourceLineItemTaxBreakdownSourcing, - - /// Details regarding the rate for this tax. - /// - /// This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. - pub tax_rate_details: Option, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: TaxProductResourceLineItemTaxBreakdownTaxabilityReason, - - /// The amount on which tax is calculated, in integer cents. - pub taxable_amount: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceJurisdiction { - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: String, - - /// A human-readable name for the jurisdiction imposing the tax. - pub display_name: String, - - /// Indicates the level of the jurisdiction imposing the tax. - pub level: TaxProductResourceJurisdictionLevel, - - /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. - /// - /// For example, "NY" for New York, United States. - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceLineItemTaxRateDetails { - /// A localized display name for tax type, intended to be human-readable. - /// - /// For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". - pub display_name: String, - - /// The tax rate percentage as a string. - /// - /// For example, 8.5% is represented as "8.5". - pub percentage_decimal: String, - - /// The tax type, such as `vat` or `sales_tax`. - pub tax_type: TaxProductResourceLineItemTaxRateDetailsTaxType, -} - -/// An enum representing the possible values of an `TaxCalculationLineItem`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxCalculationLineItemTaxBehavior { - Exclusive, - Inclusive, -} - -impl TaxCalculationLineItemTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - TaxCalculationLineItemTaxBehavior::Exclusive => "exclusive", - TaxCalculationLineItemTaxBehavior::Inclusive => "inclusive", - } - } -} - -impl AsRef for TaxCalculationLineItemTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxCalculationLineItemTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxCalculationLineItemTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `TaxProductResourceJurisdiction`'s `level` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceJurisdictionLevel { - City, - Country, - County, - District, - State, -} - -impl TaxProductResourceJurisdictionLevel { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceJurisdictionLevel::City => "city", - TaxProductResourceJurisdictionLevel::Country => "country", - TaxProductResourceJurisdictionLevel::County => "county", - TaxProductResourceJurisdictionLevel::District => "district", - TaxProductResourceJurisdictionLevel::State => "state", - } - } -} - -impl AsRef for TaxProductResourceJurisdictionLevel { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceJurisdictionLevel { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceJurisdictionLevel { - fn default() -> Self { - Self::City - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxBreakdown`'s `sourcing` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxBreakdownSourcing { - Destination, - Origin, -} - -impl TaxProductResourceLineItemTaxBreakdownSourcing { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxBreakdownSourcing::Destination => "destination", - TaxProductResourceLineItemTaxBreakdownSourcing::Origin => "origin", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxBreakdownSourcing { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownSourcing { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxBreakdownSourcing { - fn default() -> Self { - Self::Destination - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxBreakdown`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::CustomerExempt => { - "customer_exempt" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotCollecting => { - "not_collecting" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotSubjectToTax => { - "not_subject_to_tax" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotSupported => "not_supported", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionProductExempt => { - "portion_product_exempt" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionReducedRated => { - "portion_reduced_rated" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionStandardRated => { - "portion_standard_rated" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProductExempt => { - "product_exempt" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProductExemptHoliday => { - "product_exempt_holiday" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProportionallyRated => { - "proportionally_rated" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ReducedRated => "reduced_rated", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ReverseCharge => { - "reverse_charge" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::StandardRated => { - "standard_rated" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::TaxableBasisReduced => { - "taxable_basis_reduced" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxRateDetails`'s `tax_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxRateDetailsTaxType { - AmusementTax, - CommunicationsTax, - Gst, - Hst, - Igst, - Jct, - LeaseTax, - Pst, - Qst, - Rst, - SalesTax, - Vat, -} - -impl TaxProductResourceLineItemTaxRateDetailsTaxType { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxRateDetailsTaxType::AmusementTax => "amusement_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::CommunicationsTax => { - "communications_tax" - } - TaxProductResourceLineItemTaxRateDetailsTaxType::Gst => "gst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Hst => "hst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Igst => "igst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Jct => "jct", - TaxProductResourceLineItemTaxRateDetailsTaxType::LeaseTax => "lease_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::Pst => "pst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Qst => "qst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Rst => "rst", - TaxProductResourceLineItemTaxRateDetailsTaxType::SalesTax => "sales_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::Vat => "vat", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn default() -> Self { - Self::AmusementTax - } -} diff --git a/src/resources/generated/tax_code.rs b/src/resources/generated/tax_code.rs deleted file mode 100644 index 324517cde..000000000 --- a/src/resources/generated/tax_code.rs +++ /dev/null @@ -1,93 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::TaxCodeId; -use crate::params::{Expand, List, Object, Paginable}; - -/// The resource representing a Stripe "TaxProductResourceTaxCode". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxCode { - /// Unique identifier for the object. - pub id: TaxCodeId, - - /// A detailed description of which types of products the tax code represents. - pub description: String, - - /// A short name for the tax code. - pub name: String, -} - -impl TaxCode { - /// A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. - pub fn list(client: &Client, params: &ListTaxCodes<'_>) -> Response> { - client.get_query("/tax_codes", ¶ms) - } - - /// Retrieves the details of an existing tax code. - /// - /// Supply the unique tax code ID and Stripe will return the corresponding tax code information. - pub fn retrieve(client: &Client, id: &TaxCodeId, expand: &[&str]) -> Response { - client.get_query(&format!("/tax_codes/{}", id), &Expand { expand }) - } -} - -impl Object for TaxCode { - type Id = TaxCodeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax_code" - } -} - -/// The parameters for `TaxCode::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListTaxCodes<'a> { - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListTaxCodes<'a> { - pub fn new() -> Self { - ListTaxCodes { - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListTaxCodes<'_> { - type O = TaxCode; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} diff --git a/src/resources/generated/tax_deducted_at_source.rs b/src/resources/generated/tax_deducted_at_source.rs deleted file mode 100644 index 551c6544b..000000000 --- a/src/resources/generated/tax_deducted_at_source.rs +++ /dev/null @@ -1,38 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::TaxDeductedAtSourceId; -use crate::params::{Object, Timestamp}; - -/// The resource representing a Stripe "TaxDeductedAtSource". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxDeductedAtSource { - /// Unique identifier for the object. - pub id: TaxDeductedAtSourceId, - - /// The end of the invoicing period. - /// - /// This TDS applies to Stripe fees collected during this invoicing period. - pub period_end: Timestamp, - - /// The start of the invoicing period. - /// - /// This TDS applies to Stripe fees collected during this invoicing period. - pub period_start: Timestamp, - - /// The TAN that was supplied to Stripe when TDS was assessed. - pub tax_deduction_account_number: String, -} - -impl Object for TaxDeductedAtSource { - type Id = TaxDeductedAtSourceId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax_deducted_at_source" - } -} diff --git a/src/resources/generated/tax_id.rs b/src/resources/generated/tax_id.rs deleted file mode 100644 index 69b45dfa4..000000000 --- a/src/resources/generated/tax_id.rs +++ /dev/null @@ -1,279 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::TaxIdId; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::Customer; - -/// The resource representing a Stripe "tax_id". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxId { - /// Unique identifier for the object. - pub id: TaxIdId, - - /// Two-letter ISO code representing the country of the tax ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// ID of the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option>, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. - /// - /// Note that some legacy tax IDs have type `unknown`. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, - - /// Value of the tax ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub value: Option, - - /// Tax ID verification information. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification: Option, -} - -impl Object for TaxId { - type Id = TaxIdId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax_id" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxIdVerification { - /// Verification status, one of `pending`, `verified`, `unverified`, or `unavailable`. - pub status: TaxIdVerificationStatus, - - /// Verified address. - pub verified_address: Option, - - /// Verified name. - pub verified_name: Option, -} - -/// An enum representing the possible values of an `TaxId`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxIdType { - AdNrt, - AeTrn, - ArCuit, - AuAbn, - AuArn, - BgUic, - BoTin, - BrCnpj, - BrCpf, - CaBn, - CaGstHst, - CaPstBc, - CaPstMb, - CaPstSk, - CaQst, - ChVat, - ClTin, - CnTin, - CoNit, - CrTin, - DoRcn, - EcRuc, - EgTin, - EsCif, - EuOssVat, - EuVat, - GbVat, - GeVat, - HkBr, - HuTin, - IdNpwp, - IlVat, - InGst, - IsVat, - JpCn, - JpRn, - JpTrn, - KePin, - KrBrn, - LiUid, - MxRfc, - MyFrp, - MyItn, - MySst, - NoVat, - NzGst, - PeRuc, - PhTin, - RoTin, - RsPib, - RuInn, - RuKpp, - SaVat, - SgGst, - SgUen, - SiTin, - SvNit, - ThVat, - TrTin, - TwVat, - UaVat, - Unknown, - UsEin, - UyRuc, - VeRif, - VnTin, - ZaVat, -} - -impl TaxIdType { - pub fn as_str(self) -> &'static str { - match self { - TaxIdType::AdNrt => "ad_nrt", - TaxIdType::AeTrn => "ae_trn", - TaxIdType::ArCuit => "ar_cuit", - TaxIdType::AuAbn => "au_abn", - TaxIdType::AuArn => "au_arn", - TaxIdType::BgUic => "bg_uic", - TaxIdType::BoTin => "bo_tin", - TaxIdType::BrCnpj => "br_cnpj", - TaxIdType::BrCpf => "br_cpf", - TaxIdType::CaBn => "ca_bn", - TaxIdType::CaGstHst => "ca_gst_hst", - TaxIdType::CaPstBc => "ca_pst_bc", - TaxIdType::CaPstMb => "ca_pst_mb", - TaxIdType::CaPstSk => "ca_pst_sk", - TaxIdType::CaQst => "ca_qst", - TaxIdType::ChVat => "ch_vat", - TaxIdType::ClTin => "cl_tin", - TaxIdType::CnTin => "cn_tin", - TaxIdType::CoNit => "co_nit", - TaxIdType::CrTin => "cr_tin", - TaxIdType::DoRcn => "do_rcn", - TaxIdType::EcRuc => "ec_ruc", - TaxIdType::EgTin => "eg_tin", - TaxIdType::EsCif => "es_cif", - TaxIdType::EuOssVat => "eu_oss_vat", - TaxIdType::EuVat => "eu_vat", - TaxIdType::GbVat => "gb_vat", - TaxIdType::GeVat => "ge_vat", - TaxIdType::HkBr => "hk_br", - TaxIdType::HuTin => "hu_tin", - TaxIdType::IdNpwp => "id_npwp", - TaxIdType::IlVat => "il_vat", - TaxIdType::InGst => "in_gst", - TaxIdType::IsVat => "is_vat", - TaxIdType::JpCn => "jp_cn", - TaxIdType::JpRn => "jp_rn", - TaxIdType::JpTrn => "jp_trn", - TaxIdType::KePin => "ke_pin", - TaxIdType::KrBrn => "kr_brn", - TaxIdType::LiUid => "li_uid", - TaxIdType::MxRfc => "mx_rfc", - TaxIdType::MyFrp => "my_frp", - TaxIdType::MyItn => "my_itn", - TaxIdType::MySst => "my_sst", - TaxIdType::NoVat => "no_vat", - TaxIdType::NzGst => "nz_gst", - TaxIdType::PeRuc => "pe_ruc", - TaxIdType::PhTin => "ph_tin", - TaxIdType::RoTin => "ro_tin", - TaxIdType::RsPib => "rs_pib", - TaxIdType::RuInn => "ru_inn", - TaxIdType::RuKpp => "ru_kpp", - TaxIdType::SaVat => "sa_vat", - TaxIdType::SgGst => "sg_gst", - TaxIdType::SgUen => "sg_uen", - TaxIdType::SiTin => "si_tin", - TaxIdType::SvNit => "sv_nit", - TaxIdType::ThVat => "th_vat", - TaxIdType::TrTin => "tr_tin", - TaxIdType::TwVat => "tw_vat", - TaxIdType::UaVat => "ua_vat", - TaxIdType::Unknown => "unknown", - TaxIdType::UsEin => "us_ein", - TaxIdType::UyRuc => "uy_ruc", - TaxIdType::VeRif => "ve_rif", - TaxIdType::VnTin => "vn_tin", - TaxIdType::ZaVat => "za_vat", - } - } -} - -impl AsRef for TaxIdType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxIdType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxIdType { - fn default() -> Self { - Self::AdNrt - } -} - -/// An enum representing the possible values of an `TaxIdVerification`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxIdVerificationStatus { - Pending, - Unavailable, - Unverified, - Verified, -} - -impl TaxIdVerificationStatus { - pub fn as_str(self) -> &'static str { - match self { - TaxIdVerificationStatus::Pending => "pending", - TaxIdVerificationStatus::Unavailable => "unavailable", - TaxIdVerificationStatus::Unverified => "unverified", - TaxIdVerificationStatus::Verified => "verified", - } - } -} - -impl AsRef for TaxIdVerificationStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxIdVerificationStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxIdVerificationStatus { - fn default() -> Self { - Self::Pending - } -} diff --git a/src/resources/generated/tax_product_resource_customer_details.rs b/src/resources/generated/tax_product_resource_customer_details.rs deleted file mode 100644 index e44865f70..000000000 --- a/src/resources/generated/tax_product_resource_customer_details.rs +++ /dev/null @@ -1,293 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TaxProductResourceCustomerDetails". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceCustomerDetails { - /// The customer's postal address (for example, home or business location). - pub address: Option, - - /// The type of customer address provided. - pub address_source: Option, - - /// The customer's IP address (IPv4 or IPv6). - pub ip_address: Option, - - /// The customer's tax IDs (for example, EU VAT numbers). - pub tax_ids: Vec, - - /// The taxability override used for taxation. - pub taxability_override: TaxProductResourceCustomerDetailsTaxabilityOverride, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceCustomerDetailsResourceTaxId { - /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. - #[serde(rename = "type")] - pub type_: TaxProductResourceCustomerDetailsResourceTaxIdType, - - /// The value of the tax ID. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourcePostalAddress { - /// City, district, suburb, town, or village. - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: String, - - /// Address line 1 (e.g., street, PO Box, or company name). - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - pub line2: Option, - - /// ZIP or postal code. - pub postal_code: Option, - - /// State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. - /// - /// Example: "NY" or "TX". - pub state: Option, -} - -/// An enum representing the possible values of an `TaxProductResourceCustomerDetails`'s `address_source` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceCustomerDetailsAddressSource { - Billing, - Shipping, -} - -impl TaxProductResourceCustomerDetailsAddressSource { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceCustomerDetailsAddressSource::Billing => "billing", - TaxProductResourceCustomerDetailsAddressSource::Shipping => "shipping", - } - } -} - -impl AsRef for TaxProductResourceCustomerDetailsAddressSource { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceCustomerDetailsAddressSource { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceCustomerDetailsAddressSource { - fn default() -> Self { - Self::Billing - } -} - -/// An enum representing the possible values of an `TaxProductResourceCustomerDetailsResourceTaxId`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceCustomerDetailsResourceTaxIdType { - AdNrt, - AeTrn, - ArCuit, - AuAbn, - AuArn, - BgUic, - BoTin, - BrCnpj, - BrCpf, - CaBn, - CaGstHst, - CaPstBc, - CaPstMb, - CaPstSk, - CaQst, - ChVat, - ClTin, - CnTin, - CoNit, - CrTin, - DoRcn, - EcRuc, - EgTin, - EsCif, - EuOssVat, - EuVat, - GbVat, - GeVat, - HkBr, - HuTin, - IdNpwp, - IlVat, - InGst, - IsVat, - JpCn, - JpRn, - JpTrn, - KePin, - KrBrn, - LiUid, - MxRfc, - MyFrp, - MyItn, - MySst, - NoVat, - NzGst, - PeRuc, - PhTin, - RoTin, - RsPib, - RuInn, - RuKpp, - SaVat, - SgGst, - SgUen, - SiTin, - SvNit, - ThVat, - TrTin, - TwVat, - UaVat, - Unknown, - UsEin, - UyRuc, - VeRif, - VnTin, - ZaVat, -} - -impl TaxProductResourceCustomerDetailsResourceTaxIdType { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceCustomerDetailsResourceTaxIdType::AdNrt => "ad_nrt", - TaxProductResourceCustomerDetailsResourceTaxIdType::AeTrn => "ae_trn", - TaxProductResourceCustomerDetailsResourceTaxIdType::ArCuit => "ar_cuit", - TaxProductResourceCustomerDetailsResourceTaxIdType::AuAbn => "au_abn", - TaxProductResourceCustomerDetailsResourceTaxIdType::AuArn => "au_arn", - TaxProductResourceCustomerDetailsResourceTaxIdType::BgUic => "bg_uic", - TaxProductResourceCustomerDetailsResourceTaxIdType::BoTin => "bo_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::BrCnpj => "br_cnpj", - TaxProductResourceCustomerDetailsResourceTaxIdType::BrCpf => "br_cpf", - TaxProductResourceCustomerDetailsResourceTaxIdType::CaBn => "ca_bn", - TaxProductResourceCustomerDetailsResourceTaxIdType::CaGstHst => "ca_gst_hst", - TaxProductResourceCustomerDetailsResourceTaxIdType::CaPstBc => "ca_pst_bc", - TaxProductResourceCustomerDetailsResourceTaxIdType::CaPstMb => "ca_pst_mb", - TaxProductResourceCustomerDetailsResourceTaxIdType::CaPstSk => "ca_pst_sk", - TaxProductResourceCustomerDetailsResourceTaxIdType::CaQst => "ca_qst", - TaxProductResourceCustomerDetailsResourceTaxIdType::ChVat => "ch_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::ClTin => "cl_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::CnTin => "cn_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::CoNit => "co_nit", - TaxProductResourceCustomerDetailsResourceTaxIdType::CrTin => "cr_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::DoRcn => "do_rcn", - TaxProductResourceCustomerDetailsResourceTaxIdType::EcRuc => "ec_ruc", - TaxProductResourceCustomerDetailsResourceTaxIdType::EgTin => "eg_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::EsCif => "es_cif", - TaxProductResourceCustomerDetailsResourceTaxIdType::EuOssVat => "eu_oss_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::EuVat => "eu_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::GbVat => "gb_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::GeVat => "ge_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::HkBr => "hk_br", - TaxProductResourceCustomerDetailsResourceTaxIdType::HuTin => "hu_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::IdNpwp => "id_npwp", - TaxProductResourceCustomerDetailsResourceTaxIdType::IlVat => "il_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::InGst => "in_gst", - TaxProductResourceCustomerDetailsResourceTaxIdType::IsVat => "is_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::JpCn => "jp_cn", - TaxProductResourceCustomerDetailsResourceTaxIdType::JpRn => "jp_rn", - TaxProductResourceCustomerDetailsResourceTaxIdType::JpTrn => "jp_trn", - TaxProductResourceCustomerDetailsResourceTaxIdType::KePin => "ke_pin", - TaxProductResourceCustomerDetailsResourceTaxIdType::KrBrn => "kr_brn", - TaxProductResourceCustomerDetailsResourceTaxIdType::LiUid => "li_uid", - TaxProductResourceCustomerDetailsResourceTaxIdType::MxRfc => "mx_rfc", - TaxProductResourceCustomerDetailsResourceTaxIdType::MyFrp => "my_frp", - TaxProductResourceCustomerDetailsResourceTaxIdType::MyItn => "my_itn", - TaxProductResourceCustomerDetailsResourceTaxIdType::MySst => "my_sst", - TaxProductResourceCustomerDetailsResourceTaxIdType::NoVat => "no_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::NzGst => "nz_gst", - TaxProductResourceCustomerDetailsResourceTaxIdType::PeRuc => "pe_ruc", - TaxProductResourceCustomerDetailsResourceTaxIdType::PhTin => "ph_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::RoTin => "ro_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::RsPib => "rs_pib", - TaxProductResourceCustomerDetailsResourceTaxIdType::RuInn => "ru_inn", - TaxProductResourceCustomerDetailsResourceTaxIdType::RuKpp => "ru_kpp", - TaxProductResourceCustomerDetailsResourceTaxIdType::SaVat => "sa_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::SgGst => "sg_gst", - TaxProductResourceCustomerDetailsResourceTaxIdType::SgUen => "sg_uen", - TaxProductResourceCustomerDetailsResourceTaxIdType::SiTin => "si_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::SvNit => "sv_nit", - TaxProductResourceCustomerDetailsResourceTaxIdType::ThVat => "th_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::TrTin => "tr_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::TwVat => "tw_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::UaVat => "ua_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::Unknown => "unknown", - TaxProductResourceCustomerDetailsResourceTaxIdType::UsEin => "us_ein", - TaxProductResourceCustomerDetailsResourceTaxIdType::UyRuc => "uy_ruc", - TaxProductResourceCustomerDetailsResourceTaxIdType::VeRif => "ve_rif", - TaxProductResourceCustomerDetailsResourceTaxIdType::VnTin => "vn_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::ZaVat => "za_vat", - } - } -} - -impl AsRef for TaxProductResourceCustomerDetailsResourceTaxIdType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceCustomerDetailsResourceTaxIdType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceCustomerDetailsResourceTaxIdType { - fn default() -> Self { - Self::AdNrt - } -} - -/// An enum representing the possible values of an `TaxProductResourceCustomerDetails`'s `taxability_override` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceCustomerDetailsTaxabilityOverride { - CustomerExempt, - None, - ReverseCharge, -} - -impl TaxProductResourceCustomerDetailsTaxabilityOverride { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceCustomerDetailsTaxabilityOverride::CustomerExempt => { - "customer_exempt" - } - TaxProductResourceCustomerDetailsTaxabilityOverride::None => "none", - TaxProductResourceCustomerDetailsTaxabilityOverride::ReverseCharge => "reverse_charge", - } - } -} - -impl AsRef for TaxProductResourceCustomerDetailsTaxabilityOverride { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceCustomerDetailsTaxabilityOverride { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceCustomerDetailsTaxabilityOverride { - fn default() -> Self { - Self::CustomerExempt - } -} diff --git a/src/resources/generated/tax_rate.rs b/src/resources/generated/tax_rate.rs deleted file mode 100644 index 046e4308f..000000000 --- a/src/resources/generated/tax_rate.rs +++ /dev/null @@ -1,368 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::TaxRateId; -use crate::params::{Expand, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; - -/// The resource representing a Stripe "TaxRate". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxRate { - /// Unique identifier for the object. - pub id: TaxRateId, - - /// Defaults to `true`. - /// - /// When set to `false`, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. - pub active: bool, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// An arbitrary string attached to the tax rate for your internal use only. - /// - /// It will not be visible to your customers. - pub description: Option, - - /// The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page. - pub display_name: String, - - /// Actual/effective tax rate percentage out of 100. - /// - /// For tax calculations with automatic_tax[enabled]=true, this percentage reflects the rate actually used to calculate tax based on the product's taxability and whether the user is registered to collect taxes in the corresponding jurisdiction. - pub effective_percentage: Option, - - /// This specifies if the tax rate is inclusive or exclusive. - pub inclusive: bool, - - /// The jurisdiction for the tax rate. - /// - /// You can use this label field for tax reporting purposes. - /// It also appears on your customer’s invoice. - pub jurisdiction: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// Tax rate percentage out of 100. - /// - /// For tax calculations with automatic_tax[enabled]=true, this percentage includes the statutory tax rate of non-taxable jurisdictions. - pub percentage: f64, - - /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. - /// - /// For example, "NY" for New York, United States. - pub state: Option, - - /// The high-level tax type, such as `vat` or `sales_tax`. - pub tax_type: Option, -} - -impl TaxRate { - /// Returns a list of your tax rates. - /// - /// Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. - pub fn list(client: &Client, params: &ListTaxRates<'_>) -> Response> { - client.get_query("/tax_rates", ¶ms) - } - - /// Creates a new tax rate. - pub fn create(client: &Client, params: CreateTaxRate<'_>) -> Response { - client.post_form("/tax_rates", ¶ms) - } - - /// Retrieves a tax rate with the given ID. - pub fn retrieve(client: &Client, id: &TaxRateId, expand: &[&str]) -> Response { - client.get_query(&format!("/tax_rates/{}", id), &Expand { expand }) - } - - /// Updates an existing tax rate. - pub fn update(client: &Client, id: &TaxRateId, params: UpdateTaxRate<'_>) -> Response { - client.post_form(&format!("/tax_rates/{}", id), ¶ms) - } -} - -impl Object for TaxRate { - type Id = TaxRateId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax_rate" - } -} - -/// The parameters for `TaxRate::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateTaxRate<'a> { - /// Flag determining whether the tax rate is active or inactive (archived). - /// - /// Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option<&'a str>, - - /// An arbitrary string attached to the tax rate for your internal use only. - /// - /// It will not be visible to your customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// The display name of the tax rate, which will be shown to users. - pub display_name: &'a str, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// This specifies if the tax rate is inclusive or exclusive. - pub inclusive: bool, - - /// The jurisdiction for the tax rate. - /// - /// You can use this label field for tax reporting purposes. - /// It also appears on your customer’s invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub jurisdiction: Option<&'a str>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// This represents the tax rate percent out of 100. - pub percentage: f64, - - /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. - /// - /// For example, "NY" for New York, United States. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option<&'a str>, - - /// The high-level tax type, such as `vat` or `sales_tax`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_type: Option, -} - -impl<'a> CreateTaxRate<'a> { - pub fn new(display_name: &'a str, percentage: f64) -> Self { - CreateTaxRate { - active: Default::default(), - country: Default::default(), - description: Default::default(), - display_name, - expand: Default::default(), - inclusive: Default::default(), - jurisdiction: Default::default(), - metadata: Default::default(), - percentage, - state: Default::default(), - tax_type: Default::default(), - } - } -} - -/// The parameters for `TaxRate::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListTaxRates<'a> { - /// Optional flag to filter by tax rates that are either active or inactive (archived). - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Optional range for filtering created date. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Optional flag to filter by tax rates that are inclusive (or those that are not inclusive). - #[serde(skip_serializing_if = "Option::is_none")] - pub inclusive: Option, - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListTaxRates<'a> { - pub fn new() -> Self { - ListTaxRates { - active: Default::default(), - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - inclusive: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListTaxRates<'_> { - type O = TaxRate; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `TaxRate::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateTaxRate<'a> { - /// Flag determining whether the tax rate is active or inactive (archived). - /// - /// Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option<&'a str>, - - /// An arbitrary string attached to the tax rate for your internal use only. - /// - /// It will not be visible to your customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// The display name of the tax rate, which will be shown to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_name: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The jurisdiction for the tax rate. - /// - /// You can use this label field for tax reporting purposes. - /// It also appears on your customer’s invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub jurisdiction: Option<&'a str>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. - /// - /// For example, "NY" for New York, United States. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option<&'a str>, - - /// The high-level tax type, such as `vat` or `sales_tax`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_type: Option, -} - -impl<'a> UpdateTaxRate<'a> { - pub fn new() -> Self { - UpdateTaxRate { - active: Default::default(), - country: Default::default(), - description: Default::default(), - display_name: Default::default(), - expand: Default::default(), - jurisdiction: Default::default(), - metadata: Default::default(), - state: Default::default(), - tax_type: Default::default(), - } - } -} - -/// An enum representing the possible values of an `TaxRate`'s `tax_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxRateTaxType { - AmusementTax, - CommunicationsTax, - Gst, - Hst, - Igst, - Jct, - LeaseTax, - Pst, - Qst, - Rst, - SalesTax, - ServiceTax, - Vat, -} - -impl TaxRateTaxType { - pub fn as_str(self) -> &'static str { - match self { - TaxRateTaxType::AmusementTax => "amusement_tax", - TaxRateTaxType::CommunicationsTax => "communications_tax", - TaxRateTaxType::Gst => "gst", - TaxRateTaxType::Hst => "hst", - TaxRateTaxType::Igst => "igst", - TaxRateTaxType::Jct => "jct", - TaxRateTaxType::LeaseTax => "lease_tax", - TaxRateTaxType::Pst => "pst", - TaxRateTaxType::Qst => "qst", - TaxRateTaxType::Rst => "rst", - TaxRateTaxType::SalesTax => "sales_tax", - TaxRateTaxType::ServiceTax => "service_tax", - TaxRateTaxType::Vat => "vat", - } - } -} - -impl AsRef for TaxRateTaxType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxRateTaxType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxRateTaxType { - fn default() -> Self { - Self::AmusementTax - } -} diff --git a/src/resources/generated/tax_settings.rs b/src/resources/generated/tax_settings.rs deleted file mode 100644 index be6357b5d..000000000 --- a/src/resources/generated/tax_settings.rs +++ /dev/null @@ -1,150 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::params::{Object}; -use crate::resources::{Address}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TaxProductResourceTaxSettings". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxSettings { - - pub defaults: TaxProductResourceTaxSettingsDefaults, - - /// The place where your business is located. - pub head_office: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The `active` status indicates you have all required settings to calculate tax. - /// - /// A status can transition out of `active` when new required settings are introduced. - pub status: TaxSettingsStatus, - - pub status_details: TaxProductResourceTaxSettingsStatusDetails, -} - -impl Object for TaxSettings { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "tax.settings" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxSettingsDefaults { - - /// Default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) used to specify whether the price is considered inclusive of taxes or exclusive of taxes. - /// - /// If the item's price has a tax behavior set, it will take precedence over the default tax behavior. - pub tax_behavior: Option, - - /// Default [tax code](https://stripe.com/docs/tax/tax-categories) used to classify your products and prices. - pub tax_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxSettingsHeadOffice { - - pub address: Address, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxSettingsStatusDetails { - - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pending: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxSettingsStatusDetailsResourceActive { -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxSettingsStatusDetailsResourcePending { - - /// The list of missing fields that are required to perform calculations. - /// - /// It includes the entry `head_office` when the status is `pending`. - /// It is recommended to set the optional values even if they aren't listed as required for calculating taxes. - /// Calculations can fail if missing fields aren't explicitly provided on every call. - pub missing_fields: Option>, -} - -/// An enum representing the possible values of an `TaxProductResourceTaxSettingsDefaults`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceTaxSettingsDefaultsTaxBehavior { - Exclusive, - Inclusive, - InferredByCurrency, -} - -impl TaxProductResourceTaxSettingsDefaultsTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceTaxSettingsDefaultsTaxBehavior::Exclusive => "exclusive", - TaxProductResourceTaxSettingsDefaultsTaxBehavior::Inclusive => "inclusive", - TaxProductResourceTaxSettingsDefaultsTaxBehavior::InferredByCurrency => "inferred_by_currency", - } - } -} - -impl AsRef for TaxProductResourceTaxSettingsDefaultsTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceTaxSettingsDefaultsTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceTaxSettingsDefaultsTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `TaxSettings`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxSettingsStatus { - Active, - Pending, -} - -impl TaxSettingsStatus { - pub fn as_str(self) -> &'static str { - match self { - TaxSettingsStatus::Active => "active", - TaxSettingsStatus::Pending => "pending", - } - } -} - -impl AsRef for TaxSettingsStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxSettingsStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxSettingsStatus { - fn default() -> Self { - Self::Active - } -} diff --git a/src/resources/generated/tax_transaction.rs b/src/resources/generated/tax_transaction.rs deleted file mode 100644 index efb1eaf74..000000000 --- a/src/resources/generated/tax_transaction.rs +++ /dev/null @@ -1,423 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TaxTransactionId}; -use crate::params::{List, Metadata, Object, Timestamp}; -use crate::resources::{Currency, TaxProductResourceCustomerDetails, TaxTransactionLineItem}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TaxProductResourceTaxTransaction". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxTransaction { - /// Unique identifier for the transaction. - pub id: TaxTransactionId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource. - pub customer: Option, - - pub customer_details: TaxProductResourceCustomerDetails, - - /// The tax collected or refunded, by line item. - pub line_items: List, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// A custom unique identifier, such as 'myOrder_123'. - pub reference: String, - - /// If `type=reversal`, contains information about what was reversed. - pub reversal: Option, - - /// The shipping cost details for the transaction. - pub shipping_cost: Option, - - /// Timestamp of date at which the tax rules and rates in effect applies for the calculation. - pub tax_date: Timestamp, - - /// If `reversal`, this transaction reverses an earlier transaction. - #[serde(rename = "type")] - pub type_: TaxTransactionType, -} - -impl Object for TaxTransaction { - type Id = TaxTransactionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax.transaction" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxTransactionResourceReversal { - - /// The `id` of the reversed `Transaction` object. - pub original_transaction: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxTransactionShippingCost { - - /// The shipping amount in integer cents. - /// - /// If `tax_behavior=inclusive`, then this amount includes taxes. - /// Otherwise, taxes were calculated on top of this amount. - pub amount: i64, - - /// The amount of tax calculated for shipping, in integer cents. - pub amount_tax: i64, - - /// The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_rate: Option, - - /// Specifies whether the `amount` includes taxes. - /// - /// If `tax_behavior=inclusive`, then the amount includes taxes. - pub tax_behavior: TaxProductResourceTaxTransactionShippingCostTaxBehavior, - - /// Detailed account of taxes relevant to shipping cost. - /// - /// (It is not populated for the transaction resource object and will be removed in the next API version.). - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_breakdown: Option>, - - /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for shipping. - pub tax_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceLineItemTaxBreakdown { - - /// The amount of tax, in integer cents. - pub amount: i64, - - pub jurisdiction: TaxProductResourceJurisdiction, - - /// Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). - pub sourcing: TaxProductResourceLineItemTaxBreakdownSourcing, - - /// Details regarding the rate for this tax. - /// - /// This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. - pub tax_rate_details: Option, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: TaxProductResourceLineItemTaxBreakdownTaxabilityReason, - - /// The amount on which tax is calculated, in integer cents. - pub taxable_amount: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceJurisdiction { - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: String, - - /// A human-readable name for the jurisdiction imposing the tax. - pub display_name: String, - - /// Indicates the level of the jurisdiction imposing the tax. - pub level: TaxProductResourceJurisdictionLevel, - - /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. - /// - /// For example, "NY" for New York, United States. - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceLineItemTaxRateDetails { - - /// A localized display name for tax type, intended to be human-readable. - /// - /// For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". - pub display_name: String, - - /// The tax rate percentage as a string. - /// - /// For example, 8.5% is represented as "8.5". - pub percentage_decimal: String, - - /// The tax type, such as `vat` or `sales_tax`. - pub tax_type: TaxProductResourceLineItemTaxRateDetailsTaxType, -} - -/// An enum representing the possible values of an `TaxProductResourceJurisdiction`'s `level` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceJurisdictionLevel { - City, - Country, - County, - District, - State, -} - -impl TaxProductResourceJurisdictionLevel { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceJurisdictionLevel::City => "city", - TaxProductResourceJurisdictionLevel::Country => "country", - TaxProductResourceJurisdictionLevel::County => "county", - TaxProductResourceJurisdictionLevel::District => "district", - TaxProductResourceJurisdictionLevel::State => "state", - } - } -} - -impl AsRef for TaxProductResourceJurisdictionLevel { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceJurisdictionLevel { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceJurisdictionLevel { - fn default() -> Self { - Self::City - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxBreakdown`'s `sourcing` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxBreakdownSourcing { - Destination, - Origin, -} - -impl TaxProductResourceLineItemTaxBreakdownSourcing { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxBreakdownSourcing::Destination => "destination", - TaxProductResourceLineItemTaxBreakdownSourcing::Origin => "origin", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxBreakdownSourcing { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownSourcing { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxBreakdownSourcing { - fn default() -> Self { - Self::Destination - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxBreakdown`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::CustomerExempt => "customer_exempt", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotCollecting => "not_collecting", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotSupported => "not_supported", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionProductExempt => "portion_product_exempt", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionStandardRated => "portion_standard_rated", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProductExempt => "product_exempt", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProportionallyRated => "proportionally_rated", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ReducedRated => "reduced_rated", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ReverseCharge => "reverse_charge", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::StandardRated => "standard_rated", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxRateDetails`'s `tax_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxRateDetailsTaxType { - AmusementTax, - CommunicationsTax, - Gst, - Hst, - Igst, - Jct, - LeaseTax, - Pst, - Qst, - Rst, - SalesTax, - Vat, -} - -impl TaxProductResourceLineItemTaxRateDetailsTaxType { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxRateDetailsTaxType::AmusementTax => "amusement_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::CommunicationsTax => "communications_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::Gst => "gst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Hst => "hst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Igst => "igst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Jct => "jct", - TaxProductResourceLineItemTaxRateDetailsTaxType::LeaseTax => "lease_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::Pst => "pst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Qst => "qst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Rst => "rst", - TaxProductResourceLineItemTaxRateDetailsTaxType::SalesTax => "sales_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::Vat => "vat", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn default() -> Self { - Self::AmusementTax - } -} - -/// An enum representing the possible values of an `TaxProductResourceTaxTransactionShippingCost`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceTaxTransactionShippingCostTaxBehavior { - Exclusive, - Inclusive, -} - -impl TaxProductResourceTaxTransactionShippingCostTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceTaxTransactionShippingCostTaxBehavior::Exclusive => "exclusive", - TaxProductResourceTaxTransactionShippingCostTaxBehavior::Inclusive => "inclusive", - } - } -} - -impl AsRef for TaxProductResourceTaxTransactionShippingCostTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceTaxTransactionShippingCostTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceTaxTransactionShippingCostTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `TaxTransaction`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxTransactionType { - Reversal, - Transaction, -} - -impl TaxTransactionType { - pub fn as_str(self) -> &'static str { - match self { - TaxTransactionType::Reversal => "reversal", - TaxTransactionType::Transaction => "transaction", - } - } -} - -impl AsRef for TaxTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxTransactionType { - fn default() -> Self { - Self::Reversal - } -} diff --git a/src/resources/generated/tax_transaction_line_item.rs b/src/resources/generated/tax_transaction_line_item.rs deleted file mode 100644 index 6a42c15ff..000000000 --- a/src/resources/generated/tax_transaction_line_item.rs +++ /dev/null @@ -1,142 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TaxTransactionLineItemId}; -use crate::params::{Metadata, Object}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TaxProductResourceTaxTransactionLineItem". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxTransactionLineItem { - /// Unique identifier for the object. - pub id: TaxTransactionLineItemId, - - /// The line item amount in integer cents. - /// - /// If `tax_behavior=inclusive`, then this amount includes taxes. - /// Otherwise, taxes were calculated on top of this amount. - pub amount: i64, - - /// The amount of tax calculated for this line item, in integer cents. - pub amount_tax: i64, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// The ID of an existing [Product](https://stripe.com/docs/api/products/object). - pub product: Option, - - /// The number of units of the item being purchased. - /// - /// For reversals, this is the quantity reversed. - pub quantity: u64, - - /// A custom identifier for this line item in the transaction. - pub reference: String, - - /// If `type=reversal`, contains information about what was reversed. - pub reversal: Option, - - /// Specifies whether the `amount` includes taxes. - /// - /// If `tax_behavior=inclusive`, then the amount includes taxes. - pub tax_behavior: TaxTransactionLineItemTaxBehavior, - - /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource. - pub tax_code: String, - - /// If `reversal`, this line item reverses an earlier transaction. - #[serde(rename = "type")] - pub type_: TaxTransactionLineItemType, -} - -impl Object for TaxTransactionLineItem { - type Id = TaxTransactionLineItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax.transaction_line_item" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxTransactionLineItemResourceReversal { - - /// The `id` of the line item to reverse in the original transaction. - pub original_line_item: String, -} - -/// An enum representing the possible values of an `TaxTransactionLineItem`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxTransactionLineItemTaxBehavior { - Exclusive, - Inclusive, -} - -impl TaxTransactionLineItemTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - TaxTransactionLineItemTaxBehavior::Exclusive => "exclusive", - TaxTransactionLineItemTaxBehavior::Inclusive => "inclusive", - } - } -} - -impl AsRef for TaxTransactionLineItemTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxTransactionLineItemTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxTransactionLineItemTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `TaxTransactionLineItem`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxTransactionLineItemType { - Reversal, - Transaction, -} - -impl TaxTransactionLineItemType { - pub fn as_str(self) -> &'static str { - match self { - TaxTransactionLineItemType::Reversal => "reversal", - TaxTransactionLineItemType::Transaction => "transaction", - } - } -} - -impl AsRef for TaxTransactionLineItemType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxTransactionLineItemType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxTransactionLineItemType { - fn default() -> Self { - Self::Reversal - } -} diff --git a/src/resources/generated/terminal_configuration.rs b/src/resources/generated/terminal_configuration.rs deleted file mode 100644 index 4d38d9a1f..000000000 --- a/src/resources/generated/terminal_configuration.rs +++ /dev/null @@ -1,116 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::TerminalConfigurationId; -use crate::params::{Expandable, Object}; -use crate::resources::File; - -/// The resource representing a Stripe "TerminalConfigurationConfiguration". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalConfiguration { - /// Unique identifier for the object. - pub id: TerminalConfigurationId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bbpos_wisepos_e: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// Whether this Configuration is the default for your account. - #[serde(skip_serializing_if = "Option::is_none")] - pub is_account_default: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub tipping: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub verifone_p400: Option, -} - -impl Object for TerminalConfiguration { - type Id = TerminalConfigurationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "terminal.configuration" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalConfigurationConfigurationResourceDeviceTypeSpecificConfig { - /// A File ID representing an image you would like displayed on the reader. - #[serde(skip_serializing_if = "Option::is_none")] - pub splashscreen: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalConfigurationConfigurationResourceTipping { - #[serde(skip_serializing_if = "Option::is_none")] - pub aud: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cad: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub chf: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub czk: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub dkk: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub eur: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub gbp: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub hkd: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub myr: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub nok: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub nzd: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sek: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sgd: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub usd: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalConfigurationConfigurationResourceCurrencySpecificConfig { - /// Fixed amounts displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amounts: Option>, - - /// Percentages displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub percentages: Option>, - - /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub smart_tip_threshold: Option, -} diff --git a/src/resources/generated/terminal_connection_token.rs b/src/resources/generated/terminal_connection_token.rs deleted file mode 100644 index e38051d1f..000000000 --- a/src/resources/generated/terminal_connection_token.rs +++ /dev/null @@ -1,31 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::params::Object; - -/// The resource representing a Stripe "TerminalConnectionToken". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalConnectionToken { - /// The id of the location that this connection token is scoped to. - /// - /// Note that location scoping only applies to internet-connected readers. - /// For more details, see [the docs on scoping connection tokens](https://stripe.com/docs/terminal/fleet/locations#connection-tokens). - #[serde(skip_serializing_if = "Option::is_none")] - pub location: Option, - - /// Your application should pass this token to the Stripe Terminal SDK. - pub secret: String, -} - -impl Object for TerminalConnectionToken { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "terminal.connection_token" - } -} diff --git a/src/resources/generated/terminal_location.rs b/src/resources/generated/terminal_location.rs deleted file mode 100644 index 0c2fa311f..000000000 --- a/src/resources/generated/terminal_location.rs +++ /dev/null @@ -1,53 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::TerminalLocationId; -use crate::params::{Metadata, Object}; -use crate::resources::Address; - -/// The resource representing a Stripe "TerminalLocationLocation". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalLocation { - /// Unique identifier for the object. - pub id: TerminalLocationId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// The ID of a configuration that will be used to customize all readers in this location. - #[serde(skip_serializing_if = "Option::is_none")] - pub configuration_overrides: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// The display name of the location. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_name: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl Object for TerminalLocation { - type Id = TerminalLocationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "terminal.location" - } -} diff --git a/src/resources/generated/terminal_reader.rs b/src/resources/generated/terminal_reader.rs deleted file mode 100644 index 3a7d54c12..000000000 --- a/src/resources/generated/terminal_reader.rs +++ /dev/null @@ -1,428 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::TerminalReaderId; -use crate::params::{Expandable, Metadata, Object}; -use crate::resources::{Charge, Currency, PaymentIntent, Refund, SetupIntent, TerminalLocation}; - -/// The resource representing a Stripe "TerminalReaderReader". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReader { - /// Unique identifier for the object. - pub id: TerminalReaderId, - - /// The most recent action performed by the reader. - #[serde(skip_serializing_if = "Option::is_none")] - pub action: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// The current software version of the reader. - #[serde(skip_serializing_if = "Option::is_none")] - pub device_sw_version: Option, - - /// Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, or `simulated_wisepos_e`. - #[serde(skip_serializing_if = "Option::is_none")] - pub device_type: Option, - - /// The local IP address of the reader. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip_address: Option, - - /// Custom label given to the reader for easier identification. - #[serde(skip_serializing_if = "Option::is_none")] - pub label: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// The location identifier of the reader. - #[serde(skip_serializing_if = "Option::is_none")] - pub location: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Serial number of the reader. - #[serde(skip_serializing_if = "Option::is_none")] - pub serial_number: Option, - - /// The networking status of the reader. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, -} - -impl Object for TerminalReader { - type Id = TerminalReaderId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "terminal.reader" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceReaderAction { - /// Failure code, only set if status is `failed`. - pub failure_code: Option, - - /// Detailed failure message, only set if status is `failed`. - pub failure_message: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub process_payment_intent: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub process_setup_intent: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_payment: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub set_reader_display: Option, - - /// Status of the action performed by the reader. - pub status: TerminalReaderReaderResourceReaderActionStatus, - - /// Type of action performed by the reader. - #[serde(rename = "type")] - pub type_: TerminalReaderReaderResourceReaderActionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceProcessPaymentIntentAction { - /// Most recent PaymentIntent processed by the reader. - pub payment_intent: Expandable, - - #[serde(skip_serializing_if = "Option::is_none")] - pub process_config: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceProcessConfig { - /// Override showing a tipping selection screen on this transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub skip_tipping: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub tipping: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceProcessSetupIntentAction { - /// ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. - /// - /// Only present if it was possible to generate a card PaymentMethod. - #[serde(skip_serializing_if = "Option::is_none")] - pub generated_card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub process_config: Option, - - /// Most recent SetupIntent processed by the reader. - pub setup_intent: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceProcessSetupConfig {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceRefundPaymentAction { - /// The amount being refunded. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// Charge that is being refunded. - #[serde(skip_serializing_if = "Option::is_none")] - pub charge: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Payment intent that is being refunded. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option>, - - /// The reason for the refund. - #[serde(skip_serializing_if = "Option::is_none")] - pub reason: Option, - - /// Unique identifier for the refund object. - #[serde(skip_serializing_if = "Option::is_none")] - pub refund: Option>, - - /// Boolean indicating whether the application fee should be refunded when refunding this charge. - /// - /// If a full charge refund is given, the full application fee will be refunded. - /// Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. - /// An application fee can be refunded only by the application that created the charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_application_fee: Option, - - /// Boolean indicating whether the transfer should be reversed when refunding this charge. - /// - /// The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). - /// A transfer can be reversed only by the application that created the charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub reverse_transfer: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceSetReaderDisplayAction { - /// Cart object to be displayed by the reader. - pub cart: Option, - - /// Type of information to be displayed by the reader. - #[serde(rename = "type")] - pub type_: TerminalReaderReaderResourceSetReaderDisplayActionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceCart { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// List of line items in the cart. - pub line_items: Vec, - - /// Tax amount for the entire cart. - /// - /// A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub tax: Option, - - /// Total amount for the entire cart, including tax. - /// - /// A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub total: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceLineItem { - /// The amount of the line item. - /// - /// A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: i64, - - /// Description of the line item. - pub description: String, - - /// The quantity of the line item. - pub quantity: u64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceTippingConfig { - /// Amount used to calculate tip suggestions on tipping selection screen for this transaction. - /// - /// Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_eligible: Option, -} - -/// An enum representing the possible values of an `TerminalReader`'s `device_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TerminalReaderDeviceType { - BbposChipper2x, - BbposWisepad3, - BbposWiseposE, - SimulatedWiseposE, - StripeM2, - #[serde(rename = "verifone_P400")] - VerifoneP400, -} - -impl TerminalReaderDeviceType { - pub fn as_str(self) -> &'static str { - match self { - TerminalReaderDeviceType::BbposChipper2x => "bbpos_chipper2x", - TerminalReaderDeviceType::BbposWisepad3 => "bbpos_wisepad3", - TerminalReaderDeviceType::BbposWiseposE => "bbpos_wisepos_e", - TerminalReaderDeviceType::SimulatedWiseposE => "simulated_wisepos_e", - TerminalReaderDeviceType::StripeM2 => "stripe_m2", - TerminalReaderDeviceType::VerifoneP400 => "verifone_P400", - } - } -} - -impl AsRef for TerminalReaderDeviceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TerminalReaderDeviceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TerminalReaderDeviceType { - fn default() -> Self { - Self::BbposChipper2x - } -} - -/// An enum representing the possible values of an `TerminalReaderReaderResourceReaderAction`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TerminalReaderReaderResourceReaderActionStatus { - Failed, - InProgress, - Succeeded, -} - -impl TerminalReaderReaderResourceReaderActionStatus { - pub fn as_str(self) -> &'static str { - match self { - TerminalReaderReaderResourceReaderActionStatus::Failed => "failed", - TerminalReaderReaderResourceReaderActionStatus::InProgress => "in_progress", - TerminalReaderReaderResourceReaderActionStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for TerminalReaderReaderResourceReaderActionStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TerminalReaderReaderResourceReaderActionStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TerminalReaderReaderResourceReaderActionStatus { - fn default() -> Self { - Self::Failed - } -} - -/// An enum representing the possible values of an `TerminalReaderReaderResourceReaderAction`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TerminalReaderReaderResourceReaderActionType { - ProcessPaymentIntent, - ProcessSetupIntent, - RefundPayment, - SetReaderDisplay, -} - -impl TerminalReaderReaderResourceReaderActionType { - pub fn as_str(self) -> &'static str { - match self { - TerminalReaderReaderResourceReaderActionType::ProcessPaymentIntent => { - "process_payment_intent" - } - TerminalReaderReaderResourceReaderActionType::ProcessSetupIntent => { - "process_setup_intent" - } - TerminalReaderReaderResourceReaderActionType::RefundPayment => "refund_payment", - TerminalReaderReaderResourceReaderActionType::SetReaderDisplay => "set_reader_display", - } - } -} - -impl AsRef for TerminalReaderReaderResourceReaderActionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TerminalReaderReaderResourceReaderActionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TerminalReaderReaderResourceReaderActionType { - fn default() -> Self { - Self::ProcessPaymentIntent - } -} - -/// An enum representing the possible values of an `TerminalReaderReaderResourceRefundPaymentAction`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TerminalReaderReaderResourceRefundPaymentActionReason { - Duplicate, - Fraudulent, - RequestedByCustomer, -} - -impl TerminalReaderReaderResourceRefundPaymentActionReason { - pub fn as_str(self) -> &'static str { - match self { - TerminalReaderReaderResourceRefundPaymentActionReason::Duplicate => "duplicate", - TerminalReaderReaderResourceRefundPaymentActionReason::Fraudulent => "fraudulent", - TerminalReaderReaderResourceRefundPaymentActionReason::RequestedByCustomer => { - "requested_by_customer" - } - } - } -} - -impl AsRef for TerminalReaderReaderResourceRefundPaymentActionReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TerminalReaderReaderResourceRefundPaymentActionReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TerminalReaderReaderResourceRefundPaymentActionReason { - fn default() -> Self { - Self::Duplicate - } -} - -/// An enum representing the possible values of an `TerminalReaderReaderResourceSetReaderDisplayAction`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TerminalReaderReaderResourceSetReaderDisplayActionType { - Cart, -} - -impl TerminalReaderReaderResourceSetReaderDisplayActionType { - pub fn as_str(self) -> &'static str { - match self { - TerminalReaderReaderResourceSetReaderDisplayActionType::Cart => "cart", - } - } -} - -impl AsRef for TerminalReaderReaderResourceSetReaderDisplayActionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TerminalReaderReaderResourceSetReaderDisplayActionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TerminalReaderReaderResourceSetReaderDisplayActionType { - fn default() -> Self { - Self::Cart - } -} diff --git a/src/resources/generated/test_helpers_test_clock.rs b/src/resources/generated/test_helpers_test_clock.rs deleted file mode 100644 index da2f8bbf6..000000000 --- a/src/resources/generated/test_helpers_test_clock.rs +++ /dev/null @@ -1,91 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::TestHelpersTestClockId; -use crate::params::{Object, Timestamp}; - -/// The resource representing a Stripe "TestClock". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TestHelpersTestClock { - /// Unique identifier for the object. - pub id: TestHelpersTestClockId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// Time at which this clock is scheduled to auto delete. - #[serde(skip_serializing_if = "Option::is_none")] - pub deletes_after: Option, - - /// Time at which all objects belonging to this clock are frozen. - #[serde(skip_serializing_if = "Option::is_none")] - pub frozen_time: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// The custom name supplied at creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// The status of the Test Clock. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, -} - -impl Object for TestHelpersTestClock { - type Id = TestHelpersTestClockId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "test_helpers.test_clock" - } -} - -/// An enum representing the possible values of an `TestHelpersTestClock`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TestHelpersTestClockStatus { - Advancing, - InternalFailure, - Ready, -} - -impl TestHelpersTestClockStatus { - pub fn as_str(self) -> &'static str { - match self { - TestHelpersTestClockStatus::Advancing => "advancing", - TestHelpersTestClockStatus::InternalFailure => "internal_failure", - TestHelpersTestClockStatus::Ready => "ready", - } - } -} - -impl AsRef for TestHelpersTestClockStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TestHelpersTestClockStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TestHelpersTestClockStatus { - fn default() -> Self { - Self::Advancing - } -} diff --git a/src/resources/generated/token.rs b/src/resources/generated/token.rs deleted file mode 100644 index 45cae1c0f..000000000 --- a/src/resources/generated/token.rs +++ /dev/null @@ -1,495 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, TokenId}; -use crate::params::{Expand, Metadata, Object, Timestamp}; -use crate::resources::{Address, BankAccount, Card, CompanyParams, PersonParams, TokenType}; - -/// The resource representing a Stripe "Token". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Token { - /// Unique identifier for the object. - pub id: TokenId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_account: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// IP address of the client that generated the token. - pub client_ip: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Type of the token: `account`, `bank_account`, `card`, or `pii`. - #[serde(rename = "type")] - pub type_: TokenType, - - /// Whether this token has already been used (tokens can be used only once). - pub used: bool, -} - -impl Token { - /// Creates a single-use token that represents a bank account’s details. - /// This token can be used with any API method in place of a bank account dictionary. - /// - /// This token can be used only once, by attaching it to a [Custom account](https://stripe.com/docs/api#accounts). - pub fn create(client: &Client, params: CreateToken<'_>) -> Response { - client.post_form("/tokens", ¶ms) - } - - /// Retrieves the token with the given ID. - pub fn retrieve(client: &Client, id: &TokenId, expand: &[&str]) -> Response { - client.get_query(&format!("/tokens/{}", id), &Expand { expand }) - } -} - -impl Object for Token { - type Id = TokenId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "token" - } -} - -/// The parameters for `Token::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateToken<'a> { - /// Information for the account this token will represent. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// The card this token will represent. - /// - /// If you also pass in a customer, the card must be the ID of a card belonging to the customer. - /// Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// The customer (owned by the application's account) for which to create a token. - /// - /// This can be used only with an [OAuth access token](https://stripe.com/docs/connect/standard-accounts) or [Stripe-Account header](https://stripe.com/docs/connect/authentication). - /// For more details, see [Cloning Saved Payment Methods](https://stripe.com/docs/connect/cloning-saved-payment-methods). - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// The updated CVC value this token will represent. - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc_update: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Information for the person this token will represent. - #[serde(skip_serializing_if = "Option::is_none")] - pub person: Option, - - /// The PII this token will represent. - #[serde(skip_serializing_if = "Option::is_none")] - pub pii: Option, -} - -impl<'a> CreateToken<'a> { - pub fn new() -> Self { - CreateToken { - account: Default::default(), - card: Default::default(), - customer: Default::default(), - cvc_update: Default::default(), - expand: Default::default(), - person: Default::default(), - pii: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenAccount { - /// The business type. - #[serde(skip_serializing_if = "Option::is_none")] - pub business_type: Option, - - /// Information about the company or business. - #[serde(skip_serializing_if = "Option::is_none")] - pub company: Option, - - /// Information about the person represented by the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub individual: Option, - - /// Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/docs/connect/account-tokens#stripe-connected-account-agreement). - /// - /// When creating an account token to create a new Connect account, this value must be `true`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_shown_and_accepted: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenCvcUpdate { - /// The CVC value, in string form. - pub cvc: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPerson { - /// The person's address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// The Kana variation of the person's address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kana: Option
, - - /// The Kanji variation of the person's address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kanji: Option
, - - /// The person's date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub dob: Option, - - /// Documents that may be submitted to satisfy various informational requests. - #[serde(skip_serializing_if = "Option::is_none")] - pub documents: Option, - - /// The person's email address. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// The person's first name. - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name: Option, - - /// The Kana variation of the person's first name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name_kana: Option, - - /// The Kanji variation of the person's first name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name_kanji: Option, - - /// A list of alternate names or aliases that the person is known by. - #[serde(skip_serializing_if = "Option::is_none")] - pub full_name_aliases: Option>, - - /// The person's gender (International regulations require either "male" or "female"). - #[serde(skip_serializing_if = "Option::is_none")] - pub gender: Option, - - /// The person's ID number, as appropriate for their country. - /// - /// For example, a social security number in the U.S., social insurance number in Canada, etc. - /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number: Option, - - /// The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. - /// - /// In Thailand, this would be the laser code found on the back of an ID card. - /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number_secondary: Option, - - /// The person's last name. - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name: Option, - - /// The Kana variation of the person's last name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name_kana: Option, - - /// The Kanji variation of the person's last name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name_kanji: Option, - - /// The person's maiden name. - #[serde(skip_serializing_if = "Option::is_none")] - pub maiden_name: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The country where the person is a national. - /// - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. - #[serde(skip_serializing_if = "Option::is_none")] - pub nationality: Option, - - /// The person's phone number. - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - #[serde(skip_serializing_if = "Option::is_none")] - pub political_exposure: Option, - - /// The person's registered address. - #[serde(skip_serializing_if = "Option::is_none")] - pub registered_address: Option, - - /// The relationship that this person has with the account's legal entity. - #[serde(skip_serializing_if = "Option::is_none")] - pub relationship: Option, - - /// The last four digits of the person's Social Security number (U.S. - /// - /// only). - #[serde(skip_serializing_if = "Option::is_none")] - pub ssn_last_4: Option, - - /// The person's verification status. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPii { - /// The `id_number` for the PII, in string form. - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPersonDob { - /// The day of birth, between 1 and 31. - pub day: i64, - - /// The month of birth, between 1 and 12. - pub month: i64, - - /// The four-digit year of birth. - pub year: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPersonDocuments { - /// One or more documents that demonstrate proof that this person is authorized to represent the company. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_authorization: Option, - - /// One or more documents showing the person's passport page with photo and personal data. - #[serde(skip_serializing_if = "Option::is_none")] - pub passport: Option, - - /// One or more documents showing the person's visa required for living in the country where they are residing. - #[serde(skip_serializing_if = "Option::is_none")] - pub visa: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPersonRegisteredAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPersonRelationship { - /// Whether the person is a director of the account's legal entity. - /// - /// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. - #[serde(skip_serializing_if = "Option::is_none")] - pub director: Option, - - /// Whether the person has significant responsibility to control, manage, or direct the organization. - #[serde(skip_serializing_if = "Option::is_none")] - pub executive: Option, - - /// Whether the person is an owner of the account’s legal entity. - #[serde(skip_serializing_if = "Option::is_none")] - pub owner: Option, - - /// The percent owned by the person of the account's legal entity. - #[serde(skip_serializing_if = "Option::is_none")] - pub percent_ownership: Option, - - /// Whether the person is authorized as the primary representative of the account. - /// - /// This is the person nominated by the business to provide information about themselves, and general information about the account. - /// There can only be one representative at any given time. - /// At the time the account is created, this person should be set to the person responsible for opening the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub representative: Option, - - /// The person's title (e.g., CEO, Support Engineer). - #[serde(skip_serializing_if = "Option::is_none")] - pub title: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonVerificationParams { - /// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. - #[serde(skip_serializing_if = "Option::is_none")] - pub additional_document: Option, - - /// An identifying document, either a passport or local ID card. - #[serde(skip_serializing_if = "Option::is_none")] - pub document: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPersonDocumentsCompanyAuthorization { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPersonDocumentsPassport { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPersonDocumentsVisa { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct VerificationDocumentParams { - /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. - /// - /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - #[serde(skip_serializing_if = "Option::is_none")] - pub back: Option, - - /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. - /// - /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - #[serde(skip_serializing_if = "Option::is_none")] - pub front: Option, -} - -/// An enum representing the possible values of an `CreateTokenAccount`'s `business_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateTokenAccountBusinessType { - Company, - GovernmentEntity, - Individual, - NonProfit, -} - -impl CreateTokenAccountBusinessType { - pub fn as_str(self) -> &'static str { - match self { - CreateTokenAccountBusinessType::Company => "company", - CreateTokenAccountBusinessType::GovernmentEntity => "government_entity", - CreateTokenAccountBusinessType::Individual => "individual", - CreateTokenAccountBusinessType::NonProfit => "non_profit", - } - } -} - -impl AsRef for CreateTokenAccountBusinessType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateTokenAccountBusinessType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateTokenAccountBusinessType { - fn default() -> Self { - Self::Company - } -} - -/// The card this token will represent. -/// -/// If you also pass in a customer, the card must be the ID of a card belonging to the customer. -/// Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(untagged, rename_all = "snake_case")] -pub enum CreateTokenCardUnion { - CreditCardSpecs(CreditCardSpecs), - String(String), -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreditCardSpecs { - /// City / District / Suburb / Town / Village. - #[serde(skip_serializing_if = "Option::is_none")] - pub address_city: Option, - /// Billing address country, if provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub address_country: Option, - /// Address line 1 (Street address / PO Box / Company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_line1: Option, - /// Address line 2 (Apartment / Suite / Unit / Building). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_line2: Option, - /// State / County / Province / Region. - #[serde(skip_serializing_if = "Option::is_none")] - pub address_state: Option, - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub address_zip: Option, - /// Required in order to add the card to an account; in all other cases, this parameter is not used. - /// - /// When added to an account, the card (which must be a debit card) can be used as a transfer destination for funds in this currency. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - /// Card security code. - /// - /// Highly recommended to always include this value. - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc: Option, - /// Two-digit number representing the card's expiration month. - pub exp_month: String, - /// Two- or four-digit number representing the card's expiration year. - pub exp_year: String, - /// Cardholder's full name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - /// The card number, as a string without any separators. - pub number: String, -} diff --git a/src/resources/generated/topup.rs b/src/resources/generated/topup.rs deleted file mode 100644 index 6b3a0336f..000000000 --- a/src/resources/generated/topup.rs +++ /dev/null @@ -1,283 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::TopupId; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{BalanceTransaction, Currency, Source}; - -/// The resource representing a Stripe "Topup". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Topup { - /// Unique identifier for the object. - pub id: TopupId, - - /// Amount transferred. - pub amount: i64, - - /// ID of the balance transaction that describes the impact of this top-up on your account balance. - /// - /// May not be specified depending on status of top-up. - pub balance_transaction: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// Date the funds are expected to arrive in your Stripe account for payouts. - /// - /// This factors in delays like weekends or bank holidays. - /// May not be specified depending on status of top-up. - pub expected_availability_date: Option, - - /// Error code explaining reason for top-up failure if available (see [the errors section](https://stripe.com/docs/api#errors) for a list of codes). - pub failure_code: Option, - - /// Message to user further explaining reason for top-up failure if available. - pub failure_message: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// For most Stripe users, the source of every top-up is a bank account. - /// - /// This hash is then the [source object](https://stripe.com/docs/api#source_object) describing that bank account. - pub source: Option, - - /// Extra information about a top-up. - /// - /// This will appear on your source's bank statement. - /// It must contain at least one letter. - pub statement_descriptor: Option, - - /// The status of the top-up is either `canceled`, `failed`, `pending`, `reversed`, or `succeeded`. - pub status: TopupStatus, - - /// A string that identifies this top-up as part of a group. - pub transfer_group: Option, -} - -impl Topup { - /// Returns a list of top-ups. - pub fn list(client: &Client, params: &ListTopups<'_>) -> Response> { - client.get_query("/topups", ¶ms) - } - - /// Retrieves the details of a top-up that has previously been created. - /// - /// Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information. - pub fn retrieve(client: &Client, id: &TopupId, expand: &[&str]) -> Response { - client.get_query(&format!("/topups/{}", id), &Expand { expand }) - } - - /// Updates the metadata of a top-up. - /// - /// Other top-up details are not editable by design. - pub fn update(client: &Client, id: &TopupId, params: UpdateTopup<'_>) -> Response { - client.post_form(&format!("/topups/{}", id), ¶ms) - } -} - -impl Object for Topup { - type Id = TopupId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "topup" - } -} - -/// The parameters for `Topup::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListTopups<'a> { - /// A positive integer representing how much to transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option>, - - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// Only return top-ups that have the given status. - /// - /// One of `canceled`, `failed`, `pending` or `succeeded`. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, -} - -impl<'a> ListTopups<'a> { - pub fn new() -> Self { - ListTopups { - amount: Default::default(), - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - status: Default::default(), - } - } -} -impl Paginable for ListTopups<'_> { - type O = Topup; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Topup::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateTopup<'a> { - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl<'a> UpdateTopup<'a> { - pub fn new() -> Self { - UpdateTopup { - description: Default::default(), - expand: Default::default(), - metadata: Default::default(), - } - } -} - -/// An enum representing the possible values of an `Topup`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TopupStatus { - Canceled, - Failed, - Pending, - Reversed, - Succeeded, -} - -impl TopupStatus { - pub fn as_str(self) -> &'static str { - match self { - TopupStatus::Canceled => "canceled", - TopupStatus::Failed => "failed", - TopupStatus::Pending => "pending", - TopupStatus::Reversed => "reversed", - TopupStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for TopupStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TopupStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TopupStatus { - fn default() -> Self { - Self::Canceled - } -} - -/// An enum representing the possible values of an `ListTopups`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TopupStatusFilter { - Canceled, - Failed, - Pending, - Succeeded, -} - -impl TopupStatusFilter { - pub fn as_str(self) -> &'static str { - match self { - TopupStatusFilter::Canceled => "canceled", - TopupStatusFilter::Failed => "failed", - TopupStatusFilter::Pending => "pending", - TopupStatusFilter::Succeeded => "succeeded", - } - } -} - -impl AsRef for TopupStatusFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TopupStatusFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TopupStatusFilter { - fn default() -> Self { - Self::Canceled - } -} diff --git a/src/resources/generated/transfer.rs b/src/resources/generated/transfer.rs deleted file mode 100644 index 2bfad37c1..000000000 --- a/src/resources/generated/transfer.rs +++ /dev/null @@ -1,320 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ChargeId, TransferId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{Account, BalanceTransaction, Charge, Currency, TransferReversal}; - -/// The resource representing a Stripe "Transfer". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Transfer { - /// Unique identifier for the object. - pub id: TransferId, - - /// Amount in cents (or local equivalent) to be transferred. - pub amount: i64, - - /// Amount in cents (or local equivalent) reversed (can be less than the amount attribute on the transfer if a partial reversal was issued). - pub amount_reversed: i64, - - /// Balance transaction that describes the impact of this transfer on your account balance. - pub balance_transaction: Option>, - - /// Time that this record of the transfer was first created. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// ID of the Stripe account the transfer was sent to. - pub destination: Option>, - - /// If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub destination_payment: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// A list of reversals that have been applied to the transfer. - pub reversals: List, - - /// Whether the transfer has been fully reversed. - /// - /// If the transfer is only partially reversed, this attribute will still be false. - pub reversed: bool, - - /// ID of the charge or payment that was used to fund the transfer. - /// - /// If null, the transfer was funded from the available balance. - pub source_transaction: Option>, - - /// The source balance this transfer came from. - /// - /// One of `card`, `fpx`, or `bank_account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub source_type: Option, - - /// A string that identifies this transaction as part of a group. - /// - /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. - pub transfer_group: Option, -} - -impl Transfer { - /// Returns a list of existing transfers sent to connected accounts. - /// - /// The transfers are returned in sorted order, with the most recently created transfers appearing first. - pub fn list(client: &Client, params: &ListTransfers<'_>) -> Response> { - client.get_query("/transfers", ¶ms) - } - - /// To send funds from your Stripe account to a connected account, you create a new transfer object. - /// - /// Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you’ll receive an “Insufficient Funds” error. - pub fn create(client: &Client, params: CreateTransfer<'_>) -> Response { - client.post_form("/transfers", ¶ms) - } - - /// Retrieves the details of an existing transfer. - /// - /// Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information. - pub fn retrieve(client: &Client, id: &TransferId, expand: &[&str]) -> Response { - client.get_query(&format!("/transfers/{}", id), &Expand { expand }) - } - - /// Updates the specified transfer by setting the values of the parameters passed. - /// - /// Any parameters not provided will be left unchanged. This request accepts only metadata as an argument. - pub fn update( - client: &Client, - id: &TransferId, - params: UpdateTransfer<'_>, - ) -> Response { - client.post_form(&format!("/transfers/{}", id), ¶ms) - } -} - -impl Object for Transfer { - type Id = TransferId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "transfer" - } -} - -/// The parameters for `Transfer::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateTransfer<'a> { - /// A positive integer in cents (or local equivalent) representing how much to transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// 3-letter [ISO code for currency](https://stripe.com/docs/payouts). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// The ID of a connected Stripe account. - /// - /// [See the Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. - pub destination: String, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// You can use this parameter to transfer funds from a charge before they are added to your available balance. - /// - /// A pending balance will transfer immediately but the funds will not become available until the original charge becomes available. - /// [See the Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-availability) for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub source_transaction: Option, - - /// The source balance to use for this transfer. - /// - /// One of `bank_account`, `card`, or `fpx`. - /// For most users, this will default to `card`. - #[serde(skip_serializing_if = "Option::is_none")] - pub source_type: Option, - - /// A string that identifies this transaction as part of a group. - /// - /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option<&'a str>, -} - -impl<'a> CreateTransfer<'a> { - pub fn new(currency: Currency, destination: String) -> Self { - CreateTransfer { - amount: Default::default(), - currency, - description: Default::default(), - destination, - expand: Default::default(), - metadata: Default::default(), - source_transaction: Default::default(), - source_type: Default::default(), - transfer_group: Default::default(), - } - } -} - -/// The parameters for `Transfer::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListTransfers<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return transfers for the destination specified by this account ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub destination: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// Only return transfers with the specified transfer group. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option<&'a str>, -} - -impl<'a> ListTransfers<'a> { - pub fn new() -> Self { - ListTransfers { - created: Default::default(), - destination: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - transfer_group: Default::default(), - } - } -} -impl Paginable for ListTransfers<'_> { - type O = Transfer; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Transfer::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateTransfer<'a> { - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl<'a> UpdateTransfer<'a> { - pub fn new() -> Self { - UpdateTransfer { - description: Default::default(), - expand: Default::default(), - metadata: Default::default(), - } - } -} - -/// An enum representing the possible values of an `CreateTransfer`'s `source_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TransferSourceType { - BankAccount, - Card, - Fpx, -} - -impl TransferSourceType { - pub fn as_str(self) -> &'static str { - match self { - TransferSourceType::BankAccount => "bank_account", - TransferSourceType::Card => "card", - TransferSourceType::Fpx => "fpx", - } - } -} - -impl AsRef for TransferSourceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TransferSourceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TransferSourceType { - fn default() -> Self { - Self::BankAccount - } -} diff --git a/src/resources/generated/transfer_reversal.rs b/src/resources/generated/transfer_reversal.rs deleted file mode 100644 index 342970dbc..000000000 --- a/src/resources/generated/transfer_reversal.rs +++ /dev/null @@ -1,58 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::TransferReversalId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{BalanceTransaction, Currency, Refund, Transfer}; - -/// The resource representing a Stripe "TransferReversal". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransferReversal { - /// Unique identifier for the object. - pub id: TransferReversalId, - - /// Amount, in cents (or local equivalent). - pub amount: i64, - - /// Balance transaction that describes the impact on your account balance. - pub balance_transaction: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Linked payment refund for the transfer reversal. - pub destination_payment_refund: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// ID of the refund responsible for the transfer reversal. - pub source_refund: Option>, - - /// ID of the transfer that was reversed. - pub transfer: Expandable, -} - -impl Object for TransferReversal { - type Id = TransferReversalId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "transfer_reversal" - } -} diff --git a/src/resources/generated/treasury_credit_reversal.rs b/src/resources/generated/treasury_credit_reversal.rs deleted file mode 100644 index 16318ed4d..000000000 --- a/src/resources/generated/treasury_credit_reversal.rs +++ /dev/null @@ -1,143 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryCreditReversalId}; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Currency, TreasuryTransaction}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryReceivedCreditsResourceCreditReversal". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryCreditReversal { - /// Unique identifier for the object. - pub id: TreasuryCreditReversalId, - - /// Amount (in cents) transferred. - pub amount: i64, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The FinancialAccount to reverse funds from. - pub financial_account: String, - - /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - pub hosted_regulatory_receipt_url: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// The rails used to reverse the funds. - pub network: TreasuryCreditReversalNetwork, - - /// The ReceivedCredit being reversed. - pub received_credit: String, - - /// Status of the CreditReversal. - pub status: TreasuryCreditReversalStatus, - - pub status_transitions: TreasuryReceivedCreditsResourceStatusTransitions, - - /// The Transaction associated with this object. - pub transaction: Option>, -} - -impl Object for TreasuryCreditReversal { - type Id = TreasuryCreditReversalId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.credit_reversal" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedCreditsResourceStatusTransitions { - - /// Timestamp describing when the CreditReversal changed status to `posted`. - pub posted_at: Option, -} - -/// An enum representing the possible values of an `TreasuryCreditReversal`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryCreditReversalNetwork { - Ach, - Stripe, -} - -impl TreasuryCreditReversalNetwork { - pub fn as_str(self) -> &'static str { - match self { - TreasuryCreditReversalNetwork::Ach => "ach", - TreasuryCreditReversalNetwork::Stripe => "stripe", - } - } -} - -impl AsRef for TreasuryCreditReversalNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryCreditReversalNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryCreditReversalNetwork { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `TreasuryCreditReversal`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryCreditReversalStatus { - Canceled, - Posted, - Processing, -} - -impl TreasuryCreditReversalStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryCreditReversalStatus::Canceled => "canceled", - TreasuryCreditReversalStatus::Posted => "posted", - TreasuryCreditReversalStatus::Processing => "processing", - } - } -} - -impl AsRef for TreasuryCreditReversalStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryCreditReversalStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryCreditReversalStatus { - fn default() -> Self { - Self::Canceled - } -} diff --git a/src/resources/generated/treasury_debit_reversal.rs b/src/resources/generated/treasury_debit_reversal.rs deleted file mode 100644 index 09fcdadb2..000000000 --- a/src/resources/generated/treasury_debit_reversal.rs +++ /dev/null @@ -1,153 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryDebitReversalId}; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Currency, TreasuryTransaction}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryReceivedDebitsResourceDebitReversal". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryDebitReversal { - /// Unique identifier for the object. - pub id: TreasuryDebitReversalId, - - /// Amount (in cents) transferred. - pub amount: i64, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The FinancialAccount to reverse funds from. - pub financial_account: Option, - - /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - pub hosted_regulatory_receipt_url: Option, - - /// Other flows linked to a DebitReversal. - pub linked_flows: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// The rails used to reverse the funds. - pub network: TreasuryDebitReversalNetwork, - - /// The ReceivedDebit being reversed. - pub received_debit: String, - - /// Status of the DebitReversal. - pub status: TreasuryDebitReversalStatus, - - pub status_transitions: TreasuryReceivedDebitsResourceStatusTransitions, - - /// The Transaction associated with this object. - pub transaction: Option>, -} - -impl Object for TreasuryDebitReversal { - type Id = TreasuryDebitReversalId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.debit_reversal" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedDebitsResourceDebitReversalLinkedFlows { - - /// Set if there is an Issuing dispute associated with the DebitReversal. - pub issuing_dispute: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedDebitsResourceStatusTransitions { - - /// Timestamp describing when the DebitReversal changed status to `completed`. - pub completed_at: Option, -} - -/// An enum representing the possible values of an `TreasuryDebitReversal`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryDebitReversalNetwork { - Ach, - Card, -} - -impl TreasuryDebitReversalNetwork { - pub fn as_str(self) -> &'static str { - match self { - TreasuryDebitReversalNetwork::Ach => "ach", - TreasuryDebitReversalNetwork::Card => "card", - } - } -} - -impl AsRef for TreasuryDebitReversalNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryDebitReversalNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryDebitReversalNetwork { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `TreasuryDebitReversal`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryDebitReversalStatus { - Failed, - Processing, - Succeeded, -} - -impl TreasuryDebitReversalStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryDebitReversalStatus::Failed => "failed", - TreasuryDebitReversalStatus::Processing => "processing", - TreasuryDebitReversalStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for TreasuryDebitReversalStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryDebitReversalStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryDebitReversalStatus { - fn default() -> Self { - Self::Failed - } -} diff --git a/src/resources/generated/treasury_financial_account.rs b/src/resources/generated/treasury_financial_account.rs deleted file mode 100644 index 7e986bfc6..000000000 --- a/src/resources/generated/treasury_financial_account.rs +++ /dev/null @@ -1,518 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryFinancialAccountId}; -use crate::params::{Metadata, Object, Timestamp}; -use crate::resources::{TreasuryFinancialAccountFeatures}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryFinancialAccountsResourceFinancialAccount". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccount { - /// Unique identifier for the object. - pub id: TreasuryFinancialAccountId, - - /// The array of paths to active Features in the Features hash. - #[serde(skip_serializing_if = "Option::is_none")] - pub active_features: Option>, - - pub balance: TreasuryFinancialAccountsResourceBalance, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: String, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - #[serde(skip_serializing_if = "Option::is_none")] - pub features: Option, - - /// The set of credentials that resolve to a FinancialAccount. - pub financial_addresses: Vec, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// The array of paths to pending Features in the Features hash. - #[serde(skip_serializing_if = "Option::is_none")] - pub pending_features: Option>, - - /// The set of functionalities that the platform can restrict on the FinancialAccount. - #[serde(skip_serializing_if = "Option::is_none")] - pub platform_restrictions: Option, - - /// The array of paths to restricted Features in the Features hash. - #[serde(skip_serializing_if = "Option::is_none")] - pub restricted_features: Option>, - - /// The enum specifying what state the account is in. - pub status: TreasuryFinancialAccountStatus, - - pub status_details: TreasuryFinancialAccountsResourceStatusDetails, - - /// The currencies the FinancialAccount can hold a balance in. - /// - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - pub supported_currencies: Vec, -} - -impl Object for TreasuryFinancialAccount { - type Id = TreasuryFinancialAccountId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.financial_account" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceBalance { - - /// Funds the user can spend right now. - pub cash: i64, - - /// Funds not spendable yet, but will become available at a later time. - pub inbound_pending: i64, - - /// Funds in the account, but not spendable because they are being held for pending outbound flows. - pub outbound_pending: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceFinancialAddress { - - #[serde(skip_serializing_if = "Option::is_none")] - pub aba: Option, - - /// The list of networks that the address supports. - #[serde(skip_serializing_if = "Option::is_none")] - pub supported_networks: Option>, - - /// The type of financial address. - #[serde(rename = "type")] - pub type_: TreasuryFinancialAccountsResourceFinancialAddressType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceAbaRecord { - - /// The name of the person or business that owns the bank account. - pub account_holder_name: String, - - /// The account number. - pub account_number: Option, - - /// The last four characters of the account number. - pub account_number_last4: String, - - /// Name of the bank. - pub bank_name: String, - - /// Routing number for the account. - pub routing_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourcePlatformRestrictions { - - /// Restricts all inbound money movement. - pub inbound_flows: Option, - - /// Restricts all outbound money movement. - pub outbound_flows: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceStatusDetails { - - /// Details related to the closure of this FinancialAccount. - pub closed: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceClosedStatusDetails { - - /// The array that contains reasons for a FinancialAccount closure. - pub reasons: Vec, -} - -/// An enum representing the possible values of an `TreasuryFinancialAccount`'s `active_features` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountActiveFeatures { - CardIssuing, - DepositInsurance, - #[serde(rename = "financial_addresses.aba")] - FinancialAddressesAba, - #[serde(rename = "inbound_transfers.ach")] - InboundTransfersAch, - IntraStripeFlows, - #[serde(rename = "outbound_payments.ach")] - OutboundPaymentsAch, - #[serde(rename = "outbound_payments.us_domestic_wire")] - OutboundPaymentsUsDomesticWire, - #[serde(rename = "outbound_transfers.ach")] - OutboundTransfersAch, - #[serde(rename = "outbound_transfers.us_domestic_wire")] - OutboundTransfersUsDomesticWire, - RemoteDepositCapture, -} - -impl TreasuryFinancialAccountActiveFeatures { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountActiveFeatures::CardIssuing => "card_issuing", - TreasuryFinancialAccountActiveFeatures::DepositInsurance => "deposit_insurance", - TreasuryFinancialAccountActiveFeatures::FinancialAddressesAba => "financial_addresses.aba", - TreasuryFinancialAccountActiveFeatures::InboundTransfersAch => "inbound_transfers.ach", - TreasuryFinancialAccountActiveFeatures::IntraStripeFlows => "intra_stripe_flows", - TreasuryFinancialAccountActiveFeatures::OutboundPaymentsAch => "outbound_payments.ach", - TreasuryFinancialAccountActiveFeatures::OutboundPaymentsUsDomesticWire => "outbound_payments.us_domestic_wire", - TreasuryFinancialAccountActiveFeatures::OutboundTransfersAch => "outbound_transfers.ach", - TreasuryFinancialAccountActiveFeatures::OutboundTransfersUsDomesticWire => "outbound_transfers.us_domestic_wire", - TreasuryFinancialAccountActiveFeatures::RemoteDepositCapture => "remote_deposit_capture", - } - } -} - -impl AsRef for TreasuryFinancialAccountActiveFeatures { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountActiveFeatures { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountActiveFeatures { - fn default() -> Self { - Self::CardIssuing - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccount`'s `pending_features` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountPendingFeatures { - CardIssuing, - DepositInsurance, - #[serde(rename = "financial_addresses.aba")] - FinancialAddressesAba, - #[serde(rename = "inbound_transfers.ach")] - InboundTransfersAch, - IntraStripeFlows, - #[serde(rename = "outbound_payments.ach")] - OutboundPaymentsAch, - #[serde(rename = "outbound_payments.us_domestic_wire")] - OutboundPaymentsUsDomesticWire, - #[serde(rename = "outbound_transfers.ach")] - OutboundTransfersAch, - #[serde(rename = "outbound_transfers.us_domestic_wire")] - OutboundTransfersUsDomesticWire, - RemoteDepositCapture, -} - -impl TreasuryFinancialAccountPendingFeatures { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountPendingFeatures::CardIssuing => "card_issuing", - TreasuryFinancialAccountPendingFeatures::DepositInsurance => "deposit_insurance", - TreasuryFinancialAccountPendingFeatures::FinancialAddressesAba => "financial_addresses.aba", - TreasuryFinancialAccountPendingFeatures::InboundTransfersAch => "inbound_transfers.ach", - TreasuryFinancialAccountPendingFeatures::IntraStripeFlows => "intra_stripe_flows", - TreasuryFinancialAccountPendingFeatures::OutboundPaymentsAch => "outbound_payments.ach", - TreasuryFinancialAccountPendingFeatures::OutboundPaymentsUsDomesticWire => "outbound_payments.us_domestic_wire", - TreasuryFinancialAccountPendingFeatures::OutboundTransfersAch => "outbound_transfers.ach", - TreasuryFinancialAccountPendingFeatures::OutboundTransfersUsDomesticWire => "outbound_transfers.us_domestic_wire", - TreasuryFinancialAccountPendingFeatures::RemoteDepositCapture => "remote_deposit_capture", - } - } -} - -impl AsRef for TreasuryFinancialAccountPendingFeatures { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountPendingFeatures { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountPendingFeatures { - fn default() -> Self { - Self::CardIssuing - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccount`'s `restricted_features` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountRestrictedFeatures { - CardIssuing, - DepositInsurance, - #[serde(rename = "financial_addresses.aba")] - FinancialAddressesAba, - #[serde(rename = "inbound_transfers.ach")] - InboundTransfersAch, - IntraStripeFlows, - #[serde(rename = "outbound_payments.ach")] - OutboundPaymentsAch, - #[serde(rename = "outbound_payments.us_domestic_wire")] - OutboundPaymentsUsDomesticWire, - #[serde(rename = "outbound_transfers.ach")] - OutboundTransfersAch, - #[serde(rename = "outbound_transfers.us_domestic_wire")] - OutboundTransfersUsDomesticWire, - RemoteDepositCapture, -} - -impl TreasuryFinancialAccountRestrictedFeatures { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountRestrictedFeatures::CardIssuing => "card_issuing", - TreasuryFinancialAccountRestrictedFeatures::DepositInsurance => "deposit_insurance", - TreasuryFinancialAccountRestrictedFeatures::FinancialAddressesAba => "financial_addresses.aba", - TreasuryFinancialAccountRestrictedFeatures::InboundTransfersAch => "inbound_transfers.ach", - TreasuryFinancialAccountRestrictedFeatures::IntraStripeFlows => "intra_stripe_flows", - TreasuryFinancialAccountRestrictedFeatures::OutboundPaymentsAch => "outbound_payments.ach", - TreasuryFinancialAccountRestrictedFeatures::OutboundPaymentsUsDomesticWire => "outbound_payments.us_domestic_wire", - TreasuryFinancialAccountRestrictedFeatures::OutboundTransfersAch => "outbound_transfers.ach", - TreasuryFinancialAccountRestrictedFeatures::OutboundTransfersUsDomesticWire => "outbound_transfers.us_domestic_wire", - TreasuryFinancialAccountRestrictedFeatures::RemoteDepositCapture => "remote_deposit_capture", - } - } -} - -impl AsRef for TreasuryFinancialAccountRestrictedFeatures { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountRestrictedFeatures { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountRestrictedFeatures { - fn default() -> Self { - Self::CardIssuing - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccount`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountStatus { - Closed, - Open, -} - -impl TreasuryFinancialAccountStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountStatus::Closed => "closed", - TreasuryFinancialAccountStatus::Open => "open", - } - } -} - -impl AsRef for TreasuryFinancialAccountStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountStatus { - fn default() -> Self { - Self::Closed - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceClosedStatusDetails`'s `reasons` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { - AccountRejected, - ClosedByPlatform, - Other, -} - -impl TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceClosedStatusDetailsReasons::AccountRejected => "account_rejected", - TreasuryFinancialAccountsResourceClosedStatusDetailsReasons::ClosedByPlatform => "closed_by_platform", - TreasuryFinancialAccountsResourceClosedStatusDetailsReasons::Other => "other", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { - fn default() -> Self { - Self::AccountRejected - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceFinancialAddress`'s `supported_networks` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { - Ach, - UsDomesticWire, -} - -impl TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks::Ach => "ach", - TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks::UsDomesticWire => "us_domestic_wire", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceFinancialAddress`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceFinancialAddressType { - Aba, -} - -impl TreasuryFinancialAccountsResourceFinancialAddressType { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceFinancialAddressType::Aba => "aba", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceFinancialAddressType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceFinancialAddressType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceFinancialAddressType { - fn default() -> Self { - Self::Aba - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourcePlatformRestrictions`'s `inbound_flows` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { - Restricted, - Unrestricted, -} - -impl TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows::Restricted => "restricted", - TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows::Unrestricted => "unrestricted", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { - fn default() -> Self { - Self::Restricted - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourcePlatformRestrictions`'s `outbound_flows` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { - Restricted, - Unrestricted, -} - -impl TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows::Restricted => "restricted", - TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows::Unrestricted => "unrestricted", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { - fn default() -> Self { - Self::Restricted - } -} diff --git a/src/resources/generated/treasury_financial_account_features.rs b/src/resources/generated/treasury_financial_account_features.rs deleted file mode 100644 index ba5499f7d..000000000 --- a/src/resources/generated/treasury_financial_account_features.rs +++ /dev/null @@ -1,256 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::params::{Object}; -use crate::resources::{TreasuryFinancialAccountsResourceAchToggleSettings, TreasuryFinancialAccountsResourceToggleSettings}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryFinancialAccountsResourceFinancialAccountFeatures". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountFeatures { - - #[serde(skip_serializing_if = "Option::is_none")] - pub card_issuing: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub deposit_insurance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_addresses: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub inbound_transfers: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub intra_stripe_flows: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub outbound_payments: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub outbound_transfers: Option, -} - -impl Object for TreasuryFinancialAccountFeatures { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "treasury.financial_account_features" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceFinancialAddressesFeatures { - - #[serde(skip_serializing_if = "Option::is_none")] - pub aba: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceAbaToggleSettings { - - /// Whether the FinancialAccount should have the Feature. - pub requested: bool, - - /// Whether the Feature is operational. - pub status: TreasuryFinancialAccountsResourceAbaToggleSettingsStatus, - - /// Additional details; includes at least one entry when the status is not `active`. - pub status_details: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceInboundTransfers { - - #[serde(skip_serializing_if = "Option::is_none")] - pub ach: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceOutboundPayments { - - #[serde(skip_serializing_if = "Option::is_none")] - pub ach: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_domestic_wire: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceOutboundTransfers { - - #[serde(skip_serializing_if = "Option::is_none")] - pub ach: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_domestic_wire: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceTogglesSettingStatusDetails { - - /// Represents the reason why the status is `pending` or `restricted`. - pub code: TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode, - - /// Represents what the user should do, if anything, to activate the Feature. - pub resolution: Option, - - /// The `platform_restrictions` that are restricting this Feature. - #[serde(skip_serializing_if = "Option::is_none")] - pub restriction: Option, -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceAbaToggleSettings`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { - Active, - Pending, - Restricted, -} - -impl TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceAbaToggleSettingsStatus::Active => "active", - TreasuryFinancialAccountsResourceAbaToggleSettingsStatus::Pending => "pending", - TreasuryFinancialAccountsResourceAbaToggleSettingsStatus::Restricted => "restricted", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - Activating, - CapabilityNotRequested, - FinancialAccountClosed, - RejectedOther, - RejectedUnsupportedBusiness, - RequirementsPastDue, - RequirementsPendingVerification, - RestrictedByPlatform, - RestrictedOther, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::Activating => "activating", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::CapabilityNotRequested => "capability_not_requested", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::FinancialAccountClosed => "financial_account_closed", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RejectedOther => "rejected_other", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RejectedUnsupportedBusiness => "rejected_unsupported_business", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RequirementsPastDue => "requirements_past_due", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RequirementsPendingVerification => "requirements_pending_verification", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RestrictedByPlatform => "restricted_by_platform", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RestrictedOther => "restricted_other", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn default() -> Self { - Self::Activating - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `resolution` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - ContactStripe, - ProvideInformation, - RemoveRestriction, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::ContactStripe => "contact_stripe", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::ProvideInformation => "provide_information", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::RemoveRestriction => "remove_restriction", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn default() -> Self { - Self::ContactStripe - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `restriction` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - InboundFlows, - OutboundFlows, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction::InboundFlows => "inbound_flows", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction::OutboundFlows => "outbound_flows", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn default() -> Self { - Self::InboundFlows - } -} diff --git a/src/resources/generated/treasury_financial_accounts_resource_ach_toggle_settings.rs b/src/resources/generated/treasury_financial_accounts_resource_ach_toggle_settings.rs deleted file mode 100644 index 133e36bd8..000000000 --- a/src/resources/generated/treasury_financial_accounts_resource_ach_toggle_settings.rs +++ /dev/null @@ -1,187 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryFinancialAccountsResourceAchToggleSettings". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceAchToggleSettings { - - /// Whether the FinancialAccount should have the Feature. - pub requested: bool, - - /// Whether the Feature is operational. - pub status: TreasuryFinancialAccountsResourceAchToggleSettingsStatus, - - /// Additional details; includes at least one entry when the status is not `active`. - pub status_details: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceTogglesSettingStatusDetails { - - /// Represents the reason why the status is `pending` or `restricted`. - pub code: TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode, - - /// Represents what the user should do, if anything, to activate the Feature. - pub resolution: Option, - - /// The `platform_restrictions` that are restricting this Feature. - #[serde(skip_serializing_if = "Option::is_none")] - pub restriction: Option, -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceAchToggleSettings`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceAchToggleSettingsStatus { - Active, - Pending, - Restricted, -} - -impl TreasuryFinancialAccountsResourceAchToggleSettingsStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceAchToggleSettingsStatus::Active => "active", - TreasuryFinancialAccountsResourceAchToggleSettingsStatus::Pending => "pending", - TreasuryFinancialAccountsResourceAchToggleSettingsStatus::Restricted => "restricted", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceAchToggleSettingsStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceAchToggleSettingsStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceAchToggleSettingsStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - Activating, - CapabilityNotRequested, - FinancialAccountClosed, - RejectedOther, - RejectedUnsupportedBusiness, - RequirementsPastDue, - RequirementsPendingVerification, - RestrictedByPlatform, - RestrictedOther, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::Activating => "activating", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::CapabilityNotRequested => "capability_not_requested", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::FinancialAccountClosed => "financial_account_closed", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RejectedOther => "rejected_other", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RejectedUnsupportedBusiness => "rejected_unsupported_business", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RequirementsPastDue => "requirements_past_due", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RequirementsPendingVerification => "requirements_pending_verification", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RestrictedByPlatform => "restricted_by_platform", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RestrictedOther => "restricted_other", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn default() -> Self { - Self::Activating - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `resolution` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - ContactStripe, - ProvideInformation, - RemoveRestriction, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::ContactStripe => "contact_stripe", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::ProvideInformation => "provide_information", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::RemoveRestriction => "remove_restriction", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn default() -> Self { - Self::ContactStripe - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `restriction` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - InboundFlows, - OutboundFlows, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction::InboundFlows => "inbound_flows", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction::OutboundFlows => "outbound_flows", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn default() -> Self { - Self::InboundFlows - } -} diff --git a/src/resources/generated/treasury_financial_accounts_resource_toggle_settings.rs b/src/resources/generated/treasury_financial_accounts_resource_toggle_settings.rs deleted file mode 100644 index 951ff1c63..000000000 --- a/src/resources/generated/treasury_financial_accounts_resource_toggle_settings.rs +++ /dev/null @@ -1,187 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryFinancialAccountsResourceToggleSettings". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceToggleSettings { - - /// Whether the FinancialAccount should have the Feature. - pub requested: bool, - - /// Whether the Feature is operational. - pub status: TreasuryFinancialAccountsResourceToggleSettingsStatus, - - /// Additional details; includes at least one entry when the status is not `active`. - pub status_details: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceTogglesSettingStatusDetails { - - /// Represents the reason why the status is `pending` or `restricted`. - pub code: TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode, - - /// Represents what the user should do, if anything, to activate the Feature. - pub resolution: Option, - - /// The `platform_restrictions` that are restricting this Feature. - #[serde(skip_serializing_if = "Option::is_none")] - pub restriction: Option, -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceToggleSettings`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceToggleSettingsStatus { - Active, - Pending, - Restricted, -} - -impl TreasuryFinancialAccountsResourceToggleSettingsStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceToggleSettingsStatus::Active => "active", - TreasuryFinancialAccountsResourceToggleSettingsStatus::Pending => "pending", - TreasuryFinancialAccountsResourceToggleSettingsStatus::Restricted => "restricted", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceToggleSettingsStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceToggleSettingsStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceToggleSettingsStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - Activating, - CapabilityNotRequested, - FinancialAccountClosed, - RejectedOther, - RejectedUnsupportedBusiness, - RequirementsPastDue, - RequirementsPendingVerification, - RestrictedByPlatform, - RestrictedOther, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::Activating => "activating", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::CapabilityNotRequested => "capability_not_requested", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::FinancialAccountClosed => "financial_account_closed", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RejectedOther => "rejected_other", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RejectedUnsupportedBusiness => "rejected_unsupported_business", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RequirementsPastDue => "requirements_past_due", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RequirementsPendingVerification => "requirements_pending_verification", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RestrictedByPlatform => "restricted_by_platform", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RestrictedOther => "restricted_other", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn default() -> Self { - Self::Activating - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `resolution` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - ContactStripe, - ProvideInformation, - RemoveRestriction, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::ContactStripe => "contact_stripe", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::ProvideInformation => "provide_information", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::RemoveRestriction => "remove_restriction", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn default() -> Self { - Self::ContactStripe - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `restriction` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - InboundFlows, - OutboundFlows, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction::InboundFlows => "inbound_flows", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction::OutboundFlows => "outbound_flows", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn default() -> Self { - Self::InboundFlows - } -} diff --git a/src/resources/generated/treasury_inbound_transfer.rs b/src/resources/generated/treasury_inbound_transfer.rs deleted file mode 100644 index d8c2013bc..000000000 --- a/src/resources/generated/treasury_inbound_transfer.rs +++ /dev/null @@ -1,389 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryInboundTransferId}; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Currency, TreasurySharedResourceBillingDetails, TreasuryTransaction}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryInboundTransfersResourceInboundTransfer". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryInboundTransfer { - /// Unique identifier for the object. - pub id: TreasuryInboundTransferId, - - /// Amount (in cents) transferred. - pub amount: i64, - - /// Returns `true` if the InboundTransfer is able to be canceled. - pub cancelable: bool, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// Details about this InboundTransfer's failure. - /// - /// Only set when status is `failed`. - pub failure_details: Option, - - /// The FinancialAccount that received the funds. - pub financial_account: String, - - /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - pub hosted_regulatory_receipt_url: Option, - - pub linked_flows: TreasuryInboundTransfersResourceInboundTransferResourceLinkedFlows, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// The origin payment method to be debited for an InboundTransfer. - pub origin_payment_method: String, - - /// Details about the PaymentMethod for an InboundTransfer. - pub origin_payment_method_details: Option, - - /// Returns `true` if the funds for an InboundTransfer were returned after the InboundTransfer went to the `succeeded` state. - pub returned: Option, - - /// Statement descriptor shown when funds are debited from the source. - /// - /// Not all payment networks support `statement_descriptor`. - pub statement_descriptor: String, - - /// Status of the InboundTransfer: `processing`, `succeeded`, `failed`, and `canceled`. - /// - /// An InboundTransfer is `processing` if it is created and pending. - /// The status changes to `succeeded` once the funds have been "confirmed" and a `transaction` is created and posted. - /// The status changes to `failed` if the transfer fails. - pub status: TreasuryInboundTransferStatus, - - pub status_transitions: TreasuryInboundTransfersResourceInboundTransferResourceStatusTransitions, - - /// The Transaction associated with this object. - pub transaction: Option>, -} - -impl Object for TreasuryInboundTransfer { - type Id = TreasuryInboundTransferId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.inbound_transfer" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InboundTransfers { - - pub billing_details: TreasurySharedResourceBillingDetails, - - /// The type of the payment method used in the InboundTransfer. - #[serde(rename = "type")] - pub type_: InboundTransfersType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InboundTransfersPaymentMethodDetailsUsBankAccount { - - /// Account holder type: individual or company. - pub account_holder_type: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - pub account_type: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// The US bank account network used to debit funds. - pub network: InboundTransfersPaymentMethodDetailsUsBankAccountNetwork, - - /// Routing number of the bank account. - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryInboundTransfersResourceFailureDetails { - - /// Reason for the failure. - pub code: TreasuryInboundTransfersResourceFailureDetailsCode, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryInboundTransfersResourceInboundTransferResourceLinkedFlows { - - /// If funds for this flow were returned after the flow went to the `succeeded` state, this field contains a reference to the ReceivedDebit return. - pub received_debit: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryInboundTransfersResourceInboundTransferResourceStatusTransitions { - - /// Timestamp describing when an InboundTransfer changed status to `canceled`. - #[serde(skip_serializing_if = "Option::is_none")] - pub canceled_at: Option, - - /// Timestamp describing when an InboundTransfer changed status to `failed`. - pub failed_at: Option, - - /// Timestamp describing when an InboundTransfer changed status to `succeeded`. - pub succeeded_at: Option, -} - -/// An enum representing the possible values of an `InboundTransfersPaymentMethodDetailsUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType::Company => "company", - InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `InboundTransfersPaymentMethodDetailsUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - Checking, - Savings, -} - -impl InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - InboundTransfersPaymentMethodDetailsUsBankAccountAccountType::Checking => "checking", - InboundTransfersPaymentMethodDetailsUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `InboundTransfersPaymentMethodDetailsUsBankAccount`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - Ach, -} - -impl InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - pub fn as_str(self) -> &'static str { - match self { - InboundTransfersPaymentMethodDetailsUsBankAccountNetwork::Ach => "ach", - } - } -} - -impl AsRef for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `InboundTransfers`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InboundTransfersType { - UsBankAccount, -} - -impl InboundTransfersType { - pub fn as_str(self) -> &'static str { - match self { - InboundTransfersType::UsBankAccount => "us_bank_account", - } - } -} - -impl AsRef for InboundTransfersType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InboundTransfersType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InboundTransfersType { - fn default() -> Self { - Self::UsBankAccount - } -} - -/// An enum representing the possible values of an `TreasuryInboundTransfer`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryInboundTransferStatus { - Canceled, - Failed, - Processing, - Succeeded, -} - -impl TreasuryInboundTransferStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryInboundTransferStatus::Canceled => "canceled", - TreasuryInboundTransferStatus::Failed => "failed", - TreasuryInboundTransferStatus::Processing => "processing", - TreasuryInboundTransferStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for TreasuryInboundTransferStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryInboundTransferStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryInboundTransferStatus { - fn default() -> Self { - Self::Canceled - } -} - -/// An enum representing the possible values of an `TreasuryInboundTransfersResourceFailureDetails`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryInboundTransfersResourceFailureDetailsCode { - AccountClosed, - AccountFrozen, - BankAccountRestricted, - BankOwnershipChanged, - DebitNotAuthorized, - IncorrectAccountHolderAddress, - IncorrectAccountHolderName, - IncorrectAccountHolderTaxId, - InsufficientFunds, - InvalidAccountNumber, - InvalidCurrency, - NoAccount, - Other, -} - -impl TreasuryInboundTransfersResourceFailureDetailsCode { - pub fn as_str(self) -> &'static str { - match self { - TreasuryInboundTransfersResourceFailureDetailsCode::AccountClosed => "account_closed", - TreasuryInboundTransfersResourceFailureDetailsCode::AccountFrozen => "account_frozen", - TreasuryInboundTransfersResourceFailureDetailsCode::BankAccountRestricted => "bank_account_restricted", - TreasuryInboundTransfersResourceFailureDetailsCode::BankOwnershipChanged => "bank_ownership_changed", - TreasuryInboundTransfersResourceFailureDetailsCode::DebitNotAuthorized => "debit_not_authorized", - TreasuryInboundTransfersResourceFailureDetailsCode::IncorrectAccountHolderAddress => "incorrect_account_holder_address", - TreasuryInboundTransfersResourceFailureDetailsCode::IncorrectAccountHolderName => "incorrect_account_holder_name", - TreasuryInboundTransfersResourceFailureDetailsCode::IncorrectAccountHolderTaxId => "incorrect_account_holder_tax_id", - TreasuryInboundTransfersResourceFailureDetailsCode::InsufficientFunds => "insufficient_funds", - TreasuryInboundTransfersResourceFailureDetailsCode::InvalidAccountNumber => "invalid_account_number", - TreasuryInboundTransfersResourceFailureDetailsCode::InvalidCurrency => "invalid_currency", - TreasuryInboundTransfersResourceFailureDetailsCode::NoAccount => "no_account", - TreasuryInboundTransfersResourceFailureDetailsCode::Other => "other", - } - } -} - -impl AsRef for TreasuryInboundTransfersResourceFailureDetailsCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryInboundTransfersResourceFailureDetailsCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryInboundTransfersResourceFailureDetailsCode { - fn default() -> Self { - Self::AccountClosed - } -} diff --git a/src/resources/generated/treasury_outbound_payment.rs b/src/resources/generated/treasury_outbound_payment.rs deleted file mode 100644 index 944a4a368..000000000 --- a/src/resources/generated/treasury_outbound_payment.rs +++ /dev/null @@ -1,452 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryOutboundPaymentId}; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Currency, TreasurySharedResourceBillingDetails, TreasuryTransaction}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryOutboundPaymentsResourceOutboundPayment". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundPayment { - /// Unique identifier for the object. - pub id: TreasuryOutboundPaymentId, - - /// Amount (in cents) transferred. - pub amount: i64, - - /// Returns `true` if the object can be canceled, and `false` otherwise. - pub cancelable: bool, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// ID of the [customer](https://stripe.com/docs/api/customers) to whom an OutboundPayment is sent. - pub customer: Option, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// The PaymentMethod via which an OutboundPayment is sent. - /// - /// This field can be empty if the OutboundPayment was created using `destination_payment_method_data`. - pub destination_payment_method: Option, - - /// Details about the PaymentMethod for an OutboundPayment. - pub destination_payment_method_details: Option, - - /// Details about the end user. - pub end_user_details: Option, - - /// The date when funds are expected to arrive in the destination account. - pub expected_arrival_date: Timestamp, - - /// The FinancialAccount that funds were pulled from. - pub financial_account: String, - - /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - pub hosted_regulatory_receipt_url: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// Details about a returned OutboundPayment. - /// - /// Only set when the status is `returned`. - pub returned_details: Option, - - /// The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer). - pub statement_descriptor: String, - - /// Current status of the OutboundPayment: `processing`, `failed`, `posted`, `returned`, `canceled`. - /// - /// An OutboundPayment is `processing` if it has been created and is pending. - /// The status changes to `posted` once the OutboundPayment has been "confirmed" and funds have left the account, or to `failed` or `canceled`. - /// If an OutboundPayment fails to arrive at its destination, its status will change to `returned`. - pub status: TreasuryOutboundPaymentStatus, - - pub status_transitions: TreasuryOutboundPaymentsResourceOutboundPaymentResourceStatusTransitions, - - /// The Transaction associated with this object. - pub transaction: Expandable, -} - -impl Object for TreasuryOutboundPayment { - type Id = TreasuryOutboundPaymentId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.outbound_payment" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OutboundPaymentsPaymentMethodDetails { - - pub billing_details: TreasurySharedResourceBillingDetails, - - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_account: Option, - - /// The type of the payment method used in the OutboundPayment. - #[serde(rename = "type")] - pub type_: OutboundPaymentsPaymentMethodDetailsType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OutboundPaymentsPaymentMethodDetailsFinancialAccount { - - /// Token of the FinancialAccount. - pub id: String, - - /// The rails used to send funds. - pub network: OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OutboundPaymentsPaymentMethodDetailsUsBankAccount { - - /// Account holder type: individual or company. - pub account_holder_type: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - pub account_type: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// The US bank account network used to send funds. - pub network: OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork, - - /// Routing number of the bank account. - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundPaymentsResourceOutboundPaymentResourceEndUserDetails { - - /// IP address of the user initiating the OutboundPayment. - /// - /// Set if `present` is set to `true`. - /// IP address collection is required for risk and compliance reasons. - /// This will be used to help determine if the OutboundPayment is authorized or should be blocked. - pub ip_address: Option, - - /// `true`` if the OutboundPayment creation request is being made on behalf of an end user by a platform. - /// - /// Otherwise, `false`. - pub present: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundPaymentsResourceOutboundPaymentResourceStatusTransitions { - - /// Timestamp describing when an OutboundPayment changed status to `canceled`. - pub canceled_at: Option, - - /// Timestamp describing when an OutboundPayment changed status to `failed`. - pub failed_at: Option, - - /// Timestamp describing when an OutboundPayment changed status to `posted`. - pub posted_at: Option, - - /// Timestamp describing when an OutboundPayment changed status to `returned`. - pub returned_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundPaymentsResourceReturnedStatus { - - /// Reason for the return. - pub code: TreasuryOutboundPaymentsResourceReturnedStatusCode, - - /// The Transaction associated with this object. - pub transaction: Expandable, -} - -/// An enum representing the possible values of an `OutboundPaymentsPaymentMethodDetailsFinancialAccount`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { - Stripe, -} - -impl OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { - pub fn as_str(self) -> &'static str { - match self { - OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork::Stripe => "stripe", - } - } -} - -impl AsRef for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { - fn default() -> Self { - Self::Stripe - } -} - -/// An enum representing the possible values of an `OutboundPaymentsPaymentMethodDetails`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundPaymentsPaymentMethodDetailsType { - FinancialAccount, - UsBankAccount, -} - -impl OutboundPaymentsPaymentMethodDetailsType { - pub fn as_str(self) -> &'static str { - match self { - OutboundPaymentsPaymentMethodDetailsType::FinancialAccount => "financial_account", - OutboundPaymentsPaymentMethodDetailsType::UsBankAccount => "us_bank_account", - } - } -} - -impl AsRef for OutboundPaymentsPaymentMethodDetailsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundPaymentsPaymentMethodDetailsType { - fn default() -> Self { - Self::FinancialAccount - } -} - -/// An enum representing the possible values of an `OutboundPaymentsPaymentMethodDetailsUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType::Company => "company", - OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `OutboundPaymentsPaymentMethodDetailsUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { - Checking, - Savings, -} - -impl OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType::Checking => "checking", - OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `OutboundPaymentsPaymentMethodDetailsUsBankAccount`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { - Ach, - UsDomesticWire, -} - -impl OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { - pub fn as_str(self) -> &'static str { - match self { - OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork::Ach => "ach", - OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork::UsDomesticWire => "us_domestic_wire", - } - } -} - -impl AsRef for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `TreasuryOutboundPayment`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryOutboundPaymentStatus { - Canceled, - Failed, - Posted, - Processing, - Returned, -} - -impl TreasuryOutboundPaymentStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryOutboundPaymentStatus::Canceled => "canceled", - TreasuryOutboundPaymentStatus::Failed => "failed", - TreasuryOutboundPaymentStatus::Posted => "posted", - TreasuryOutboundPaymentStatus::Processing => "processing", - TreasuryOutboundPaymentStatus::Returned => "returned", - } - } -} - -impl AsRef for TreasuryOutboundPaymentStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryOutboundPaymentStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryOutboundPaymentStatus { - fn default() -> Self { - Self::Canceled - } -} - -/// An enum representing the possible values of an `TreasuryOutboundPaymentsResourceReturnedStatus`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryOutboundPaymentsResourceReturnedStatusCode { - AccountClosed, - AccountFrozen, - BankAccountRestricted, - BankOwnershipChanged, - Declined, - IncorrectAccountHolderName, - InvalidAccountNumber, - InvalidCurrency, - NoAccount, - Other, -} - -impl TreasuryOutboundPaymentsResourceReturnedStatusCode { - pub fn as_str(self) -> &'static str { - match self { - TreasuryOutboundPaymentsResourceReturnedStatusCode::AccountClosed => "account_closed", - TreasuryOutboundPaymentsResourceReturnedStatusCode::AccountFrozen => "account_frozen", - TreasuryOutboundPaymentsResourceReturnedStatusCode::BankAccountRestricted => "bank_account_restricted", - TreasuryOutboundPaymentsResourceReturnedStatusCode::BankOwnershipChanged => "bank_ownership_changed", - TreasuryOutboundPaymentsResourceReturnedStatusCode::Declined => "declined", - TreasuryOutboundPaymentsResourceReturnedStatusCode::IncorrectAccountHolderName => "incorrect_account_holder_name", - TreasuryOutboundPaymentsResourceReturnedStatusCode::InvalidAccountNumber => "invalid_account_number", - TreasuryOutboundPaymentsResourceReturnedStatusCode::InvalidCurrency => "invalid_currency", - TreasuryOutboundPaymentsResourceReturnedStatusCode::NoAccount => "no_account", - TreasuryOutboundPaymentsResourceReturnedStatusCode::Other => "other", - } - } -} - -impl AsRef for TreasuryOutboundPaymentsResourceReturnedStatusCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryOutboundPaymentsResourceReturnedStatusCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryOutboundPaymentsResourceReturnedStatusCode { - fn default() -> Self { - Self::AccountClosed - } -} diff --git a/src/resources/generated/treasury_outbound_transfer.rs b/src/resources/generated/treasury_outbound_transfer.rs deleted file mode 100644 index 1db7b7dde..000000000 --- a/src/resources/generated/treasury_outbound_transfer.rs +++ /dev/null @@ -1,380 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryOutboundTransferId}; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Currency, TreasurySharedResourceBillingDetails, TreasuryTransaction}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryOutboundTransfersResourceOutboundTransfer". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundTransfer { - /// Unique identifier for the object. - pub id: TreasuryOutboundTransferId, - - /// Amount (in cents) transferred. - pub amount: i64, - - /// Returns `true` if the object can be canceled, and `false` otherwise. - pub cancelable: bool, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// The PaymentMethod used as the payment instrument for an OutboundTransfer. - pub destination_payment_method: Option, - - pub destination_payment_method_details: OutboundTransfersPaymentMethodDetails, - - /// The date when funds are expected to arrive in the destination account. - pub expected_arrival_date: Timestamp, - - /// The FinancialAccount that funds were pulled from. - pub financial_account: String, - - /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - pub hosted_regulatory_receipt_url: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// Details about a returned OutboundTransfer. - /// - /// Only set when the status is `returned`. - pub returned_details: Option, - - /// Information about the OutboundTransfer to be sent to the recipient account. - pub statement_descriptor: String, - - /// Current status of the OutboundTransfer: `processing`, `failed`, `canceled`, `posted`, `returned`. - /// - /// An OutboundTransfer is `processing` if it has been created and is pending. - /// The status changes to `posted` once the OutboundTransfer has been "confirmed" and funds have left the account, or to `failed` or `canceled`. - /// If an OutboundTransfer fails to arrive at its destination, its status will change to `returned`. - pub status: TreasuryOutboundTransferStatus, - - pub status_transitions: TreasuryOutboundTransfersResourceStatusTransitions, - - /// The Transaction associated with this object. - pub transaction: Expandable, -} - -impl Object for TreasuryOutboundTransfer { - type Id = TreasuryOutboundTransferId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.outbound_transfer" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OutboundTransfersPaymentMethodDetails { - - pub billing_details: TreasurySharedResourceBillingDetails, - - /// The type of the payment method used in the OutboundTransfer. - #[serde(rename = "type")] - pub type_: OutboundTransfersPaymentMethodDetailsType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OutboundTransfersPaymentMethodDetailsUsBankAccount { - - /// Account holder type: individual or company. - pub account_holder_type: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - pub account_type: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// The US bank account network used to send funds. - pub network: OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork, - - /// Routing number of the bank account. - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundTransfersResourceReturnedDetails { - - /// Reason for the return. - pub code: TreasuryOutboundTransfersResourceReturnedDetailsCode, - - /// The Transaction associated with this object. - pub transaction: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundTransfersResourceStatusTransitions { - - /// Timestamp describing when an OutboundTransfer changed status to `canceled`. - pub canceled_at: Option, - - /// Timestamp describing when an OutboundTransfer changed status to `failed`. - pub failed_at: Option, - - /// Timestamp describing when an OutboundTransfer changed status to `posted`. - pub posted_at: Option, - - /// Timestamp describing when an OutboundTransfer changed status to `returned`. - pub returned_at: Option, -} - -/// An enum representing the possible values of an `OutboundTransfersPaymentMethodDetails`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundTransfersPaymentMethodDetailsType { - UsBankAccount, -} - -impl OutboundTransfersPaymentMethodDetailsType { - pub fn as_str(self) -> &'static str { - match self { - OutboundTransfersPaymentMethodDetailsType::UsBankAccount => "us_bank_account", - } - } -} - -impl AsRef for OutboundTransfersPaymentMethodDetailsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundTransfersPaymentMethodDetailsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundTransfersPaymentMethodDetailsType { - fn default() -> Self { - Self::UsBankAccount - } -} - -/// An enum representing the possible values of an `OutboundTransfersPaymentMethodDetailsUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType::Company => "company", - OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `OutboundTransfersPaymentMethodDetailsUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - Checking, - Savings, -} - -impl OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType::Checking => "checking", - OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `OutboundTransfersPaymentMethodDetailsUsBankAccount`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - Ach, - UsDomesticWire, -} - -impl OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - pub fn as_str(self) -> &'static str { - match self { - OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork::Ach => "ach", - OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork::UsDomesticWire => "us_domestic_wire", - } - } -} - -impl AsRef for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `TreasuryOutboundTransfer`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryOutboundTransferStatus { - Canceled, - Failed, - Posted, - Processing, - Returned, -} - -impl TreasuryOutboundTransferStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryOutboundTransferStatus::Canceled => "canceled", - TreasuryOutboundTransferStatus::Failed => "failed", - TreasuryOutboundTransferStatus::Posted => "posted", - TreasuryOutboundTransferStatus::Processing => "processing", - TreasuryOutboundTransferStatus::Returned => "returned", - } - } -} - -impl AsRef for TreasuryOutboundTransferStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryOutboundTransferStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryOutboundTransferStatus { - fn default() -> Self { - Self::Canceled - } -} - -/// An enum representing the possible values of an `TreasuryOutboundTransfersResourceReturnedDetails`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryOutboundTransfersResourceReturnedDetailsCode { - AccountClosed, - AccountFrozen, - BankAccountRestricted, - BankOwnershipChanged, - Declined, - IncorrectAccountHolderName, - InvalidAccountNumber, - InvalidCurrency, - NoAccount, - Other, -} - -impl TreasuryOutboundTransfersResourceReturnedDetailsCode { - pub fn as_str(self) -> &'static str { - match self { - TreasuryOutboundTransfersResourceReturnedDetailsCode::AccountClosed => "account_closed", - TreasuryOutboundTransfersResourceReturnedDetailsCode::AccountFrozen => "account_frozen", - TreasuryOutboundTransfersResourceReturnedDetailsCode::BankAccountRestricted => "bank_account_restricted", - TreasuryOutboundTransfersResourceReturnedDetailsCode::BankOwnershipChanged => "bank_ownership_changed", - TreasuryOutboundTransfersResourceReturnedDetailsCode::Declined => "declined", - TreasuryOutboundTransfersResourceReturnedDetailsCode::IncorrectAccountHolderName => "incorrect_account_holder_name", - TreasuryOutboundTransfersResourceReturnedDetailsCode::InvalidAccountNumber => "invalid_account_number", - TreasuryOutboundTransfersResourceReturnedDetailsCode::InvalidCurrency => "invalid_currency", - TreasuryOutboundTransfersResourceReturnedDetailsCode::NoAccount => "no_account", - TreasuryOutboundTransfersResourceReturnedDetailsCode::Other => "other", - } - } -} - -impl AsRef for TreasuryOutboundTransfersResourceReturnedDetailsCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryOutboundTransfersResourceReturnedDetailsCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryOutboundTransfersResourceReturnedDetailsCode { - fn default() -> Self { - Self::AccountClosed - } -} diff --git a/src/resources/generated/treasury_received_credit.rs b/src/resources/generated/treasury_received_credit.rs deleted file mode 100644 index bebaebd7f..000000000 --- a/src/resources/generated/treasury_received_credit.rs +++ /dev/null @@ -1,314 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryReceivedCreditId}; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::{Currency, Payout, TreasuryCreditReversal, TreasuryOutboundPayment, TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails, TreasuryTransaction}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryReceivedCreditsResourceReceivedCredit". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedCredit { - /// Unique identifier for the object. - pub id: TreasuryReceivedCreditId, - - /// Amount (in cents) transferred. - pub amount: i64, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: String, - - /// Reason for the failure. - /// - /// A ReceivedCredit might fail because the receiving FinancialAccount is closed or frozen. - pub failure_code: Option, - - /// The FinancialAccount that received the funds. - pub financial_account: Option, - - /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - pub hosted_regulatory_receipt_url: Option, - - pub initiating_payment_method_details: TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails, - - pub linked_flows: TreasuryReceivedCreditsResourceLinkedFlows, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The rails used to send the funds. - pub network: TreasuryReceivedCreditNetwork, - - /// Details describing when a ReceivedCredit may be reversed. - pub reversal_details: Option, - - /// Status of the ReceivedCredit. - /// - /// ReceivedCredits are created either `succeeded` (approved) or `failed` (declined). - /// If a ReceivedCredit is declined, the failure reason can be found in the `failure_code` field. - pub status: TreasuryReceivedCreditStatus, - - /// The Transaction associated with this object. - pub transaction: Option>, -} - -impl Object for TreasuryReceivedCredit { - type Id = TreasuryReceivedCreditId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.received_credit" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedCreditsResourceLinkedFlows { - - /// The CreditReversal created as a result of this ReceivedCredit being reversed. - pub credit_reversal: Option, - - /// Set if the ReceivedCredit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. - pub issuing_authorization: Option, - - /// Set if the ReceivedCredit is also viewable as an [Issuing transaction](https://stripe.com/docs/api#issuing_transactions) object. - pub issuing_transaction: Option, - - /// ID of the source flow. - /// - /// Set if `network` is `stripe` and the source flow is visible to the user. - /// Examples of source flows include OutboundPayments, payouts, or CreditReversals. - pub source_flow: Option, - - /// The expandable object of the source flow. - pub source_flow_details: Option, - - /// The type of flow that originated the ReceivedCredit (for example, `outbound_payment`). - pub source_flow_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedCreditsResourceReversalDetails { - - /// Time before which a ReceivedCredit can be reversed. - pub deadline: Option, - - /// Set if a ReceivedCredit cannot be reversed. - pub restricted_reason: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedCreditsResourceSourceFlowsDetails { - - #[serde(skip_serializing_if = "Option::is_none")] - pub credit_reversal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub outbound_payment: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub payout: Option, - - /// The type of the source flow that originated the ReceivedCredit. - #[serde(rename = "type")] - pub type_: TreasuryReceivedCreditsResourceSourceFlowsDetailsType, -} - -/// An enum representing the possible values of an `TreasuryReceivedCredit`'s `failure_code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedCreditFailureCode { - AccountClosed, - AccountFrozen, - Other, -} - -impl TreasuryReceivedCreditFailureCode { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedCreditFailureCode::AccountClosed => "account_closed", - TreasuryReceivedCreditFailureCode::AccountFrozen => "account_frozen", - TreasuryReceivedCreditFailureCode::Other => "other", - } - } -} - -impl AsRef for TreasuryReceivedCreditFailureCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedCreditFailureCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedCreditFailureCode { - fn default() -> Self { - Self::AccountClosed - } -} - -/// An enum representing the possible values of an `TreasuryReceivedCredit`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedCreditNetwork { - Ach, - Card, - Stripe, - UsDomesticWire, -} - -impl TreasuryReceivedCreditNetwork { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedCreditNetwork::Ach => "ach", - TreasuryReceivedCreditNetwork::Card => "card", - TreasuryReceivedCreditNetwork::Stripe => "stripe", - TreasuryReceivedCreditNetwork::UsDomesticWire => "us_domestic_wire", - } - } -} - -impl AsRef for TreasuryReceivedCreditNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedCreditNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedCreditNetwork { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `TreasuryReceivedCredit`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedCreditStatus { - Failed, - Succeeded, -} - -impl TreasuryReceivedCreditStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedCreditStatus::Failed => "failed", - TreasuryReceivedCreditStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for TreasuryReceivedCreditStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedCreditStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedCreditStatus { - fn default() -> Self { - Self::Failed - } -} - -/// An enum representing the possible values of an `TreasuryReceivedCreditsResourceReversalDetails`'s `restricted_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { - AlreadyReversed, - DeadlinePassed, - NetworkRestricted, - Other, - SourceFlowRestricted, -} - -impl TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason::AlreadyReversed => "already_reversed", - TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason::DeadlinePassed => "deadline_passed", - TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason::NetworkRestricted => "network_restricted", - TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason::Other => "other", - TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason::SourceFlowRestricted => "source_flow_restricted", - } - } -} - -impl AsRef for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { - fn default() -> Self { - Self::AlreadyReversed - } -} - -/// An enum representing the possible values of an `TreasuryReceivedCreditsResourceSourceFlowsDetails`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedCreditsResourceSourceFlowsDetailsType { - CreditReversal, - Other, - OutboundPayment, - Payout, -} - -impl TreasuryReceivedCreditsResourceSourceFlowsDetailsType { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedCreditsResourceSourceFlowsDetailsType::CreditReversal => "credit_reversal", - TreasuryReceivedCreditsResourceSourceFlowsDetailsType::Other => "other", - TreasuryReceivedCreditsResourceSourceFlowsDetailsType::OutboundPayment => "outbound_payment", - TreasuryReceivedCreditsResourceSourceFlowsDetailsType::Payout => "payout", - } - } -} - -impl AsRef for TreasuryReceivedCreditsResourceSourceFlowsDetailsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedCreditsResourceSourceFlowsDetailsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedCreditsResourceSourceFlowsDetailsType { - fn default() -> Self { - Self::CreditReversal - } -} diff --git a/src/resources/generated/treasury_received_debit.rs b/src/resources/generated/treasury_received_debit.rs deleted file mode 100644 index 3ef80636a..000000000 --- a/src/resources/generated/treasury_received_debit.rs +++ /dev/null @@ -1,251 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryReceivedDebitId}; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::{Currency, TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails, TreasuryTransaction}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryReceivedDebitsResourceReceivedDebit". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedDebit { - /// Unique identifier for the object. - pub id: TreasuryReceivedDebitId, - - /// Amount (in cents) transferred. - pub amount: i64, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: String, - - /// Reason for the failure. - /// - /// A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen. - pub failure_code: Option, - - /// The FinancialAccount that funds were pulled from. - pub financial_account: Option, - - /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - pub hosted_regulatory_receipt_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub initiating_payment_method_details: Option, - - pub linked_flows: TreasuryReceivedDebitsResourceLinkedFlows, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The network used for the ReceivedDebit. - pub network: TreasuryReceivedDebitNetwork, - - /// Details describing when a ReceivedDebit might be reversed. - pub reversal_details: Option, - - /// Status of the ReceivedDebit. - /// - /// ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). - /// The failure reason can be found under the `failure_code`. - pub status: TreasuryReceivedDebitStatus, - - /// The Transaction associated with this object. - pub transaction: Option>, -} - -impl Object for TreasuryReceivedDebit { - type Id = TreasuryReceivedDebitId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.received_debit" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedDebitsResourceLinkedFlows { - - /// The DebitReversal created as a result of this ReceivedDebit being reversed. - pub debit_reversal: Option, - - /// Set if the ReceivedDebit is associated with an InboundTransfer's return of funds. - pub inbound_transfer: Option, - - /// Set if the ReceivedDebit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. - pub issuing_authorization: Option, - - /// Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://stripe.com/docs/api#issuing_disputes) object. - pub issuing_transaction: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedDebitsResourceReversalDetails { - - /// Time before which a ReceivedDebit can be reversed. - pub deadline: Option, - - /// Set if a ReceivedDebit can't be reversed. - pub restricted_reason: Option, -} - -/// An enum representing the possible values of an `TreasuryReceivedDebit`'s `failure_code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedDebitFailureCode { - AccountClosed, - AccountFrozen, - InsufficientFunds, - Other, -} - -impl TreasuryReceivedDebitFailureCode { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedDebitFailureCode::AccountClosed => "account_closed", - TreasuryReceivedDebitFailureCode::AccountFrozen => "account_frozen", - TreasuryReceivedDebitFailureCode::InsufficientFunds => "insufficient_funds", - TreasuryReceivedDebitFailureCode::Other => "other", - } - } -} - -impl AsRef for TreasuryReceivedDebitFailureCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedDebitFailureCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedDebitFailureCode { - fn default() -> Self { - Self::AccountClosed - } -} - -/// An enum representing the possible values of an `TreasuryReceivedDebit`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedDebitNetwork { - Ach, - Card, - Stripe, -} - -impl TreasuryReceivedDebitNetwork { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedDebitNetwork::Ach => "ach", - TreasuryReceivedDebitNetwork::Card => "card", - TreasuryReceivedDebitNetwork::Stripe => "stripe", - } - } -} - -impl AsRef for TreasuryReceivedDebitNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedDebitNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedDebitNetwork { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `TreasuryReceivedDebit`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedDebitStatus { - Failed, - Succeeded, -} - -impl TreasuryReceivedDebitStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedDebitStatus::Failed => "failed", - TreasuryReceivedDebitStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for TreasuryReceivedDebitStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedDebitStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedDebitStatus { - fn default() -> Self { - Self::Failed - } -} - -/// An enum representing the possible values of an `TreasuryReceivedDebitsResourceReversalDetails`'s `restricted_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { - AlreadyReversed, - DeadlinePassed, - NetworkRestricted, - Other, - SourceFlowRestricted, -} - -impl TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason::AlreadyReversed => "already_reversed", - TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason::DeadlinePassed => "deadline_passed", - TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason::NetworkRestricted => "network_restricted", - TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason::Other => "other", - TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason::SourceFlowRestricted => "source_flow_restricted", - } - } -} - -impl AsRef for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { - fn default() -> Self { - Self::AlreadyReversed - } -} diff --git a/src/resources/generated/treasury_shared_resource_billing_details.rs b/src/resources/generated/treasury_shared_resource_billing_details.rs deleted file mode 100644 index f7f4c71fa..000000000 --- a/src/resources/generated/treasury_shared_resource_billing_details.rs +++ /dev/null @@ -1,19 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::resources::{Address}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasurySharedResourceBillingDetails". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasurySharedResourceBillingDetails { - - pub address: Address, - - /// Email address. - pub email: Option, - - /// Full name. - pub name: Option, -} diff --git a/src/resources/generated/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details.rs b/src/resources/generated/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details.rs deleted file mode 100644 index de572ab51..000000000 --- a/src/resources/generated/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details.rs +++ /dev/null @@ -1,164 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::resources::{TreasurySharedResourceBillingDetails}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails { - - /// Set when `type` is `balance`. - #[serde(skip_serializing_if = "Option::is_none")] - pub balance: Option, - - pub billing_details: TreasurySharedResourceBillingDetails, - - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_account: Option, - - /// Set when `type` is `issuing_card`. - /// - /// This is an [Issuing Card](https://stripe.com/docs/api#issuing_cards) ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub issuing_card: Option, - - /// Polymorphic type matching the originating money movement's source. - /// - /// This can be an external account, a Stripe balance, or a FinancialAccount. - #[serde(rename = "type")] - pub type_: TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ReceivedPaymentMethodDetailsFinancialAccount { - - /// The FinancialAccount ID. - pub id: String, - - /// The rails the ReceivedCredit was sent over. - /// - /// A FinancialAccount can only send funds over `stripe`. - pub network: ReceivedPaymentMethodDetailsFinancialAccountNetwork, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasurySharedResourceInitiatingPaymentMethodDetailsUsBankAccount { - - /// Bank name. - pub bank_name: Option, - - /// The last four digits of the bank account number. - pub last4: Option, - - /// The routing number for the bank account. - pub routing_number: Option, -} - -/// An enum representing the possible values of an `ReceivedPaymentMethodDetailsFinancialAccount`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ReceivedPaymentMethodDetailsFinancialAccountNetwork { - Stripe, -} - -impl ReceivedPaymentMethodDetailsFinancialAccountNetwork { - pub fn as_str(self) -> &'static str { - match self { - ReceivedPaymentMethodDetailsFinancialAccountNetwork::Stripe => "stripe", - } - } -} - -impl AsRef for ReceivedPaymentMethodDetailsFinancialAccountNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ReceivedPaymentMethodDetailsFinancialAccountNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ReceivedPaymentMethodDetailsFinancialAccountNetwork { - fn default() -> Self { - Self::Stripe - } -} - -/// An enum representing the possible values of an `TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails`'s `balance` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { - Payments, -} - -impl TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { - pub fn as_str(self) -> &'static str { - match self { - TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance::Payments => "payments", - } - } -} - -impl AsRef for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { - fn default() -> Self { - Self::Payments - } -} - -/// An enum representing the possible values of an `TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { - Balance, - FinancialAccount, - IssuingCard, - Stripe, - UsBankAccount, -} - -impl TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { - pub fn as_str(self) -> &'static str { - match self { - TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType::Balance => "balance", - TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType::FinancialAccount => "financial_account", - TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType::IssuingCard => "issuing_card", - TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType::Stripe => "stripe", - TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType::UsBankAccount => "us_bank_account", - } - } -} - -impl AsRef for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { - fn default() -> Self { - Self::Balance - } -} diff --git a/src/resources/generated/treasury_transaction.rs b/src/resources/generated/treasury_transaction.rs deleted file mode 100644 index 5ced22510..000000000 --- a/src/resources/generated/treasury_transaction.rs +++ /dev/null @@ -1,164 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryTransactionId}; -use crate::params::{List, Object, Timestamp}; -use crate::resources::{Currency, TreasuryTransactionEntry, TreasuryTransactionsResourceBalanceImpact, TreasuryTransactionsResourceFlowDetails}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryTransactionsResourceTransaction". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryTransaction { - /// Unique identifier for the object. - pub id: TreasuryTransactionId, - - /// Amount (in cents) transferred. - pub amount: i64, - - pub balance_impact: TreasuryTransactionsResourceBalanceImpact, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: String, - - /// A list of TransactionEntries that are part of this Transaction. - /// - /// This cannot be expanded in any list endpoints. - pub entries: List, - - /// The FinancialAccount associated with this object. - pub financial_account: String, - - /// ID of the flow that created the Transaction. - pub flow: Option, - - /// Details of the flow that created the Transaction. - pub flow_details: Option, - - /// Type of the flow that created the Transaction. - pub flow_type: TreasuryTransactionFlowType, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Status of the Transaction. - pub status: TreasuryTransactionStatus, - - pub status_transitions: TreasuryTransactionsResourceAbstractTransactionResourceStatusTransitions, -} - -impl Object for TreasuryTransaction { - type Id = TreasuryTransactionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.transaction" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryTransactionsResourceAbstractTransactionResourceStatusTransitions { - - /// Timestamp describing when the Transaction changed status to `posted`. - pub posted_at: Option, - - /// Timestamp describing when the Transaction changed status to `void`. - pub void_at: Option, -} - -/// An enum representing the possible values of an `TreasuryTransaction`'s `flow_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryTransactionFlowType { - CreditReversal, - DebitReversal, - InboundTransfer, - IssuingAuthorization, - Other, - OutboundPayment, - OutboundTransfer, - ReceivedCredit, - ReceivedDebit, -} - -impl TreasuryTransactionFlowType { - pub fn as_str(self) -> &'static str { - match self { - TreasuryTransactionFlowType::CreditReversal => "credit_reversal", - TreasuryTransactionFlowType::DebitReversal => "debit_reversal", - TreasuryTransactionFlowType::InboundTransfer => "inbound_transfer", - TreasuryTransactionFlowType::IssuingAuthorization => "issuing_authorization", - TreasuryTransactionFlowType::Other => "other", - TreasuryTransactionFlowType::OutboundPayment => "outbound_payment", - TreasuryTransactionFlowType::OutboundTransfer => "outbound_transfer", - TreasuryTransactionFlowType::ReceivedCredit => "received_credit", - TreasuryTransactionFlowType::ReceivedDebit => "received_debit", - } - } -} - -impl AsRef for TreasuryTransactionFlowType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryTransactionFlowType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryTransactionFlowType { - fn default() -> Self { - Self::CreditReversal - } -} - -/// An enum representing the possible values of an `TreasuryTransaction`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryTransactionStatus { - Open, - Posted, - Void, -} - -impl TreasuryTransactionStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryTransactionStatus::Open => "open", - TreasuryTransactionStatus::Posted => "posted", - TreasuryTransactionStatus::Void => "void", - } - } -} - -impl AsRef for TreasuryTransactionStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryTransactionStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryTransactionStatus { - fn default() -> Self { - Self::Open - } -} diff --git a/src/resources/generated/treasury_transaction_entry.rs b/src/resources/generated/treasury_transaction_entry.rs deleted file mode 100644 index dab4d7839..000000000 --- a/src/resources/generated/treasury_transaction_entry.rs +++ /dev/null @@ -1,180 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryTransactionEntryId}; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::{Currency, TreasuryTransaction, TreasuryTransactionsResourceBalanceImpact, TreasuryTransactionsResourceFlowDetails}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryTransactionsResourceTransactionEntry". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryTransactionEntry { - /// Unique identifier for the object. - pub id: TreasuryTransactionEntryId, - - pub balance_impact: TreasuryTransactionsResourceBalanceImpact, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// When the TransactionEntry will impact the FinancialAccount's balance. - pub effective_at: Timestamp, - - /// The FinancialAccount associated with this object. - pub financial_account: String, - - /// Token of the flow associated with the TransactionEntry. - pub flow: Option, - - /// Details of the flow associated with the TransactionEntry. - pub flow_details: Option, - - /// Type of the flow associated with the TransactionEntry. - pub flow_type: TreasuryTransactionEntryFlowType, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The Transaction associated with this object. - pub transaction: Expandable, - - /// The specific money movement that generated the TransactionEntry. - #[serde(rename = "type")] - pub type_: TreasuryTransactionEntryType, -} - -impl Object for TreasuryTransactionEntry { - type Id = TreasuryTransactionEntryId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.transaction_entry" - } -} - -/// An enum representing the possible values of an `TreasuryTransactionEntry`'s `flow_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryTransactionEntryFlowType { - CreditReversal, - DebitReversal, - InboundTransfer, - IssuingAuthorization, - Other, - OutboundPayment, - OutboundTransfer, - ReceivedCredit, - ReceivedDebit, -} - -impl TreasuryTransactionEntryFlowType { - pub fn as_str(self) -> &'static str { - match self { - TreasuryTransactionEntryFlowType::CreditReversal => "credit_reversal", - TreasuryTransactionEntryFlowType::DebitReversal => "debit_reversal", - TreasuryTransactionEntryFlowType::InboundTransfer => "inbound_transfer", - TreasuryTransactionEntryFlowType::IssuingAuthorization => "issuing_authorization", - TreasuryTransactionEntryFlowType::Other => "other", - TreasuryTransactionEntryFlowType::OutboundPayment => "outbound_payment", - TreasuryTransactionEntryFlowType::OutboundTransfer => "outbound_transfer", - TreasuryTransactionEntryFlowType::ReceivedCredit => "received_credit", - TreasuryTransactionEntryFlowType::ReceivedDebit => "received_debit", - } - } -} - -impl AsRef for TreasuryTransactionEntryFlowType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryTransactionEntryFlowType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryTransactionEntryFlowType { - fn default() -> Self { - Self::CreditReversal - } -} - -/// An enum representing the possible values of an `TreasuryTransactionEntry`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryTransactionEntryType { - CreditReversal, - CreditReversalPosting, - DebitReversal, - InboundTransfer, - InboundTransferReturn, - IssuingAuthorizationHold, - IssuingAuthorizationRelease, - Other, - OutboundPayment, - OutboundPaymentCancellation, - OutboundPaymentFailure, - OutboundPaymentPosting, - OutboundPaymentReturn, - OutboundTransfer, - OutboundTransferCancellation, - OutboundTransferFailure, - OutboundTransferPosting, - OutboundTransferReturn, - ReceivedCredit, - ReceivedDebit, -} - -impl TreasuryTransactionEntryType { - pub fn as_str(self) -> &'static str { - match self { - TreasuryTransactionEntryType::CreditReversal => "credit_reversal", - TreasuryTransactionEntryType::CreditReversalPosting => "credit_reversal_posting", - TreasuryTransactionEntryType::DebitReversal => "debit_reversal", - TreasuryTransactionEntryType::InboundTransfer => "inbound_transfer", - TreasuryTransactionEntryType::InboundTransferReturn => "inbound_transfer_return", - TreasuryTransactionEntryType::IssuingAuthorizationHold => "issuing_authorization_hold", - TreasuryTransactionEntryType::IssuingAuthorizationRelease => "issuing_authorization_release", - TreasuryTransactionEntryType::Other => "other", - TreasuryTransactionEntryType::OutboundPayment => "outbound_payment", - TreasuryTransactionEntryType::OutboundPaymentCancellation => "outbound_payment_cancellation", - TreasuryTransactionEntryType::OutboundPaymentFailure => "outbound_payment_failure", - TreasuryTransactionEntryType::OutboundPaymentPosting => "outbound_payment_posting", - TreasuryTransactionEntryType::OutboundPaymentReturn => "outbound_payment_return", - TreasuryTransactionEntryType::OutboundTransfer => "outbound_transfer", - TreasuryTransactionEntryType::OutboundTransferCancellation => "outbound_transfer_cancellation", - TreasuryTransactionEntryType::OutboundTransferFailure => "outbound_transfer_failure", - TreasuryTransactionEntryType::OutboundTransferPosting => "outbound_transfer_posting", - TreasuryTransactionEntryType::OutboundTransferReturn => "outbound_transfer_return", - TreasuryTransactionEntryType::ReceivedCredit => "received_credit", - TreasuryTransactionEntryType::ReceivedDebit => "received_debit", - } - } -} - -impl AsRef for TreasuryTransactionEntryType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryTransactionEntryType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryTransactionEntryType { - fn default() -> Self { - Self::CreditReversal - } -} diff --git a/src/resources/generated/treasury_transactions_resource_balance_impact.rs b/src/resources/generated/treasury_transactions_resource_balance_impact.rs deleted file mode 100644 index 307e2b891..000000000 --- a/src/resources/generated/treasury_transactions_resource_balance_impact.rs +++ /dev/null @@ -1,19 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryTransactionsResourceBalanceImpact". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryTransactionsResourceBalanceImpact { - - /// The change made to funds the user can spend right now. - pub cash: i64, - - /// The change made to funds that are not spendable yet, but will become available at a later time. - pub inbound_pending: i64, - - /// The change made to funds in the account, but not spendable because they are being held for pending outbound flows. - pub outbound_pending: i64, -} diff --git a/src/resources/generated/treasury_transactions_resource_flow_details.rs b/src/resources/generated/treasury_transactions_resource_flow_details.rs deleted file mode 100644 index 8d89a2e7a..000000000 --- a/src/resources/generated/treasury_transactions_resource_flow_details.rs +++ /dev/null @@ -1,89 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::resources::{IssuingAuthorization, TreasuryCreditReversal, TreasuryDebitReversal, TreasuryInboundTransfer, TreasuryOutboundPayment, TreasuryOutboundTransfer, TreasuryReceivedCredit, TreasuryReceivedDebit}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryTransactionsResourceFlowDetails". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryTransactionsResourceFlowDetails { - - #[serde(skip_serializing_if = "Option::is_none")] - pub credit_reversal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub debit_reversal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub inbound_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub issuing_authorization: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub outbound_payment: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub outbound_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub received_credit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub received_debit: Option, - - /// Type of the flow that created the Transaction. - /// - /// Set to the same value as `flow_type`. - #[serde(rename = "type")] - pub type_: TreasuryTransactionsResourceFlowDetailsType, -} - -/// An enum representing the possible values of an `TreasuryTransactionsResourceFlowDetails`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryTransactionsResourceFlowDetailsType { - CreditReversal, - DebitReversal, - InboundTransfer, - IssuingAuthorization, - Other, - OutboundPayment, - OutboundTransfer, - ReceivedCredit, - ReceivedDebit, -} - -impl TreasuryTransactionsResourceFlowDetailsType { - pub fn as_str(self) -> &'static str { - match self { - TreasuryTransactionsResourceFlowDetailsType::CreditReversal => "credit_reversal", - TreasuryTransactionsResourceFlowDetailsType::DebitReversal => "debit_reversal", - TreasuryTransactionsResourceFlowDetailsType::InboundTransfer => "inbound_transfer", - TreasuryTransactionsResourceFlowDetailsType::IssuingAuthorization => "issuing_authorization", - TreasuryTransactionsResourceFlowDetailsType::Other => "other", - TreasuryTransactionsResourceFlowDetailsType::OutboundPayment => "outbound_payment", - TreasuryTransactionsResourceFlowDetailsType::OutboundTransfer => "outbound_transfer", - TreasuryTransactionsResourceFlowDetailsType::ReceivedCredit => "received_credit", - TreasuryTransactionsResourceFlowDetailsType::ReceivedDebit => "received_debit", - } - } -} - -impl AsRef for TreasuryTransactionsResourceFlowDetailsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryTransactionsResourceFlowDetailsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryTransactionsResourceFlowDetailsType { - fn default() -> Self { - Self::CreditReversal - } -} diff --git a/src/resources/generated/usage_record.rs b/src/resources/generated/usage_record.rs deleted file mode 100644 index 47d7bd4b8..000000000 --- a/src/resources/generated/usage_record.rs +++ /dev/null @@ -1,39 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::UsageRecordId; -use crate::params::{Object, Timestamp}; - -/// The resource representing a Stripe "UsageRecord". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UsageRecord { - /// Unique identifier for the object. - pub id: UsageRecordId, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The usage quantity for the specified date. - pub quantity: u64, - - /// The ID of the subscription item this usage record contains data for. - pub subscription_item: String, - - /// The timestamp when this usage occurred. - pub timestamp: Timestamp, -} - -impl Object for UsageRecord { - type Id = UsageRecordId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "usage_record" - } -} diff --git a/src/resources/generated/usage_record_summary.rs b/src/resources/generated/usage_record_summary.rs deleted file mode 100644 index db45835c7..000000000 --- a/src/resources/generated/usage_record_summary.rs +++ /dev/null @@ -1,52 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::UsageRecordSummaryId; -use crate::params::{Object, Timestamp}; - -/// The resource representing a Stripe "UsageRecordSummary". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UsageRecordSummary { - /// Unique identifier for the object. - pub id: UsageRecordSummaryId, - - /// The invoice in which this usage period has been billed for. - pub invoice: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - pub period: Period, - - /// The ID of the subscription item this summary is describing. - pub subscription_item: String, - - /// The total usage within this usage period. - pub total_usage: i64, -} - -impl Object for UsageRecordSummary { - type Id = UsageRecordSummaryId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "usage_record_summary" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Period { - /// The end date of this usage period. - /// - /// All usage up to and including this point in time is included. - pub end: Option, - - /// The start date of this usage period. - /// - /// All usage after this point in time is included. - pub start: Option, -} diff --git a/src/resources/generated/version.rs b/src/resources/generated/version.rs deleted file mode 100644 index 2d5a335b9..000000000 --- a/src/resources/generated/version.rs +++ /dev/null @@ -1,3 +0,0 @@ -use crate::ApiVersion; - -pub const VERSION: ApiVersion = ApiVersion::V2023_08_16; diff --git a/src/resources/generated/webhook_endpoint.rs b/src/resources/generated/webhook_endpoint.rs deleted file mode 100644 index 0bc31e036..000000000 --- a/src/resources/generated/webhook_endpoint.rs +++ /dev/null @@ -1,1019 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::WebhookEndpointId; -use crate::params::{Deleted, Expand, List, Metadata, Object, Paginable, Timestamp}; -use crate::resources::{ApiVersion, WebhookEndpointStatus}; - -/// The resource representing a Stripe "NotificationWebhookEndpoint". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WebhookEndpoint { - /// Unique identifier for the object. - pub id: WebhookEndpointId, - - /// The API version events are rendered as for this webhook endpoint. - #[serde(skip_serializing_if = "Option::is_none")] - pub api_version: Option, - - /// The ID of the associated Connect application. - #[serde(skip_serializing_if = "Option::is_none")] - pub application: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// An optional description of what the webhook is used for. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// The list of events to enable for this endpoint. - /// - /// `['*']` indicates that all events are enabled, except those that require explicit selection. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled_events: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The endpoint's secret, used to generate [webhook signatures](https://stripe.com/docs/webhooks/signatures). - /// - /// Only returned at creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub secret: Option, - - /// The status of the webhook. - /// - /// It can be `enabled` or `disabled`. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, - - /// The URL of the webhook endpoint. - #[serde(skip_serializing_if = "Option::is_none")] - pub url: Option, -} - -impl WebhookEndpoint { - /// Returns a list of your webhook endpoints. - pub fn list( - client: &Client, - params: &ListWebhookEndpoints<'_>, - ) -> Response> { - client.get_query("/webhook_endpoints", ¶ms) - } - - /// A webhook endpoint must have a `url` and a list of `enabled_events`. - /// - /// You may optionally specify the Boolean `connect` parameter. - /// If set to true, then a Connect webhook endpoint that notifies the specified `url` about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified `url` only about events from your account is created. - /// You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. - pub fn create(client: &Client, params: CreateWebhookEndpoint<'_>) -> Response { - client.post_form("/webhook_endpoints", ¶ms) - } - - /// Retrieves the webhook endpoint with the given ID. - pub fn retrieve( - client: &Client, - id: &WebhookEndpointId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/webhook_endpoints/{}", id), &Expand { expand }) - } - - /// Updates the webhook endpoint. - /// - /// You may edit the `url`, the list of `enabled_events`, and the status of your endpoint. - pub fn update( - client: &Client, - id: &WebhookEndpointId, - params: UpdateWebhookEndpoint<'_>, - ) -> Response { - client.post_form(&format!("/webhook_endpoints/{}", id), ¶ms) - } - - /// You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. - pub fn delete(client: &Client, id: &WebhookEndpointId) -> Response> { - client.delete(&format!("/webhook_endpoints/{}", id)) - } -} - -impl Object for WebhookEndpoint { - type Id = WebhookEndpointId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "webhook_endpoint" - } -} - -/// The parameters for `WebhookEndpoint::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateWebhookEndpoint<'a> { - /// Events sent to this endpoint will be generated with this Stripe Version instead of your account's default Stripe Version. - #[serde(skip_serializing_if = "Option::is_none")] - pub api_version: Option, - - /// Whether this endpoint should receive events from connected accounts (`true`), or from your account (`false`). - /// - /// Defaults to `false`. - #[serde(skip_serializing_if = "Option::is_none")] - pub connect: Option, - - /// An optional description of what the webhook is used for. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// The list of events to enable for this endpoint. - /// - /// You may specify `['*']` to enable all events, except those that require explicit selection. - pub enabled_events: Vec, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The URL of the webhook endpoint. - pub url: &'a str, -} - -impl<'a> CreateWebhookEndpoint<'a> { - pub fn new(enabled_events: Vec, url: &'a str) -> Self { - CreateWebhookEndpoint { - api_version: Default::default(), - connect: Default::default(), - description: Default::default(), - enabled_events, - expand: Default::default(), - metadata: Default::default(), - url, - } - } -} - -/// The parameters for `WebhookEndpoint::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListWebhookEndpoints<'a> { - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListWebhookEndpoints<'a> { - pub fn new() -> Self { - ListWebhookEndpoints { - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListWebhookEndpoints<'_> { - type O = WebhookEndpoint; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `WebhookEndpoint::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateWebhookEndpoint<'a> { - /// An optional description of what the webhook is used for. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Disable the webhook endpoint if set to true. - #[serde(skip_serializing_if = "Option::is_none")] - pub disabled: Option, - - /// The list of events to enable for this endpoint. - /// - /// You may specify `['*']` to enable all events, except those that require explicit selection. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled_events: Option>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The URL of the webhook endpoint. - #[serde(skip_serializing_if = "Option::is_none")] - pub url: Option<&'a str>, -} - -impl<'a> UpdateWebhookEndpoint<'a> { - pub fn new() -> Self { - UpdateWebhookEndpoint { - description: Default::default(), - disabled: Default::default(), - enabled_events: Default::default(), - expand: Default::default(), - metadata: Default::default(), - url: Default::default(), - } - } -} - -/// An enum representing the possible values of an `CreateWebhookEndpoint`'s `enabled_events` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum EventFilter { - #[serde(rename = "*")] - All, - #[serde(rename = "account.application.authorized")] - AccountApplicationAuthorized, - #[serde(rename = "account.application.deauthorized")] - AccountApplicationDeauthorized, - #[serde(rename = "account.external_account.created")] - AccountExternalAccountCreated, - #[serde(rename = "account.external_account.deleted")] - AccountExternalAccountDeleted, - #[serde(rename = "account.external_account.updated")] - AccountExternalAccountUpdated, - #[serde(rename = "account.updated")] - AccountUpdated, - #[serde(rename = "application_fee.created")] - ApplicationFeeCreated, - #[serde(rename = "application_fee.refund.updated")] - ApplicationFeeRefundUpdated, - #[serde(rename = "application_fee.refunded")] - ApplicationFeeRefunded, - #[serde(rename = "balance.available")] - BalanceAvailable, - #[serde(rename = "billing_portal.configuration.created")] - BillingPortalConfigurationCreated, - #[serde(rename = "billing_portal.configuration.updated")] - BillingPortalConfigurationUpdated, - #[serde(rename = "billing_portal.session.created")] - BillingPortalSessionCreated, - #[serde(rename = "capability.updated")] - CapabilityUpdated, - #[serde(rename = "cash_balance.funds_available")] - CashBalanceFundsAvailable, - #[serde(rename = "charge.captured")] - ChargeCaptured, - #[serde(rename = "charge.dispute.closed")] - ChargeDisputeClosed, - #[serde(rename = "charge.dispute.created")] - ChargeDisputeCreated, - #[serde(rename = "charge.dispute.funds_reinstated")] - ChargeDisputeFundsReinstated, - #[serde(rename = "charge.dispute.funds_withdrawn")] - ChargeDisputeFundsWithdrawn, - #[serde(rename = "charge.dispute.updated")] - ChargeDisputeUpdated, - #[serde(rename = "charge.expired")] - ChargeExpired, - #[serde(rename = "charge.failed")] - ChargeFailed, - #[serde(rename = "charge.pending")] - ChargePending, - #[serde(rename = "charge.refund.updated")] - ChargeRefundUpdated, - #[serde(rename = "charge.refunded")] - ChargeRefunded, - #[serde(rename = "charge.succeeded")] - ChargeSucceeded, - #[serde(rename = "charge.updated")] - ChargeUpdated, - #[serde(rename = "checkout.session.async_payment_failed")] - CheckoutSessionAsyncPaymentFailed, - #[serde(rename = "checkout.session.async_payment_succeeded")] - CheckoutSessionAsyncPaymentSucceeded, - #[serde(rename = "checkout.session.completed")] - CheckoutSessionCompleted, - #[serde(rename = "checkout.session.expired")] - CheckoutSessionExpired, - #[serde(rename = "coupon.created")] - CouponCreated, - #[serde(rename = "coupon.deleted")] - CouponDeleted, - #[serde(rename = "coupon.updated")] - CouponUpdated, - #[serde(rename = "credit_note.created")] - CreditNoteCreated, - #[serde(rename = "credit_note.updated")] - CreditNoteUpdated, - #[serde(rename = "credit_note.voided")] - CreditNoteVoided, - #[serde(rename = "customer.created")] - CustomerCreated, - #[serde(rename = "customer.deleted")] - CustomerDeleted, - #[serde(rename = "customer.discount.created")] - CustomerDiscountCreated, - #[serde(rename = "customer.discount.deleted")] - CustomerDiscountDeleted, - #[serde(rename = "customer.discount.updated")] - CustomerDiscountUpdated, - #[serde(rename = "customer.source.created")] - CustomerSourceCreated, - #[serde(rename = "customer.source.deleted")] - CustomerSourceDeleted, - #[serde(rename = "customer.source.expiring")] - CustomerSourceExpiring, - #[serde(rename = "customer.source.updated")] - CustomerSourceUpdated, - #[serde(rename = "customer.subscription.created")] - CustomerSubscriptionCreated, - #[serde(rename = "customer.subscription.deleted")] - CustomerSubscriptionDeleted, - #[serde(rename = "customer.subscription.paused")] - CustomerSubscriptionPaused, - #[serde(rename = "customer.subscription.pending_update_applied")] - CustomerSubscriptionPendingUpdateApplied, - #[serde(rename = "customer.subscription.pending_update_expired")] - CustomerSubscriptionPendingUpdateExpired, - #[serde(rename = "customer.subscription.resumed")] - CustomerSubscriptionResumed, - #[serde(rename = "customer.subscription.trial_will_end")] - CustomerSubscriptionTrialWillEnd, - #[serde(rename = "customer.subscription.updated")] - CustomerSubscriptionUpdated, - #[serde(rename = "customer.tax_id.created")] - CustomerTaxIdCreated, - #[serde(rename = "customer.tax_id.deleted")] - CustomerTaxIdDeleted, - #[serde(rename = "customer.tax_id.updated")] - CustomerTaxIdUpdated, - #[serde(rename = "customer.updated")] - CustomerUpdated, - #[serde(rename = "customer_cash_balance_transaction.created")] - CustomerCashBalanceTransactionCreated, - #[serde(rename = "file.created")] - FileCreated, - #[serde(rename = "financial_connections.account.created")] - FinancialConnectionsAccountCreated, - #[serde(rename = "financial_connections.account.deactivated")] - FinancialConnectionsAccountDeactivated, - #[serde(rename = "financial_connections.account.disconnected")] - FinancialConnectionsAccountDisconnected, - #[serde(rename = "financial_connections.account.reactivated")] - FinancialConnectionsAccountReactivated, - #[serde(rename = "financial_connections.account.refreshed_balance")] - FinancialConnectionsAccountRefreshedBalance, - #[serde(rename = "identity.verification_session.canceled")] - IdentityVerificationSessionCanceled, - #[serde(rename = "identity.verification_session.created")] - IdentityVerificationSessionCreated, - #[serde(rename = "identity.verification_session.processing")] - IdentityVerificationSessionProcessing, - #[serde(rename = "identity.verification_session.redacted")] - IdentityVerificationSessionRedacted, - #[serde(rename = "identity.verification_session.requires_input")] - IdentityVerificationSessionRequiresInput, - #[serde(rename = "identity.verification_session.verified")] - IdentityVerificationSessionVerified, - #[serde(rename = "invoice.created")] - InvoiceCreated, - #[serde(rename = "invoice.deleted")] - InvoiceDeleted, - #[serde(rename = "invoice.finalization_failed")] - InvoiceFinalizationFailed, - #[serde(rename = "invoice.finalized")] - InvoiceFinalized, - #[serde(rename = "invoice.marked_uncollectible")] - InvoiceMarkedUncollectible, - #[serde(rename = "invoice.paid")] - InvoicePaid, - #[serde(rename = "invoice.payment_action_required")] - InvoicePaymentActionRequired, - #[serde(rename = "invoice.payment_failed")] - InvoicePaymentFailed, - #[serde(rename = "invoice.payment_succeeded")] - InvoicePaymentSucceeded, - #[serde(rename = "invoice.sent")] - InvoiceSent, - #[serde(rename = "invoice.upcoming")] - InvoiceUpcoming, - #[serde(rename = "invoice.updated")] - InvoiceUpdated, - #[serde(rename = "invoice.voided")] - InvoiceVoided, - #[serde(rename = "invoiceitem.created")] - InvoiceitemCreated, - #[serde(rename = "invoiceitem.deleted")] - InvoiceitemDeleted, - #[serde(rename = "issuing_authorization.created")] - IssuingAuthorizationCreated, - #[serde(rename = "issuing_authorization.request")] - IssuingAuthorizationRequest, - #[serde(rename = "issuing_authorization.updated")] - IssuingAuthorizationUpdated, - #[serde(rename = "issuing_card.created")] - IssuingCardCreated, - #[serde(rename = "issuing_card.updated")] - IssuingCardUpdated, - #[serde(rename = "issuing_cardholder.created")] - IssuingCardholderCreated, - #[serde(rename = "issuing_cardholder.updated")] - IssuingCardholderUpdated, - #[serde(rename = "issuing_dispute.closed")] - IssuingDisputeClosed, - #[serde(rename = "issuing_dispute.created")] - IssuingDisputeCreated, - #[serde(rename = "issuing_dispute.funds_reinstated")] - IssuingDisputeFundsReinstated, - #[serde(rename = "issuing_dispute.submitted")] - IssuingDisputeSubmitted, - #[serde(rename = "issuing_dispute.updated")] - IssuingDisputeUpdated, - #[serde(rename = "issuing_transaction.created")] - IssuingTransactionCreated, - #[serde(rename = "issuing_transaction.updated")] - IssuingTransactionUpdated, - #[serde(rename = "mandate.updated")] - MandateUpdated, - #[serde(rename = "order.created")] - OrderCreated, - #[serde(rename = "payment_intent.amount_capturable_updated")] - PaymentIntentAmountCapturableUpdated, - #[serde(rename = "payment_intent.canceled")] - PaymentIntentCanceled, - #[serde(rename = "payment_intent.created")] - PaymentIntentCreated, - #[serde(rename = "payment_intent.partially_funded")] - PaymentIntentPartiallyFunded, - #[serde(rename = "payment_intent.payment_failed")] - PaymentIntentPaymentFailed, - #[serde(rename = "payment_intent.processing")] - PaymentIntentProcessing, - #[serde(rename = "payment_intent.requires_action")] - PaymentIntentRequiresAction, - #[serde(rename = "payment_intent.succeeded")] - PaymentIntentSucceeded, - #[serde(rename = "payment_link.created")] - PaymentLinkCreated, - #[serde(rename = "payment_link.updated")] - PaymentLinkUpdated, - #[serde(rename = "payment_method.attached")] - PaymentMethodAttached, - #[serde(rename = "payment_method.automatically_updated")] - PaymentMethodAutomaticallyUpdated, - #[serde(rename = "payment_method.detached")] - PaymentMethodDetached, - #[serde(rename = "payment_method.updated")] - PaymentMethodUpdated, - #[serde(rename = "payout.canceled")] - PayoutCanceled, - #[serde(rename = "payout.created")] - PayoutCreated, - #[serde(rename = "payout.failed")] - PayoutFailed, - #[serde(rename = "payout.paid")] - PayoutPaid, - #[serde(rename = "payout.reconciliation_completed")] - PayoutReconciliationCompleted, - #[serde(rename = "payout.updated")] - PayoutUpdated, - #[serde(rename = "person.created")] - PersonCreated, - #[serde(rename = "person.deleted")] - PersonDeleted, - #[serde(rename = "person.updated")] - PersonUpdated, - #[serde(rename = "plan.created")] - PlanCreated, - #[serde(rename = "plan.deleted")] - PlanDeleted, - #[serde(rename = "plan.updated")] - PlanUpdated, - #[serde(rename = "price.created")] - PriceCreated, - #[serde(rename = "price.deleted")] - PriceDeleted, - #[serde(rename = "price.updated")] - PriceUpdated, - #[serde(rename = "product.created")] - ProductCreated, - #[serde(rename = "product.deleted")] - ProductDeleted, - #[serde(rename = "product.updated")] - ProductUpdated, - #[serde(rename = "promotion_code.created")] - PromotionCodeCreated, - #[serde(rename = "promotion_code.updated")] - PromotionCodeUpdated, - #[serde(rename = "quote.accepted")] - QuoteAccepted, - #[serde(rename = "quote.canceled")] - QuoteCanceled, - #[serde(rename = "quote.created")] - QuoteCreated, - #[serde(rename = "quote.finalized")] - QuoteFinalized, - #[serde(rename = "radar.early_fraud_warning.created")] - RadarEarlyFraudWarningCreated, - #[serde(rename = "radar.early_fraud_warning.updated")] - RadarEarlyFraudWarningUpdated, - #[serde(rename = "recipient.created")] - RecipientCreated, - #[serde(rename = "recipient.deleted")] - RecipientDeleted, - #[serde(rename = "recipient.updated")] - RecipientUpdated, - #[serde(rename = "refund.created")] - RefundCreated, - #[serde(rename = "refund.updated")] - RefundUpdated, - #[serde(rename = "reporting.report_run.failed")] - ReportingReportRunFailed, - #[serde(rename = "reporting.report_run.succeeded")] - ReportingReportRunSucceeded, - #[serde(rename = "reporting.report_type.updated")] - ReportingReportTypeUpdated, - #[serde(rename = "review.closed")] - ReviewClosed, - #[serde(rename = "review.opened")] - ReviewOpened, - #[serde(rename = "setup_intent.canceled")] - SetupIntentCanceled, - #[serde(rename = "setup_intent.created")] - SetupIntentCreated, - #[serde(rename = "setup_intent.requires_action")] - SetupIntentRequiresAction, - #[serde(rename = "setup_intent.setup_failed")] - SetupIntentSetupFailed, - #[serde(rename = "setup_intent.succeeded")] - SetupIntentSucceeded, - #[serde(rename = "sigma.scheduled_query_run.created")] - SigmaScheduledQueryRunCreated, - #[serde(rename = "sku.created")] - SkuCreated, - #[serde(rename = "sku.deleted")] - SkuDeleted, - #[serde(rename = "sku.updated")] - SkuUpdated, - #[serde(rename = "source.canceled")] - SourceCanceled, - #[serde(rename = "source.chargeable")] - SourceChargeable, - #[serde(rename = "source.failed")] - SourceFailed, - #[serde(rename = "source.mandate_notification")] - SourceMandateNotification, - #[serde(rename = "source.refund_attributes_required")] - SourceRefundAttributesRequired, - #[serde(rename = "source.transaction.created")] - SourceTransactionCreated, - #[serde(rename = "source.transaction.updated")] - SourceTransactionUpdated, - #[serde(rename = "subscription_schedule.aborted")] - SubscriptionScheduleAborted, - #[serde(rename = "subscription_schedule.canceled")] - SubscriptionScheduleCanceled, - #[serde(rename = "subscription_schedule.completed")] - SubscriptionScheduleCompleted, - #[serde(rename = "subscription_schedule.created")] - SubscriptionScheduleCreated, - #[serde(rename = "subscription_schedule.expiring")] - SubscriptionScheduleExpiring, - #[serde(rename = "subscription_schedule.released")] - SubscriptionScheduleReleased, - #[serde(rename = "subscription_schedule.updated")] - SubscriptionScheduleUpdated, - #[serde(rename = "tax.settings.updated")] - TaxSettingsUpdated, - #[serde(rename = "tax_rate.created")] - TaxRateCreated, - #[serde(rename = "tax_rate.updated")] - TaxRateUpdated, - #[serde(rename = "terminal.reader.action_failed")] - TerminalReaderActionFailed, - #[serde(rename = "terminal.reader.action_succeeded")] - TerminalReaderActionSucceeded, - #[serde(rename = "test_helpers.test_clock.advancing")] - TestHelpersTestClockAdvancing, - #[serde(rename = "test_helpers.test_clock.created")] - TestHelpersTestClockCreated, - #[serde(rename = "test_helpers.test_clock.deleted")] - TestHelpersTestClockDeleted, - #[serde(rename = "test_helpers.test_clock.internal_failure")] - TestHelpersTestClockInternalFailure, - #[serde(rename = "test_helpers.test_clock.ready")] - TestHelpersTestClockReady, - #[serde(rename = "topup.canceled")] - TopupCanceled, - #[serde(rename = "topup.created")] - TopupCreated, - #[serde(rename = "topup.failed")] - TopupFailed, - #[serde(rename = "topup.reversed")] - TopupReversed, - #[serde(rename = "topup.succeeded")] - TopupSucceeded, - #[serde(rename = "transfer.created")] - TransferCreated, - #[serde(rename = "transfer.reversed")] - TransferReversed, - #[serde(rename = "transfer.updated")] - TransferUpdated, - #[serde(rename = "treasury.credit_reversal.created")] - TreasuryCreditReversalCreated, - #[serde(rename = "treasury.credit_reversal.posted")] - TreasuryCreditReversalPosted, - #[serde(rename = "treasury.debit_reversal.completed")] - TreasuryDebitReversalCompleted, - #[serde(rename = "treasury.debit_reversal.created")] - TreasuryDebitReversalCreated, - #[serde(rename = "treasury.debit_reversal.initial_credit_granted")] - TreasuryDebitReversalInitialCreditGranted, - #[serde(rename = "treasury.financial_account.closed")] - TreasuryFinancialAccountClosed, - #[serde(rename = "treasury.financial_account.created")] - TreasuryFinancialAccountCreated, - #[serde(rename = "treasury.financial_account.features_status_updated")] - TreasuryFinancialAccountFeaturesStatusUpdated, - #[serde(rename = "treasury.inbound_transfer.canceled")] - TreasuryInboundTransferCanceled, - #[serde(rename = "treasury.inbound_transfer.created")] - TreasuryInboundTransferCreated, - #[serde(rename = "treasury.inbound_transfer.failed")] - TreasuryInboundTransferFailed, - #[serde(rename = "treasury.inbound_transfer.succeeded")] - TreasuryInboundTransferSucceeded, - #[serde(rename = "treasury.outbound_payment.canceled")] - TreasuryOutboundPaymentCanceled, - #[serde(rename = "treasury.outbound_payment.created")] - TreasuryOutboundPaymentCreated, - #[serde(rename = "treasury.outbound_payment.expected_arrival_date_updated")] - TreasuryOutboundPaymentExpectedArrivalDateUpdated, - #[serde(rename = "treasury.outbound_payment.failed")] - TreasuryOutboundPaymentFailed, - #[serde(rename = "treasury.outbound_payment.posted")] - TreasuryOutboundPaymentPosted, - #[serde(rename = "treasury.outbound_payment.returned")] - TreasuryOutboundPaymentReturned, - #[serde(rename = "treasury.outbound_transfer.canceled")] - TreasuryOutboundTransferCanceled, - #[serde(rename = "treasury.outbound_transfer.created")] - TreasuryOutboundTransferCreated, - #[serde(rename = "treasury.outbound_transfer.expected_arrival_date_updated")] - TreasuryOutboundTransferExpectedArrivalDateUpdated, - #[serde(rename = "treasury.outbound_transfer.failed")] - TreasuryOutboundTransferFailed, - #[serde(rename = "treasury.outbound_transfer.posted")] - TreasuryOutboundTransferPosted, - #[serde(rename = "treasury.outbound_transfer.returned")] - TreasuryOutboundTransferReturned, - #[serde(rename = "treasury.received_credit.created")] - TreasuryReceivedCreditCreated, - #[serde(rename = "treasury.received_credit.failed")] - TreasuryReceivedCreditFailed, - #[serde(rename = "treasury.received_credit.succeeded")] - TreasuryReceivedCreditSucceeded, - #[serde(rename = "treasury.received_debit.created")] - TreasuryReceivedDebitCreated, -} - -impl EventFilter { - pub fn as_str(self) -> &'static str { - match self { - EventFilter::All => "*", - EventFilter::AccountApplicationAuthorized => "account.application.authorized", - EventFilter::AccountApplicationDeauthorized => "account.application.deauthorized", - EventFilter::AccountExternalAccountCreated => "account.external_account.created", - EventFilter::AccountExternalAccountDeleted => "account.external_account.deleted", - EventFilter::AccountExternalAccountUpdated => "account.external_account.updated", - EventFilter::AccountUpdated => "account.updated", - EventFilter::ApplicationFeeCreated => "application_fee.created", - EventFilter::ApplicationFeeRefundUpdated => "application_fee.refund.updated", - EventFilter::ApplicationFeeRefunded => "application_fee.refunded", - EventFilter::BalanceAvailable => "balance.available", - EventFilter::BillingPortalConfigurationCreated => { - "billing_portal.configuration.created" - } - EventFilter::BillingPortalConfigurationUpdated => { - "billing_portal.configuration.updated" - } - EventFilter::BillingPortalSessionCreated => "billing_portal.session.created", - EventFilter::CapabilityUpdated => "capability.updated", - EventFilter::CashBalanceFundsAvailable => "cash_balance.funds_available", - EventFilter::ChargeCaptured => "charge.captured", - EventFilter::ChargeDisputeClosed => "charge.dispute.closed", - EventFilter::ChargeDisputeCreated => "charge.dispute.created", - EventFilter::ChargeDisputeFundsReinstated => "charge.dispute.funds_reinstated", - EventFilter::ChargeDisputeFundsWithdrawn => "charge.dispute.funds_withdrawn", - EventFilter::ChargeDisputeUpdated => "charge.dispute.updated", - EventFilter::ChargeExpired => "charge.expired", - EventFilter::ChargeFailed => "charge.failed", - EventFilter::ChargePending => "charge.pending", - EventFilter::ChargeRefundUpdated => "charge.refund.updated", - EventFilter::ChargeRefunded => "charge.refunded", - EventFilter::ChargeSucceeded => "charge.succeeded", - EventFilter::ChargeUpdated => "charge.updated", - EventFilter::CheckoutSessionAsyncPaymentFailed => { - "checkout.session.async_payment_failed" - } - EventFilter::CheckoutSessionAsyncPaymentSucceeded => { - "checkout.session.async_payment_succeeded" - } - EventFilter::CheckoutSessionCompleted => "checkout.session.completed", - EventFilter::CheckoutSessionExpired => "checkout.session.expired", - EventFilter::CouponCreated => "coupon.created", - EventFilter::CouponDeleted => "coupon.deleted", - EventFilter::CouponUpdated => "coupon.updated", - EventFilter::CreditNoteCreated => "credit_note.created", - EventFilter::CreditNoteUpdated => "credit_note.updated", - EventFilter::CreditNoteVoided => "credit_note.voided", - EventFilter::CustomerCreated => "customer.created", - EventFilter::CustomerDeleted => "customer.deleted", - EventFilter::CustomerDiscountCreated => "customer.discount.created", - EventFilter::CustomerDiscountDeleted => "customer.discount.deleted", - EventFilter::CustomerDiscountUpdated => "customer.discount.updated", - EventFilter::CustomerSourceCreated => "customer.source.created", - EventFilter::CustomerSourceDeleted => "customer.source.deleted", - EventFilter::CustomerSourceExpiring => "customer.source.expiring", - EventFilter::CustomerSourceUpdated => "customer.source.updated", - EventFilter::CustomerSubscriptionCreated => "customer.subscription.created", - EventFilter::CustomerSubscriptionDeleted => "customer.subscription.deleted", - EventFilter::CustomerSubscriptionPaused => "customer.subscription.paused", - EventFilter::CustomerSubscriptionPendingUpdateApplied => { - "customer.subscription.pending_update_applied" - } - EventFilter::CustomerSubscriptionPendingUpdateExpired => { - "customer.subscription.pending_update_expired" - } - EventFilter::CustomerSubscriptionResumed => "customer.subscription.resumed", - EventFilter::CustomerSubscriptionTrialWillEnd => "customer.subscription.trial_will_end", - EventFilter::CustomerSubscriptionUpdated => "customer.subscription.updated", - EventFilter::CustomerTaxIdCreated => "customer.tax_id.created", - EventFilter::CustomerTaxIdDeleted => "customer.tax_id.deleted", - EventFilter::CustomerTaxIdUpdated => "customer.tax_id.updated", - EventFilter::CustomerUpdated => "customer.updated", - EventFilter::CustomerCashBalanceTransactionCreated => { - "customer_cash_balance_transaction.created" - } - EventFilter::FileCreated => "file.created", - EventFilter::FinancialConnectionsAccountCreated => { - "financial_connections.account.created" - } - EventFilter::FinancialConnectionsAccountDeactivated => { - "financial_connections.account.deactivated" - } - EventFilter::FinancialConnectionsAccountDisconnected => { - "financial_connections.account.disconnected" - } - EventFilter::FinancialConnectionsAccountReactivated => { - "financial_connections.account.reactivated" - } - EventFilter::FinancialConnectionsAccountRefreshedBalance => { - "financial_connections.account.refreshed_balance" - } - EventFilter::IdentityVerificationSessionCanceled => { - "identity.verification_session.canceled" - } - EventFilter::IdentityVerificationSessionCreated => { - "identity.verification_session.created" - } - EventFilter::IdentityVerificationSessionProcessing => { - "identity.verification_session.processing" - } - EventFilter::IdentityVerificationSessionRedacted => { - "identity.verification_session.redacted" - } - EventFilter::IdentityVerificationSessionRequiresInput => { - "identity.verification_session.requires_input" - } - EventFilter::IdentityVerificationSessionVerified => { - "identity.verification_session.verified" - } - EventFilter::InvoiceCreated => "invoice.created", - EventFilter::InvoiceDeleted => "invoice.deleted", - EventFilter::InvoiceFinalizationFailed => "invoice.finalization_failed", - EventFilter::InvoiceFinalized => "invoice.finalized", - EventFilter::InvoiceMarkedUncollectible => "invoice.marked_uncollectible", - EventFilter::InvoicePaid => "invoice.paid", - EventFilter::InvoicePaymentActionRequired => "invoice.payment_action_required", - EventFilter::InvoicePaymentFailed => "invoice.payment_failed", - EventFilter::InvoicePaymentSucceeded => "invoice.payment_succeeded", - EventFilter::InvoiceSent => "invoice.sent", - EventFilter::InvoiceUpcoming => "invoice.upcoming", - EventFilter::InvoiceUpdated => "invoice.updated", - EventFilter::InvoiceVoided => "invoice.voided", - EventFilter::InvoiceitemCreated => "invoiceitem.created", - EventFilter::InvoiceitemDeleted => "invoiceitem.deleted", - EventFilter::IssuingAuthorizationCreated => "issuing_authorization.created", - EventFilter::IssuingAuthorizationRequest => "issuing_authorization.request", - EventFilter::IssuingAuthorizationUpdated => "issuing_authorization.updated", - EventFilter::IssuingCardCreated => "issuing_card.created", - EventFilter::IssuingCardUpdated => "issuing_card.updated", - EventFilter::IssuingCardholderCreated => "issuing_cardholder.created", - EventFilter::IssuingCardholderUpdated => "issuing_cardholder.updated", - EventFilter::IssuingDisputeClosed => "issuing_dispute.closed", - EventFilter::IssuingDisputeCreated => "issuing_dispute.created", - EventFilter::IssuingDisputeFundsReinstated => "issuing_dispute.funds_reinstated", - EventFilter::IssuingDisputeSubmitted => "issuing_dispute.submitted", - EventFilter::IssuingDisputeUpdated => "issuing_dispute.updated", - EventFilter::IssuingTransactionCreated => "issuing_transaction.created", - EventFilter::IssuingTransactionUpdated => "issuing_transaction.updated", - EventFilter::MandateUpdated => "mandate.updated", - EventFilter::OrderCreated => "order.created", - EventFilter::PaymentIntentAmountCapturableUpdated => { - "payment_intent.amount_capturable_updated" - } - EventFilter::PaymentIntentCanceled => "payment_intent.canceled", - EventFilter::PaymentIntentCreated => "payment_intent.created", - EventFilter::PaymentIntentPartiallyFunded => "payment_intent.partially_funded", - EventFilter::PaymentIntentPaymentFailed => "payment_intent.payment_failed", - EventFilter::PaymentIntentProcessing => "payment_intent.processing", - EventFilter::PaymentIntentRequiresAction => "payment_intent.requires_action", - EventFilter::PaymentIntentSucceeded => "payment_intent.succeeded", - EventFilter::PaymentLinkCreated => "payment_link.created", - EventFilter::PaymentLinkUpdated => "payment_link.updated", - EventFilter::PaymentMethodAttached => "payment_method.attached", - EventFilter::PaymentMethodAutomaticallyUpdated => { - "payment_method.automatically_updated" - } - EventFilter::PaymentMethodDetached => "payment_method.detached", - EventFilter::PaymentMethodUpdated => "payment_method.updated", - EventFilter::PayoutCanceled => "payout.canceled", - EventFilter::PayoutCreated => "payout.created", - EventFilter::PayoutFailed => "payout.failed", - EventFilter::PayoutPaid => "payout.paid", - EventFilter::PayoutReconciliationCompleted => "payout.reconciliation_completed", - EventFilter::PayoutUpdated => "payout.updated", - EventFilter::PersonCreated => "person.created", - EventFilter::PersonDeleted => "person.deleted", - EventFilter::PersonUpdated => "person.updated", - EventFilter::PlanCreated => "plan.created", - EventFilter::PlanDeleted => "plan.deleted", - EventFilter::PlanUpdated => "plan.updated", - EventFilter::PriceCreated => "price.created", - EventFilter::PriceDeleted => "price.deleted", - EventFilter::PriceUpdated => "price.updated", - EventFilter::ProductCreated => "product.created", - EventFilter::ProductDeleted => "product.deleted", - EventFilter::ProductUpdated => "product.updated", - EventFilter::PromotionCodeCreated => "promotion_code.created", - EventFilter::PromotionCodeUpdated => "promotion_code.updated", - EventFilter::QuoteAccepted => "quote.accepted", - EventFilter::QuoteCanceled => "quote.canceled", - EventFilter::QuoteCreated => "quote.created", - EventFilter::QuoteFinalized => "quote.finalized", - EventFilter::RadarEarlyFraudWarningCreated => "radar.early_fraud_warning.created", - EventFilter::RadarEarlyFraudWarningUpdated => "radar.early_fraud_warning.updated", - EventFilter::RecipientCreated => "recipient.created", - EventFilter::RecipientDeleted => "recipient.deleted", - EventFilter::RecipientUpdated => "recipient.updated", - EventFilter::RefundCreated => "refund.created", - EventFilter::RefundUpdated => "refund.updated", - EventFilter::ReportingReportRunFailed => "reporting.report_run.failed", - EventFilter::ReportingReportRunSucceeded => "reporting.report_run.succeeded", - EventFilter::ReportingReportTypeUpdated => "reporting.report_type.updated", - EventFilter::ReviewClosed => "review.closed", - EventFilter::ReviewOpened => "review.opened", - EventFilter::SetupIntentCanceled => "setup_intent.canceled", - EventFilter::SetupIntentCreated => "setup_intent.created", - EventFilter::SetupIntentRequiresAction => "setup_intent.requires_action", - EventFilter::SetupIntentSetupFailed => "setup_intent.setup_failed", - EventFilter::SetupIntentSucceeded => "setup_intent.succeeded", - EventFilter::SigmaScheduledQueryRunCreated => "sigma.scheduled_query_run.created", - EventFilter::SkuCreated => "sku.created", - EventFilter::SkuDeleted => "sku.deleted", - EventFilter::SkuUpdated => "sku.updated", - EventFilter::SourceCanceled => "source.canceled", - EventFilter::SourceChargeable => "source.chargeable", - EventFilter::SourceFailed => "source.failed", - EventFilter::SourceMandateNotification => "source.mandate_notification", - EventFilter::SourceRefundAttributesRequired => "source.refund_attributes_required", - EventFilter::SourceTransactionCreated => "source.transaction.created", - EventFilter::SourceTransactionUpdated => "source.transaction.updated", - EventFilter::SubscriptionScheduleAborted => "subscription_schedule.aborted", - EventFilter::SubscriptionScheduleCanceled => "subscription_schedule.canceled", - EventFilter::SubscriptionScheduleCompleted => "subscription_schedule.completed", - EventFilter::SubscriptionScheduleCreated => "subscription_schedule.created", - EventFilter::SubscriptionScheduleExpiring => "subscription_schedule.expiring", - EventFilter::SubscriptionScheduleReleased => "subscription_schedule.released", - EventFilter::SubscriptionScheduleUpdated => "subscription_schedule.updated", - EventFilter::TaxSettingsUpdated => "tax.settings.updated", - EventFilter::TaxRateCreated => "tax_rate.created", - EventFilter::TaxRateUpdated => "tax_rate.updated", - EventFilter::TerminalReaderActionFailed => "terminal.reader.action_failed", - EventFilter::TerminalReaderActionSucceeded => "terminal.reader.action_succeeded", - EventFilter::TestHelpersTestClockAdvancing => "test_helpers.test_clock.advancing", - EventFilter::TestHelpersTestClockCreated => "test_helpers.test_clock.created", - EventFilter::TestHelpersTestClockDeleted => "test_helpers.test_clock.deleted", - EventFilter::TestHelpersTestClockInternalFailure => { - "test_helpers.test_clock.internal_failure" - } - EventFilter::TestHelpersTestClockReady => "test_helpers.test_clock.ready", - EventFilter::TopupCanceled => "topup.canceled", - EventFilter::TopupCreated => "topup.created", - EventFilter::TopupFailed => "topup.failed", - EventFilter::TopupReversed => "topup.reversed", - EventFilter::TopupSucceeded => "topup.succeeded", - EventFilter::TransferCreated => "transfer.created", - EventFilter::TransferReversed => "transfer.reversed", - EventFilter::TransferUpdated => "transfer.updated", - EventFilter::TreasuryCreditReversalCreated => "treasury.credit_reversal.created", - EventFilter::TreasuryCreditReversalPosted => "treasury.credit_reversal.posted", - EventFilter::TreasuryDebitReversalCompleted => "treasury.debit_reversal.completed", - EventFilter::TreasuryDebitReversalCreated => "treasury.debit_reversal.created", - EventFilter::TreasuryDebitReversalInitialCreditGranted => { - "treasury.debit_reversal.initial_credit_granted" - } - EventFilter::TreasuryFinancialAccountClosed => "treasury.financial_account.closed", - EventFilter::TreasuryFinancialAccountCreated => "treasury.financial_account.created", - EventFilter::TreasuryFinancialAccountFeaturesStatusUpdated => { - "treasury.financial_account.features_status_updated" - } - EventFilter::TreasuryInboundTransferCanceled => "treasury.inbound_transfer.canceled", - EventFilter::TreasuryInboundTransferCreated => "treasury.inbound_transfer.created", - EventFilter::TreasuryInboundTransferFailed => "treasury.inbound_transfer.failed", - EventFilter::TreasuryInboundTransferSucceeded => "treasury.inbound_transfer.succeeded", - EventFilter::TreasuryOutboundPaymentCanceled => "treasury.outbound_payment.canceled", - EventFilter::TreasuryOutboundPaymentCreated => "treasury.outbound_payment.created", - EventFilter::TreasuryOutboundPaymentExpectedArrivalDateUpdated => { - "treasury.outbound_payment.expected_arrival_date_updated" - } - EventFilter::TreasuryOutboundPaymentFailed => "treasury.outbound_payment.failed", - EventFilter::TreasuryOutboundPaymentPosted => "treasury.outbound_payment.posted", - EventFilter::TreasuryOutboundPaymentReturned => "treasury.outbound_payment.returned", - EventFilter::TreasuryOutboundTransferCanceled => "treasury.outbound_transfer.canceled", - EventFilter::TreasuryOutboundTransferCreated => "treasury.outbound_transfer.created", - EventFilter::TreasuryOutboundTransferExpectedArrivalDateUpdated => { - "treasury.outbound_transfer.expected_arrival_date_updated" - } - EventFilter::TreasuryOutboundTransferFailed => "treasury.outbound_transfer.failed", - EventFilter::TreasuryOutboundTransferPosted => "treasury.outbound_transfer.posted", - EventFilter::TreasuryOutboundTransferReturned => "treasury.outbound_transfer.returned", - EventFilter::TreasuryReceivedCreditCreated => "treasury.received_credit.created", - EventFilter::TreasuryReceivedCreditFailed => "treasury.received_credit.failed", - EventFilter::TreasuryReceivedCreditSucceeded => "treasury.received_credit.succeeded", - EventFilter::TreasuryReceivedDebitCreated => "treasury.received_debit.created", - } - } -} - -impl AsRef for EventFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for EventFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for EventFilter { - fn default() -> Self { - Self::All - } -} diff --git a/src/resources/invoice_ext.rs b/src/resources/invoice_ext.rs deleted file mode 100644 index 5d1f8daaf..000000000 --- a/src/resources/invoice_ext.rs +++ /dev/null @@ -1,96 +0,0 @@ -use serde::Serialize; - -use crate::client::{Client, Response}; -use crate::ids::{CouponId, CustomerId, InvoiceId, PlanId, SubscriptionId, SubscriptionItemId}; -use crate::params::{Metadata, SearchList, Timestamp}; -use crate::resources::{CollectionMethod, Invoice}; - -#[deprecated(since = "0.12.0")] -pub type InvoiceCollectionMethod = CollectionMethod; - -impl Invoice { - /// Retrieves the details of an upcoming invoice_id - /// - /// For more details see . - pub fn upcoming(client: &Client, params: RetrieveUpcomingInvoice) -> Response { - client.get_query("/invoices/upcoming", ¶ms) - } - - /// Pays an invoice. - /// - /// For more details see . - pub fn pay(client: &Client, invoice_id: &InvoiceId) -> Response { - client.post(&format!("/invoices/{}/pay", invoice_id)) - } - - /// Searches for an invoice. - /// - /// For more details see . - pub fn search(client: &Client, params: InvoiceSearchParams) -> Response> { - client.get_query("/invoices/search", params) - } -} - -#[derive(Clone, Debug, Serialize)] -pub struct RetrieveUpcomingInvoice { - pub customer: CustomerId, // this is a required param - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_items: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_prorate: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_proration_date: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_tax_percent: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_trial_end: Option, -} - -impl RetrieveUpcomingInvoice { - pub fn new(customer: CustomerId) -> Self { - RetrieveUpcomingInvoice { - customer, - coupon: None, - subscription: None, - subscription_items: None, - subscription_prorate: None, - subscription_proration_date: None, - subscription_tax_percent: None, - subscription_trial_end: None, - } - } -} - -#[derive(Clone, Debug, Serialize)] -pub struct SubscriptionItemFilter { - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub deleted: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, -} - -#[derive(Clone, Debug, Default, Serialize)] -pub struct InvoiceSearchParams<'a> { - pub query: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub page: Option, - pub expand: &'a [&'a str], -} - -impl<'a> InvoiceSearchParams<'a> { - pub fn new() -> InvoiceSearchParams<'a> { - InvoiceSearchParams { query: String::new(), limit: None, page: None, expand: &[] } - } -} diff --git a/src/resources/issuing_authorization_ext.rs b/src/resources/issuing_authorization_ext.rs deleted file mode 100644 index 8d262dc40..000000000 --- a/src/resources/issuing_authorization_ext.rs +++ /dev/null @@ -1,93 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of the `IssuingAuthorizationVerificationData` fields. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingAuthorizationCheck { - Match, - Mismatch, - NotProvided, -} - -impl std::default::Default for IssuingAuthorizationCheck { - fn default() -> Self { - Self::NotProvided - } -} - -/// An enum representing the possible values of the `IssuingAuthorization`'s `authorization_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingAuthorizationMethod { - KeyedIn, - Swipe, - Chip, - Contactless, - Online, -} - -impl std::default::Default for IssuingAuthorizationMethod { - fn default() -> Self { - Self::Online - } -} - -/// An enum representing the possible values of the `IssuingAuthorizationRequest`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingAuthorizationReason { - AuthenticationFailed, - AuthorizationControls, - CardActive, - CardInactive, - InsufficientFunds, - AccountComplianceDisabled, - AccountInactive, - SuspectedFraud, - WebhookApproved, - WebhookDeclined, - WebhookTimeout, -} - -impl std::default::Default for IssuingAuthorizationReason { - fn default() -> Self { - Self::AuthenticationFailed - } -} - -/// An enum representing the possible values of an `IssuingAuthorization`'s `wallet_provider` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingAuthorizationWalletProvider { - ApplePay, - GooglePay, - SamsungPay, -} - -impl IssuingAuthorizationWalletProvider { - pub fn as_str(self) -> &'static str { - match self { - IssuingAuthorizationWalletProvider::ApplePay => "apple_pay", - IssuingAuthorizationWalletProvider::GooglePay => "google_pay", - IssuingAuthorizationWalletProvider::SamsungPay => "samsung_pay", - } - } -} - -impl AsRef for IssuingAuthorizationWalletProvider { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingAuthorizationWalletProvider { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for IssuingAuthorizationWalletProvider { - fn default() -> Self { - Self::ApplePay - } -} diff --git a/src/resources/issuing_card_ext.rs b/src/resources/issuing_card_ext.rs deleted file mode 100644 index 3a304b29b..000000000 --- a/src/resources/issuing_card_ext.rs +++ /dev/null @@ -1,137 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `IssuingCardPin`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardPinStatus { - Active, - Blocked, -} - -impl IssuingCardPinStatus { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardPinStatus::Active => "active", - IssuingCardPinStatus::Blocked => "blocked", - } - } -} - -impl AsRef for IssuingCardPinStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardPinStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -/// An enum representing the possible values of an `IssuingCardShipping`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardShippingStatus { - Canceled, - Delivered, - Failure, - Pending, - Returned, - Shipped, -} - -impl IssuingCardShippingStatus { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardShippingStatus::Canceled => "canceled", - IssuingCardShippingStatus::Delivered => "delivered", - IssuingCardShippingStatus::Failure => "failure", - IssuingCardShippingStatus::Pending => "pending", - IssuingCardShippingStatus::Returned => "returned", - IssuingCardShippingStatus::Shipped => "shipped", - } - } -} - -impl AsRef for IssuingCardShippingStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardShippingStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -/// An enum representing the possible values of an `IssuingCardShipping`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardShippingType { - Bulk, - Individual, -} - -impl IssuingCardShippingType { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardShippingType::Bulk => "bulk", - IssuingCardShippingType::Individual => "individual", - } - } -} - -impl AsRef for IssuingCardShippingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardShippingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for IssuingCardShippingType { - fn default() -> Self { - Self::Individual - } -} - -/// An enum representing the possible values of an `IssuingCard`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardType { - Physical, - Virtual, -} - -impl IssuingCardType { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardType::Physical => "physical", - IssuingCardType::Virtual => "virtual", - } - } -} - -impl AsRef for IssuingCardType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for IssuingCardType { - fn default() -> Self { - Self::Physical - } -} diff --git a/src/resources/issuing_dispute_ext.rs b/src/resources/issuing_dispute_ext.rs deleted file mode 100644 index 850165ffe..000000000 --- a/src/resources/issuing_dispute_ext.rs +++ /dev/null @@ -1,69 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `IssuingDispute`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingDisputeReason { - Fraudulent, - Other, -} - -impl IssuingDisputeReason { - pub fn as_str(self) -> &'static str { - match self { - IssuingDisputeReason::Fraudulent => "fraudulent", - IssuingDisputeReason::Other => "other", - } - } -} - -impl AsRef for IssuingDisputeReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingDisputeReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -/// An enum representing the possible values of an `IssuingDispute`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingDisputeStatus { - Lost, - UnderReview, - Unsubmitted, - Won, -} - -impl IssuingDisputeStatus { - pub fn as_str(self) -> &'static str { - match self { - IssuingDisputeStatus::Lost => "lost", - IssuingDisputeStatus::UnderReview => "under_review", - IssuingDisputeStatus::Unsubmitted => "unsubmitted", - IssuingDisputeStatus::Won => "won", - } - } -} - -impl AsRef for IssuingDisputeStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingDisputeStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for IssuingDisputeStatus { - fn default() -> Self { - Self::Unsubmitted - } -} diff --git a/src/resources/issuing_merchant_data.rs b/src/resources/issuing_merchant_data.rs deleted file mode 100644 index da10ef759..000000000 --- a/src/resources/issuing_merchant_data.rs +++ /dev/null @@ -1,331 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "IssuingAuthorizationMerchantData". -#[derive(Clone, Debug, Deserialize, Default, Serialize)] -pub struct MerchantData { - /// Identifier assigned to the seller by the card brand. - pub network_id: String, - - /// A categorization of the seller's type of business. - /// - /// See the [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. - pub category: MerchantCategory, - - /// Name of the seller. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// City where the seller is located. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// State where the seller is located. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, - - /// Country where the seller is located. - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Postal code where the seller is located. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, -} - -/// An enum representing the industry of a merchant. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum MerchantCategory { - AcRefrigerationRepair, - AccountingBookkeepingServices, - AdvertisingServices, - AgriculturalCooperative, - AirlinesAirCarriers, - AirportsFlyingFields, - AmbulanceServices, - AmusementParksCarnivals, - AntiqueReproductions, - AntiqueShops, - Aquariums, - ArchitecturalSurveyingServices, - ArtDealersAndGalleries, - ArtistsSupplyAndCraftShops, - AutoAndHomeSupplyStores, - AutoBodyRepairShops, - AutoPaintShops, - AutoServiceShops, - AutomatedCashDisburse, - AutomatedFuelDispensers, - AutomobileAssociations, - AutomotivePartsAndAccessoriesStores, - AutomotiveTireStores, - BailAndBondPayments, - Bakeries, - BandsOrchestras, - BarberAndBeautyShops, - BettingCasinoGambling, - BicycleShops, - BilliardPoolEstablishments, - BoatDealers, - BoatRentalsAndLeases, - BookStores, - BooksPeriodicalsAndNewspapers, - BowlingAlleys, - BusLines, - BusinessSecretarialSchools, - BuyingShoppingServices, - CableSatelliteAndOtherPayTelevisionAndRadio, - CameraAndPhotographicSupplyStores, - CandyNutAndConfectioneryStores, - CarAndTruckDealersNewUsed, - CarAndTruckDealersUsedOnly, - CarRentalAgencies, - CarWashes, - CarpentryServices, - CarpetUpholsteryCleaning, - Caterers, - CharitableAndSocialServiceOrganizationsFundraising, - ChemicalsAndAlliedProducts, - ChidrensAndInfantsWearStores, - ChildCareServices, - ChiropodistsPodiatrists, - Chiropractors, - CigarStoresAndStands, - CivicSocialFraternalAssociations, - CleaningAndMaintenance, - ClothingRental, - CollegesUniversities, - CommercialEquipment, - CommercialFootwear, - CommercialPhotographyArtAndGraphics, - CommuterTransportAndFerries, - ComputerNetworkServices, - ComputerProgramming, - ComputerRepair, - ComputerSoftwareStores, - ComputersPeripheralsAndSoftware, - ConcreteWorkServices, - ConstructionMaterials, - ConsultingPublicRelations, - CorrespondenceSchools, - CosmeticStores, - CounselingServices, - CountryClubs, - CourierServices, - CourtCosts, - CreditReportingAgencies, - CruiseLines, - DairyProductsStores, - DanceHallStudiosSchools, - DatingEscortServices, - DentistsOrthodontists, - DepartmentStores, - DetectiveAgencies, - DirectMarketingCatalogMerchant, - DirectMarketingCombinationCatalogAndRetailMerchant, - DirectMarketingInboundTelemarketing, - DirectMarketingInsuranceServices, - DirectMarketingOther, - DirectMarketingOutboundTelemarketing, - DirectMarketingSubscription, - DirectMarketingTravel, - DiscountStores, - Doctors, - DoorToDoorSales, - DraperyWindowCoveringAndUpholsteryStores, - DrinkingPlaces, - DrugStoresAndPharmacies, - DrugsDrugProprietariesAndDruggistSundries, - DryCleaners, - DurableGoods, - DutyFreeStores, - EatingPlacesRestaurants, - EducationalServices, - ElectricRazorStores, - ElectricalPartsAndEquipment, - ElectricalServices, - ElectronicsRepairShops, - ElectronicsStores, - ElementarySecondarySchools, - EmploymentTempAgencies, - EquipmentRental, - ExterminatingServices, - FamilyClothingStores, - FastFoodRestaurants, - FinancialInstitutions, - FinesGovernmentAdministrativeEntities, - FireplaceFireplaceScreensAndAccessoriesStores, - FloorCoveringStores, - Florists, - FloristsSuppliesNurseryStockAndFlowers, - FreezerAndLockerMeatProvisioners, - FuelDealersNonAutomotive, - FuneralServicesCrematories, - FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, - FurnitureRepairRefinishing, - FurriersAndFurShops, - GeneralServices, - GiftCardNoveltyAndSouvenirShops, - GlassPaintAndWallpaperStores, - GlasswareCrystalStores, - GolfCoursesPublic, - GovernmentServices, - GroceryStoresSupermarkets, - HardwareEquipmentAndSupplies, - HardwareStores, - HealthAndBeautySpas, - HearingAidsSalesAndSupplies, - #[serde(rename = "heating_plumbing_a_c")] - HeatingPlumbingAC, - HobbyToyAndGameShops, - HomeSupplyWarehouseStores, - Hospitals, - HotelsMotelsAndResorts, - HouseholdApplianceStores, - IndustrialSupplies, - InformationRetrievalServices, - InsuranceDefault, - InsuranceUnderwritingPremiums, - IntraCompanyPurchases, - JewelryStoresWatchesClocksAndSilverwareStores, - LandscapingServices, - Laundries, - LaundryCleaningServices, - LegalServicesAttorneys, - LuggageAndLeatherGoodsStores, - LumberBuildingMaterialsStores, - ManualCashDisburse, - MarinasServiceAndSupplies, - MasonryStoneworkAndPlaster, - MassageParlors, - MedicalAndDentalLabs, - MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, - MedicalServices, - MembershipOrganizations, - MensAndBoysClothingAndAccessoriesStores, - MensWomensClothingStores, - MetalServiceCenters, - Miscellaneous, - MiscellaneousApparelAndAccessoryShops, - MiscellaneousAutoDealers, - MiscellaneousBusinessServices, - MiscellaneousFoodStores, - MiscellaneousGeneralMerchandise, - MiscellaneousGeneralServices, - MiscellaneousHomeFurnishingSpecialtyStores, - MiscellaneousPublishingAndPrinting, - MiscellaneousRecreationServices, - MiscellaneousRepairShops, - MiscellaneousSpecialtyRetail, - MobileHomeDealers, - MotionPictureTheaters, - MotorFreightCarriersAndTrucking, - MotorHomesDealers, - MotorVehicleSuppliesAndNewParts, - MotorcycleShopsAndDealers, - MotorcycleShopsDealers, - MusicStoresMusicalInstrumentsPianosAndSheetMusic, - NewsDealersAndNewsstands, - NonFiMoneyOrders, - NonFiStoredValueCardPurchaseLoad, - NondurableGoods, - NurseriesLawnAndGardenSupplyStores, - NursingPersonalCare, - OfficeAndCommercialFurniture, - OpticiansEyeglasses, - OptometristsOphthalmologist, - OrthopedicGoodsProstheticDevices, - Osteopaths, - PackageStoresBeerWineAndLiquor, - PaintsVarnishesAndSupplies, - ParkingLotsGarages, - PassengerRailways, - PawnShops, - PetShopsPetFoodAndSupplies, - PetroleumAndPetroleumProducts, - PhotoDeveloping, - PhotographicPhotocopyMicrofilmEquipmentAndSupplies, - PhotographicStudios, - PictureVideoProduction, - PieceGoodsNotionsAndOtherDryGoods, - PlumbingHeatingEquipmentAndSupplies, - PoliticalOrganizations, - PostalServicesGovernmentOnly, - PreciousStonesAndMetalsWatchesAndJewelry, - ProfessionalServices, - PublicWarehousingAndStorage, - QuickCopyReproAndBlueprint, - Railroads, - RealEstateAgentsAndManagersRentals, - RecordStores, - RecreationalVehicleRentals, - ReligiousGoodsStores, - ReligiousOrganizations, - RoofingSidingSheetMetal, - SecretarialSupportServices, - SecurityBrokersDealers, - ServiceStations, - SewingNeedleworkFabricAndPieceGoodsStores, - ShoeRepairHatCleaning, - ShoeStores, - SmallApplianceRepair, - SnowmobileDealers, - SpecialTradeServices, - SpecialtyCleaning, - SportingGoodsStores, - SportingRecreationCamps, - SportsAndRidingApparelStores, - SportsClubsFields, - StampAndCoinStores, - StationaryOfficeSuppliesPrintingAndWritingPaper, - StationeryStoresOfficeAndSchoolSupplyStores, - SwimmingPoolsSales, - TUiTravelGermany, - TailorsAlterations, - TaxPaymentsGovernmentAgencies, - TaxPreparationServices, - TaxicabsLimousines, - TelecommunicationEquipmentAndTelephoneSales, - TelecommunicationServices, - TelegraphServices, - TentAndAwningShops, - TestingLaboratories, - TheatricalTicketAgencies, - Timeshares, - TireRetreadingAndRepair, - TollsBridgeFees, - TouristAttractionsAndExhibits, - TowingServices, - TrailerParksCampgrounds, - TransportationServices, - TravelAgenciesTourOperators, - TruckStopIteration, - TruckUtilityTrailerRentals, - TypesettingPlateMakingAndRelatedServices, - TypewriterStores, - #[serde(rename = "u_s_federal_government_agencies_or_departments")] - USFederalGovernmentAgenciesOrDepartments, - UniformsCommercialClothing, - UsedMerchandiseAndSecondhandStores, - Utilities, - VarietyStores, - VeterinaryServices, - VideoAmusementGameSupplies, - VideoGameArcades, - VideoTapeRentalStores, - VocationalTradeSchools, - WatchJewelryRepair, - WeldingRepair, - WholesaleClubs, - WigAndToupeeStores, - WiresMoneyOrders, - WomensAccessoryAndSpecialtyShops, - WomensReadyToWearStores, - WreckingAndSalvageYards, -} - -impl std::default::Default for MerchantCategory { - fn default() -> Self { - Self::Miscellaneous - } -} diff --git a/src/resources/issuing_transaction_ext.rs b/src/resources/issuing_transaction_ext.rs deleted file mode 100644 index 16d9ecdca..000000000 --- a/src/resources/issuing_transaction_ext.rs +++ /dev/null @@ -1,44 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `IssuingTransaction`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingTransactionType { - Capture, - CashWithdrawal, - Dispute, - DisputeLoss, - Refund, - RefundReversal, -} - -impl IssuingTransactionType { - pub fn as_str(self) -> &'static str { - match self { - IssuingTransactionType::Capture => "capture", - IssuingTransactionType::CashWithdrawal => "cash_withdrawal", - IssuingTransactionType::Dispute => "dispute", - IssuingTransactionType::DisputeLoss => "dispute_loss", - IssuingTransactionType::Refund => "refund", - IssuingTransactionType::RefundReversal => "refund_reversal", - } - } -} - -impl AsRef for IssuingTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for IssuingTransactionType { - fn default() -> Self { - Self::Capture - } -} diff --git a/src/resources/line_item_ext.rs b/src/resources/line_item_ext.rs deleted file mode 100644 index 191805672..000000000 --- a/src/resources/line_item_ext.rs +++ /dev/null @@ -1,46 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, InvoiceId}; -use crate::resources::{Currency, InvoiceLineItem}; - -impl InvoiceLineItem { - /// Creates an invoice line item. - /// - /// For more details see . - pub fn create(client: &Client, params: CreateInvoiceLineItem<'_>) -> Response { - client.post_form("/invoiceitems", ¶ms) - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceLineItem<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - #[serde(skip_serializing_if = "Option::is_none")] - pub discountable: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option, -} - -impl CreateInvoiceLineItem<'_> { - pub fn new() -> Self { - CreateInvoiceLineItem { - amount: None, - currency: None, - customer: None, - description: None, - discountable: None, - invoice: None, - subscription: None, - } - } -} diff --git a/src/resources/login_links_ext.rs b/src/resources/login_links_ext.rs deleted file mode 100644 index e8a26cf26..000000000 --- a/src/resources/login_links_ext.rs +++ /dev/null @@ -1,26 +0,0 @@ -use serde::Serialize; - -use crate::client::{Client, Response}; -use crate::params::Expand; -use crate::resources::LoginLink; -use crate::AccountId; - -#[derive(Clone, Debug, Serialize)] -pub struct CreateLoginLink<'a> { - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Where to redirect the user after they log out of their dashboard. - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect_url: Option, -} - -impl LoginLink { - pub fn create(client: &Client, id: &AccountId, redirect_url: &str) -> Response { - let create_login_link = - CreateLoginLink { expand: &[], redirect_url: Some(redirect_url.to_string()) }; - - client.post_form(&format!("/accounts/{}/login_links", id), &create_login_link) - } -} diff --git a/src/resources/order_ext.rs b/src/resources/order_ext.rs deleted file mode 100644 index f18962171..000000000 --- a/src/resources/order_ext.rs +++ /dev/null @@ -1,34 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `ListOrders`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OrderStatusFilter { - Created, - Fulfilled, - Paid, - Refunded, -} - -impl OrderStatusFilter { - pub fn as_str(self) -> &'static str { - match self { - OrderStatusFilter::Created => "created", - OrderStatusFilter::Fulfilled => "fulfilled", - OrderStatusFilter::Paid => "paid", - OrderStatusFilter::Refunded => "refunded", - } - } -} - -impl AsRef for OrderStatusFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OrderStatusFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} diff --git a/src/resources/payment_intent_ext.rs b/src/resources/payment_intent_ext.rs deleted file mode 100644 index 4f18679dc..000000000 --- a/src/resources/payment_intent_ext.rs +++ /dev/null @@ -1,233 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::params::{Expandable, Metadata, SearchList}; -use crate::resources::{Currency, PaymentSource, Shipping}; -use crate::{PaymentIntent, PaymentIntentCancellationReason}; - -impl PaymentIntent { - /// Confirm that customer intends to pay with current or provided source. Upon confirmation, the PaymentIntent will attempt to initiate a payment. - /// - /// For more details see . - pub fn confirm( - client: &Client, - payment_intent_id: &str, - params: PaymentIntentConfirmParams<'_>, - ) -> Response { - client.post_form(&format!("/payment_intents/{}/confirm", payment_intent_id), params) - } - - /// Capture the funds of an existing uncaptured PaymentIntent where required_action="requires_capture". - /// - /// For more details see . - pub fn capture( - client: &Client, - payment_intent_id: &str, - params: CapturePaymentIntent, - ) -> Response { - client.post_form(&format!("/payment_intents/{}/capture", payment_intent_id), params) - } - - /// A PaymentIntent object can be canceled when it is in one of these statuses: requires_source, requires_capture, requires_confirmation, requires_source_action. - /// - /// For more details see . - pub fn cancel( - client: &Client, - payment_intent_id: &str, - params: CancelPaymentIntent, - ) -> Response { - client.post_form(&format!("/payment_intents/{}/cancel", payment_intent_id), params) - } - - /// Searches for a payment intent. - /// - /// For more details see . - pub fn search( - client: &Client, - params: PaymentIntentSearchParams, - ) -> Response> { - client.get_query("/payment_intents/search", params) - } -} -/// The resource representing a Stripe PaymentError object. -/// -/// For more details see . -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PaymentError { - #[serde(rename = "type")] - pub payment_error_type: PaymentErrorType, - pub charge: Option, - pub code: Option, - pub decline_code: Option, - pub doc_url: Option, - pub message: Option, - pub param: Option, - pub source: Option>, -} - -/// The resource representing a Stripe PaymentErrorType object. -/// -/// For more details see . -#[derive(Deserialize, Serialize, PartialEq, Debug, Clone, Eq)] -pub enum PaymentErrorType { - #[serde(rename = "api_error")] - Api, - #[serde(rename = "api_connection_error")] - Connection, - #[serde(rename = "authentication_error")] - Authentication, - #[serde(rename = "card_error")] - Card, - #[serde(rename = "idempotency_error")] - Idempotency, - #[serde(rename = "invalid_request_error")] - InvalidRequest, - #[serde(rename = "rate_limit_error")] - RateLimit, - - /// A variant not yet supported by the library. - /// It is an error to send `Other` as part of a request. - #[serde(other, skip_serializing)] - Other, -} - -// TODO: This might be moved to `PaymentSourceType` if we determine -// that all of the variants are _always_ the same. -// -// In that case this can be replaced with a deprecated type alias. -/// Represents the way a `PaymentIntent` needs to be fulfilled. -#[derive(Deserialize, Serialize, PartialEq, Debug, Clone, Eq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentMethodType { - /// This `PaymentIntent` needs to be fulfilled through credit card payment. - Card, - /// This `PaymentIntent` needs to be fulfilled through an - /// [iDeal](https://stripe.com/docs/payments/ideal) payment. - Ideal, - /// This `PaymentIntent` needs to be fulfilled through a - /// [Sepa Direct Debit](https://stripe.com/docs/payments/sepa-debit) payment. - SepaDebit, -} - -/// The resource representing a Stripe CaptureMethod object. -/// -/// For more details see . -#[derive(Deserialize, Serialize, PartialEq, Debug, Clone, Eq)] -#[serde(rename_all = "snake_case")] -pub enum CaptureMethod { - Automatic, - Manual, - - /// A variant not yet supported by the library. - /// It is an error to send `Other` as part of a request. - #[serde(other, skip_serializing)] - Other, -} -/// The resource representing a Stripe ConfirmationMethod object. -/// -/// For more details see . -#[derive(Deserialize, Serialize, PartialEq, Debug, Clone, Eq)] -#[serde(rename_all = "snake_case")] -pub enum ConfirmationMethod { - Secret, - Publishable, - - /// A variant not yet supported by the library. - /// It is an error to send `Other` as part of a request. - #[serde(other, skip_serializing)] - Other, -} - -#[derive(Deserialize, Serialize, PartialEq, Debug, Clone, Eq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentNextActionType { - RedirectToUrl, - UseStripeSdk, - - /// A variant not yet supported by the library. - /// It is an error to send `Other` as part of a request. - #[serde(other, skip_serializing)] - Other, -} - -/// The set of parameters that can be used when updating a payment_intent object. -/// -/// For more details see -#[derive(Clone, Debug, Default, Serialize)] -pub struct PaymentIntentUpdateParams<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option<&'a str>, - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_email: Option<&'a str>, - #[serde(skip_serializing_if = "Option::is_none")] - pub save_source_to_customer: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub source: Option<&'a str>, - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option<&'a str>, -} - -/// The set of parameters that can be used when confirming a payment_intent object. -/// -/// For more details see -#[derive(Clone, Debug, Default, Serialize)] -pub struct PaymentIntentConfirmParams<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_email: Option<&'a str>, - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option<&'a str>, - #[serde(skip_serializing_if = "Option::is_none")] - pub save_source_to_customer: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub source: Option<&'a str>, -} - -/// The set of parameters that can be used when capturing a payment_intent object. -/// -/// For more details see -#[derive(Clone, Debug, Default, Serialize)] -pub struct CapturePaymentIntent { - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_to_capture: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, -} - -/// The set of parameters that can be used when canceling a payment_intent object. -/// -/// For more details see -#[derive(Clone, Debug, Default, Serialize)] -pub struct CancelPaymentIntent { - #[serde(skip_serializing_if = "Option::is_none")] - pub cancellation_reason: Option, -} - -#[derive(Clone, Debug, Default, Serialize)] -pub struct PaymentIntentSearchParams<'a> { - pub query: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub page: Option, - pub expand: &'a [&'a str], -} - -impl<'a> PaymentIntentSearchParams<'a> { - pub fn new() -> PaymentIntentSearchParams<'a> { - PaymentIntentSearchParams { query: String::new(), limit: None, page: None, expand: &[] } - } -} diff --git a/src/resources/payment_method_ext.rs b/src/resources/payment_method_ext.rs deleted file mode 100644 index 9c7854386..000000000 --- a/src/resources/payment_method_ext.rs +++ /dev/null @@ -1,33 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, PaymentMethodId}; -use crate::resources::PaymentMethod; - -/// The parameters for `PaymentMethod::attach` -/// -/// For more details see . -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct AttachPaymentMethod { - pub customer: CustomerId, -} - -impl PaymentMethod { - /// Attach a payment method to a customer - /// - /// For more details see . - pub fn attach( - client: &Client, - payment_method_id: &PaymentMethodId, - params: AttachPaymentMethod, - ) -> Response { - client.post_form(&format!("/payment_methods/{}/attach", payment_method_id), params) - } - - /// Detach a PaymentMethod from a Customer - /// - /// For more details see . - pub fn detach(client: &Client, payment_method_id: &PaymentMethodId) -> Response { - client.post(&format!("/payment_methods/{}/detach", payment_method_id)) - } -} diff --git a/src/resources/payment_source.rs b/src/resources/payment_source.rs deleted file mode 100644 index 54198d4cc..000000000 --- a/src/resources/payment_source.rs +++ /dev/null @@ -1,111 +0,0 @@ -use serde::ser::SerializeStruct; -use serde::{Deserialize, Serialize}; - -use crate::ids::{PaymentSourceId, SourceId, TokenId}; -use crate::params::Object; -use crate::resources::{Account, BankAccount, Card, Currency, Source}; - -/// A PaymentSourceParams represents all of the supported ways that can -/// be used to creating a new customer with a payment method or creating -/// a payment method directly for a customer via `Customer::attach_source`. -/// -/// Not to be confused with `SourceParams` which is used by `Source::create` -/// to create a source that is not necessarily attached to a customer. -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PaymentSourceParams { - /// Creates a payment method (e.g. card or bank account) from tokenized data, - /// using a token typically received from Stripe Elements. - Token(TokenId), - - /// Attach an existing source to an existing customer or - /// create a new customer from an existing source. - Source(SourceId), -} - -/// A PaymentSource represents a payment method _associated with a customer or charge_. -/// This value is usually returned as a subresource on another request. -/// -/// Not to be confused with `Source` which represents a "generic" payment method -/// returned by the `Source::get` (which could still be a credit card, etc) -/// but is not necessarily attached to either a customer or charge. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(tag = "object", rename_all = "snake_case")] -pub enum PaymentSource { - Card(Card), - Source(Source), - Account(Account), - BankAccount(BankAccount), -} - -impl Object for PaymentSource { - type Id = PaymentSourceId; - fn id(&self) -> Self::Id { - match self { - PaymentSource::Card(x) => PaymentSourceId::Card(x.id()), - PaymentSource::Source(x) => PaymentSourceId::Source(x.id()), - PaymentSource::Account(x) => PaymentSourceId::Account(x.id()), - PaymentSource::BankAccount(x) => PaymentSourceId::BankAccount(x.id()), - } - } - fn object(&self) -> &'static str { - match self { - PaymentSource::Card(x) => x.object(), - PaymentSource::Source(x) => x.object(), - PaymentSource::Account(x) => x.object(), - PaymentSource::BankAccount(x) => x.object(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize)] -pub struct BankAccountParams<'a> { - pub country: &'a str, - pub currency: Currency, - pub account_holder_name: Option<&'a str>, - pub account_holder_type: Option<&'a str>, - pub routing_number: Option<&'a str>, - pub account_number: &'a str, -} - -impl<'a> serde::ser::Serialize for BankAccountParams<'a> { - fn serialize(&self, serializer: S) -> Result - where - S: serde::ser::Serializer, - { - let mut s = serializer.serialize_struct("BankAccountParams", 6)?; - s.serialize_field("object", "bank_account")?; - s.serialize_field("country", &self.country)?; - s.serialize_field("currency", &self.currency)?; - s.serialize_field("account_holder_name", &self.account_holder_name)?; - s.serialize_field("routing_number", &self.routing_number)?; - s.serialize_field("account_number", &self.account_number)?; - s.end() - } -} - -#[derive(Clone, Debug, Default, Deserialize)] -pub struct CardParams<'a> { - pub exp_month: &'a str, // eg. "12" - pub exp_year: &'a str, // eg. "17" or 2017" - - pub number: &'a str, // card number - pub name: Option<&'a str>, // cardholder's full name - pub cvc: Option<&'a str>, // card security code -} - -impl<'a> serde::ser::Serialize for CardParams<'a> { - fn serialize(&self, serializer: S) -> Result - where - S: serde::ser::Serializer, - { - let mut s = serializer.serialize_struct("CardParams", 6)?; - s.serialize_field("object", "card")?; - s.serialize_field("exp_month", &self.exp_month)?; - s.serialize_field("exp_year", &self.exp_year)?; - s.serialize_field("number", &self.number)?; - s.serialize_field("name", &self.name)?; - s.serialize_field("cvc", &self.cvc)?; - s.end() - } -} diff --git a/src/resources/payout_ext.rs b/src/resources/payout_ext.rs deleted file mode 100644 index 44689cef0..000000000 --- a/src/resources/payout_ext.rs +++ /dev/null @@ -1,42 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{PayoutDestinationId, PayoutId}; -use crate::params::Object; -use crate::resources::{BankAccount, Card, Payout}; - -impl Payout { - /// Cancels the payout. - /// - /// For more details see . - pub fn cancel(client: &Client, id: &PayoutId) -> Response { - client.post(&format!("/payouts/{}/cancel", id)) - } -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(untagged, rename_all = "snake_case")] -pub enum PayoutDestinationUnion { - BankAccount(BankAccount), - Card(Card), -} -impl std::default::Default for PayoutDestinationUnion { - fn default() -> Self { - Self::BankAccount(Default::default()) - } -} -impl Object for PayoutDestinationUnion { - type Id = PayoutDestinationId; - fn id(&self) -> Self::Id { - match self { - PayoutDestinationUnion::BankAccount(x) => PayoutDestinationId::BankAccount(x.id()), - PayoutDestinationUnion::Card(x) => PayoutDestinationId::Card(x.id()), - } - } - fn object(&self) -> &'static str { - match self { - PayoutDestinationUnion::BankAccount(x) => x.object(), - PayoutDestinationUnion::Card(x) => x.object(), - } - } -} diff --git a/src/resources/placeholders.rs b/src/resources/placeholders.rs deleted file mode 100644 index 55e891f79..000000000 --- a/src/resources/placeholders.rs +++ /dev/null @@ -1,34 +0,0 @@ -//! Structs of unknown origin that aren't picked -//! up by the codegen. - -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CountrySpecSupportedBankAccountCurrencies {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ExchangeRateRates {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationAmountDetails {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct NotificationEventData {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardInstallmentsPlan {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWallet {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RadarValueListItem {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionTransferData {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ThreeDSecureDetails {} diff --git a/src/resources/price_ext.rs b/src/resources/price_ext.rs deleted file mode 100644 index 549943697..000000000 --- a/src/resources/price_ext.rs +++ /dev/null @@ -1,29 +0,0 @@ -use serde::Serialize; - -use crate::params::SearchList; -use crate::{Client, Price, Response}; - -#[derive(Clone, Debug, Default, Serialize)] -pub struct PriceSearchParams<'a> { - pub query: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub page: Option, - pub expand: &'a [&'a str], -} - -impl<'a> PriceSearchParams<'a> { - pub fn new() -> PriceSearchParams<'a> { - PriceSearchParams { query: String::new(), limit: None, page: None, expand: &[] } - } -} - -impl Price { - /// Searches for a price. - /// - /// For more details see . - pub fn search(client: &Client, params: PriceSearchParams) -> Response> { - client.get_query("/prices/search", params) - } -} diff --git a/src/resources/product_ext.rs b/src/resources/product_ext.rs deleted file mode 100644 index 052136c92..000000000 --- a/src/resources/product_ext.rs +++ /dev/null @@ -1,29 +0,0 @@ -use serde::Serialize; - -use crate::params::SearchList; -use crate::{Client, Product, Response}; - -#[derive(Clone, Debug, Default, Serialize)] -pub struct ProductSearchParams<'a> { - pub query: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub page: Option, - pub expand: &'a [&'a str], -} - -impl<'a> ProductSearchParams<'a> { - pub fn new() -> ProductSearchParams<'a> { - ProductSearchParams { query: String::new(), limit: None, page: None, expand: &[] } - } -} - -impl Product { - /// Searches for a product. - /// - /// For more details see . - pub fn search(client: &Client, params: ProductSearchParams) -> Response> { - client.get_query("/products/search", params) - } -} diff --git a/src/resources/review_ext.rs b/src/resources/review_ext.rs deleted file mode 100644 index 9d68bd2ff..000000000 --- a/src/resources/review_ext.rs +++ /dev/null @@ -1,44 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `Review`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ReviewReason { - Approved, - Disputed, - Manual, - Refunded, - RefundedAsFraud, - Rule, -} - -impl ReviewReason { - pub fn as_str(self) -> &'static str { - match self { - ReviewReason::Approved => "approved", - ReviewReason::Disputed => "disputed", - ReviewReason::Manual => "manual", - ReviewReason::Refunded => "refunded", - ReviewReason::RefundedAsFraud => "refunded_as_fraud", - ReviewReason::Rule => "rule", - } - } -} - -impl AsRef for ReviewReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ReviewReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for ReviewReason { - fn default() -> Self { - Self::Approved - } -} diff --git a/src/resources/setup_intent_ext.rs b/src/resources/setup_intent_ext.rs deleted file mode 100644 index 1d89ec6c7..000000000 --- a/src/resources/setup_intent_ext.rs +++ /dev/null @@ -1,55 +0,0 @@ -use serde::Serialize; - -use crate::client::{Client, Response}; -use crate::resources::SetupIntent; -use crate::{SetupIntentCancellationReason, SetupIntentId}; - -#[derive(Clone, Debug, Serialize)] -pub struct ConfirmSetupIntent { - /// The client secret if on the client side - #[serde(skip_serializing_if = "Option::is_none")] - pub client_secret: Option, - - /// Specifies which payment method - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - //Mandate data and payment method options not implemented. If you want - //something better, create an issue and lets fix - /// Where to redirect the user after they log out of their dashboard. - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect_url: Option, -} - -/// The set of parameters that can be used when canceling a setup_intent object. -/// -/// For more details see -#[derive(Clone, Debug, Default, Serialize)] -pub struct CancelSetupIntent { - #[serde(skip_serializing_if = "Option::is_none")] - pub cancellation_reason: Option, -} - -impl SetupIntent { - pub fn confirm( - client: &Client, - setup_id: &SetupIntentId, - params: ConfirmSetupIntent, - ) -> Response { - client.post_form(&format!("/setup_intents/{}/confirm", setup_id), ¶ms) - } - - /// A SetupIntent object can be canceled when it is in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. - /// - /// For more details see . - pub fn cancel( - client: &Client, - setup_id: &SetupIntentId, - params: CancelSetupIntent, - ) -> Response { - client.post_form(&format!("/setup_intents/{}/cancel", setup_id), params) - } -} - -#[cfg(test)] -mod test {} diff --git a/src/resources/source_ext.rs b/src/resources/source_ext.rs deleted file mode 100644 index cb7c8c212..000000000 --- a/src/resources/source_ext.rs +++ /dev/null @@ -1,147 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `Source`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceStatus { - Canceled, - Chargeable, - Consumed, - Failed, - Pending, -} - -impl SourceStatus { - pub fn as_str(self) -> &'static str { - match self { - SourceStatus::Canceled => "canceled", - SourceStatus::Chargeable => "chargeable", - SourceStatus::Consumed => "consumed", - SourceStatus::Failed => "failed", - SourceStatus::Pending => "pending", - } - } -} - -impl AsRef for SourceStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for SourceStatus { - fn default() -> Self { - Self::Pending - } -} - -/// An enum representing the possible values of an `Source`'s `usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceUsage { - Reusable, - SingleUse, -} - -impl SourceUsage { - pub fn as_str(self) -> &'static str { - match self { - SourceUsage::Reusable => "reusable", - SourceUsage::SingleUse => "single_use", - } - } -} - -impl AsRef for SourceUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -/// An enum representing the possible values of an `SourceRedirectFlow`'s `failure_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceRedirectFlowFailureReason { - Declined, - ProcessingError, - UserAbort, -} - -impl SourceRedirectFlowFailureReason { - pub fn as_str(self) -> &'static str { - match self { - SourceRedirectFlowFailureReason::Declined => "declined", - SourceRedirectFlowFailureReason::ProcessingError => "processing_error", - SourceRedirectFlowFailureReason::UserAbort => "user_abort", - } - } -} - -impl AsRef for SourceRedirectFlowFailureReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceRedirectFlowFailureReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for SourceRedirectFlowFailureReason { - fn default() -> Self { - Self::Declined - } -} - -/// An enum representing the possible values of an `SourceRedirectFlow`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceRedirectFlowStatus { - Failed, - NotRequired, - Pending, - Succeeded, -} - -impl SourceRedirectFlowStatus { - pub fn as_str(self) -> &'static str { - match self { - SourceRedirectFlowStatus::Failed => "failed", - SourceRedirectFlowStatus::NotRequired => "not_required", - SourceRedirectFlowStatus::Pending => "pending", - SourceRedirectFlowStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for SourceRedirectFlowStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceRedirectFlowStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for SourceRedirectFlowStatus { - fn default() -> Self { - Self::Pending - } -} diff --git a/src/resources/subscription_ext.rs b/src/resources/subscription_ext.rs deleted file mode 100644 index c246564d5..000000000 --- a/src/resources/subscription_ext.rs +++ /dev/null @@ -1,62 +0,0 @@ -use serde::Serialize; - -use crate::client::{Client, Response}; -use crate::ids::SubscriptionId; -use crate::params::SearchList; -use crate::resources::{CreateSubscriptionItems, Subscription}; - -#[derive(Clone, Debug, Default, Serialize)] -pub struct CancelSubscription { - #[serde(skip_serializing_if = "Option::is_none")] - pub at_period_end: Option, -} - -impl CancelSubscription { - pub fn new() -> CancelSubscription { - CancelSubscription { at_period_end: None } - } -} - -#[derive(Clone, Debug, Default, Serialize)] -pub struct SubscriptionSearchParams<'a> { - pub query: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub page: Option, - pub expand: &'a [&'a str], -} - -impl<'a> SubscriptionSearchParams<'a> { - pub fn new() -> SubscriptionSearchParams<'a> { - SubscriptionSearchParams { query: String::new(), limit: None, page: None, expand: &[] } - } -} - -impl Subscription { - /// Cancels a subscription. - /// - /// For more details see . - pub fn cancel( - client: &Client, - subscription_id: &SubscriptionId, - params: CancelSubscription, - ) -> Response { - client.delete_query(&format!("/subscriptions/{}", subscription_id), params) - } - /// Searches for a subscription. - /// - /// For more details see . - pub fn search( - client: &Client, - params: SubscriptionSearchParams, - ) -> Response> { - client.get_query("/subscriptions/search", params) - } -} - -impl CreateSubscriptionItems { - pub fn new() -> Self { - Default::default() - } -} diff --git a/src/resources/token_ext.rs b/src/resources/token_ext.rs deleted file mode 100644 index e5b518ea2..000000000 --- a/src/resources/token_ext.rs +++ /dev/null @@ -1,40 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `Token`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TokenType { - Account, - BankAccount, - Card, - Pii, -} - -impl TokenType { - pub fn as_str(self) -> &'static str { - match self { - TokenType::Account => "account", - TokenType::BankAccount => "bank_account", - TokenType::Card => "card", - TokenType::Pii => "pii", - } - } -} - -impl AsRef for TokenType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TokenType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for TokenType { - fn default() -> Self { - Self::Account - } -} diff --git a/src/resources/transfer_reversal_ext.rs b/src/resources/transfer_reversal_ext.rs deleted file mode 100644 index aa7532845..000000000 --- a/src/resources/transfer_reversal_ext.rs +++ /dev/null @@ -1,35 +0,0 @@ -use serde::Deserialize; -use serde::Serialize; - -use crate::client::{Client, Response}; -use crate::params::Metadata; -use crate::resources::TransferReversal; -use crate::TransferId; - -/// The set of parameters that can be used when doing transfer reversal. -/// -/// For more details see . -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTransferReversal { - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_application_fee: Option, -} - -impl TransferReversal { - /// Create Transfer Reversal - /// - /// For more details see . - pub fn create( - client: &Client, - transfer: &TransferId, - params: CreateTransferReversal, - ) -> Response { - client.post_form(&format!("/transfers/{}/reversals", transfer), params) - } -} diff --git a/src/resources/types.rs b/src/resources/types.rs deleted file mode 100644 index 9e5bfa40a..000000000 --- a/src/resources/types.rs +++ /dev/null @@ -1,408 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::params::Timestamp; - -/// An enum representing the versions of the Stripe API. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ApiVersion { - #[serde(rename = "2011-01-01")] - V2011_01_01, - #[serde(rename = "2011-06-21")] - V2011_06_21, - #[serde(rename = "2011-06-28")] - V2011_06_28, - #[serde(rename = "2011-08-01")] - V2011_08_01, - #[serde(rename = "2011-09-15")] - V2011_09_15, - #[serde(rename = "2011-11-17")] - V2011_11_17, - #[serde(rename = "2012-02-23")] - V2012_02_23, - #[serde(rename = "2012-03-25")] - V2012_03_25, - #[serde(rename = "2012-06-18")] - V2012_06_18, - #[serde(rename = "2012-06-28")] - V2012_06_28, - #[serde(rename = "2012-07-09")] - V2012_07_09, - #[serde(rename = "2012-09-24")] - V2012_09_24, - #[serde(rename = "2012-10-26")] - V2012_10_26, - #[serde(rename = "2012-11-07")] - V2012_11_07, - #[serde(rename = "2013-02-11")] - V2013_02_11, - #[serde(rename = "2013-02-13")] - V2013_02_13, - #[serde(rename = "2013-07-05")] - V2013_07_05, - #[serde(rename = "2013-08-12")] - V2013_08_12, - #[serde(rename = "2013-08-13")] - V2013_08_13, - #[serde(rename = "2013-10-29")] - V2013_10_29, - #[serde(rename = "2013-12-03")] - V2013_12_03, - #[serde(rename = "2014-01-31")] - V2014_01_31, - #[serde(rename = "2014-03-13")] - V2014_03_13, - #[serde(rename = "2014-03-28")] - V2014_03_28, - #[serde(rename = "2014-05-19")] - V2014_05_19, - #[serde(rename = "2014-06-13")] - V2014_06_13, - #[serde(rename = "2014-06-17")] - V2014_06_17, - #[serde(rename = "2014-07-22")] - V2014_07_22, - #[serde(rename = "2014-07-26")] - V2014_07_26, - #[serde(rename = "2014-08-04")] - V2014_08_04, - #[serde(rename = "2014-08-20")] - V2014_08_20, - #[serde(rename = "2014-09-08")] - V2014_09_08, - #[serde(rename = "2014-10-07")] - V2014_10_07, - #[serde(rename = "2014-11-05")] - V2014_11_05, - #[serde(rename = "2014-11-20")] - V2014_11_20, - #[serde(rename = "2014-12-08")] - V2014_12_08, - #[serde(rename = "2014-12-17")] - V2014_12_17, - #[serde(rename = "2014-12-22")] - V2014_12_22, - #[serde(rename = "2015-01-11")] - V2015_01_11, - #[serde(rename = "2015-01-26")] - V2015_01_26, - #[serde(rename = "2015-02-10")] - V2015_02_10, - #[serde(rename = "2015-02-16")] - V2015_02_16, - #[serde(rename = "2015-02-18")] - V2015_02_18, - #[serde(rename = "2015-03-24")] - V2015_03_24, - #[serde(rename = "2015-04-07")] - V2015_04_07, - #[serde(rename = "2015-06-15")] - V2015_06_15, - #[serde(rename = "2015-07-07")] - V2015_07_07, - #[serde(rename = "2015-07-13")] - V2015_07_13, - #[serde(rename = "2015-07-28")] - V2015_07_28, - #[serde(rename = "2015-08-07")] - V2015_08_07, - #[serde(rename = "2015-08-19")] - V2015_08_19, - #[serde(rename = "2015-09-03")] - V2015_09_03, - #[serde(rename = "2015-09-08")] - V2015_09_08, - #[serde(rename = "2015-09-23")] - V2015_09_23, - #[serde(rename = "2015-10-01")] - V2015_10_01, - #[serde(rename = "2015-10-12")] - V2015_10_12, - #[serde(rename = "2015-10-16")] - V2015_10_16, - #[serde(rename = "2016-02-03")] - V2016_02_03, - #[serde(rename = "2016-02-19")] - V2016_02_19, - #[serde(rename = "2016-02-22")] - V2016_02_22, - #[serde(rename = "2016-02-23")] - V2016_02_23, - #[serde(rename = "2016-02-29")] - V2016_02_29, - #[serde(rename = "2016-03-07")] - V2016_03_07, - #[serde(rename = "2016-06-15")] - V2016_06_15, - #[serde(rename = "2016-07-06")] - V2016_07_06, - #[serde(rename = "2016-10-19")] - V2016_10_19, - #[serde(rename = "2017-01-27")] - V2017_01_27, - #[serde(rename = "2017-02-14")] - V2017_02_14, - #[serde(rename = "2017-04-06")] - V2017_04_06, - #[serde(rename = "2017-05-25")] - V2017_05_25, - #[serde(rename = "2017-06-05")] - V2017_06_05, - #[serde(rename = "2017-08-15")] - V2017_08_15, - #[serde(rename = "2017-12-14")] - V2017_12_14, - #[serde(rename = "2018-01-23")] - V2018_01_23, - #[serde(rename = "2018-02-05")] - V2018_02_05, - #[serde(rename = "2018-02-06")] - V2018_02_06, - #[serde(rename = "2018-02-28")] - V2018_02_28, - #[serde(rename = "2018-05-21")] - V2018_05_21, - #[serde(rename = "2018-07-27")] - V2018_07_27, - #[serde(rename = "2018-08-23")] - V2018_08_23, - #[serde(rename = "2018-09-06")] - V2018_09_06, - #[serde(rename = "2018-09-24")] - V2018_09_24, - #[serde(rename = "2018-10-31")] - V2018_10_31, - #[serde(rename = "2018-11-08")] - V2018_11_08, - #[serde(rename = "2019-02-11")] - V2019_02_11, - #[serde(rename = "2019-02-19")] - V2019_02_19, - #[serde(rename = "2019-03-14")] - V2019_03_14, - #[serde(rename = "2019-05-16")] - V2019_05_16, - #[serde(rename = "2019-08-14")] - V2019_08_14, - #[serde(rename = "2019-09-09")] - V2019_09_09, - #[serde(rename = "2020-08-27")] - V2020_08_27, - #[serde(rename = "2022-08-01")] - V2022_08_01, - #[serde(rename = "2022-11-15")] - V2022_11_15, - #[serde(rename = "2023-08-16")] - V2023_08_16, -} - -impl ApiVersion { - pub fn as_str(self) -> &'static str { - match self { - ApiVersion::V2011_01_01 => "2011-01-01", - ApiVersion::V2011_06_21 => "2011-06-21", - ApiVersion::V2011_06_28 => "2011-06-28", - ApiVersion::V2011_08_01 => "2011-08-01", - ApiVersion::V2011_09_15 => "2011-09-15", - ApiVersion::V2011_11_17 => "2011-11-17", - ApiVersion::V2012_02_23 => "2012-02-23", - ApiVersion::V2012_03_25 => "2012-03-25", - ApiVersion::V2012_06_18 => "2012-06-18", - ApiVersion::V2012_06_28 => "2012-06-28", - ApiVersion::V2012_07_09 => "2012-07-09", - ApiVersion::V2012_09_24 => "2012-09-24", - ApiVersion::V2012_10_26 => "2012-10-26", - ApiVersion::V2012_11_07 => "2012-11-07", - ApiVersion::V2013_02_11 => "2013-02-11", - ApiVersion::V2013_02_13 => "2013-02-13", - ApiVersion::V2013_07_05 => "2013-07-05", - ApiVersion::V2013_08_12 => "2013-08-12", - ApiVersion::V2013_08_13 => "2013-08-13", - ApiVersion::V2013_10_29 => "2013-10-29", - ApiVersion::V2013_12_03 => "2013-12-03", - ApiVersion::V2014_01_31 => "2014-01-31", - ApiVersion::V2014_03_13 => "2014-03-13", - ApiVersion::V2014_03_28 => "2014-03-28", - ApiVersion::V2014_05_19 => "2014-05-19", - ApiVersion::V2014_06_13 => "2014-06-13", - ApiVersion::V2014_06_17 => "2014-06-17", - ApiVersion::V2014_07_22 => "2014-07-22", - ApiVersion::V2014_07_26 => "2014-07-26", - ApiVersion::V2014_08_04 => "2014-08-04", - ApiVersion::V2014_08_20 => "2014-08-20", - ApiVersion::V2014_09_08 => "2014-09-08", - ApiVersion::V2014_10_07 => "2014-10-07", - ApiVersion::V2014_11_05 => "2014-11-05", - ApiVersion::V2014_11_20 => "2014-11-20", - ApiVersion::V2014_12_08 => "2014-12-08", - ApiVersion::V2014_12_17 => "2014-12-17", - ApiVersion::V2014_12_22 => "2014-12-22", - ApiVersion::V2015_01_11 => "2015-01-11", - ApiVersion::V2015_01_26 => "2015-01-26", - ApiVersion::V2015_02_10 => "2015-02-10", - ApiVersion::V2015_02_16 => "2015-02-16", - ApiVersion::V2015_02_18 => "2015-02-18", - ApiVersion::V2015_03_24 => "2015-03-24", - ApiVersion::V2015_04_07 => "2015-04-07", - ApiVersion::V2015_06_15 => "2015-06-15", - ApiVersion::V2015_07_07 => "2015-07-07", - ApiVersion::V2015_07_13 => "2015-07-13", - ApiVersion::V2015_07_28 => "2015-07-28", - ApiVersion::V2015_08_07 => "2015-08-07", - ApiVersion::V2015_08_19 => "2015-08-19", - ApiVersion::V2015_09_03 => "2015-09-03", - ApiVersion::V2015_09_08 => "2015-09-08", - ApiVersion::V2015_09_23 => "2015-09-23", - ApiVersion::V2015_10_01 => "2015-10-01", - ApiVersion::V2015_10_12 => "2015-10-12", - ApiVersion::V2015_10_16 => "2015-10-16", - ApiVersion::V2016_02_03 => "2016-02-03", - ApiVersion::V2016_02_19 => "2016-02-19", - ApiVersion::V2016_02_22 => "2016-02-22", - ApiVersion::V2016_02_23 => "2016-02-23", - ApiVersion::V2016_02_29 => "2016-02-29", - ApiVersion::V2016_03_07 => "2016-03-07", - ApiVersion::V2016_06_15 => "2016-06-15", - ApiVersion::V2016_07_06 => "2016-07-06", - ApiVersion::V2016_10_19 => "2016-10-19", - ApiVersion::V2017_01_27 => "2017-01-27", - ApiVersion::V2017_02_14 => "2017-02-14", - ApiVersion::V2017_04_06 => "2017-04-06", - ApiVersion::V2017_05_25 => "2017-05-25", - ApiVersion::V2017_06_05 => "2017-06-05", - ApiVersion::V2017_08_15 => "2017-08-15", - ApiVersion::V2017_12_14 => "2017-12-14", - ApiVersion::V2018_01_23 => "2018-01-23", - ApiVersion::V2018_02_05 => "2018-02-05", - ApiVersion::V2018_02_06 => "2018-02-06", - ApiVersion::V2018_02_28 => "2018-02-28", - ApiVersion::V2018_05_21 => "2018-05-21", - ApiVersion::V2018_07_27 => "2018-07-27", - ApiVersion::V2018_08_23 => "2018-08-23", - ApiVersion::V2018_09_06 => "2018-09-06", - ApiVersion::V2018_09_24 => "2018-09-24", - ApiVersion::V2018_10_31 => "2018-10-31", - ApiVersion::V2018_11_08 => "2018-11-08", - ApiVersion::V2019_02_11 => "2019-02-11", - ApiVersion::V2019_02_19 => "2019-02-19", - ApiVersion::V2019_03_14 => "2019-03-14", - ApiVersion::V2019_05_16 => "2019-05-16", - ApiVersion::V2019_08_14 => "2019-08-14", - ApiVersion::V2019_09_09 => "2019-09-09", - ApiVersion::V2020_08_27 => "2020-08-27", - ApiVersion::V2022_08_01 => "2022-08-01", - ApiVersion::V2022_11_15 => "2022-11-15", - ApiVersion::V2023_08_16 => "2023-08-16", - } - } -} - -impl AsRef for ApiVersion { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ApiVersion { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -/* Developers note -- DelayDays and DelayDaysOther are not worth the trouble - * to automate. Recommend letting the mapping stand*/ -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(untagged)] -pub enum DelayDays { - Days(u32), - Other(DelayDaysOther), -} - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum DelayDaysOther { - Minimum, -} - -impl DelayDays { - pub fn days(n: u32) -> Self { - DelayDays::Days(n) - } - pub fn minimum() -> Self { - DelayDays::Other(DelayDaysOther::Minimum) - } -} - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(untagged)] -pub enum Scheduled { - Timestamp(Timestamp), - Other(ScheduledOther), -} - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ScheduledOther { - Now, -} - -impl Scheduled { - pub fn at(ts: Timestamp) -> Self { - Scheduled::Timestamp(ts) - } - pub fn now() -> Self { - Scheduled::Other(ScheduledOther::Now) - } -} - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(untagged)] -pub enum UpTo { - Max(u64), - Other(UpToOther), -} - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpToOther { - Inf, -} - -impl UpTo { - pub fn max(n: u64) -> Self { - UpTo::Max(n) - } - pub fn now() -> Self { - UpTo::Other(UpToOther::Inf) - } -} - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(untagged)] -pub enum PaymentIntentOffSession { - Exists(bool), - Other(OffSessionOther), -} - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OffSessionOther { - #[serde(rename = "one_off")] - OneOff, - #[serde(rename = "recurring")] - Recurring, -} - -impl PaymentIntentOffSession { - pub fn exists(n: bool) -> Self { - PaymentIntentOffSession::Exists(n) - } - pub fn frequency(n: OffSessionOther) -> Self { - match n { - OffSessionOther::OneOff => PaymentIntentOffSession::Other(OffSessionOther::OneOff), - OffSessionOther::Recurring => { - PaymentIntentOffSession::Other(OffSessionOther::Recurring) - } - } - } -} diff --git a/src/resources/usage_record_ext.rs b/src/resources/usage_record_ext.rs deleted file mode 100644 index 07032e59b..000000000 --- a/src/resources/usage_record_ext.rs +++ /dev/null @@ -1,44 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::{Client, Response, SubscriptionItemId, Timestamp, UsageRecord}; - -impl UsageRecord { - pub fn create( - client: &Client, - subscription_item_id: &SubscriptionItemId, - params: CreateUsageRecord, - ) -> Response { - client.post_form( - &format!("/subscription_items/{}/usage_records", subscription_item_id), - ¶ms, - ) - } -} - -/// The parameters for `UsageRecord::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateUsageRecord { - /// The usage quantity for the specified timestamp. - pub quantity: u64, - /// Valid values are `increment` (default) or `set`. - /// When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. - /// The `set` action will overwrite the usage quantity at that timestamp. - /// If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), - /// `increment` is the only allowed value. - #[serde(skip_serializing_if = "Option::is_none")] - pub action: Option, - /// The timestamp for the usage event. - /// This timestamp must be within the current billing period of the subscription of the provided `subscription_item`, - /// and must not be in the future. When passing `"now"`, Stripe records usage for the current time. - /// Default is `"now"` if a value is not provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub timestamp: Option, -} - -/// An enum representing the possible values of a `UsageRecord`'s `account` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UsageRecordAction { - Increment, - Set, -} diff --git a/src/resources/webhook_endpoint_ext.rs b/src/resources/webhook_endpoint_ext.rs deleted file mode 100644 index 660d359cb..000000000 --- a/src/resources/webhook_endpoint_ext.rs +++ /dev/null @@ -1,30 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `WebhookEndpoint`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum WebhookEndpointStatus { - Disabled, - Enabled, -} - -impl WebhookEndpointStatus { - pub fn as_str(self) -> &'static str { - match self { - WebhookEndpointStatus::Disabled => "disabled", - WebhookEndpointStatus::Enabled => "enabled", - } - } -} - -impl AsRef for WebhookEndpointStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for WebhookEndpointStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} diff --git a/stripe_types/Cargo.toml b/stripe_types/Cargo.toml new file mode 100644 index 000000000..162a3e978 --- /dev/null +++ b/stripe_types/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "stripe_types" +version = "0.1.0" +edition = "2021" + +[dependencies] +serde = {workspace = true } +smol_str.workspace = true +serde_json.workspace = true + +[dev-dependencies] +serde_qs = "0.12.0" \ No newline at end of file diff --git a/src/resources/currency.rs b/stripe_types/src/currency.rs similarity index 92% rename from src/resources/currency.rs rename to stripe_types/src/currency.rs index 89d035982..1458122aa 100644 --- a/src/resources/currency.rs +++ b/stripe_types/src/currency.rs @@ -1,11 +1,9 @@ use serde::{Deserialize, Serialize}; -use crate::params::to_snakecase; - /// Currency is the list of supported currencies. /// /// For more details see . -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq, Hash)] +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq, Hash, Default)] pub enum Currency { #[serde(rename = "aed")] AED, // United Arab Emirates Dirham @@ -258,6 +256,7 @@ pub enum Currency { #[serde(rename = "ugx")] UGX, // Ugandan Shilling #[serde(rename = "usd")] + #[default] USD, // United States Dollar #[serde(rename = "uyu")] UYU, // Uruguayan Peso @@ -287,15 +286,9 @@ pub enum Currency { ZMW, // Zambian Kwacha } -impl Default for Currency { - fn default() -> Self { - Currency::USD - } -} - impl std::fmt::Display for Currency { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", to_snakecase(&format!("{:?}", self))) + write!(f, "{}", format!("{:?}", self).to_ascii_lowercase()) } } @@ -462,3 +455,35 @@ impl std::error::Error for ParseCurrencyError { "unknown currency code" } } + +#[cfg(test)] +mod tests { + use super::*; + #[test] + fn debug_currency() { + assert_eq!(format!("{:?}", Currency::AED), "AED"); + assert_eq!(format!("{:?}", Currency::USD), "USD"); + assert_eq!(format!("{:?}", Currency::ZMW), "ZMW"); + } + + #[test] + fn display_currency() { + assert_eq!(format!("{}", Currency::AED), "aed"); + assert_eq!(format!("{}", Currency::USD), "usd"); + assert_eq!(format!("{}", Currency::ZMW), "zmw"); + } + + #[test] + fn serialize_currency() { + assert_eq!(serde_json::to_string(&Currency::AED).unwrap(), "\"aed\""); + assert_eq!(serde_json::to_string(&Currency::USD).unwrap(), "\"usd\""); + assert_eq!(serde_json::to_string(&Currency::ZMW).unwrap(), "\"zmw\""); + } + + #[test] + fn deserialize_currency() { + assert_eq!(serde_json::from_str::("\"aed\"").unwrap(), Currency::AED); + assert_eq!(serde_json::from_str::("\"usd\"").unwrap(), Currency::USD); + assert_eq!(serde_json::from_str::("\"zmw\"").unwrap(), Currency::ZMW); + } +} diff --git a/stripe_types/src/expandable.rs b/stripe_types/src/expandable.rs new file mode 100644 index 000000000..282f769f9 --- /dev/null +++ b/stripe_types/src/expandable.rs @@ -0,0 +1,49 @@ +use serde::{Deserialize, Serialize}; + +use crate::Object; + +/// An id or object. +/// +/// By default stripe will return an id for most fields, but if more detail is +/// necessary the `expand` parameter can be provided to ask for the id to be +/// loaded as an object instead. +/// +/// For more details see . +#[derive(Clone, Debug, Serialize, Deserialize)] // TODO: Implement deserialize by hand for better error messages +#[serde(untagged)] +pub enum Expandable { + Id(T::Id), + Object(Box), +} + +impl Default for Expandable +where + T::Id: Default, +{ + fn default() -> Self { + Expandable::Id(Default::default()) + } +} + +impl Expandable { + pub fn is_object(&self) -> bool { + match self { + Expandable::Id(_) => false, + Expandable::Object(_) => true, + } + } + + pub fn as_object(&self) -> Option<&T> { + match self { + Expandable::Id(_) => None, + Expandable::Object(obj) => Some(obj), + } + } + + pub fn into_object(self) -> Option { + match self { + Expandable::Id(_) => None, + Expandable::Object(obj) => Some(*obj), + } + } +} diff --git a/stripe_types/src/ids.rs b/stripe_types/src/ids.rs new file mode 100644 index 000000000..43b17ec41 --- /dev/null +++ b/stripe_types/src/ids.rs @@ -0,0 +1,309 @@ +#[macro_export] +macro_rules! def_id_serde_impls { + ($struct_name:ident) => { + impl serde::Serialize for $struct_name { + fn serialize(&self, serializer: S) -> Result + where + S: serde::ser::Serializer, + { + self.as_str().serialize(serializer) + } + } + + impl<'de> serde::Deserialize<'de> for $struct_name { + fn deserialize(deserializer: D) -> Result + where + D: serde::de::Deserializer<'de>, + { + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + s.parse::().map_err(::serde::de::Error::custom) + } + } + }; +} + +#[macro_export] +macro_rules! def_id { + ($struct_name:ident) => { + #[derive(Clone, Debug, Default, Eq, PartialEq, Hash)] + pub struct $struct_name(smol_str::SmolStr); + + impl $struct_name { + /// Extracts a string slice containing the entire id. + #[inline] + pub fn as_str(&self) -> &str { + self.0.as_str() + } + } + + impl PartialEq for $struct_name { + fn eq(&self, other: &str) -> bool { + self.as_str() == other + } + } + + impl PartialEq<&str> for $struct_name { + fn eq(&self, other: &&str) -> bool { + self.as_str() == *other + } + } + + impl PartialEq for $struct_name { + fn eq(&self, other: &String) -> bool { + self.as_str() == other + } + } + + impl PartialOrd for $struct_name { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } + } + + impl Ord for $struct_name { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { + self.as_str().cmp(other.as_str()) + } + } + + impl AsRef for $struct_name { + fn as_ref(&self) -> &str { + self.as_str() + } + } + + impl std::ops::Deref for $struct_name { + type Target = str; + + fn deref(&self) -> &str { + self.as_str() + } + } + + impl std::fmt::Display for $struct_name { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.0.fmt(f) + } + } + + impl std::str::FromStr for $struct_name { + type Err = $crate::ParseIdError; + + fn from_str(s: &str) -> Result { + Ok($struct_name(s.into())) + } + } + + $crate::def_id_serde_impls!($struct_name); + }; + ($struct_name:ident, $prefix:literal $(| $alt_prefix:literal)*) => { + /// An id for the corresponding object type. + /// + /// This type _typically_ will not allocate and + /// therefore is usually cheaply clonable. + #[derive(Clone, Debug, Default, Eq, PartialEq, Hash)] + pub struct $struct_name(smol_str::SmolStr); + + impl $struct_name { + /// The valid prefixes of the id type (e.g. [`ch_`, `py_`\ for a `ChargeId`). + #[inline] + pub fn prefixes() -> &'static [&'static str] { + &[$prefix$(, $alt_prefix)*] + } + + /// Extracts a string slice containing the entire id. + #[inline] + pub fn as_str(&self) -> &str { + self.0.as_str() + } + + /// Check is provided prefix would be a valid prefix for id's of this type + pub fn is_valid_prefix(prefix: &str) -> bool { + prefix == $prefix $( || prefix == $alt_prefix )* + } + } + + impl PartialEq for $struct_name { + fn eq(&self, other: &str) -> bool { + self.as_str() == other + } + } + + impl PartialEq<&str> for $struct_name { + fn eq(&self, other: &&str) -> bool { + self.as_str() == *other + } + } + + impl PartialEq for $struct_name { + fn eq(&self, other: &String) -> bool { + self.as_str() == other + } + } + + impl PartialOrd for $struct_name { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } + } + + impl Ord for $struct_name { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { + self.as_str().cmp(other.as_str()) + } + } + + impl AsRef for $struct_name { + fn as_ref(&self) -> &str { + self.as_str() + } + } + + impl std::ops::Deref for $struct_name { + type Target = str; + + fn deref(&self) -> &str { + self.as_str() + } + } + + impl std::fmt::Display for $struct_name { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.0.fmt(f) + } + } + + impl std::str::FromStr for $struct_name { + type Err = $crate::ParseIdError; + + fn from_str(s: &str) -> Result { + if !s.starts_with($prefix) $( + && !s.starts_with($alt_prefix) + )* { + Err($crate::ParseIdError { + typename: stringify!($struct_name), + expected: stringify!(id to start with $prefix $(or $alt_prefix)*), + }) + } else { + Ok($struct_name(s.into())) + } + } + } + + $crate::def_id_serde_impls!($struct_name); + }; +} + +#[derive(Copy, Clone, Debug)] +pub struct ParseIdError { + pub typename: &'static str, + pub expected: &'static str, +} + +impl std::fmt::Display for ParseIdError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "invalid `{}`, expected {}", self.typename, self.expected) + } +} + +impl std::error::Error for ParseIdError { + fn description(&self) -> &str { + "error parsing an id" + } +} + +#[cfg(test)] +mod tests { + use std::fmt::{Debug, Display}; + use std::str::FromStr; + + use serde::de::DeserializeOwned; + use serde::Serialize; + + use crate::charge::ChargeId; + use crate::customer::CustomerId; + use crate::invoice::InvoiceId; + use crate::payment_method::PaymentMethodId; + use crate::price::PriceId; + use crate::product::ProductId; + use crate::refund::RefundId; + use crate::subscription::SubscriptionId; + + fn assert_ser_de_roundtrip(id: &str) + where + T: DeserializeOwned + Serialize + FromStr + Display + Debug, + ::Err: Debug, + { + let parsed_id = T::from_str(id).expect("Could not parse id"); + let ser = serde_json::to_string(&parsed_id).expect("Could not serialize id"); + let deser: T = serde_json::from_str(&ser).expect("Could not deserialize id"); + assert_eq!(deser.to_string(), id.to_string()); + } + + fn assert_deser_err(id: &str) { + let json_str = format!(r#""{}""#, id); + let deser: Result = serde_json::from_str(&json_str); + assert!(deser.is_err(), "Expected error, got {:?}", deser); + } + + #[test] + fn test_ser_de_roundtrip() { + // Single prefixes + for id in ["in_12345", "in_"] { + assert_ser_de_roundtrip::(id); + } + assert_ser_de_roundtrip::("price_abc"); + + // Case where multiple possible prefixes + for id in ["re_bcd", "pyr_123"] { + assert_ser_de_roundtrip::(id); + } + + // Case where id can be anything + for id in ["anything", ""] { + assert_ser_de_roundtrip::(id); + } + } + + #[test] + fn test_deser_err() { + // Single prefix + assert_deser_err::("in"); + + for id in ["sub", ""] { + assert_deser_err::(id); + } + + // Case where multiple possible prefixes + for id in ["abc_bcd", "pyr_123"] { + assert_deser_err::(id); + } + } + + #[test] + fn test_parse_customer() { + assert!("cus_123".parse::().is_ok()); + let bad_parse = "zzz_123".parse::(); + assert!(bad_parse.is_err()); + if let Err(err) = bad_parse { + assert_eq!( + format!("{}", err), + "invalid `CustomerId`, expected id to start with \"cus_\"" + ); + } + } + + #[test] + fn test_parse_charge() { + assert!("ch_123".parse::().is_ok()); + assert!("py_123".parse::().is_ok()); + let bad_parse = "zz_123".parse::(); + assert!(bad_parse.is_err()); + if let Err(err) = bad_parse { + assert_eq!( + format!("{}", err), + "invalid `ChargeId`, expected id to start with \"ch_\" or \"py_\"" + ); + } + } +} diff --git a/stripe_types/src/lib.rs b/stripe_types/src/lib.rs new file mode 100644 index 000000000..526f81489 --- /dev/null +++ b/stripe_types/src/lib.rs @@ -0,0 +1,23 @@ +#![recursion_limit = "128"] +// FIXME: could be worked around in the codegen +#![allow(clippy::large_enum_variant)] +// FIXME: probably fixable with better doc comment formatting, but stripe might also just have doc typos at times that break the regex +#![allow(rustdoc::broken_intra_doc_links)] + +mod currency; +mod expandable; +mod ids; +mod pagination; +mod params; + +pub use currency::{Currency, ParseCurrencyError}; +pub use expandable::*; +pub use generated::account::AccountId; +pub use generated::application::ApplicationId; +pub use generated::*; +pub use ids::*; +pub use pagination::*; +pub use params::*; + +// Allow generated code to use absolute paths starting with `stripe` instead of `crate` +extern crate self as stripe_types; diff --git a/stripe_types/src/pagination.rs b/stripe_types/src/pagination.rs new file mode 100644 index 000000000..1961372a0 --- /dev/null +++ b/stripe_types/src/pagination.rs @@ -0,0 +1,37 @@ +use serde::{Deserialize, Serialize}; + +/// Implemented by types which represent stripe objects. +pub trait Object { + /// The canonical id type for this object. + type Id; + /// The id of the object. + fn id(&self) -> Option<&str>; +} + +/// A single page of a cursor-paginated list of an object. +/// +/// For more details, see +#[derive(Debug, Serialize, Deserialize)] +pub struct List { + pub data: Vec, + pub has_more: bool, + pub total_count: Option, + pub url: String, +} + +impl Default for List { + fn default() -> Self { + List { data: Vec::new(), has_more: false, total_count: None, url: String::new() } + } +} + +impl Clone for List { + fn clone(&self) -> Self { + List { + data: self.data.clone(), + has_more: self.has_more, + total_count: self.total_count, + url: self.url.clone(), + } + } +} diff --git a/stripe_types/src/params.rs b/stripe_types/src/params.rs new file mode 100644 index 000000000..01ca65c76 --- /dev/null +++ b/stripe_types/src/params.rs @@ -0,0 +1,179 @@ +use std::collections::HashMap; + +use serde::{Deserializer, Serialize, Serializer}; + +use crate::account::AccountId; +use crate::application::ApplicationId; +use crate::ApiVersion; + +#[derive(Clone, Default)] +pub struct AppInfo { + pub name: String, + pub url: Option, + pub version: Option, +} + +#[derive(Copy, Clone, Eq, PartialEq, Debug)] +pub struct AlwaysTrue; + +impl serde::Serialize for AlwaysTrue { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_bool(true) + } +} + +impl<'de> serde::Deserialize<'de> for AlwaysTrue { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let bool_: bool = serde::Deserialize::deserialize(deserializer)?; + if !bool_ { + Err(serde::de::Error::custom("Expected value to always be `true`")) + } else { + Ok(AlwaysTrue) + } + } +} + +impl ToString for AppInfo { + /// Formats a plugin's 'App Info' into a string that can be added to the end of an User-Agent string. + /// + /// This formatting matches that of other libraries, and if changed then it should be changed everywhere. + fn to_string(&self) -> String { + match (&self.version, &self.url) { + (Some(a), Some(b)) => format!("{}/{} ({})", &self.name, a, b), + (Some(a), None) => format!("{}/{}", &self.name, a), + (None, Some(b)) => format!("{} ({})", &self.name, b), + _ => self.name.to_string(), + } + } +} + +#[derive(Clone)] +pub struct Headers { + pub stripe_version: ApiVersion, + pub user_agent: String, + + pub client_id: Option, + pub stripe_account: Option, +} + +impl Headers { + pub fn to_array(&self) -> [(&str, Option<&str>); 4] { + [ + ("Client-Id", self.client_id.as_deref()), + ("Stripe-Account", self.stripe_account.as_deref()), + ("Stripe-Version", Some(self.stripe_version.as_str())), + ("User-Agent", Some(&self.user_agent)), + ] + } +} + +pub type Metadata = HashMap; +pub type Timestamp = i64; + +#[derive(Copy, Clone, Debug, Serialize, Default)] +pub struct RangeBoundsTs { + pub gt: Option, + pub gte: Option, + pub lt: Option, + pub lte: Option, +} + +/// A set of generic request parameters that can be used on +/// list endpoints to filter their results by some timestamp. +#[derive(Copy, Clone, Debug, Serialize)] +#[serde(untagged)] +pub enum RangeQueryTs { + Exact(Timestamp), + Bounds(RangeBoundsTs), +} + +impl RangeQueryTs { + /// Filter results to exactly match a given value + pub fn eq(value: Timestamp) -> Self { + Self::Exact(value) + } + + /// Filter results to be after a given value + pub fn gt(value: Timestamp) -> Self { + Self::Bounds(RangeBoundsTs { gt: Some(value), ..Default::default() }) + } + + /// Filter results to be after or equal to a given value + pub fn gte(value: Timestamp) -> Self { + Self::Bounds(RangeBoundsTs { gte: Some(value), ..Default::default() }) + } + + /// Filter results to be before to a given value + pub fn lt(value: Timestamp) -> Self { + Self::Bounds(RangeBoundsTs { lt: Some(value), ..Default::default() }) + } + + /// Filter results to be before or equal to a given value + pub fn lte(value: Timestamp) -> Self { + Self::Bounds(RangeBoundsTs { lte: Some(value), ..Default::default() }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn urldecode(input: String) -> String { + input.replace("%5B", "[").replace("%5D", "]") + } + + // A smaller version of `ListCustomer`, used to test de/serialization of `RangeQueryTs` + #[derive(Clone, Debug, Default, serde::Serialize)] + struct TestListCustomer { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option, + } + + impl TestListCustomer { + fn new() -> Self { + Self::default() + } + } + + #[test] + fn serialize_range_query() { + let query = RangeQueryTs::Bounds(RangeBoundsTs { + gt: None, + gte: Some(1501598702), + lt: Some(1504233902), + lte: None, + }); + assert_eq!(urldecode(serde_qs::to_string(&query).unwrap()), "gte=1501598702<=1504233902"); + + let mut params = TestListCustomer::new(); + params.created = Some(RangeQueryTs::eq(1501598702)); + params.limit = Some(3); + assert_eq!(urldecode(serde_qs::to_string(¶ms).unwrap()), "created=1501598702&limit=3"); + + let mut params = TestListCustomer::new(); + params.created = Some(RangeQueryTs::gte(1501598702)); + params.limit = Some(3); + assert_eq!( + urldecode(serde_qs::to_string(¶ms).unwrap()), + "created[gte]=1501598702&limit=3" + ); + + let mut params = TestListCustomer::new(); + params.created = Some(query); + params.limit = Some(3); + let encoded = urldecode(serde_qs::to_string(¶ms).unwrap()); + assert_eq!(encoded, "created[gte]=1501598702&created[lt]=1504233902&limit=3"); + } +}