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

Merged
merged 4 commits into from
Oct 29, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update generated code for v1318
stripe-openapi[bot] committed Oct 23, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 427656c3f0aa8ef6d1bb80dc992e326990b59f73
1 change: 1 addition & 0 deletions lib/stripe/object_types.rb
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions lib/stripe/resources.rb
Original file line number Diff line number Diff line change
@@ -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"
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
@@ -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"
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
@@ -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