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 #1472

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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 @@
v1268
v1318
2 changes: 1 addition & 1 deletion lib/stripe/api_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

module Stripe
module ApiVersion
CURRENT = "2024-09-30.acacia"
CURRENT = "2024-10-28.acacia"
end
end
1 change: 1 addition & 0 deletions lib/stripe/object_types.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ def self.v2_object_names_to_classes
V2::Billing::MeterEventAdjustment.object_name => V2::Billing::MeterEventAdjustment,
V2::Billing::MeterEventSession.object_name => V2::Billing::MeterEventSession,
V2::Event.object_name => V2::Event,
V2::EventDestination.object_name => V2::EventDestination,
# v2 object classes: The end of the section generated from our OpenAPI spec
}
end
Expand Down
1 change: 1 addition & 0 deletions lib/stripe/resources.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
require "stripe/resources/v2/billing/meter_event_adjustment"
require "stripe/resources/v2/billing/meter_event_session"
require "stripe/resources/v2/event"
require "stripe/resources/v2/event_destination"
require "stripe/resources/webhook_endpoint"
require "stripe/events/v1_billing_meter_error_report_triggered_event"
require "stripe/events/v1_billing_meter_no_meter_found_event"
2 changes: 1 addition & 1 deletion lib/stripe/resources/billing/credit_balance_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

module Stripe
module Billing
# Indicates the credit balance for credits granted to a customer.
# Indicates the billing credit balance for billing credits granted to a customer.
class CreditBalanceSummary < SingletonAPIResource
OBJECT_NAME = "billing.credit_balance_summary"
def self.object_name
Expand Down
5 changes: 4 additions & 1 deletion lib/stripe/resources/billing/credit_grant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

module Stripe
module Billing
# A credit grant is a resource that records a grant of some credit to a customer.
# A credit grant is an API resource that documents the allocation of some billing credits to a customer.
#
# Related guide: [Billing credits](https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits)
# end
class CreditGrant < APIResource
extend Stripe::APIOperations::Create
extend Stripe::APIOperations::List
Expand Down
2 changes: 2 additions & 0 deletions lib/stripe/resources/billing/meter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
module Stripe
module Billing
# A billing meter is a resource that allows you to track usage of a particular event. For example, you might create a billing meter to track the number of API calls made by a particular user. You can then attach the billing meter to a price and attach the price to a subscription to charge the user for the number of API calls they make.
#
# Related guide: [Usage based billing](https://docs.stripe.com/billing/subscriptions/usage-based)
class Meter < APIResource
extend Stripe::APIOperations::Create
extend Stripe::APIOperations::List
Expand Down
20 changes: 20 additions & 0 deletions lib/stripe/resources/issuing/card.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,26 @@ def ship_card(params = {}, opts = {})
opts: opts
)
end

# Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later.
def self.submit_card(card, params = {}, opts = {})
request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/submit", { card: CGI.escape(card) }),
params: params,
opts: opts
)
end

# Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later.
def submit_card(params = {}, opts = {})
@resource.request_stripe_object(
method: :post,
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/submit", { card: CGI.escape(@resource["id"]) }),
params: params,
opts: opts
)
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/resources/token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def self.object_name
end

# Creates a single-use token that represents a bank account's details.
# You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts.
# You can use this token with any v1 API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts.
def self.create(params = {}, opts = {})
request_stripe_object(method: :post, path: "/v1/tokens", params: params, opts: opts)
end
Expand Down
1 change: 1 addition & 0 deletions lib/stripe/resources/usage_record_summary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# frozen_string_literal: true

module Stripe
# A usage record summary represents an aggregated view of how much usage was accrued for a subscription item within a subscription billing period.
class UsageRecordSummary < StripeObject
OBJECT_NAME = "usage_record_summary"
def self.object_name
Expand Down
13 changes: 13 additions & 0 deletions lib/stripe/resources/v2/event_destination.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 V2
class EventDestination < APIResource
OBJECT_NAME = "v2.core.event_destination"
def self.object_name
"v2.core.event_destination"
end
end
end
end
1 change: 1 addition & 0 deletions lib/stripe/services.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
require "stripe/services/v2/billing/meter_event_session_service"
require "stripe/services/v2/billing/meter_event_stream_service"
require "stripe/services/v2/billing_service"
require "stripe/services/v2/core/event_destination_service"
require "stripe/services/v2/core/event_service"
require "stripe/services/v2/core_service"
require "stripe/services/v2_services"
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/services/account_login_link_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

