Skip to content

Commit

Permalink
Merge pull request #1318 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 Feb 2, 2024
2 parents 34ff3ed + 6897561 commit 41ba199
Show file tree
Hide file tree
Showing 20 changed files with 71 additions and 18 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 10.7.0 - 2024-02-01
* [#1317](https://github.com/stripe/stripe-ruby/pull/1317) Remove list method in child resources
* Removes list method mixin from child resources, as these methods always return `InvalidRequestError` and never succeed
* [#1311](https://github.com/stripe/stripe-ruby/pull/1311) Use the deprecation gem in search and clean up usage of the gem

## 10.7.0-beta.3 - 2024-01-25
* [#1313](https://github.com/stripe/stripe-ruby/pull/1313) Update generated code for beta
* Add support for `create_preview` method on resource `Invoice`
Expand All @@ -8,7 +13,6 @@
## 10.7.0-beta.2 - 2024-01-19
* [#1307](https://github.com/stripe/stripe-ruby/pull/1307) Beta: report raw request usage


## 10.7.0-beta.1 - 2024-01-12
* [#1309](https://github.com/stripe/stripe-ruby/pull/1309) Update generated code for beta
* [#1305](https://github.com/stripe/stripe-ruby/pull/1305) Update generated code for beta
Expand Down
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v794
v808
4 changes: 4 additions & 0 deletions lib/stripe/object_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,13 @@ def self.object_names_to_classes
Customer::OBJECT_NAME => Customer,
CustomerBalanceTransaction::OBJECT_NAME => CustomerBalanceTransaction,
CustomerCashBalanceTransaction::OBJECT_NAME => CustomerCashBalanceTransaction,
CustomerEntitlement::OBJECT_NAME => CustomerEntitlement,
CustomerEntitlementSummary::OBJECT_NAME => CustomerEntitlementSummary,
CustomerSession::OBJECT_NAME => CustomerSession,
Discount::OBJECT_NAME => Discount,
Dispute::OBJECT_NAME => Dispute,
Entitlements::Event::OBJECT_NAME => Entitlements::Event,
Entitlements::Feature::OBJECT_NAME => Entitlements::Feature,
EphemeralKey::OBJECT_NAME => EphemeralKey,
Event::OBJECT_NAME => Event,
ExchangeRate::OBJECT_NAME => ExchangeRate,
Expand Down
4 changes: 4 additions & 0 deletions lib/stripe/resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@
require "stripe/resources/customer"
require "stripe/resources/customer_balance_transaction"
require "stripe/resources/customer_cash_balance_transaction"
require "stripe/resources/customer_entitlement"
require "stripe/resources/customer_entitlement_summary"
require "stripe/resources/customer_session"
require "stripe/resources/discount"
require "stripe/resources/dispute"
require "stripe/resources/entitlements/event"
require "stripe/resources/entitlements/feature"
require "stripe/resources/ephemeral_key"
require "stripe/resources/event"
require "stripe/resources/exchange_rate"
Expand Down
1 change: 0 additions & 1 deletion lib/stripe/resources/application_fee_refund.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module Stripe
#
# Related guide: [Refunding application fees](https://stripe.com/docs/connect/destination-charges#refunding-app-fee)
class ApplicationFeeRefund < APIResource
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save

OBJECT_NAME = "fee_refund"
Expand Down
1 change: 0 additions & 1 deletion lib/stripe/resources/capability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ module Stripe
#
# Related guide: [Account capabilities](https://stripe.com/docs/connect/account-capabilities)
class Capability < APIResource
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save

OBJECT_NAME = "capability"
Expand Down
11 changes: 11 additions & 0 deletions lib/stripe/resources/customer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class Customer < APIResource

nested_resource_class_methods :balance_transaction, operations: %i[create retrieve update list]
nested_resource_class_methods :cash_balance_transaction, operations: %i[retrieve list]
nested_resource_class_methods :entitlement, operations: %i[list]
nested_resource_class_methods :tax_id, operations: %i[create retrieve delete list]

# Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new
Expand Down Expand Up @@ -141,6 +142,16 @@ def self.update_cash_balance(customer, params = {}, opts = {})
)
end

# Retrieve the entitlement summary for a customer
def self.retrieve_entitlement_summary(customer, params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/customers/%<customer>s/entitlement_summary", { customer: CGI.escape(customer) }),
params: params,
opts: opts
)
end

def test_helpers
TestHelpers.new(self)
end
Expand Down
1 change: 0 additions & 1 deletion lib/stripe/resources/customer_balance_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module Stripe
#
# Related guide: [Customer balance](https://stripe.com/docs/billing/customer/balance)
class CustomerBalanceTransaction < APIResource
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save

OBJECT_NAME = "customer_balance_transaction"
Expand Down
2 changes: 0 additions & 2 deletions lib/stripe/resources/customer_cash_balance_transaction.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ module Stripe
# represent when funds are moved into or out of this balance. This includes funding by the customer, allocation
# to payments, and refunds to the customer.
class CustomerCashBalanceTransaction < APIResource
extend Stripe::APIOperations::List

OBJECT_NAME = "customer_cash_balance_transaction"
end
end
9 changes: 9 additions & 0 deletions lib/stripe/resources/customer_entitlement.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
# A entitlement for a customer describes access to a feature.
class CustomerEntitlement < APIResource
OBJECT_NAME = "customer_entitlement"
end
end
9 changes: 9 additions & 0 deletions lib/stripe/resources/customer_entitlement_summary.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
# A summary of a customer's entitlements.
class CustomerEntitlementSummary < APIResource
OBJECT_NAME = "customer_entitlement_summary"
end
end
13 changes: 13 additions & 0 deletions lib/stripe/resources/entitlements/event.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
module Entitlements
# An entitlement event either grants or revokes an entitlement to a feature for a customer.
class Event < APIResource
extend Stripe::APIOperations::Create

OBJECT_NAME = "entitlements.event"
end
end
end
15 changes: 15 additions & 0 deletions lib/stripe/resources/entitlements/feature.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
module Entitlements
# A feature represents a monetizable ability or functionality in your system.
# Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer.
class Feature < APIResource
extend Stripe::APIOperations::Create
extend Stripe::APIOperations::List

OBJECT_NAME = "entitlements.feature"
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ module Stripe
module FinancialConnections
# A historical balance for the account on a particular day. It may be sourced from a balance snapshot provided by a financial institution, or inferred using transactions data.
class AccountInferredBalance < APIResource
extend Stripe::APIOperations::List

OBJECT_NAME = "financial_connections.account_inferred_balance"
end
end
Expand Down
2 changes: 0 additions & 2 deletions lib/stripe/resources/invoice_payment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
module Stripe
# The invoice payment object
class InvoicePayment < APIResource
extend Stripe::APIOperations::List

OBJECT_NAME = "invoice_payment"
end
end
1 change: 0 additions & 1 deletion lib/stripe/resources/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module Stripe
#
# Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/handling-api-verification#person-information)
class Person < APIResource
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save

OBJECT_NAME = "person"
Expand Down
2 changes: 0 additions & 2 deletions lib/stripe/resources/quote_preview_invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ module Stripe
#
# Related guide: [Send invoices to customers](https://stripe.com/docs/billing/invoices/sending)
class QuotePreviewInvoice < APIResource
extend Stripe::APIOperations::List

OBJECT_NAME = "quote_preview_invoice"
end
end
2 changes: 0 additions & 2 deletions lib/stripe/resources/quote_preview_subscription_schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

module Stripe
class QuotePreviewSubscriptionSchedule < APIResource
extend Stripe::APIOperations::List

OBJECT_NAME = "quote_preview_subscription_schedule"
end
end
1 change: 0 additions & 1 deletion lib/stripe/resources/reversal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ module Stripe
#
# Related guide: [Reversing transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#reversing-transfers)
class Reversal < APIResource
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save

OBJECT_NAME = "transfer_reversal"
Expand Down
1 change: 0 additions & 1 deletion lib/stripe/resources/tax_id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module Stripe
# Related guides: [Customer tax identification numbers](https://stripe.com/docs/billing/taxes/tax-ids), [Account tax IDs](https://stripe.com/docs/invoicing/connect#account-tax-ids)
class TaxId < APIResource
include Stripe::APIOperations::Delete
extend Stripe::APIOperations::List

OBJECT_NAME = "tax_id"

Expand Down

0 comments on commit 41ba199

Please sign in to comment.