From 0030faf88f5859a109287d8965df6e794cc647d0 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 16:34:47 +0000 Subject: [PATCH] Update generated code for v582 --- OPENAPI_VERSION | 2 +- lib/stripe/resources/quote.rb | 20 ++++++++++++++++++- lib/stripe/resources/quote_preview_invoice.rb | 18 ----------------- test/stripe/generated_examples_test.rb | 12 +++++------ 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index f8eb31b2e..849d00a97 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v580 \ No newline at end of file +v582 \ No newline at end of file diff --git a/lib/stripe/resources/quote.rb b/lib/stripe/resources/quote.rb index ae4de7ef7..42455cc9e 100644 --- a/lib/stripe/resources/quote.rb +++ b/lib/stripe/resources/quote.rb @@ -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 = {}) @@ -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/%s/preview_invoices/%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, @@ -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/%s/preview_invoices/%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, diff --git a/lib/stripe/resources/quote_preview_invoice.rb b/lib/stripe/resources/quote_preview_invoice.rb index ea1327744..abf093a16 100644 --- a/lib/stripe/resources/quote_preview_invoice.rb +++ b/lib/stripe/resources/quote_preview_invoice.rb @@ -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/%s/preview_invoices/%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/%s/preview_invoices/%s/lines", { quote: CGI.escape(quote), preview_invoice: CGI.escape(preview_invoice) }), - params: params, - opts: opts - ) - end end end diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index 665a15e3b..b03c50f1b 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -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") @@ -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 })