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, RetrieveParams
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.
-
.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
#==, #[], #[]=, 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.
171 172 173 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 171 def created @created end |
#error ⇒ Object (readonly)
If something should go wrong during the run, a message about the failure (populated when
`status=failed`).
175 176 177 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 175 def error @error end |
#id ⇒ Object (readonly)
Unique identifier for the object.
178 179 180 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 178 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.
181 182 183 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 181 def livemode @livemode end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
184 185 186 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 184 def object @object end |
#parameters ⇒ Object (readonly)
Attribute for field parameters
187 188 189 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 187 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”`.
190 191 192 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 190 def report_type @report_type end |
#result ⇒ Object (readonly)
The file object representing the result of the report run (populated when
`status=succeeded`).
194 195 196 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 194 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.
199 200 201 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 199 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.
203 204 205 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 203 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).)
206 207 208 209 210 211 212 213 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 206 def self.create(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/reporting/report_runs", params: params, opts: opts ) end |
.list(params = {}, opts = {}) ⇒ Object
Returns a list of Report Runs, with the most recent appearing first.
216 217 218 219 220 221 222 223 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 216 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 |