Skip to content

Commit

Permalink
Update generated code (#1303)
Browse files Browse the repository at this point in the history
* Update generated code for v726

* Update generated code for v733

* Update generated code for v733

* Update generated code for v734

* Update generated code for v734

---------

Co-authored-by: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com>
Co-authored-by: pakrym-stripe <99349468+pakrym-stripe@users.noreply.github.com>
  • Loading branch information
stripe-openapi[bot] and pakrym-stripe committed Dec 21, 2023
1 parent c46f4a6 commit c51404d
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 2 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v682
v734
1 change: 1 addition & 0 deletions lib/stripe/object_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def self.object_names_to_classes
FinancialConnections::AccountOwnership::OBJECT_NAME =>
FinancialConnections::AccountOwnership,
FinancialConnections::Session::OBJECT_NAME => FinancialConnections::Session,
FinancialConnections::Transaction::OBJECT_NAME => FinancialConnections::Transaction,
FundingInstructions::OBJECT_NAME => FundingInstructions,
Identity::VerificationReport::OBJECT_NAME => Identity::VerificationReport,
Identity::VerificationSession::OBJECT_NAME => Identity::VerificationSession,
Expand Down
1 change: 1 addition & 0 deletions lib/stripe/resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
require "stripe/resources/financial_connections/account_owner"
require "stripe/resources/financial_connections/account_ownership"
require "stripe/resources/financial_connections/session"
require "stripe/resources/financial_connections/transaction"
require "stripe/resources/funding_instructions"
require "stripe/resources/identity/verification_report"
require "stripe/resources/identity/verification_session"
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/resources/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Stripe
# This object represents files hosted on Stripe's servers. You can upload
# files with the [create file](https://stripe.com/docs/api#create_file) request
# (for example, when uploading dispute evidence). Stripe also
# creates files independetly (for example, the results of a [Sigma scheduled
# creates files independently (for example, the results of a [Sigma scheduled
# query](https://stripe.com/docs/api#scheduled_queries)).
#
# Related guide: [File upload guide](https://stripe.com/docs/file-upload)
Expand Down
36 changes: 36 additions & 0 deletions lib/stripe/resources/financial_connections/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,24 @@ def refresh_account(params = {}, opts = {})
)
end

def subscribe(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/financial_connections/accounts/%<account>s/subscribe", { account: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end

def unsubscribe(params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(self["id"]) }),
params: params,
opts: opts
)
end

def self.disconnect(account, params = {}, opts = {})
request_stripe_object(
method: :post,
Expand All @@ -62,6 +80,24 @@ def self.refresh_account(account, params = {}, opts = {})
opts: opts
)
end

def self.subscribe(account, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/financial_connections/accounts/%<account>s/subscribe", { account: CGI.escape(account) }),
params: params,
opts: opts
)
end

def self.unsubscribe(account, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/financial_connections/accounts/%<account>s/unsubscribe", { account: CGI.escape(account) }),
params: params,
opts: opts
)
end
end
end
end
13 changes: 13 additions & 0 deletions lib/stripe/resources/financial_connections/transaction.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
module FinancialConnections
# A Transaction represents a real transaction that affects a Financial Connections Account balance.
class Transaction < APIResource
extend Stripe::APIOperations::List

OBJECT_NAME = "financial_connections.transaction"
end
end
end
32 changes: 32 additions & 0 deletions test/stripe/generated_examples_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,14 @@ class CodegennedExampleTest < Test::Unit::TestCase
Stripe::FinancialConnections::Account.refresh_account("fca_xyz", { features: ["balance"] })
assert_requested :post, "#{Stripe.api_base}/v1/financial_connections/accounts/fca_xyz/refresh"
end
should "Test financial connections accounts subscribe post" do
Stripe::FinancialConnections::Account.subscribe("fa_123", { features: ["transactions"] })
assert_requested :post, "#{Stripe.api_base}/v1/financial_connections/accounts/fa_123/subscribe"
end
should "Test financial connections accounts unsubscribe post" do
Stripe::FinancialConnections::Account.unsubscribe("fa_123", { features: ["transactions"] })
assert_requested :post, "#{Stripe.api_base}/v1/financial_connections/accounts/fa_123/unsubscribe"
end
should "Test financial connections sessions get" do
Stripe::FinancialConnections::Session.retrieve("fcsess_xyz")
assert_requested :get, "#{Stripe.api_base}/v1/financial_connections/sessions/fcsess_xyz?"
Expand Down Expand Up @@ -642,6 +650,14 @@ class CodegennedExampleTest < Test::Unit::TestCase
})
assert_requested :post, "#{Stripe.api_base}/v1/financial_connections/sessions"
end
should "Test financial connections transactions get" do
Stripe::FinancialConnections::Transaction.retrieve("tr_123")
assert_requested :get, "#{Stripe.api_base}/v1/financial_connections/transactions/tr_123?"
end
should "Test financial connections transactions get 2" do
Stripe::FinancialConnections::Transaction.list({ account: "fca_xyz" })
assert_requested :get, "#{Stripe.api_base}/v1/financial_connections/transactions?account=fca_xyz"
end
should "Test identity verification reports get" do
Stripe::Identity::VerificationReport.list({ limit: 3 })
assert_requested :get, "#{Stripe.api_base}/v1/identity/verification_reports?limit=3"
Expand Down Expand Up @@ -1571,6 +1587,22 @@ class CodegennedExampleTest < Test::Unit::TestCase
Stripe::TaxRate.update("txr_xxxxxxxxxxxxx", { active: false })
assert_requested :post, "#{Stripe.api_base}/v1/tax_rates/txr_xxxxxxxxxxxxx"
end
should "Test tax registrations get" do
Stripe::Tax::Registration.list({ status: "all" })
assert_requested :get, "#{Stripe.api_base}/v1/tax/registrations?status=all"
end
should "Test tax registrations post" do
Stripe::Tax::Registration.create({
country: "IE",
country_options: { ie: { type: "oss_union" } },
active_from: "now",
})
assert_requested :post, "#{Stripe.api_base}/v1/tax/registrations"
end
should "Test tax registrations post 2" do
Stripe::Tax::Registration.update("taxreg_xxxxxxxxxxxxx", { expires_at: "now" })
assert_requested :post, "#{Stripe.api_base}/v1/tax/registrations/taxreg_xxxxxxxxxxxxx"
end
should "Test tax settings get" do
Stripe::Tax::Settings.retrieve
assert_requested :get, "#{Stripe.api_base}/v1/tax/settings?"
Expand Down

0 comments on commit c51404d

Please sign in to comment.