Skip to content

Commit

Permalink
Update generated code for v576
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Oct 3, 2023
1 parent d7a0967 commit 119802a
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 50 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v575
v576
3 changes: 2 additions & 1 deletion lib/stripe/object_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def self.object_names_to_classes
Issuing::Dispute::OBJECT_NAME => Issuing::Dispute,
Issuing::PersonalizationDesign::OBJECT_NAME => Issuing::PersonalizationDesign,
Issuing::PhysicalBundle::OBJECT_NAME => Issuing::PhysicalBundle,
Issuing::Token::OBJECT_NAME => Issuing::Token,
Issuing::Transaction::OBJECT_NAME => Issuing::Transaction,
LineItem::OBJECT_NAME => LineItem,
LoginLink::OBJECT_NAME => LoginLink,
Expand All @@ -90,7 +91,7 @@ def self.object_names_to_classes
Quote::OBJECT_NAME => Quote,
QuotePhase::OBJECT_NAME => QuotePhase,
QuotePreviewInvoice::OBJECT_NAME => QuotePreviewInvoice,
QuotePreviewSchedule::OBJECT_NAME => QuotePreviewSchedule,
QuotePreviewSubscriptionSchedule::OBJECT_NAME => QuotePreviewSubscriptionSchedule,
Radar::EarlyFraudWarning::OBJECT_NAME => Radar::EarlyFraudWarning,
Radar::ValueList::OBJECT_NAME => Radar::ValueList,
Radar::ValueListItem::OBJECT_NAME => Radar::ValueListItem,
Expand Down
3 changes: 2 additions & 1 deletion lib/stripe/resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
require "stripe/resources/issuing/dispute"
require "stripe/resources/issuing/personalization_design"
require "stripe/resources/issuing/physical_bundle"
require "stripe/resources/issuing/token"
require "stripe/resources/issuing/transaction"
require "stripe/resources/line_item"
require "stripe/resources/login_link"
Expand All @@ -76,7 +77,7 @@
require "stripe/resources/quote"
require "stripe/resources/quote_phase"
require "stripe/resources/quote_preview_invoice"
require "stripe/resources/quote_preview_schedule"
require "stripe/resources/quote_preview_subscription_schedule"
require "stripe/resources/radar/early_fraud_warning"
require "stripe/resources/radar/value_list"
require "stripe/resources/radar/value_list_item"
Expand Down
14 changes: 14 additions & 0 deletions lib/stripe/resources/issuing/token.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
module Issuing
# An issuing token object is created when an issued card is added to a digital wallet. As a [card issuer](https://stripe.com/docs/issuing), you can view and manage these tokens through Stripe.
class Token < APIResource
extend Stripe::APIOperations::List
include Stripe::APIOperations::Save

OBJECT_NAME = "issuing.token"
end
end
end
60 changes: 21 additions & 39 deletions 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]
nested_resource_class_methods :preview_invoice, operations: %i[list_lines list]
nested_resource_class_methods :preview_subscription_schedule, operations: %i[list]

def accept(params = {}, opts = {})
Expand All @@ -33,15 +33,6 @@ def cancel(params = {}, opts = {})
)
end

def draft_quote(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end

def finalize_quote(params = {}, opts = {})
request_stripe_object(
method: :post,
Expand Down Expand Up @@ -78,7 +69,16 @@ def list_lines(params = {}, opts = {})
)
end

def mark_stale_quote(params = {}, opts = {})
def mark_draft(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end

def mark_stale(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(self["id"]) }),
Expand All @@ -99,15 +99,6 @@ 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 @@ -135,15 +126,6 @@ def self.cancel(quote, params = {}, opts = {})
)
end

def self.draft_quote(quote, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(quote) }),
params: params,
opts: opts
)
end

def self.finalize_quote(quote, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand Down Expand Up @@ -180,7 +162,16 @@ def self.list_lines(quote, params = {}, opts = {})
)
end

def self.mark_stale_quote(quote, params = {}, opts = {})
def self.mark_draft(quote, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/quotes/%<quote>s/mark_draft", { quote: CGI.escape(quote) }),
params: params,
opts: opts
)
end

def self.mark_stale(quote, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/quotes/%<quote>s/mark_stale", { quote: CGI.escape(quote) }),
Expand All @@ -201,15 +192,6 @@ 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: 18 additions & 0 deletions lib/stripe/resources/quote_preview_invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,23 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# frozen_string_literal: true

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

OBJECT_NAME = "quote_preview_schedule"
OBJECT_NAME = "quote_preview_subscription_schedule"
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,12 +1832,6 @@ 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 @@ -1850,6 +1844,12 @@ 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 119802a

Please sign in to comment.