Skip to content

Commit

Permalink
Update generated code (new) (#1197)
Browse files Browse the repository at this point in the history
* Update generated code for v275

* Update generated code for v276

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] committed Mar 23, 2023
1 parent 980b7b0 commit 57f61c0
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 1 deletion.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v232
v276
2 changes: 2 additions & 0 deletions lib/stripe/object_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ def self.object_names_to_classes
Subscription::OBJECT_NAME => Subscription,
SubscriptionItem::OBJECT_NAME => SubscriptionItem,
SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule,
Tax::Calculation::OBJECT_NAME => Tax::Calculation,
Tax::Transaction::OBJECT_NAME => Tax::Transaction,
TaxCode::OBJECT_NAME => TaxCode,
TaxId::OBJECT_NAME => TaxId,
TaxRate::OBJECT_NAME => TaxRate,
Expand Down
2 changes: 2 additions & 0 deletions lib/stripe/resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@
require "stripe/resources/subscription"
require "stripe/resources/subscription_item"
require "stripe/resources/subscription_schedule"
require "stripe/resources/tax/calculation"
require "stripe/resources/tax/transaction"
require "stripe/resources/tax_code"
require "stripe/resources/tax_id"
require "stripe/resources/tax_rate"
Expand Down
31 changes: 31 additions & 0 deletions lib/stripe/resources/tax/calculation.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
module Tax
# A Tax `Calculation` allows you to calculate the tax to collect from your customer.
class Calculation < APIResource
extend Stripe::APIOperations::Create

OBJECT_NAME = "tax.calculation"

def list_line_items(params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end

def self.list_line_items(calculation, params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/tax/calculations/%<calculation>s/line_items", { calculation: CGI.escape(calculation) }),
params: params,
opts: opts
)
end
end
end
end
49 changes: 49 additions & 0 deletions lib/stripe/resources/tax/transaction.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
module Tax
# A Tax transaction records the tax collected from or refunded to your customer.
class Transaction < APIResource
extend Stripe::APIOperations::Create

OBJECT_NAME = "tax.transaction"

def list_line_items(params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/tax/transactions/%<transaction>s/line_items", { transaction: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end

def self.create_from_calculation(params = {}, opts = {})
request_stripe_object(
method: :post,
path: "/v1/tax/transactions/create_from_calculation",
params: params,
opts: opts
)
end

def self.create_reversal(params = {}, opts = {})
request_stripe_object(
method: :post,
path: "/v1/tax/transactions/create_reversal",
params: params,
opts: opts
)
end

def self.list_line_items(transaction, params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/tax/transactions/%<transaction>s/line_items", { transaction: CGI.escape(transaction) }),
params: params,
opts: opts
)
end
end
end
end

0 comments on commit 57f61c0

Please sign in to comment.