Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated code for beta #1276

Merged
merged 8 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v540
v569
4 changes: 2 additions & 2 deletions lib/stripe/object_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ def self.object_names_to_classes
InvoiceLineItem::OBJECT_NAME => InvoiceLineItem,
Issuing::Authorization::OBJECT_NAME => Issuing::Authorization,
Issuing::Card::OBJECT_NAME => Issuing::Card,
Issuing::CardBundle::OBJECT_NAME => Issuing::CardBundle,
Issuing::CardDesign::OBJECT_NAME => Issuing::CardDesign,
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::Transaction::OBJECT_NAME => Issuing::Transaction,
LineItem::OBJECT_NAME => LineItem,
LoginLink::OBJECT_NAME => LoginLink,
Expand Down
4 changes: 2 additions & 2 deletions lib/stripe/resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@
require "stripe/resources/invoice_line_item"
require "stripe/resources/issuing/authorization"
require "stripe/resources/issuing/card"
require "stripe/resources/issuing/card_bundle"
require "stripe/resources/issuing/card_design"
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/transaction"
require "stripe/resources/line_item"
require "stripe/resources/login_link"
Expand Down
13 changes: 0 additions & 13 deletions lib/stripe/resources/issuing/card_bundle.rb

This file was deleted.

77 changes: 0 additions & 77 deletions lib/stripe/resources/issuing/card_design.rb

This file was deleted.

77 changes: 77 additions & 0 deletions lib/stripe/resources/issuing/personalization_design.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# 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 test_helpers
TestHelpers.new(self)
end

class TestHelpers < APIResourceTestHelpers
RESOURCE_CLASS = PersonalizationDesign

def self.activate(personalization_design, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/personalization_designs/%<personalization_design>s/activate", { personalization_design: CGI.escape(personalization_design) }),
params: params,
opts: opts
)
end

def self.deactivate(personalization_design, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/personalization_designs/%<personalization_design>s/deactivate", { personalization_design: CGI.escape(personalization_design) }),
params: params,
opts: opts
)
end

def self.reject(personalization_design, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/personalization_designs/%<personalization_design>s/reject", { personalization_design: CGI.escape(personalization_design) }),
params: params,
opts: opts
)
end

def activate(params = {}, opts = {})
@resource.request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/personalization_designs/%<personalization_design>s/activate", { personalization_design: CGI.escape(@resource["id"]) }),
params: params,
opts: opts
)
end

def deactivate(params = {}, opts = {})
@resource.request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/personalization_designs/%<personalization_design>s/deactivate", { personalization_design: CGI.escape(@resource["id"]) }),
params: params,
opts: opts
)
end

def reject(params = {}, opts = {})
@resource.request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/personalization_designs/%<personalization_design>s/reject", { personalization_design: CGI.escape(@resource["id"]) }),
params: params,
opts: opts
)
end
end
end
end
end
13 changes: 13 additions & 0 deletions lib/stripe/resources/issuing/physical_bundle.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 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"
end
end
end
2 changes: 1 addition & 1 deletion lib/stripe/resources/mandate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# frozen_string_literal: true

module Stripe
# A Mandate is a record of the permission a customer has given you to debit their payment method.
# A Mandate is a record of the permission that your customer gives you to debit their payment method.
class Mandate < APIResource
OBJECT_NAME = "mandate"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/resources/payout.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Stripe
# A `Payout` object is created when you receive funds from Stripe, or when you
# initiate a payout to either a bank account or debit card of a [connected
# Stripe account](https://stripe.com/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts,
# as well as list all payouts. Payouts are made on [varying
# and list all payouts. Payouts are made on [varying
# schedules](https://stripe.com/docs/connect/manage-payout-schedule), depending on your country and
# industry.
#
Expand Down
6 changes: 3 additions & 3 deletions lib/stripe/resources/refund.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# frozen_string_literal: true

module Stripe
# `Refund` objects allow you to refund a charge that has previously been created
# but not yet refunded. Funds will be refunded to the credit or debit card that
# was originally charged.
# Refund objects allow you to refund a previously created charge that isn't
# refunded yet. Funds are refunded to the credit or debit card that's
# initially charged.
#
# Related guide: [Refunds](https://stripe.com/docs/refunds)
class Refund < APIResource
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/resources/setup_attempt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

module Stripe
# A SetupAttempt describes one attempted confirmation of a SetupIntent,
# whether that confirmation was successful or unsuccessful. You can use
# whether that confirmation is successful or unsuccessful. You can use
# SetupAttempts to inspect details of a specific attempt at setting up a
# payment method using a SetupIntent.
class SetupAttempt < APIResource
Expand Down
6 changes: 6 additions & 0 deletions test/stripe/generated_examples_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2176,6 +2176,12 @@ class CodegennedExampleTest < Test::Unit::TestCase
assert_requested :post, "#{Stripe.api_base}/v1/subscriptions"
end
end
context "Subscription.delete_discount" do
should "support requests with args: subscription_exposed_id" do
Stripe::Subscription.delete_discount("sub_xyz")
assert_requested :delete, "#{Stripe.api_base}/v1/subscriptions/sub_xyz/discount?"
end
end
context "Subscription.list" do
should "support requests with args: limit" do
Stripe::Subscription.list({ limit: 3 })
Expand Down