module Stripe
class AccountLoginLinkService < StripeService
# Creates a single-use login link for a connected account to access the Express Dashboard.
# Creates a login link for a connected account to access the Express Dashboard.
#
# You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform.
def create(account, params = {}, opts = {})
Expand Down
11 changes: 11 additions & 0 deletions lib/stripe/services/test_helpers/issuing/card_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ def ship_card(card, params = {}, opts = {})
base_address: :api
)
end

# Updates the shipping status of the specified Issuing Card object to submitted. This method requires Stripe Version ‘2024-09-30.acacia' or later.
def submit_card(card, params = {}, opts = {})
request(
method: :post,
path: format("/v1/test_helpers/issuing/cards/%<card>s/shipping/submit", { card: CGI.escape(card) }),
params: params,
opts: opts,
base_address: :api
)
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/stripe/services/token_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module Stripe
class TokenService < StripeService
# Creates a single-use token that represents a bank account's details.
# You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts.
# You can use this token with any v1 API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts.
def create(params = {}, opts = {})
request(method: :post, path: "/v1/tokens", params: params, opts: opts, base_address: :api)
end
Expand Down
98 changes: 98 additions & 0 deletions lib/stripe/services/v2/core/event_destination_service.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true

module Stripe
module V2
module Core
class EventDestinationService < StripeService
# Create a new event destination.
def create(params = {}, opts = {})
request(
method: :post,
path: "/v2/core/event_destinations",
params: params,
opts: opts,
base_address: :api
)
end

# Delete an event destination.
def delete(id, params = {}, opts = {})
request(
method: :delete,
path: format("/v2/core/event_destinations/%<id>s", { id: CGI.escape(id) }),
params: params,
opts: opts,
base_address: :api
)
end

# Disable an event destination.
def disable(id, params = {}, opts = {})
request(
method: :post,
path: format("/v2/core/event_destinations/%<id>s/disable", { id: CGI.escape(id) }),
params: params,
opts: opts,
base_address: :api
)
end

# Enable an event destination.
def enable(id, params = {}, opts = {})
request(
method: :post,
path: format("/v2/core/event_destinations/%<id>s/enable", { id: CGI.escape(id) }),
params: params,
opts: opts,
base_address: :api
)
end

# Lists all event destinations.
def list(params = {}, opts = {})
request(
method: :get,
path: "/v2/core/event_destinations",
params: params,
opts: opts,
base_address: :api
)
end

# Send a `ping` event to an event destination.
def ping(id, params = {}, opts = {})
request(
method: :post,
path: format("/v2/core/event_destinations/%<id>s/ping", { id: CGI.escape(id) }),
params: params,
opts: opts,
base_address: :api
)
end

# Retrieves the details of an event destination.
def retrieve(id, params = {}, opts = {})
request(
method: :get,
path: format("/v2/core/event_destinations/%<id>s", { id: CGI.escape(id) }),
params: params,
opts: opts,
base_address: :api
)
end

# Update the details of an event destination.
def update(id, params = {}, opts = {})
request(
method: :post,
path: format("/v2/core/event_destinations/%<id>s", { id: CGI.escape(id) }),
params: params,
opts: opts,
base_address: :api
)
end
end
end
end
end
3 changes: 2 additions & 1 deletion lib/stripe/services/v2/core_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
module Stripe
module V2
class CoreService < StripeService
attr_reader :events
attr_reader :event_destinations, :events

def initialize(requestor)
super(requestor)
@event_destinations = Stripe::V2::Core::EventDestinationService.new(@requestor)
@events = Stripe::V2::Core::EventService.new(@requestor)
end
end
Expand Down
Loading