From 7aacd35c2449b73b6d39cdd2bf426f690f13eb86 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 15:19:56 +0000 Subject: [PATCH] Update generated code for v872 --- OPENAPI_VERSION | 2 +- lib/stripe/object_types.rb | 2 + lib/stripe/resources.rb | 2 + .../issuing/personalization_design.rb | 119 ++++++++++++++++++ .../resources/issuing/physical_bundle.rb | 26 ++++ test/stripe/generated_examples_test.rb | 4 + 6 files changed, 154 insertions(+), 1 deletion(-) create mode 100644 lib/stripe/resources/issuing/personalization_design.rb create mode 100644 lib/stripe/resources/issuing/physical_bundle.rb diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 2e1dc524f..64010e9ed 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v841 \ No newline at end of file +v872 \ No newline at end of file diff --git a/lib/stripe/object_types.rb b/lib/stripe/object_types.rb index 86b36e8f7..07d7b823f 100644 --- a/lib/stripe/object_types.rb +++ b/lib/stripe/object_types.rb @@ -63,6 +63,8 @@ def self.object_names_to_classes Issuing::Card.object_name => Issuing::Card, Issuing::Cardholder.object_name => Issuing::Cardholder, 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, diff --git a/lib/stripe/resources.rb b/lib/stripe/resources.rb index 024ba1f91..f3c03d1ff 100644 --- a/lib/stripe/resources.rb +++ b/lib/stripe/resources.rb @@ -51,6 +51,8 @@ require "stripe/resources/issuing/card" require "stripe/resources/issuing/cardholder" 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" diff --git a/lib/stripe/resources/issuing/personalization_design.rb b/lib/stripe/resources/issuing/personalization_design.rb new file mode 100644 index 000000000..37d00f50a --- /dev/null +++ b/lib/stripe/resources/issuing/personalization_design.rb @@ -0,0 +1,119 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Issuing + # A Personalization Design is a logical grouping of a Physical Bundle, card logo, and carrier text that represents a product line. + class PersonalizationDesign < APIResource + extend Stripe::APIOperations::Create + extend Stripe::APIOperations::List + include Stripe::APIOperations::Save + + OBJECT_NAME = "issuing.personalization_design" + def self.object_name + "issuing.personalization_design" + end + + # Creates a personalization design object. + def self.create(params = {}, opts = {}) + request_stripe_object( + method: :post, + path: "/v1/issuing/personalization_designs", + params: params, + opts: opts + ) + end + + # Returns a list of personalization design objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + def self.list(filters = {}, opts = {}) + request_stripe_object( + method: :get, + path: "/v1/issuing/personalization_designs", + params: filters, + opts: opts + ) + end + + # Updates a card personalization object. + def self.update(id, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/issuing/personalization_designs/%s", { id: CGI.escape(id) }), + params: params, + opts: opts + ) + end + + def test_helpers + TestHelpers.new(self) + end + + class TestHelpers < APIResourceTestHelpers + RESOURCE_CLASS = PersonalizationDesign + def self.resource_class + "PersonalizationDesign" + end + + # Updates the status of the specified testmode personalization design object to active. + def self.activate(personalization_design, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/personalization_designs/%s/activate", { personalization_design: CGI.escape(personalization_design) }), + params: params, + opts: opts + ) + end + + # Updates the status of the specified testmode personalization design object to active. + def activate(params = {}, opts = {}) + @resource.request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/personalization_designs/%s/activate", { personalization_design: CGI.escape(@resource["id"]) }), + params: params, + opts: opts + ) + end + + # Updates the status of the specified testmode personalization design object to inactive. + def self.deactivate(personalization_design, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/personalization_designs/%s/deactivate", { personalization_design: CGI.escape(personalization_design) }), + params: params, + opts: opts + ) + end + + # Updates the status of the specified testmode personalization design object to inactive. + def deactivate(params = {}, opts = {}) + @resource.request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/personalization_designs/%s/deactivate", { personalization_design: CGI.escape(@resource["id"]) }), + params: params, + opts: opts + ) + end + + # Updates the status of the specified testmode personalization design object to rejected. + def self.reject(personalization_design, params = {}, opts = {}) + request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/personalization_designs/%s/reject", { personalization_design: CGI.escape(personalization_design) }), + params: params, + opts: opts + ) + end + + # Updates the status of the specified testmode personalization design object to rejected. + def reject(params = {}, opts = {}) + @resource.request_stripe_object( + method: :post, + path: format("/v1/test_helpers/issuing/personalization_designs/%s/reject", { personalization_design: CGI.escape(@resource["id"]) }), + params: params, + opts: opts + ) + end + end + end + end +end diff --git a/lib/stripe/resources/issuing/physical_bundle.rb b/lib/stripe/resources/issuing/physical_bundle.rb new file mode 100644 index 000000000..890eab761 --- /dev/null +++ b/lib/stripe/resources/issuing/physical_bundle.rb @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Issuing + # A Physical Bundle represents the bundle of physical items - card stock, carrier letter, and envelope - that is shipped to a cardholder when you create a physical card. + class PhysicalBundle < APIResource + extend Stripe::APIOperations::List + + OBJECT_NAME = "issuing.physical_bundle" + def self.object_name + "issuing.physical_bundle" + end + + # Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. + def self.list(filters = {}, opts = {}) + request_stripe_object( + method: :get, + path: "/v1/issuing/physical_bundles", + params: filters, + opts: opts + ) + end + end + end +end diff --git a/test/stripe/generated_examples_test.rb b/test/stripe/generated_examples_test.rb index 10de5d909..ce2a68dc5 100644 --- a/test/stripe/generated_examples_test.rb +++ b/test/stripe/generated_examples_test.rb @@ -426,6 +426,10 @@ class CodegennedExampleTest < Test::Unit::TestCase Stripe::Customer.update_cash_balance("cus_123", { settings: { reconciliation_mode: "manual" } }) assert_requested :post, "#{Stripe.api_base}/v1/customers/cus_123/cash_balance" end + should "Test customers cash balance transactions get" do + Stripe::Customer.list_cash_balance_transactions("cus_123", { limit: 3 }) + assert_requested :get, "#{Stripe.api_base}/v1/customers/cus_123/cash_balance_transactions?limit=3" + end should "Test customers delete" do Stripe::Customer.delete("cus_xxxxxxxxxxxxx") assert_requested :delete, "#{Stripe.api_base}/v1/customers/cus_xxxxxxxxxxxxx?"