Skip to content

Commit

Permalink
Update generated code for v582
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Oct 5, 2023
1 parent 3285671 commit 0030faf
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v580
v582
20 changes: 19 additions & 1 deletion lib/stripe/resources/quote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Quote < APIResource

OBJECT_NAME = "quote"

nested_resource_class_methods :preview_invoice, operations: %i[list_lines list]
nested_resource_class_methods :preview_invoice, operations: %i[list]
nested_resource_class_methods :preview_subscription_schedule, operations: %i[list]

def accept(params = {}, opts = {})
Expand Down Expand Up @@ -99,6 +99,15 @@ def pdf(params = {}, opts = {}, &read_body_chunk_block)
)
end

def preview_invoice_lines(preview_invoice, params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(self["id"]), preview_invoice: CGI.escape(preview_invoice) }),
params: params,
opts: opts
)
end

def reestimate(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand Down Expand Up @@ -192,6 +201,15 @@ def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
)
end

def self.preview_invoice_lines(quote, preview_invoice, params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }),
params: params,
opts: opts
)
end

def self.reestimate(quote, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand Down
18 changes: 0 additions & 18 deletions lib/stripe/resources/quote_preview_invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,5 @@ class QuotePreviewInvoice < APIResource
extend Stripe::APIOperations::List

OBJECT_NAME = "quote_preview_invoice"

def list_lines(preview_invoice, params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(self["id"]), preview_invoice: CGI.escape(preview_invoice) }),
params: params,
opts: opts
)
end

def self.list_lines(quote, preview_invoice, params = {}, opts = {})
request_stripe_object(
method: :get,
path: format("/v1/quotes/%<quote>s/preview_invoices/%<preview_invoice>s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }),
params: params,
opts: opts
)
end
end
end
12 changes: 6 additions & 6 deletions test/stripe/generated_examples_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1832,6 +1832,12 @@ class CodegennedExampleTest < Test::Unit::TestCase
assert_requested :get, "#{Stripe.api_base}/v1/quotes/qt_xxxxxxxxxxxxx/pdf?"
end
end
context "Quote.preview_invoice_lines" do
should "support requests with args: quote, preview_invoice" do
Stripe::Quote.preview_invoice_lines("qt_xyz", "in_xyz")
assert_requested :get, "#{Stripe.api_base}/v1/quotes/qt_xyz/preview_invoices/in_xyz/lines?"
end
end
context "Quote.retrieve" do
should "support requests with args: id" do
Stripe::Quote.retrieve("qt_xxxxxxxxxxxxx")
Expand All @@ -1844,12 +1850,6 @@ class CodegennedExampleTest < Test::Unit::TestCase
assert_requested :post, "#{Stripe.api_base}/v1/quotes/qt_xxxxxxxxxxxxx"
end
end
context "QuotePreviewInvoice.list_lines" do
should "support requests with args: quote, preview_invoice" do
Stripe::Quote.list_lines_preview_invoice("qt_xyz", "in_xyz")
assert_requested :get, "#{Stripe.api_base}/v1/quotes/qt_xyz/preview_invoices/in_xyz/lines?"
end
end
context "Radar.EarlyFraudWarning.list" do
should "support requests with args: limit" do
Stripe::Radar::EarlyFraudWarning.list({ limit: 3 })
Expand Down

0 comments on commit 0030faf

Please sign in to comment.