diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index da8dd2679..03b8593a8 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v426 \ No newline at end of file +v431 \ No newline at end of file diff --git a/lib/stripe/object_types.rb b/lib/stripe/object_types.rb index 0b673186c..bf4a2af89 100644 --- a/lib/stripe/object_types.rb +++ b/lib/stripe/object_types.rb @@ -104,6 +104,7 @@ def self.object_names_to_classes SubscriptionItem::OBJECT_NAME => SubscriptionItem, SubscriptionSchedule::OBJECT_NAME => SubscriptionSchedule, Tax::Calculation::OBJECT_NAME => Tax::Calculation, + Tax::Form::OBJECT_NAME => Tax::Form, Tax::Registration::OBJECT_NAME => Tax::Registration, Tax::Settings::OBJECT_NAME => Tax::Settings, Tax::Transaction::OBJECT_NAME => Tax::Transaction, diff --git a/lib/stripe/resources.rb b/lib/stripe/resources.rb index 523cc5845..462d6ac90 100644 --- a/lib/stripe/resources.rb +++ b/lib/stripe/resources.rb @@ -91,6 +91,7 @@ require "stripe/resources/subscription_item" require "stripe/resources/subscription_schedule" require "stripe/resources/tax/calculation" +require "stripe/resources/tax/form" require "stripe/resources/tax/registration" require "stripe/resources/tax/settings" require "stripe/resources/tax/transaction" diff --git a/lib/stripe/resources/tax/form.rb b/lib/stripe/resources/tax/form.rb new file mode 100644 index 000000000..788b6889a --- /dev/null +++ b/lib/stripe/resources/tax/form.rb @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Tax + # Tax forms are legal documents which are delivered to one or more tax authorities for information reporting purposes. + # + # Related guide: [US tax reporting for Connect platforms](https://stripe.com/docs/connect/tax-reporting) + class Form < APIResource + extend Stripe::APIOperations::List + + OBJECT_NAME = "tax.form" + + 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/tax/forms/%s/pdf", { id: CGI.escape(self["id"]) }), + params: params, + opts: opts, + &read_body_chunk_block + ) + end + + def self.pdf(id, 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/tax/forms/%s/pdf", { id: CGI.escape(id) }), + params, + opts, + &read_body_chunk_block + ) + end + end + end +end diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index 533d5f3ac..2562189a6 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -2220,6 +2220,13 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :get, "#{Stripe.api_base}/v1/tax/calculations/xxx/line_items?" end end + context "Tax.Form.pdf" do + should "support requests with args: id" do + block_handler = {} + Stripe::Tax::Form.pdf("form_xxxxxxxxxxxxx", &block_handler) + assert_requested :get, "#{Stripe.api_base}/v1/tax/forms/form_xxxxxxxxxxxxx/pdf?" + end + end context "Tax.Transaction.create_from_calculation" do should "support requests with args: calculation, reference" do Stripe::Tax::Transaction.create_from_calculation({