Skip to content

Commit

Permalink
Update generated code for v425
Browse files Browse the repository at this point in the history
  • Loading branch information
stripe-openapi[bot] committed Jul 19, 2023
1 parent 7dbccc4 commit ada2c1d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 43 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v424
v425
66 changes: 24 additions & 42 deletions lib/stripe/resources/quote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,18 @@ def mark_stale_quote(params = {}, opts = {})
)
end

def pdf(params = {}, opts = {}, &read_body_chunk_block)
config = opts[:client]&.config || Stripe.config
opts = { api_base: config.uploads_base }.merge(opts)
request_stream(
method: :get,
path: format("/v1/quotes/%<quote>s/pdf", { quote: CGI.escape(self["id"]) }),
params: params,
opts: opts,
&read_body_chunk_block
)
end

def preview_invoice_lines(preview_invoice, params = {}, opts = {})
request_stripe_object(
method: :get,
Expand Down Expand Up @@ -191,6 +203,18 @@ def self.mark_stale_quote(quote, params = {}, opts = {})
)
end

def self.pdf(quote, params = {}, opts = {}, &read_body_chunk_block)
config = opts[:client]&.config || Stripe.config
opts = { api_base: config.uploads_base }.merge(opts)
execute_resource_request_stream(
:get,
format("/v1/quotes/%<quote>s/pdf", { quote: CGI.escape(quote) }),
params,
opts,
&read_body_chunk_block
)
end

def self.preview_invoice_lines(
quote,
preview_invoice,
Expand Down Expand Up @@ -231,47 +255,5 @@ def self.reestimate(quote, params = {}, opts = {})
opts: opts
)
end

def pdf(params = {}, opts = {}, &read_body_chunk_block)
unless block_given?
raise ArgumentError, "A read_body_chunk_block block parameter is required when calling the pdf method."
end

config = opts[:client]&.config || Stripe.config

request_stream(
method: :get,
path: resource_url + "/pdf",
params: params,
opts: {
api_base: config.uploads_base,
}.merge(opts),
&read_body_chunk_block
)
end

def self.pdf(id, params = {}, opts = {}, &read_body_chunk_block)
unless id.is_a?(String)
raise ArgumentError,
"id should be a string representing the ID of an API resource"
end

unless block_given?
raise ArgumentError, "A read_body_chunk_block block parameter is required when calling the pdf method."
end

config = opts[:client]&.config || Stripe.config

resp = execute_resource_request_stream(
:get,
"#{resource_url}/#{CGI.escape(id)}/pdf",
params,
{
api_base: config.uploads_base,
}.merge(opts),
&read_body_chunk_block
)
resp
end
end
end

0 comments on commit ada2c1d

Please sign in to comment.