From ff7d284be0ec42915bca10fcf95d08d7bd91a0f6 Mon Sep 17 00:00:00 2001 From: Kamil Pajdzik Date: Thu, 18 Aug 2022 16:03:24 -0700 Subject: [PATCH] Codegen for openapi v183 --- OPENAPI_VERSION | 2 +- lib/stripe/object_types.rb | 1 + lib/stripe/resources.rb | 1 + lib/stripe/resources/customer.rb | 2 + .../customer_cash_balance_transaction.rb | 10 ++++ test/stripe/generated_examples_test.rb | 57 ------------------- 6 files changed, 15 insertions(+), 58 deletions(-) create mode 100644 lib/stripe/resources/customer_cash_balance_transaction.rb diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 714ead978..d9f3b7218 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v174 \ No newline at end of file +v183 \ No newline at end of file diff --git a/lib/stripe/object_types.rb b/lib/stripe/object_types.rb index 66b21a9ae..a60132743 100644 --- a/lib/stripe/object_types.rb +++ b/lib/stripe/object_types.rb @@ -34,6 +34,7 @@ def self.object_names_to_classes CreditNoteLineItem::OBJECT_NAME => CreditNoteLineItem, Customer::OBJECT_NAME => Customer, CustomerBalanceTransaction::OBJECT_NAME => CustomerBalanceTransaction, + CustomerCashBalanceTransaction::OBJECT_NAME => CustomerCashBalanceTransaction, Discount::OBJECT_NAME => Discount, Dispute::OBJECT_NAME => Dispute, EphemeralKey::OBJECT_NAME => EphemeralKey, diff --git a/lib/stripe/resources.rb b/lib/stripe/resources.rb index 24c258a7c..01da2aea2 100644 --- a/lib/stripe/resources.rb +++ b/lib/stripe/resources.rb @@ -23,6 +23,7 @@ require "stripe/resources/credit_note_line_item" require "stripe/resources/customer" require "stripe/resources/customer_balance_transaction" +require "stripe/resources/customer_cash_balance_transaction" require "stripe/resources/discount" require "stripe/resources/dispute" require "stripe/resources/ephemeral_key" diff --git a/lib/stripe/resources/customer.rb b/lib/stripe/resources/customer.rb index 390ebd95f..4bab84431 100644 --- a/lib/stripe/resources/customer.rb +++ b/lib/stripe/resources/customer.rb @@ -14,6 +14,8 @@ class Customer < APIResource nested_resource_class_methods :balance_transaction, operations: %i[create retrieve update list] + nested_resource_class_methods :cash_balance_transaction, + operations: %i[retrieve list] nested_resource_class_methods :tax_id, operations: %i[create retrieve delete list] diff --git a/lib/stripe/resources/customer_cash_balance_transaction.rb b/lib/stripe/resources/customer_cash_balance_transaction.rb new file mode 100644 index 000000000..667309cc2 --- /dev/null +++ b/lib/stripe/resources/customer_cash_balance_transaction.rb @@ -0,0 +1,10 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + class CustomerCashBalanceTransaction < APIResource + extend Stripe::APIOperations::List + + OBJECT_NAME = "customer_cash_balance_transaction" + end +end diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index 1497a0bef..2fbc1220e 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -1070,63 +1070,6 @@ class CodegennedExampleTest < Test::Unit::TestCase assert_requested :get, "#{Stripe.api_base}/v1/mandates/mandate_xxxxxxxxxxxxx?" end end - context "Order.cancel" do - should "support requests with args: order" do - Stripe::Order.cancel("order_xyz") - assert_requested :post, "#{Stripe.api_base}/v1/orders/order_xyz/cancel?" - end - end - context "Order.create" do - should "support requests with args: description, currency, line_items" do - Stripe::Order.create( - { - description: "description", - currency: "usd", - line_items: [{ description: "my line item" }], - } - ) - assert_requested :post, "#{Stripe.api_base}/v1/orders" - end - end - context "Order.list" do - should "support requests with args: limit" do - Stripe::Order.list({ limit: 3 }) - assert_requested :get, "#{Stripe.api_base}/v1/orders?limit=3" - end - end - context "Order.list_line_items" do - should "support requests with args: order" do - Stripe::Order.list_line_items("order_xyz") - assert_requested :get, "#{Stripe.api_base}/v1/orders/order_xyz/line_items?" - end - end - context "Order.reopen" do - should "support requests with args: order" do - Stripe::Order.reopen("order_xyz") - assert_requested :post, "#{Stripe.api_base}/v1/orders/order_xyz/reopen?" - end - end - context "Order.retrieve" do - should "support requests with args: order" do - Stripe::Order.retrieve("order_xyz") - assert_requested :get, "#{Stripe.api_base}/v1/orders/order_xyz?" - end - end - context "Order.submit" do - should "support requests with args: order, expected_total" do - Stripe::Order.submit("order_xyz", { expected_total: 100 }) - assert_requested :post, "#{Stripe.api_base}/v1/orders/order_xyz/submit" - end - end - context "Order.update" do - should "support requests with args: order, metadata, ip_address" do - Stripe::Order.update( - "order_xyz", - { metadata: { reference_number: "123" }, ip_address: "0.0.0.0" } - ) - assert_requested :post, "#{Stripe.api_base}/v1/orders/order_xyz" - end - end context "PaymentIntent.apply_customer_balance" do should "support requests with args: id" do Stripe::PaymentIntent.apply_customer_balance("pi_xxxxxxxxxxxxx")