Class: Stripe::Reporting::ReportRun
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::Reporting::ReportRun
- Extended by:
- APIOperations::Create, APIOperations::List
- Defined in:
- lib/stripe/resources/reporting/report_run.rb
Overview
The Report Run object represents an instance of a report type 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 a file where you can retrieve your results. For an overview, see [API Access to Reports](stripe.com/docs/reporting/statements/api).
Note that certain report types can only be run based on your live-mode data (not test-mode data), and will error when queried without a [live-mode API key](stripe.com/docs/keys#test-live-modes).
Defined Under Namespace
Classes: CreateParams, ListParams, Parameters
Constant Summary collapse
- OBJECT_NAME =
"reporting.report_run"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#created ⇒ Object
readonly
Time at which the object was created.
-
#error ⇒ Object
readonly
If something should go wrong during the run, a message about the failure (populated when ‘status=failed`).
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#livemode ⇒ Object
readonly
‘true` if the report is run on live mode data and `false` if it is run on test mode data.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#parameters ⇒ Object
readonly
Attribute for field parameters.
-
#report_type ⇒ Object
readonly
The ID of the [report type](stripe.com/docs/reports/report-types) to run, such as ‘“balance.summary.1”`.
-
#result ⇒ Object
readonly
The file object representing the result of the report run (populated when ‘status=succeeded`).
-
#status ⇒ Object
readonly
Status of this report run.
-
#succeeded_at ⇒ Object
readonly
Timestamp at which this run successfully finished (populated when ‘status=succeeded`).
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
-
.create(params = {}, opts = {}) ⇒ Object
Creates a new object and begin running the report.
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
-
.list(params = {}, opts = {}) ⇒ Object
Returns a list of Report Runs, with the most recent appearing first.
- .object_name ⇒ Object
Methods included from APIOperations::Create
Methods included from APIOperations::List
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#created ⇒ Object (readonly)
Time at which the object was created. Measured in seconds since the Unix epoch.
147 148 149 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 147 def created @created end |
#error ⇒ Object (readonly)
If something should go wrong during the run, a message about the failure (populated when
`status=failed`).
150 151 152 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 150 def error @error end |
#id ⇒ Object (readonly)
Unique identifier for the object.
152 153 154 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 152 def id @id end |
#livemode ⇒ Object (readonly)
‘true` if the report is run on live mode data and `false` if it is run on test mode data.
154 155 156 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 154 def livemode @livemode end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
156 157 158 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 156 def object @object end |
#parameters ⇒ Object (readonly)
Attribute for field parameters
158 159 160 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 158 def parameters @parameters end |
#report_type ⇒ Object (readonly)
The ID of the [report type](stripe.com/docs/reports/report-types) to run, such as ‘“balance.summary.1”`.
160 161 162 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 160 def report_type @report_type end |
#result ⇒ Object (readonly)
The file object representing the result of the report run (populated when
`status=succeeded`).
163 164 165 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 163 def result @result end |
#status ⇒ Object (readonly)
Status of this report run. This will be ‘pending` when the run is initially created.
When the run finishes, this will be set to `succeeded` and the `result` field will be populated.
Rarely, we may encounter an error, at which point this will be set to `failed` and the `error` field will be populated.
167 168 169 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 167 def status @status end |
#succeeded_at ⇒ Object (readonly)
Timestamp at which this run successfully finished (populated when
`status=succeeded`). Measured in seconds since the Unix epoch.
170 171 172 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 170 def succeeded_at @succeeded_at end |
Class Method Details
.create(params = {}, opts = {}) ⇒ Object
Creates a new object and begin running the report. (Certain report types require a [live-mode API key](stripe.com/docs/keys#test-live-modes).)
173 174 175 176 177 178 179 180 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 173 def self.create(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/reporting/report_runs", params: params, opts: opts ) end |
.field_remappings ⇒ Object
196 197 198 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 196 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
192 193 194 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 192 def self.inner_class_types @inner_class_types = { parameters: Parameters } end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of Report Runs, with the most recent appearing first.
183 184 185 186 187 188 189 190 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 183 def self.list(params = {}, opts = {}) request_stripe_object( method: :get, path: "/v1/reporting/report_runs", params: params, opts: opts ) end |
.object_name ⇒ Object
19 20 21 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 19 def self.object_name "reporting.report_run" end |