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

Open
wants to merge 8 commits into
base: beta
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ Metrics/ParameterLists:
- "lib/stripe/api_operations/request.rb"
- "lib/stripe/stripe_object.rb"

Naming/VariableNumber:
# We use a variety of variable number syntaxes
Enabled: false

Style/AccessModifierDeclarations:
EnforcedStyle: inline

Expand Down
10 changes: 10 additions & 0 deletions lib/stripe/object_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,20 @@ def self.object_names_to_classes
AccountNotice.object_name => AccountNotice,
AccountSession.object_name => AccountSession,
ApplePayDomain.object_name => ApplePayDomain,
Application.object_name => Application,
ApplicationFee.object_name => ApplicationFee,
ApplicationFeeRefund.object_name => ApplicationFeeRefund,
Apps::Secret.object_name => Apps::Secret,
Balance.object_name => Balance,
BalanceTransaction.object_name => BalanceTransaction,
BankAccount.object_name => BankAccount,
Billing::Alert.object_name => Billing::Alert,
Billing::AlertTriggered.object_name => Billing::AlertTriggered,
Billing::CreditBalanceSummary.object_name => Billing::CreditBalanceSummary,
Billing::CreditBalanceTransaction.object_name => Billing::CreditBalanceTransaction,
Billing::CreditGrant.object_name => Billing::CreditGrant,
Billing::Meter.object_name => Billing::Meter,
Billing::MeterErrorReport.object_name => Billing::MeterErrorReport,
Billing::MeterEvent.object_name => Billing::MeterEvent,
Billing::MeterEventAdjustment.object_name => Billing::MeterEventAdjustment,
Billing::MeterEventSummary.object_name => Billing::MeterEventSummary,
Expand All @@ -45,6 +48,7 @@ def self.object_names_to_classes
Climate::Product.object_name => Climate::Product,
Climate::Supplier.object_name => Climate::Supplier,
ConfirmationToken.object_name => ConfirmationToken,
ConnectCollectionTransfer.object_name => ConnectCollectionTransfer,
CountrySpec.object_name => CountrySpec,
Coupon.object_name => Coupon,
CreditNote.object_name => CreditNote,
Expand All @@ -56,6 +60,7 @@ def self.object_names_to_classes
Discount.object_name => Discount,
Dispute.object_name => Dispute,
Entitlements::ActiveEntitlement.object_name => Entitlements::ActiveEntitlement,
Entitlements::ActiveEntitlementSummary.object_name => Entitlements::ActiveEntitlementSummary,
Entitlements::Feature.object_name => Entitlements::Feature,
EphemeralKey.object_name => EphemeralKey,
Event.object_name => Event,
Expand Down Expand Up @@ -90,6 +95,7 @@ def self.object_names_to_classes
Issuing::FraudLiabilityDebit.object_name => Issuing::FraudLiabilityDebit,
Issuing::PersonalizationDesign.object_name => Issuing::PersonalizationDesign,
Issuing::PhysicalBundle.object_name => Issuing::PhysicalBundle,
Issuing::Settlement.object_name => Issuing::Settlement,
Issuing::Token.object_name => Issuing::Token,
Issuing::Transaction.object_name => Issuing::Transaction,
LineItem.object_name => LineItem,
Expand All @@ -112,6 +118,7 @@ def self.object_names_to_classes
ProductFeature.object_name => ProductFeature,
PromotionCode.object_name => PromotionCode,
Quote.object_name => Quote,
QuoteLine.object_name => QuoteLine,
QuotePreviewInvoice.object_name => QuotePreviewInvoice,
QuotePreviewSubscriptionSchedule.object_name => QuotePreviewSubscriptionSchedule,
Radar::EarlyFraudWarning.object_name => Radar::EarlyFraudWarning,
Expand All @@ -120,13 +127,15 @@ def self.object_names_to_classes
Refund.object_name => Refund,
Reporting::ReportRun.object_name => Reporting::ReportRun,
Reporting::ReportType.object_name => Reporting::ReportType,
ReserveTransaction.object_name => ReserveTransaction,
Reversal.object_name => Reversal,
Review.object_name => Review,
SetupAttempt.object_name => SetupAttempt,
SetupIntent.object_name => SetupIntent,
ShippingRate.object_name => ShippingRate,
Sigma::ScheduledQueryRun.object_name => Sigma::ScheduledQueryRun,
Source.object_name => Source,
SourceMandateNotification.object_name => SourceMandateNotification,
SourceTransaction.object_name => SourceTransaction,
Subscription.object_name => Subscription,
SubscriptionItem.object_name => SubscriptionItem,
Expand All @@ -140,6 +149,7 @@ def self.object_names_to_classes
Tax::Transaction.object_name => Tax::Transaction,
Tax::TransactionLineItem.object_name => Tax::TransactionLineItem,
TaxCode.object_name => TaxCode,
TaxDeductedAtSource.object_name => TaxDeductedAtSource,
TaxId.object_name => TaxId,
TaxRate.object_name => TaxRate,
Terminal::Configuration.object_name => Terminal::Configuration,
Expand Down
10 changes: 10 additions & 0 deletions lib/stripe/resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@
require "stripe/resources/account_notice"
require "stripe/resources/account_session"
require "stripe/resources/apple_pay_domain"
require "stripe/resources/application"
require "stripe/resources/application_fee"
require "stripe/resources/application_fee_refund"
require "stripe/resources/apps/secret"
require "stripe/resources/balance"
require "stripe/resources/balance_transaction"
require "stripe/resources/bank_account"
require "stripe/resources/billing/alert"
require "stripe/resources/billing/alert_triggered"
require "stripe/resources/billing/credit_balance_summary"
require "stripe/resources/billing/credit_balance_transaction"
require "stripe/resources/billing/credit_grant"
require "stripe/resources/billing/meter"
require "stripe/resources/billing/meter_error_report"
require "stripe/resources/billing/meter_event"
require "stripe/resources/billing/meter_event_adjustment"
require "stripe/resources/billing/meter_event_summary"
Expand All @@ -34,6 +37,7 @@
require "stripe/resources/climate/product"
require "stripe/resources/climate/supplier"
require "stripe/resources/confirmation_token"
require "stripe/resources/connect_collection_transfer"
require "stripe/resources/country_spec"
require "stripe/resources/coupon"
require "stripe/resources/credit_note"
Expand All @@ -45,6 +49,7 @@
require "stripe/resources/discount"
require "stripe/resources/dispute"
require "stripe/resources/entitlements/active_entitlement"
require "stripe/resources/entitlements/active_entitlement_summary"
require "stripe/resources/entitlements/feature"
require "stripe/resources/ephemeral_key"
require "stripe/resources/event"
Expand Down Expand Up @@ -78,6 +83,7 @@
require "stripe/resources/issuing/fraud_liability_debit"
require "stripe/resources/issuing/personalization_design"
require "stripe/resources/issuing/physical_bundle"
require "stripe/resources/issuing/settlement"
require "stripe/resources/issuing/token"
require "stripe/resources/issuing/transaction"
require "stripe/resources/line_item"
Expand All @@ -100,6 +106,7 @@
require "stripe/resources/product_feature"
require "stripe/resources/promotion_code"
require "stripe/resources/quote"
require "stripe/resources/quote_line"
require "stripe/resources/quote_preview_invoice"
require "stripe/resources/quote_preview_subscription_schedule"
require "stripe/resources/radar/early_fraud_warning"
Expand All @@ -108,13 +115,15 @@
require "stripe/resources/refund"
require "stripe/resources/reporting/report_run"
require "stripe/resources/reporting/report_type"
require "stripe/resources/reserve_transaction"
require "stripe/resources/reversal"
require "stripe/resources/review"
require "stripe/resources/setup_attempt"
require "stripe/resources/setup_intent"
require "stripe/resources/shipping_rate"
require "stripe/resources/sigma/scheduled_query_run"
require "stripe/resources/source"
require "stripe/resources/source_mandate_notification"
require "stripe/resources/source_transaction"
require "stripe/resources/subscription"
require "stripe/resources/subscription_item"
Expand All @@ -128,6 +137,7 @@
require "stripe/resources/tax/transaction"
require "stripe/resources/tax/transaction_line_item"
require "stripe/resources/tax_code"
require "stripe/resources/tax_deducted_at_source"
require "stripe/resources/tax_id"
require "stripe/resources/tax_rate"
require "stripe/resources/terminal/configuration"
Expand Down
Loading
Loading