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.
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.
Defined Under Namespace
Classes: 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
trueif the report is run on live mode data andfalseif 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 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?, field_encodings, #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.
50 51 52 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 50 def created @created end |
#error ⇒ Object (readonly)
If something should go wrong during the run, a message about the failure (populated when
status=failed).
53 54 55 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 53 def error @error end |
#id ⇒ Object (readonly)
Unique identifier for the object.
55 56 57 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 55 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.
57 58 59 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 57 def livemode @livemode end |
#object ⇒ Object (readonly)
String representing the object's type. Objects of the same type share the same value.
59 60 61 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 59 def object @object end |
#parameters ⇒ Object (readonly)
Attribute for field parameters
61 62 63 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 61 def parameters @parameters end |
#report_type ⇒ Object (readonly)
The ID of the report type to run, such as "balance.summary.1".
63 64 65 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 63 def report_type @report_type end |
#result ⇒ Object (readonly)
The file object representing the result of the report run (populated when
status=succeeded).
66 67 68 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 66 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.
70 71 72 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 70 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.
73 74 75 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 73 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.)
76 77 78 79 80 81 82 83 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 76 def self.create(params = {}, opts = {}) request_stripe_object( method: :post, path: "/v1/reporting/report_runs", params: params, opts: opts ) end |
.field_remappings ⇒ Object
99 100 101 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 99 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
95 96 97 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 95 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.
86 87 88 89 90 91 92 93 |
# File 'lib/stripe/resources/reporting/report_run.rb', line 86 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 |