Skip to content

Commit

Permalink
Merge pull request #966 from stripe/latest-codegen-beta
Browse files Browse the repository at this point in the history
Update generated code for beta
  • Loading branch information
stripe-openapi[bot] authored May 19, 2023
2 parents 08fc8ff + 6cef804 commit 035ba16
Show file tree
Hide file tree
Showing 53 changed files with 1,068 additions and 321 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v316
v351
5 changes: 4 additions & 1 deletion stripe/api_resources/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
operations=["retrieve", "update", "list"],
resource_plural="capabilities",
)
@nested_resource_class_methods("login_link", operations=["create"])
@nested_resource_class_methods(
"login_link",
operations=["create"],
)
@nested_resource_class_methods(
"person",
operations=["create", "retrieve", "update", "delete", "list"],
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/account_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class AccountLink(CreateableAPIResource):
Account Links are the means by which a Connect platform grants a connected account permission to access
Stripe-hosted applications, such as Connect Onboarding.
Related guide: [Connect Onboarding](https://stripe.com/docs/connect/connect-onboarding).
Related guide: [Connect Onboarding](https://stripe.com/docs/connect/connect-onboarding)
"""

OBJECT_NAME = "account_link"
2 changes: 1 addition & 1 deletion stripe/api_resources/account_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AccountSession(CreateableAPIResource):
to your user. Do not save AccountSessions to your database as they expire relatively
quickly, and cannot be used more than once.
Related guide: [Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components).
Related guide: [Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components)
"""

OBJECT_NAME = "account_session"
2 changes: 1 addition & 1 deletion stripe/api_resources/application_fee_refund.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ApplicationFeeRefund(UpdateableAPIResource):
has previously been created but not yet refunded. Funds will be refunded to
the Stripe account from which the fee was originally collected.
Related guide: [Refunding Application Fees](https://stripe.com/docs/connect/destination-charges#refunding-app-fee).
Related guide: [Refunding application fees](https://stripe.com/docs/connect/destination-charges#refunding-app-fee)
"""

OBJECT_NAME = "fee_refund"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/apps/secret.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Secret(CreateableAPIResource, ListableAPIResource):
A `user` scoped secret is accessible by the app backend and one specific Dashboard user. Use the `user` scope for per-user secrets like per-user OAuth tokens, where different users might have different permissions.
Related guide: [Store data between page reloads](https://stripe.com/docs/stripe-apps/store-auth-data-custom-objects).
Related guide: [Store data between page reloads](https://stripe.com/docs/stripe-apps/store-auth-data-custom-objects)
"""

OBJECT_NAME = "apps.secret"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Balance(SingletonAPIResource):
The available and pending amounts for each currency are broken down further by
payment source types.
Related guide: [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances).
Related guide: [Understanding Connect account balances](https://stripe.com/docs/connect/account-balances)
"""

OBJECT_NAME = "balance"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/balance_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class BalanceTransaction(ListableAPIResource):
Balance transactions represent funds moving through your Stripe account.
They're created for every type of transaction that comes into or flows out of your Stripe account balance.
Related guide: [Balance Transaction Types](https://stripe.com/docs/reports/balance-transaction-types).
Related guide: [Balance transaction types](https://stripe.com/docs/reports/balance-transaction-types)
"""

OBJECT_NAME = "balance_transaction"
2 changes: 1 addition & 1 deletion stripe/api_resources/bank_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class BankAccount(DeletableAPIResource, UpdateableAPIResource, VerifyMixin):
destinations on `Account` objects for [Custom accounts](https://stripe.com/docs/connect/custom-accounts).
They can be bank accounts or debit cards as well, and are documented in the links above.
Related guide: [Bank Debits and Transfers](https://stripe.com/docs/payments/bank-debits-transfers).
Related guide: [Bank debits and transfers](https://stripe.com/docs/payments/bank-debits-transfers)
"""

OBJECT_NAME = "bank_account"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/capability.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Capability(UpdateableAPIResource):
"""
This is an object representing a capability for a Stripe account.
Related guide: [Account capabilities](https://stripe.com/docs/connect/account-capabilities).
Related guide: [Account capabilities](https://stripe.com/docs/connect/account-capabilities)
"""

OBJECT_NAME = "capability"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/card.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Card(DeletableAPIResource, UpdateableAPIResource):
later. You can also store multiple debit cards on a recipient in order to
transfer to those cards later.
Related guide: [Card Payments with Sources](https://stripe.com/docs/sources/cards).
Related guide: [Card payments with Sources](https://stripe.com/docs/sources/cards)
"""

OBJECT_NAME = "card"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/charge.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Charge(
retrieve and refund individual charges as well as list all charges. Charges
are identified by a unique, random ID.
Related guide: [Accept a payment with the Charges API](https://stripe.com/docs/payments/accept-a-payment-charges).
Related guide: [Accept a payment with the Charges API](https://stripe.com/docs/payments/accept-a-payment-charges)
"""

OBJECT_NAME = "charge"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/checkout/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Session(CreateableAPIResource, ListableAPIResource):
You can create a Checkout Session on your server and redirect to its URL
to begin Checkout.
Related guide: [Checkout Quickstart](https://stripe.com/docs/checkout/quickstart).
Related guide: [Checkout quickstart](https://stripe.com/docs/checkout/quickstart)
"""

OBJECT_NAME = "checkout.session"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/credit_note.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class CreditNote(
"""
Issue a credit note to adjust an invoice's amount after the invoice is finalized.
Related guide: [Credit Notes](https://stripe.com/docs/billing/invoices/credit-notes).
Related guide: [Credit notes](https://stripe.com/docs/billing/invoices/credit-notes)
"""

OBJECT_NAME = "credit_note"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Customer(
"""
This object represents a customer of your business. It lets you create recurring charges and track payments that belong to the same customer.
Related guide: [Save a card during payment](https://stripe.com/docs/payments/save-during-payment).
Related guide: [Save a card during payment](https://stripe.com/docs/payments/save-during-payment)
"""

OBJECT_NAME = "customer"
Expand Down
4 changes: 2 additions & 2 deletions stripe/api_resources/customer_balance_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

class CustomerBalanceTransaction(APIResource):
"""
Each customer has a [`balance`](https://stripe.com/docs/api/customers/object#customer_object-balance) value,
Each customer has a [Balance](https://stripe.com/docs/api/customers/object#customer_object-balance) value,
which denotes a debit or credit that's automatically applied to their next invoice upon finalization.
You may modify the value directly by using the [update customer API](https://stripe.com/docs/api/customers/update),
or by creating a Customer Balance Transaction, which increments or decrements the customer's `balance` by the specified `amount`.
Related guide: [Customer Balance](https://stripe.com/docs/billing/customer/balance) to learn more.
Related guide: [Customer balance](https://stripe.com/docs/billing/customer/balance)
"""

OBJECT_NAME = "customer_balance_transaction"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/dispute.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Dispute(ListableAPIResource, UpdateableAPIResource):
information about the dispute process in our [Disputes and
Fraud](https://stripe.com/docs/disputes) documentation.
Related guide: [Disputes and Fraud](https://stripe.com/docs/disputes).
Related guide: [Disputes and fraud](https://stripe.com/docs/disputes)
"""

OBJECT_NAME = "dispute"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class File(ListableAPIResource):
been created by Stripe (for example, the results of a [Sigma scheduled
query](https://stripe.com/docs/api#scheduled_queries)).
Related guide: [File Upload Guide](https://stripe.com/docs/file-upload).
Related guide: [File upload guide](https://stripe.com/docs/file-upload)
"""

OBJECT_NAME = "file"
Expand Down
67 changes: 66 additions & 1 deletion stripe/api_resources/financial_connections/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
from stripe.api_resources.abstract import nested_resource_class_methods


@nested_resource_class_methods("inferred_balance", operations=["list"])
@nested_resource_class_methods(
"inferred_balance",
operations=["list"],
)
class Account(ListableAPIResource):
"""
A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access.
Expand Down Expand Up @@ -107,3 +110,65 @@ def refresh_account(self, idempotency_key=None, **params):
idempotency_key=idempotency_key,
params=params,
)

@classmethod
def _cls_subscribe(
cls,
account,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"post",
"/v1/financial_connections/accounts/{account}/subscribe".format(
account=util.sanitize_id(account)
),
api_key=api_key,
stripe_version=stripe_version,
stripe_account=stripe_account,
params=params,
)

@util.class_method_variant("_cls_subscribe")
def subscribe(self, idempotency_key=None, **params):
return self._request(
"post",
"/v1/financial_connections/accounts/{account}/subscribe".format(
account=util.sanitize_id(self.get("id"))
),
idempotency_key=idempotency_key,
params=params,
)

@classmethod
def _cls_unsubscribe(
cls,
account,
api_key=None,
stripe_version=None,
stripe_account=None,
**params
):
return cls._static_request(
"post",
"/v1/financial_connections/accounts/{account}/unsubscribe".format(
account=util.sanitize_id(account)
),
api_key=api_key,
stripe_version=stripe_version,
stripe_account=stripe_account,
params=params,
)

@util.class_method_variant("_cls_unsubscribe")
def unsubscribe(self, idempotency_key=None, **params):
return self._request(
"post",
"/v1/financial_connections/accounts/{account}/unsubscribe".format(
account=util.sanitize_id(self.get("id"))
),
idempotency_key=idempotency_key,
params=params,
)
2 changes: 1 addition & 1 deletion stripe/api_resources/funding_instructions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class FundingInstructions(StripeObject):
automatically applied to future invoices and payments using the `customer_balance` payment method.
Customers can fund this balance by initiating a bank transfer to any account in the
`financial_addresses` field.
Related guide: [Customer Balance - Funding Instructions](https://stripe.com/docs/payments/customer-balance/funding-instructions) to learn more
Related guide: [Customer balance funding instructions](https://stripe.com/docs/payments/customer-balance/funding-instructions)
"""

OBJECT_NAME = "funding_instructions"
2 changes: 1 addition & 1 deletion stripe/api_resources/invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Invoice(
More details on the customer's credit balance are
[here](https://stripe.com/docs/billing/customer/balance).
Related guide: [Send Invoices to Customers](https://stripe.com/docs/billing/invoices/sending).
Related guide: [Send invoices to customers](https://stripe.com/docs/billing/invoices/sending)
"""

OBJECT_NAME = "invoice"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/issuing/authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Authorization(ListableAPIResource, UpdateableAPIResource):
object is created. [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the
purchase to be completed successfully.
Related guide: [Issued Card Authorizations](https://stripe.com/docs/issuing/purchases/authorizations).
Related guide: [Issued card authorizations](https://stripe.com/docs/issuing/purchases/authorizations)
"""

OBJECT_NAME = "issuing.authorization"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/issuing/cardholder.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Cardholder(
"""
An Issuing `Cardholder` object represents an individual or business entity who is [issued](https://stripe.com/docs/issuing) cards.
Related guide: [How to create a Cardholder](https://stripe.com/docs/issuing/cards#create-cardholder)
Related guide: [How to create a cardholder](https://stripe.com/docs/issuing/cards#create-cardholder)
"""

OBJECT_NAME = "issuing.cardholder"
2 changes: 1 addition & 1 deletion stripe/api_resources/issuing/dispute.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Dispute(
"""
As a [card issuer](https://stripe.com/docs/issuing), you can dispute transactions that the cardholder does not recognize, suspects to be fraudulent, or has other issues with.
Related guide: [Disputing Transactions](https://stripe.com/docs/issuing/purchases/disputes)
Related guide: [Issuing disputes](https://stripe.com/docs/issuing/purchases/disputes)
"""

OBJECT_NAME = "issuing.dispute"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/issuing/transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Transaction(ListableAPIResource, UpdateableAPIResource):
your Stripe account, such as a completed purchase or refund, is represented by an Issuing
`Transaction` object.
Related guide: [Issued Card Transactions](https://stripe.com/docs/issuing/purchases/transactions).
Related guide: [Issued card transactions](https://stripe.com/docs/issuing/purchases/transactions)
"""

OBJECT_NAME = "issuing.transaction"
2 changes: 1 addition & 1 deletion stripe/api_resources/payment_intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PaymentIntent(
throughout its lifetime as it interfaces with Stripe.js to perform
authentication flows and ultimately creates at most one successful charge.
Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents).
Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents)
"""

OBJECT_NAME = "payment_intent"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/payout.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Payout(
schedules](https://stripe.com/docs/connect/manage-payout-schedule), depending on your country and
industry.
Related guide: [Receiving Payouts](https://stripe.com/docs/payouts).
Related guide: [Receiving payouts](https://stripe.com/docs/payouts)
"""

OBJECT_NAME = "payout"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/person.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class Person(UpdateableAPIResource):
A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account.
See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform pre-filling and account onboarding steps.
Related guide: [Handling Identity Verification with the API](https://stripe.com/docs/connect/identity-verification-api#person-information).
Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/identity-verification-api#person-information)
"""

OBJECT_NAME = "person"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/radar/early_fraud_warning.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class EarlyFraudWarning(ListableAPIResource):
An early fraud warning indicates that the card issuer has notified us that a
charge may be fraudulent.
Related guide: [Early Fraud Warnings](https://stripe.com/docs/disputes/measuring#early-fraud-warnings).
Related guide: [Early fraud warnings](https://stripe.com/docs/disputes/measuring#early-fraud-warnings)
"""

OBJECT_NAME = "radar.early_fraud_warning"
2 changes: 1 addition & 1 deletion stripe/api_resources/radar/value_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class ValueList(
"""
Value lists allow you to group values together which can then be referenced in rules.
Related guide: [Default Stripe Lists](https://stripe.com/docs/radar/lists#managing-list-items).
Related guide: [Default Stripe lists](https://stripe.com/docs/radar/lists#managing-list-items)
"""

OBJECT_NAME = "radar.value_list"
2 changes: 1 addition & 1 deletion stripe/api_resources/radar/value_list_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ValueListItem(
"""
Value list items allow you to add specific values to a given Radar value list, which can then be used in rules.
Related guide: [Managing List Items](https://stripe.com/docs/radar/lists#managing-list-items).
Related guide: [Managing list items](https://stripe.com/docs/radar/lists#managing-list-items)
"""

OBJECT_NAME = "radar.value_list_item"
2 changes: 1 addition & 1 deletion stripe/api_resources/refund.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Refund(
but not yet refunded. Funds will be refunded to the credit or debit card that
was originally charged.
Related guide: [Refunds](https://stripe.com/docs/refunds).
Related guide: [Refunds](https://stripe.com/docs/refunds)
"""

OBJECT_NAME = "refund"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/reversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Reversal(UpdateableAPIResource):
transfer only if the destination account has enough balance to cover the
reversal.
Related guide: [Reversing Transfers](https://stripe.com/docs/connect/charges-transfers#reversing-transfers).
Related guide: [Reversing transfers](https://stripe.com/docs/connect/charges-transfers#reversing-transfers)
"""

OBJECT_NAME = "transfer_reversal"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/setup_intent.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class SetupIntent(
By using SetupIntents, you ensure that your customers experience the minimum set of required friction,
even as regulations change over time.
Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents).
Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents)
"""

OBJECT_NAME = "setup_intent"
Expand Down
2 changes: 1 addition & 1 deletion stripe/api_resources/subscription.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Subscription(
"""
Subscriptions allow you to charge a customer on a recurring basis.
Related guide: [Creating Subscriptions](https://stripe.com/docs/billing/subscriptions/creating).
Related guide: [Creating subscriptions](https://stripe.com/docs/billing/subscriptions/creating)
"""

OBJECT_NAME = "subscription"
Expand Down
Loading

0 comments on commit 035ba16

Please sign in to comment.