Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add explicit attributes for fields in resources, and rbis for resources #1490

Merged
merged 10 commits into from
Dec 3, 2024

Conversation

helenye-stripe
Copy link
Contributor

@helenye-stripe helenye-stripe commented Nov 19, 2024

Why?

This is the first step in #1479 - this adds explicit attributes for fields in resources, and adds RBIs with type annotations for them. This is not yet ready for use as it does not define any methods, so I have not included the RBIs in the gemspec.

What?

I recommend reviewing this mostly through the codegen PR, as this is almost entirely generated changes.

Important notes:

  • There are a set of files that do not have any methods, and are returned solely in deprecated APIs. However, they are described in the return types for these methods, so I have added them and their corresponding RBIs. They are:
    • lib/stripe/resources/application.rb
    • lib/stripe/resources/billing/alert_triggered.rb
    • lib/stripe/resources/billing/meter_error_report.rb
    • lib/stripe/resources/connect_collection_transfer.rb
    • lib/stripe/resources/entitlements/active_entitlement_summary.rb
    • lib/stripe/resources/issuing/settlement.rb
    • lib/stripe/resources/quote_line.rb
    • lib/stripe/resources/reserve_transaction.rb
    • lib/stripe/resources/source_mandate_notification.rb
    • lib/stripe/resources/tax_deducted_at_source.rb
  • Added lib/stripe/resources/amount.rb and rbi/stripe/resources/amount.rbi because it is a type used in V2.
  • Added an additional step in StripeObject.add_accessors (lib/stripe/stripe_object.rb) to appropriately set instance variables upon creation.
  • Updated .rubocop.yml to ignore variable numbers, since we have field names in various conventions in the API.

@helenye-stripe helenye-stripe force-pushed the helenye-beta-fields branch 2 times, most recently from b1df5e1 to 853ccc6 Compare November 19, 2024 23:07
@helenye-stripe helenye-stripe changed the title Helenye beta fields Add explicit attributes for fields in resources, and rbis for resources Nov 20, 2024
@helenye-stripe helenye-stripe marked this pull request as ready for review November 20, 2024 04:29
Copy link
Member

@xavdid-stripe xavdid-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor formatting things, but no big concerns. looks awesome!

rbi/stripe/resources/treasury/transaction.rbi Outdated Show resolved Hide resolved
lib/stripe/resources/issuing/token.rb Show resolved Hide resolved
@helenye-stripe helenye-stripe merged commit 1c83fd3 into beta Dec 3, 2024
14 checks passed
@helenye-stripe helenye-stripe deleted the helenye-beta-fields branch December 3, 2024 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants