Update generated code for v2106 and

This commit is contained in:
Stripe OpenAPI 2025-11-03 18:07:37 +00:00
parent b8b9d5e178
commit 727f97decb
30 changed files with 1318 additions and 3 deletions

View File

@ -1 +1 @@
56689dcbcaa4c7ce6bf1b51a5add451972e0689c 85f516560e557fcd787735d9603bd57c7abb3a91

View File

@ -480,6 +480,11 @@ module Stripe
Events::V2PaymentsOffSessionPaymentRequiresCaptureEvent, Events::V2PaymentsOffSessionPaymentRequiresCaptureEvent,
Events::V2PaymentsOffSessionPaymentSucceededEvent.lookup_type => Events::V2PaymentsOffSessionPaymentSucceededEvent.lookup_type =>
Events::V2PaymentsOffSessionPaymentSucceededEvent, Events::V2PaymentsOffSessionPaymentSucceededEvent,
Events::V2ReportingReportRunCreatedEvent.lookup_type => Events::V2ReportingReportRunCreatedEvent,
Events::V2ReportingReportRunFailedEvent.lookup_type => Events::V2ReportingReportRunFailedEvent,
Events::V2ReportingReportRunSucceededEvent.lookup_type =>
Events::V2ReportingReportRunSucceededEvent,
Events::V2ReportingReportRunUpdatedEvent.lookup_type => Events::V2ReportingReportRunUpdatedEvent,
# v2 event types: The end of the section generated from our OpenAPI spec # v2 event types: The end of the section generated from our OpenAPI spec
} }
end end
@ -1059,6 +1064,14 @@ module Stripe
Events::V2PaymentsOffSessionPaymentRequiresCaptureEventNotification, Events::V2PaymentsOffSessionPaymentRequiresCaptureEventNotification,
Events::V2PaymentsOffSessionPaymentSucceededEventNotification.lookup_type => Events::V2PaymentsOffSessionPaymentSucceededEventNotification.lookup_type =>
Events::V2PaymentsOffSessionPaymentSucceededEventNotification, Events::V2PaymentsOffSessionPaymentSucceededEventNotification,
Events::V2ReportingReportRunCreatedEventNotification.lookup_type =>
Events::V2ReportingReportRunCreatedEventNotification,
Events::V2ReportingReportRunFailedEventNotification.lookup_type =>
Events::V2ReportingReportRunFailedEventNotification,
Events::V2ReportingReportRunSucceededEventNotification.lookup_type =>
Events::V2ReportingReportRunSucceededEventNotification,
Events::V2ReportingReportRunUpdatedEventNotification.lookup_type =>
Events::V2ReportingReportRunUpdatedEventNotification,
# event notification types: The end of the section generated from our OpenAPI spec # event notification types: The end of the section generated from our OpenAPI spec
} }
end end

View File

@ -0,0 +1,44 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module Events
# Occurs when a ReportRun is created.
class V2ReportingReportRunCreatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.reporting.report_run.created"
end
# Retrieves the related object from the API. Makes an API request on every call.
def fetch_related_object
_request(
method: :get,
path: related_object.url,
base_address: :api,
opts: { stripe_context: context }
)
end
attr_reader :related_object
end
# Occurs when a ReportRun is created.
class V2ReportingReportRunCreatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.reporting.report_run.created"
end
attr_reader :related_object
# Retrieves the ReportRun related to this EventNotification from the Stripe API. Makes an API request on every call.
def fetch_related_object
resp = @client.raw_request(
:get,
related_object.url,
opts: { stripe_context: context },
usage: ["fetch_related_object"]
)
@client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
end
end
end
end

View File

@ -0,0 +1,44 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module Events
# Occurs when a ReportRun has failed to complete.
class V2ReportingReportRunFailedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.reporting.report_run.failed"
end
# Retrieves the related object from the API. Makes an API request on every call.
def fetch_related_object
_request(
method: :get,
path: related_object.url,
base_address: :api,
opts: { stripe_context: context }
)
end
attr_reader :related_object
end
# Occurs when a ReportRun has failed to complete.
class V2ReportingReportRunFailedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.reporting.report_run.failed"
end
attr_reader :related_object
# Retrieves the ReportRun related to this EventNotification from the Stripe API. Makes an API request on every call.
def fetch_related_object
resp = @client.raw_request(
:get,
related_object.url,
opts: { stripe_context: context },
usage: ["fetch_related_object"]
)
@client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
end
end
end
end

View File

@ -0,0 +1,44 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module Events
# Occurs when a ReportRun has successfully completed.
class V2ReportingReportRunSucceededEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.reporting.report_run.succeeded"
end
# Retrieves the related object from the API. Makes an API request on every call.
def fetch_related_object
_request(
method: :get,
path: related_object.url,
base_address: :api,
opts: { stripe_context: context }
)
end
attr_reader :related_object
end
# Occurs when a ReportRun has successfully completed.
class V2ReportingReportRunSucceededEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.reporting.report_run.succeeded"
end
attr_reader :related_object
# Retrieves the ReportRun related to this EventNotification from the Stripe API. Makes an API request on every call.
def fetch_related_object
resp = @client.raw_request(
:get,
related_object.url,
opts: { stripe_context: context },
usage: ["fetch_related_object"]
)
@client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
end
end
end
end

View File

@ -0,0 +1,44 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module Events
# Occurs when a ReportRun is updated.
class V2ReportingReportRunUpdatedEvent < Stripe::V2::Core::Event
def self.lookup_type
"v2.reporting.report_run.updated"
end
# Retrieves the related object from the API. Makes an API request on every call.
def fetch_related_object
_request(
method: :get,
path: related_object.url,
base_address: :api,
opts: { stripe_context: context }
)
end
attr_reader :related_object
end
# Occurs when a ReportRun is updated.
class V2ReportingReportRunUpdatedEventNotification < Stripe::V2::Core::EventNotification
def self.lookup_type
"v2.reporting.report_run.updated"
end
attr_reader :related_object
# Retrieves the ReportRun related to this EventNotification from the Stripe API. Makes an API request on every call.
def fetch_related_object
resp = @client.raw_request(
:get,
related_object.url,
opts: { stripe_context: context },
usage: ["fetch_related_object"]
)
@client.deserialize(resp.http_body, api_mode: Util.get_api_mode(related_object.url))
end
end
end
end

View File

@ -247,6 +247,8 @@ module Stripe
V2::MoneyManagement::Transaction.object_name => V2::MoneyManagement::Transaction, V2::MoneyManagement::Transaction.object_name => V2::MoneyManagement::Transaction,
V2::MoneyManagement::TransactionEntry.object_name => V2::MoneyManagement::TransactionEntry, V2::MoneyManagement::TransactionEntry.object_name => V2::MoneyManagement::TransactionEntry,
V2::Payments::OffSessionPayment.object_name => V2::Payments::OffSessionPayment, V2::Payments::OffSessionPayment.object_name => V2::Payments::OffSessionPayment,
V2::Reporting::Report.object_name => V2::Reporting::Report,
V2::Reporting::ReportRun.object_name => V2::Reporting::ReportRun,
V2::Tax::AutomaticRule.object_name => V2::Tax::AutomaticRule, V2::Tax::AutomaticRule.object_name => V2::Tax::AutomaticRule,
# v2 object classes: The end of the section generated from our OpenAPI spec # v2 object classes: The end of the section generated from our OpenAPI spec
} }

View File

@ -830,6 +830,9 @@ require "stripe/params/v2/payments/off_session_payment_capture_params"
require "stripe/params/v2/payments/off_session_payment_create_params" require "stripe/params/v2/payments/off_session_payment_create_params"
require "stripe/params/v2/payments/off_session_payment_list_params" require "stripe/params/v2/payments/off_session_payment_list_params"
require "stripe/params/v2/payments/off_session_payment_retrieve_params" require "stripe/params/v2/payments/off_session_payment_retrieve_params"
require "stripe/params/v2/reporting/report_retrieve_params"
require "stripe/params/v2/reporting/report_run_create_params"
require "stripe/params/v2/reporting/report_run_retrieve_params"
require "stripe/params/v2/tax/automatic_rule_create_params" require "stripe/params/v2/tax/automatic_rule_create_params"
require "stripe/params/v2/tax/automatic_rule_deactivate_params" require "stripe/params/v2/tax/automatic_rule_deactivate_params"
require "stripe/params/v2/tax/automatic_rule_find_params" require "stripe/params/v2/tax/automatic_rule_find_params"

View File

@ -0,0 +1,10 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module V2
module Reporting
class ReportRetrieveParams < ::Stripe::RequestParams; end
end
end
end

View File

@ -0,0 +1,33 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module V2
module Reporting
class ReportRunCreateParams < ::Stripe::RequestParams
class ResultOptions < ::Stripe::RequestParams
# If set, the generated report file will be compressed into a ZIP folder.
# This is useful for reducing file size and download time for large reports.
attr_accessor :compress_file
def initialize(compress_file: nil)
@compress_file = compress_file
end
end
# The unique identifier of the `Report` being requested.
attr_accessor :report
# A map of parameter names to values, specifying how the report should be customized.
# The accepted parameters depend on the specific `Report` being run.
attr_accessor :report_parameters
# Optional settings to customize the results of the `ReportRun`.
attr_accessor :result_options
def initialize(report: nil, report_parameters: nil, result_options: nil)
@report = report
@report_parameters = report_parameters
@result_options = result_options
end
end
end
end
end

View File

@ -0,0 +1,10 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module V2
module Reporting
class ReportRunRetrieveParams < ::Stripe::RequestParams; end
end
end
end

View File

@ -222,6 +222,8 @@ require "stripe/resources/v2/money_management/recipient_verification"
require "stripe/resources/v2/money_management/transaction" require "stripe/resources/v2/money_management/transaction"
require "stripe/resources/v2/money_management/transaction_entry" require "stripe/resources/v2/money_management/transaction_entry"
require "stripe/resources/v2/payments/off_session_payment" require "stripe/resources/v2/payments/off_session_payment"
require "stripe/resources/v2/reporting/report"
require "stripe/resources/v2/reporting/report_run"
require "stripe/resources/v2/tax/automatic_rule" require "stripe/resources/v2/tax/automatic_rule"
require "stripe/resources/webhook_endpoint" require "stripe/resources/webhook_endpoint"
require "stripe/events/v1_account_updated_event" require "stripe/events/v1_account_updated_event"
@ -537,3 +539,7 @@ require "stripe/events/v2_payments_off_session_payment_created_event"
require "stripe/events/v2_payments_off_session_payment_failed_event" require "stripe/events/v2_payments_off_session_payment_failed_event"
require "stripe/events/v2_payments_off_session_payment_requires_capture_event" require "stripe/events/v2_payments_off_session_payment_requires_capture_event"
require "stripe/events/v2_payments_off_session_payment_succeeded_event" require "stripe/events/v2_payments_off_session_payment_succeeded_event"
require "stripe/events/v2_reporting_report_run_created_event"
require "stripe/events/v2_reporting_report_run_failed_event"
require "stripe/events/v2_reporting_report_run_succeeded_event"
require "stripe/events/v2_reporting_report_run_updated_event"

View File

@ -0,0 +1,116 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module V2
module Reporting
# The Report resource represents a customizable report template that provides insights into various aspects of your Stripe integration.
class Report < APIResource
OBJECT_NAME = "v2.reporting.report"
def self.object_name
"v2.reporting.report"
end
class Parameters < ::Stripe::StripeObject
class ArrayDetails < ::Stripe::StripeObject
class EnumDetails < ::Stripe::StripeObject
# Allowed values of the enum.
attr_reader :allowed_values
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Data type of the elements in the array.
attr_reader :element_type
# Details about enum elements in the array.
attr_reader :enum_details
def self.inner_class_types
@inner_class_types = { enum_details: EnumDetails }
end
def self.field_remappings
@field_remappings = {}
end
end
class EnumDetails < ::Stripe::StripeObject
# Allowed values of the enum.
attr_reader :allowed_values
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
class TimestampDetails < ::Stripe::StripeObject
# Maximum permitted timestamp which can be requested.
attr_reader :max
# Minimum permitted timestamp which can be requested.
attr_reader :min
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# For array parameters, provides details about the array elements.
attr_reader :array_details
# Explains the purpose and usage of the parameter.
attr_reader :description
# For enum parameters, provides the list of allowed values.
attr_reader :enum_details
# Indicates whether the parameter must be provided.
attr_reader :required
# For timestamp parameters, specifies the allowed date range.
attr_reader :timestamp_details
# The data type of the parameter.
attr_reader :type
def self.inner_class_types
@inner_class_types = {
array_details: ArrayDetails,
enum_details: EnumDetails,
timestamp_details: TimestampDetails,
}
end
def self.field_remappings
@field_remappings = {}
end
end
# The unique identifier of the `Report` object.
attr_reader :id
# The human-readable name of the `Report`.
attr_reader :name
# String representing the object's type. Objects of the same type share the same value of the object field.
attr_reader :object
# Specification of the parameters that the `Report` accepts. It details each parameter's
# name, description, whether it is required, and any validations performed.
attr_reader :parameters
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
attr_reader :livemode
def self.inner_class_types
@inner_class_types = { parameters: Parameters }
end
def self.field_remappings
@field_remappings = {}
end
end
end
end
end

View File

@ -0,0 +1,128 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module V2
module Reporting
# The `ReportRun` object represents an instance of a `Report` generated with specific
# run parameters. Once the object is created, Stripe begins processing the report. When
# the report has finished running, it will give you a reference to the results.
class ReportRun < APIResource
OBJECT_NAME = "v2.reporting.report_run"
def self.object_name
"v2.reporting.report_run"
end
class Result < ::Stripe::StripeObject
class File < ::Stripe::StripeObject
class DownloadUrl < ::Stripe::StripeObject
# The time that the URL expires.
attr_reader :expires_at
# The URL that can be used for accessing the file.
attr_reader :url
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# The content type of the file.
attr_reader :content_type
# A pre-signed URL that allows secure, time-limited access to download the file.
attr_reader :download_url
# The total size of the file in bytes.
attr_reader :size
def self.inner_class_types
@inner_class_types = { download_url: DownloadUrl }
end
def self.field_remappings
@field_remappings = {}
end
end
# Contains metadata about the file produced by the `ReportRun`, including
# its content type, size, and a URL to download its contents.
attr_reader :file
# The type of the `ReportRun` result.
attr_reader :type
def self.inner_class_types
@inner_class_types = { file: File }
end
def self.field_remappings
@field_remappings = {}
end
end
class ResultOptions < ::Stripe::StripeObject
# If set, the generated report file will be compressed into a ZIP folder.
# This is useful for reducing file size and download time for large reports.
attr_reader :compress_file
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
class StatusDetails < ::Stripe::StripeObject
# Error code categorizing the reason the `ReportRun` failed.
attr_reader :error_code
# Error message with additional details about the failure.
attr_reader :error_message
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Time at which the object was created.
attr_reader :created
# The unique identifier of the `ReportRun` object.
attr_reader :id
# String representing the object's type. Objects of the same type share the same value of the object field.
attr_reader :object
# The unique identifier of the `Report` object which was run.
attr_reader :report
# The human-readable name of the `Report` which was run.
attr_reader :report_name
# The parameters used to customize the generation of the report.
attr_reader :report_parameters
# Details how to retrieve the results of a successfully completed `ReportRun`.
attr_reader :result
# The options specified for customizing the output file of the `ReportRun`.
attr_reader :result_options
# The current status of the `ReportRun`.
attr_reader :status
# Additional details about the current state of the `ReportRun`. The field is currently only populated when a `ReportRun`
# is in the `failed` state, providing more information about why the report failed to generate successfully.
attr_reader :status_details
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
attr_reader :livemode
def self.inner_class_types
@inner_class_types = {
result: Result,
result_options: ResultOptions,
status_details: StatusDetails,
}
end
def self.field_remappings
@field_remappings = {}
end
end
end
end
end

View File

@ -259,6 +259,9 @@ require "stripe/services/v2/money_management/transaction_service"
require "stripe/services/v2/money_management_service" require "stripe/services/v2/money_management_service"
require "stripe/services/v2/payment_service" require "stripe/services/v2/payment_service"
require "stripe/services/v2/payments/off_session_payment_service" require "stripe/services/v2/payments/off_session_payment_service"
require "stripe/services/v2/reporting/report_run_service"
require "stripe/services/v2/reporting/report_service"
require "stripe/services/v2/reporting_service"
require "stripe/services/v2/tax/automatic_rule_service" require "stripe/services/v2/tax/automatic_rule_service"
require "stripe/services/v2/tax_service" require "stripe/services/v2/tax_service"
require "stripe/services/v2/test_helper_service" require "stripe/services/v2/test_helper_service"

View File

@ -0,0 +1,38 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module V2
module Reporting
class ReportRunService < StripeService
# Initiates the generation of a `ReportRun` based on the specified report template
# and user-provided parameters. It's the starting point for obtaining report data,
# and returns a `ReportRun` object which can be used to track the progress and retrieve
# the results of the report.
#
# ** raises RateLimitError
def create(params = {}, opts = {})
request(
method: :post,
path: "/v2/reporting/report_runs",
params: params,
opts: opts,
base_address: :api
)
end
# Fetches the current state and details of a previously created `ReportRun`. If the `ReportRun`
# has succeeded, the endpoint will provide details for how to retrieve the results.
def retrieve(id, params = {}, opts = {})
request(
method: :get,
path: format("/v2/reporting/report_runs/%<id>s", { id: CGI.escape(id) }),
params: params,
opts: opts,
base_address: :api
)
end
end
end
end
end

View File

@ -0,0 +1,23 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module V2
module Reporting
class ReportService < StripeService
# Retrieves metadata about a specific `Report` template, including its name, description,
# and the parameters it accepts. It's useful for understanding the capabilities and
# requirements of a particular `Report` before requesting a `ReportRun`.
def retrieve(id, params = {}, opts = {})
request(
method: :get,
path: format("/v2/reporting/reports/%<id>s", { id: CGI.escape(id) }),
params: params,
opts: opts,
base_address: :api
)
end
end
end
end
end

View File

@ -0,0 +1,16 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
module Stripe
module V2
class ReportingService < StripeService
attr_reader :reports, :report_runs
def initialize(requestor)
super
@reports = Stripe::V2::Reporting::ReportService.new(@requestor)
@report_runs = Stripe::V2::Reporting::ReportRunService.new(@requestor)
end
end
end
end

View File

@ -3,7 +3,7 @@
module Stripe module Stripe
class V2Services < StripeService class V2Services < StripeService
attr_reader :billing, :core, :money_management, :payments, :tax, :test_helpers attr_reader :billing, :core, :money_management, :payments, :reporting, :tax, :test_helpers
def initialize(requestor) def initialize(requestor)
super super
@ -11,6 +11,7 @@ module Stripe
@core = Stripe::V2::CoreService.new(@requestor) @core = Stripe::V2::CoreService.new(@requestor)
@money_management = Stripe::V2::MoneyManagementService.new(@requestor) @money_management = Stripe::V2::MoneyManagementService.new(@requestor)
@payments = Stripe::V2::PaymentService.new(@requestor) @payments = Stripe::V2::PaymentService.new(@requestor)
@reporting = Stripe::V2::ReportingService.new(@requestor)
@tax = Stripe::V2::TaxService.new(@requestor) @tax = Stripe::V2::TaxService.new(@requestor)
@test_helpers = Stripe::V2::TestHelperService.new(@requestor) @test_helpers = Stripe::V2::TestHelperService.new(@requestor)
end end

View File

@ -69893,6 +69893,230 @@ module Stripe
end end
end end
# typed: true # typed: true
module Stripe
module V2
module Reporting
# The `ReportRun` object represents an instance of a `Report` generated with specific
# run parameters. Once the object is created, Stripe begins processing the report. When
# the report has finished running, it will give you a reference to the results.
class ReportRun < APIResource
class Result < ::Stripe::StripeObject
class File < ::Stripe::StripeObject
class DownloadUrl < ::Stripe::StripeObject
# The time that the URL expires.
sig { returns(T.nilable(String)) }
def expires_at; end
# The URL that can be used for accessing the file.
sig { returns(String) }
def url; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# The content type of the file.
sig { returns(String) }
def content_type; end
# A pre-signed URL that allows secure, time-limited access to download the file.
sig { returns(DownloadUrl) }
def download_url; end
# The total size of the file in bytes.
sig { returns(Integer) }
def size; end
def self.inner_class_types
@inner_class_types = {download_url: DownloadUrl}
end
def self.field_remappings
@field_remappings = {}
end
end
# Contains metadata about the file produced by the `ReportRun`, including
# its content type, size, and a URL to download its contents.
sig { returns(File) }
def file; end
# The type of the `ReportRun` result.
sig { returns(String) }
def type; end
def self.inner_class_types
@inner_class_types = {file: File}
end
def self.field_remappings
@field_remappings = {}
end
end
class ResultOptions < ::Stripe::StripeObject
# If set, the generated report file will be compressed into a ZIP folder.
# This is useful for reducing file size and download time for large reports.
sig { returns(T.nilable(T::Boolean)) }
def compress_file; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
class StatusDetails < ::Stripe::StripeObject
# Error code categorizing the reason the `ReportRun` failed.
sig { returns(T.nilable(String)) }
def error_code; end
# Error message with additional details about the failure.
sig { returns(T.nilable(String)) }
def error_message; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Time at which the object was created.
sig { returns(String) }
def created; end
# The unique identifier of the `ReportRun` object.
sig { returns(String) }
def id; end
# String representing the object's type. Objects of the same type share the same value of the object field.
sig { returns(String) }
def object; end
# The unique identifier of the `Report` object which was run.
sig { returns(String) }
def report; end
# The human-readable name of the `Report` which was run.
sig { returns(String) }
def report_name; end
# The parameters used to customize the generation of the report.
sig { returns(T::Hash[String, T.untyped]) }
def report_parameters; end
# Details how to retrieve the results of a successfully completed `ReportRun`.
sig { returns(T.nilable(Result)) }
def result; end
# The options specified for customizing the output file of the `ReportRun`.
sig { returns(T.nilable(ResultOptions)) }
def result_options; end
# The current status of the `ReportRun`.
sig { returns(String) }
def status; end
# Additional details about the current state of the `ReportRun`. The field is currently only populated when a `ReportRun`
# is in the `failed` state, providing more information about why the report failed to generate successfully.
sig { returns(T::Hash[String, StatusDetails]) }
def status_details; end
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
sig { returns(T::Boolean) }
def livemode; end
end
end
end
end
# typed: true
module Stripe
module V2
module Reporting
# The Report resource represents a customizable report template that provides insights into various aspects of your Stripe integration.
class Report < APIResource
class Parameters < ::Stripe::StripeObject
class ArrayDetails < ::Stripe::StripeObject
class EnumDetails < ::Stripe::StripeObject
# Allowed values of the enum.
sig { returns(T::Array[String]) }
def allowed_values; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Data type of the elements in the array.
sig { returns(String) }
def element_type; end
# Details about enum elements in the array.
sig { returns(T.nilable(EnumDetails)) }
def enum_details; end
def self.inner_class_types
@inner_class_types = {enum_details: EnumDetails}
end
def self.field_remappings
@field_remappings = {}
end
end
class EnumDetails < ::Stripe::StripeObject
# Allowed values of the enum.
sig { returns(T::Array[String]) }
def allowed_values; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
class TimestampDetails < ::Stripe::StripeObject
# Maximum permitted timestamp which can be requested.
sig { returns(String) }
def max; end
# Minimum permitted timestamp which can be requested.
sig { returns(String) }
def min; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# For array parameters, provides details about the array elements.
sig { returns(T.nilable(ArrayDetails)) }
def array_details; end
# Explains the purpose and usage of the parameter.
sig { returns(String) }
def description; end
# For enum parameters, provides the list of allowed values.
sig { returns(T.nilable(EnumDetails)) }
def enum_details; end
# Indicates whether the parameter must be provided.
sig { returns(T::Boolean) }
def required; end
# For timestamp parameters, specifies the allowed date range.
sig { returns(T.nilable(TimestampDetails)) }
def timestamp_details; end
# The data type of the parameter.
sig { returns(String) }
def type; end
def self.inner_class_types
@inner_class_types = {
array_details: ArrayDetails,
enum_details: EnumDetails,
timestamp_details: TimestampDetails,
}
end
def self.field_remappings
@field_remappings = {}
end
end
# The unique identifier of the `Report` object.
sig { returns(String) }
def id; end
# The human-readable name of the `Report`.
sig { returns(String) }
def name; end
# String representing the object's type. Objects of the same type share the same value of the object field.
sig { returns(String) }
def object; end
# Specification of the parameters that the `Report` accepts. It details each parameter's
# name, description, whether it is required, and any validations performed.
sig { returns(T::Hash[String, Parameters]) }
def parameters; end
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
sig { returns(T::Boolean) }
def livemode; end
end
end
end
end
# typed: true
module Stripe module Stripe
module V2 module V2
module Tax module Tax
@ -75260,6 +75484,7 @@ module Stripe
attr_reader :core attr_reader :core
attr_reader :money_management attr_reader :money_management
attr_reader :payments attr_reader :payments
attr_reader :reporting
attr_reader :tax attr_reader :tax
attr_reader :test_helpers attr_reader :test_helpers
end end
@ -76895,6 +77120,57 @@ module Stripe
end end
end end
# typed: true # typed: true
module Stripe
module V2
class ReportingService < StripeService
attr_reader :reports
attr_reader :report_runs
end
end
end
# typed: true
module Stripe
module V2
module Reporting
class ReportService < StripeService
# Retrieves metadata about a specific `Report` template, including its name, description,
# and the parameters it accepts. It's useful for understanding the capabilities and
# requirements of a particular `Report` before requesting a `ReportRun`.
sig {
params(id: String, params: T.any(::Stripe::V2::Reporting::ReportRetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Reporting::Report)
}
def retrieve(id, params = {}, opts = {}); end
end
end
end
end
# typed: true
module Stripe
module V2
module Reporting
class ReportRunService < StripeService
# Initiates the generation of a `ReportRun` based on the specified report template
# and user-provided parameters. It's the starting point for obtaining report data,
# and returns a `ReportRun` object which can be used to track the progress and retrieve
# the results of the report.
#
# ** raises RateLimitError
sig {
params(params: T.any(::Stripe::V2::Reporting::ReportRunCreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Reporting::ReportRun)
}
def create(params = {}, opts = {}); end
# Fetches the current state and details of a previously created `ReportRun`. If the `ReportRun`
# has succeeded, the endpoint will provide details for how to retrieve the results.
sig {
params(id: String, params: T.any(::Stripe::V2::Reporting::ReportRunRetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Reporting::ReportRun)
}
def retrieve(id, params = {}, opts = {}); end
end
end
end
end
# typed: true
module Stripe module Stripe
module V2 module V2
class TaxService < StripeService class TaxService < StripeService
@ -211443,6 +211719,65 @@ module Stripe
end end
end end
# typed: true # typed: true
module Stripe
module V2
module Reporting
class ReportRetrieveParams < ::Stripe::RequestParams; end
end
end
end
# typed: true
module Stripe
module V2
module Reporting
class ReportRunCreateParams < ::Stripe::RequestParams
class ResultOptions < ::Stripe::RequestParams
# If set, the generated report file will be compressed into a ZIP folder.
# This is useful for reducing file size and download time for large reports.
sig { returns(T.nilable(T::Boolean)) }
def compress_file; end
sig { params(_compress_file: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) }
def compress_file=(_compress_file); end
sig { params(compress_file: T.nilable(T::Boolean)).void }
def initialize(compress_file: nil); end
end
# The unique identifier of the `Report` being requested.
sig { returns(String) }
def report; end
sig { params(_report: String).returns(String) }
def report=(_report); end
# A map of parameter names to values, specifying how the report should be customized.
# The accepted parameters depend on the specific `Report` being run.
sig { returns(T::Hash[String, T.untyped]) }
def report_parameters; end
sig {
params(_report_parameters: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped])
}
def report_parameters=(_report_parameters); end
# Optional settings to customize the results of the `ReportRun`.
sig { returns(T.nilable(V2::Reporting::ReportRunCreateParams::ResultOptions)) }
def result_options; end
sig {
params(_result_options: T.nilable(V2::Reporting::ReportRunCreateParams::ResultOptions)).returns(T.nilable(V2::Reporting::ReportRunCreateParams::ResultOptions))
}
def result_options=(_result_options); end
sig {
params(report: String, report_parameters: T::Hash[String, T.untyped], result_options: T.nilable(V2::Reporting::ReportRunCreateParams::ResultOptions)).void
}
def initialize(report: nil, report_parameters: nil, result_options: nil); end
end
end
end
end
# typed: true
module Stripe
module V2
module Reporting
class ReportRunRetrieveParams < ::Stripe::RequestParams; end
end
end
end
# typed: true
module Stripe module Stripe
module V2 module V2
module Tax module Tax

View File

@ -0,0 +1,11 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
# typed: true
module Stripe
module V2
module Reporting
class ReportRetrieveParams < ::Stripe::RequestParams; end
end
end
end

View File

@ -0,0 +1,46 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
# typed: true
module Stripe
module V2
module Reporting
class ReportRunCreateParams < ::Stripe::RequestParams
class ResultOptions < ::Stripe::RequestParams
# If set, the generated report file will be compressed into a ZIP folder.
# This is useful for reducing file size and download time for large reports.
sig { returns(T.nilable(T::Boolean)) }
def compress_file; end
sig { params(_compress_file: T.nilable(T::Boolean)).returns(T.nilable(T::Boolean)) }
def compress_file=(_compress_file); end
sig { params(compress_file: T.nilable(T::Boolean)).void }
def initialize(compress_file: nil); end
end
# The unique identifier of the `Report` being requested.
sig { returns(String) }
def report; end
sig { params(_report: String).returns(String) }
def report=(_report); end
# A map of parameter names to values, specifying how the report should be customized.
# The accepted parameters depend on the specific `Report` being run.
sig { returns(T::Hash[String, T.untyped]) }
def report_parameters; end
sig {
params(_report_parameters: T::Hash[String, T.untyped]).returns(T::Hash[String, T.untyped])
}
def report_parameters=(_report_parameters); end
# Optional settings to customize the results of the `ReportRun`.
sig { returns(T.nilable(V2::Reporting::ReportRunCreateParams::ResultOptions)) }
def result_options; end
sig {
params(_result_options: T.nilable(V2::Reporting::ReportRunCreateParams::ResultOptions)).returns(T.nilable(V2::Reporting::ReportRunCreateParams::ResultOptions))
}
def result_options=(_result_options); end
sig {
params(report: String, report_parameters: T::Hash[String, T.untyped], result_options: T.nilable(V2::Reporting::ReportRunCreateParams::ResultOptions)).void
}
def initialize(report: nil, report_parameters: nil, result_options: nil); end
end
end
end
end

View File

@ -0,0 +1,11 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
# typed: true
module Stripe
module V2
module Reporting
class ReportRunRetrieveParams < ::Stripe::RequestParams; end
end
end
end

View File

@ -0,0 +1,109 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
# typed: true
module Stripe
module V2
module Reporting
# The Report resource represents a customizable report template that provides insights into various aspects of your Stripe integration.
class Report < APIResource
class Parameters < ::Stripe::StripeObject
class ArrayDetails < ::Stripe::StripeObject
class EnumDetails < ::Stripe::StripeObject
# Allowed values of the enum.
sig { returns(T::Array[String]) }
def allowed_values; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Data type of the elements in the array.
sig { returns(String) }
def element_type; end
# Details about enum elements in the array.
sig { returns(T.nilable(EnumDetails)) }
def enum_details; end
def self.inner_class_types
@inner_class_types = {enum_details: EnumDetails}
end
def self.field_remappings
@field_remappings = {}
end
end
class EnumDetails < ::Stripe::StripeObject
# Allowed values of the enum.
sig { returns(T::Array[String]) }
def allowed_values; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
class TimestampDetails < ::Stripe::StripeObject
# Maximum permitted timestamp which can be requested.
sig { returns(String) }
def max; end
# Minimum permitted timestamp which can be requested.
sig { returns(String) }
def min; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# For array parameters, provides details about the array elements.
sig { returns(T.nilable(ArrayDetails)) }
def array_details; end
# Explains the purpose and usage of the parameter.
sig { returns(String) }
def description; end
# For enum parameters, provides the list of allowed values.
sig { returns(T.nilable(EnumDetails)) }
def enum_details; end
# Indicates whether the parameter must be provided.
sig { returns(T::Boolean) }
def required; end
# For timestamp parameters, specifies the allowed date range.
sig { returns(T.nilable(TimestampDetails)) }
def timestamp_details; end
# The data type of the parameter.
sig { returns(String) }
def type; end
def self.inner_class_types
@inner_class_types = {
array_details: ArrayDetails,
enum_details: EnumDetails,
timestamp_details: TimestampDetails,
}
end
def self.field_remappings
@field_remappings = {}
end
end
# The unique identifier of the `Report` object.
sig { returns(String) }
def id; end
# The human-readable name of the `Report`.
sig { returns(String) }
def name; end
# String representing the object's type. Objects of the same type share the same value of the object field.
sig { returns(String) }
def object; end
# Specification of the parameters that the `Report` accepts. It details each parameter's
# name, description, whether it is required, and any validations performed.
sig { returns(T::Hash[String, Parameters]) }
def parameters; end
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
sig { returns(T::Boolean) }
def livemode; end
end
end
end
end

View File

@ -0,0 +1,121 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
# typed: true
module Stripe
module V2
module Reporting
# The `ReportRun` object represents an instance of a `Report` generated with specific
# run parameters. Once the object is created, Stripe begins processing the report. When
# the report has finished running, it will give you a reference to the results.
class ReportRun < APIResource
class Result < ::Stripe::StripeObject
class File < ::Stripe::StripeObject
class DownloadUrl < ::Stripe::StripeObject
# The time that the URL expires.
sig { returns(T.nilable(String)) }
def expires_at; end
# The URL that can be used for accessing the file.
sig { returns(String) }
def url; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# The content type of the file.
sig { returns(String) }
def content_type; end
# A pre-signed URL that allows secure, time-limited access to download the file.
sig { returns(DownloadUrl) }
def download_url; end
# The total size of the file in bytes.
sig { returns(Integer) }
def size; end
def self.inner_class_types
@inner_class_types = {download_url: DownloadUrl}
end
def self.field_remappings
@field_remappings = {}
end
end
# Contains metadata about the file produced by the `ReportRun`, including
# its content type, size, and a URL to download its contents.
sig { returns(File) }
def file; end
# The type of the `ReportRun` result.
sig { returns(String) }
def type; end
def self.inner_class_types
@inner_class_types = {file: File}
end
def self.field_remappings
@field_remappings = {}
end
end
class ResultOptions < ::Stripe::StripeObject
# If set, the generated report file will be compressed into a ZIP folder.
# This is useful for reducing file size and download time for large reports.
sig { returns(T.nilable(T::Boolean)) }
def compress_file; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
class StatusDetails < ::Stripe::StripeObject
# Error code categorizing the reason the `ReportRun` failed.
sig { returns(T.nilable(String)) }
def error_code; end
# Error message with additional details about the failure.
sig { returns(T.nilable(String)) }
def error_message; end
def self.inner_class_types
@inner_class_types = {}
end
def self.field_remappings
@field_remappings = {}
end
end
# Time at which the object was created.
sig { returns(String) }
def created; end
# The unique identifier of the `ReportRun` object.
sig { returns(String) }
def id; end
# String representing the object's type. Objects of the same type share the same value of the object field.
sig { returns(String) }
def object; end
# The unique identifier of the `Report` object which was run.
sig { returns(String) }
def report; end
# The human-readable name of the `Report` which was run.
sig { returns(String) }
def report_name; end
# The parameters used to customize the generation of the report.
sig { returns(T::Hash[String, T.untyped]) }
def report_parameters; end
# Details how to retrieve the results of a successfully completed `ReportRun`.
sig { returns(T.nilable(Result)) }
def result; end
# The options specified for customizing the output file of the `ReportRun`.
sig { returns(T.nilable(ResultOptions)) }
def result_options; end
# The current status of the `ReportRun`.
sig { returns(String) }
def status; end
# Additional details about the current state of the `ReportRun`. The field is currently only populated when a `ReportRun`
# is in the `failed` state, providing more information about why the report failed to generate successfully.
sig { returns(T::Hash[String, StatusDetails]) }
def status_details; end
# Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
sig { returns(T::Boolean) }
def livemode; end
end
end
end
end

View File

@ -0,0 +1,29 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
# typed: true
module Stripe
module V2
module Reporting
class ReportRunService < StripeService
# Initiates the generation of a `ReportRun` based on the specified report template
# and user-provided parameters. It's the starting point for obtaining report data,
# and returns a `ReportRun` object which can be used to track the progress and retrieve
# the results of the report.
#
# ** raises RateLimitError
sig {
params(params: T.any(::Stripe::V2::Reporting::ReportRunCreateParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Reporting::ReportRun)
}
def create(params = {}, opts = {}); end
# Fetches the current state and details of a previously created `ReportRun`. If the `ReportRun`
# has succeeded, the endpoint will provide details for how to retrieve the results.
sig {
params(id: String, params: T.any(::Stripe::V2::Reporting::ReportRunRetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Reporting::ReportRun)
}
def retrieve(id, params = {}, opts = {}); end
end
end
end
end

View File

@ -0,0 +1,19 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
# typed: true
module Stripe
module V2
module Reporting
class ReportService < StripeService
# Retrieves metadata about a specific `Report` template, including its name, description,
# and the parameters it accepts. It's useful for understanding the capabilities and
# requirements of a particular `Report` before requesting a `ReportRun`.
sig {
params(id: String, params: T.any(::Stripe::V2::Reporting::ReportRetrieveParams, T::Hash[T.untyped, T.untyped]), opts: T.untyped).returns(::Stripe::V2::Reporting::Report)
}
def retrieve(id, params = {}, opts = {}); end
end
end
end
end

View File

@ -0,0 +1,12 @@
# File generated from our OpenAPI spec
# frozen_string_literal: true
# typed: true
module Stripe
module V2
class ReportingService < StripeService
attr_reader :reports
attr_reader :report_runs
end
end
end

View File

@ -8,6 +8,7 @@ module Stripe
attr_reader :core attr_reader :core
attr_reader :money_management attr_reader :money_management
attr_reader :payments attr_reader :payments
attr_reader :reporting
attr_reader :tax attr_reader :tax
attr_reader :test_helpers attr_reader :test_helpers
end end

View File

@ -985,7 +985,7 @@ module Stripe
end end
should "Test core events get (service)" do should "Test core events get (service)" do
stub_request(:get, "#{Stripe::DEFAULT_API_BASE}/v2/core/events/ll_123").to_return( stub_request(:get, "#{Stripe::DEFAULT_API_BASE}/v2/core/events/ll_123").to_return(
body: '{"changes":{"key":{}},"context":"context","created":"1970-01-12T21:42:34.472Z","id":"obj_123","object":"v2.core.event","reason":{"type":"request","request":{"id":"obj_123","idempotency_key":"idempotency_key"}},"type":"type","v1_event_id":"v1_event_id","livemode":true}' body: '{"changes":{"int_key":123,"string_key":"value","boolean_key":true,"object_key":{"object_int_key":123,"object_string_key":"value","object_boolean_key":true},"array_key":[1,2,3]},"context":"context","created":"1970-01-12T21:42:34.472Z","id":"obj_123","object":"v2.core.event","reason":{"type":"request","request":{"id":"obj_123","idempotency_key":"idempotency_key"}},"type":"type","v1_event_id":"v1_event_id","livemode":true}'
) )
client = Stripe::StripeClient.new("sk_test_123") client = Stripe::StripeClient.new("sk_test_123")
@ -9837,6 +9837,49 @@ module Stripe
) )
assert_requested :post, "#{Stripe::DEFAULT_API_BASE}/v2/payments/off_session_payments/id_123/capture" assert_requested :post, "#{Stripe::DEFAULT_API_BASE}/v2/payments/off_session_payments/id_123/capture"
end end
should "Test v2 reporting report get (service)" do
stub_request(:get, "#{Stripe::DEFAULT_API_BASE}/v2/reporting/reports/id_123").to_return(
body: '{"id":"obj_123","name":"name","object":"v2.reporting.report","parameters":{"key":{"description":"description","required":true,"type":"string"}},"livemode":true}',
status: 200
)
client = Stripe::StripeClient.new("sk_test_123")
report = client.v2.reporting.reports.retrieve("id_123")
assert_requested :get, "#{Stripe::DEFAULT_API_BASE}/v2/reporting/reports/id_123"
end
should "Test v2 reporting report run post (service)" do
stub_request(:post, "#{Stripe::DEFAULT_API_BASE}/v2/reporting/report_runs").to_return(
body: '{"created":"1970-01-12T21:42:34.472Z","id":"obj_123","object":"v2.reporting.report_run","report":"report","report_name":"report_name","report_parameters":{"int_key":123,"string_key":"value","boolean_key":true,"object_key":{"object_int_key":123,"object_string_key":"value","object_boolean_key":true},"array_key":[1,2,3]},"status":"failed","status_details":{"key":{}},"livemode":true}',
status: 200
)
client = Stripe::StripeClient.new("sk_test_123")
report_run = client.v2.reporting.report_runs.create({
report: "report",
report_parameters: {
int_key: 123,
string_key: "value",
boolean_key: true,
object_key: {
object_int_key: 123,
object_string_key: "value",
object_boolean_key: true,
},
array_key: [1, 2, 3],
},
})
assert_requested :post, "#{Stripe::DEFAULT_API_BASE}/v2/reporting/report_runs"
end
should "Test v2 reporting report run get (service)" do
stub_request(:get, "#{Stripe::DEFAULT_API_BASE}/v2/reporting/report_runs/id_123").to_return(
body: '{"created":"1970-01-12T21:42:34.472Z","id":"obj_123","object":"v2.reporting.report_run","report":"report","report_name":"report_name","report_parameters":{"int_key":123,"string_key":"value","boolean_key":true,"object_key":{"object_int_key":123,"object_string_key":"value","object_boolean_key":true},"array_key":[1,2,3]},"status":"failed","status_details":{"key":{}},"livemode":true}',
status: 200
)
client = Stripe::StripeClient.new("sk_test_123")
report_run = client.v2.reporting.report_runs.retrieve("id_123")
assert_requested :get, "#{Stripe::DEFAULT_API_BASE}/v2/reporting/report_runs/id_123"
end
should "Test v2 tax automatic rule post (service)" do should "Test v2 tax automatic rule post (service)" do
stub_request(:post, "#{Stripe::DEFAULT_API_BASE}/v2/tax/automatic_rules").to_return( stub_request(:post, "#{Stripe::DEFAULT_API_BASE}/v2/tax/automatic_rules").to_return(
body: '{"billable_item":"billable_item","created":"1970-01-12T21:42:34.472Z","id":"obj_123","object":"v2.tax.automatic_rule","status":"active","tax_code":"tax_code","livemode":true}', body: '{"billable_item":"billable_item","created":"1970-01-12T21:42:34.472Z","id":"obj_123","object":"v2.tax.automatic_rule","status":"active","tax_code":"tax_code","livemode":true}',