PluginProbe ʕ •ᴥ•ʔ
Booking for Appointments and Events Calendar – Amelia / 2.4.6
Booking for Appointments and Events Calendar – Amelia v2.4.6
2.4.7 2.4.6 2.4.5 2.4.4 2.4.3 2.4.2 2.4.1 2.4 trunk 1.2.1 1.2.10 1.2.11 1.2.12 1.2.13 1.2.14 1.2.15 1.2.16 1.2.17 1.2.18 1.2.19 1.2.2 1.2.20 1.2.21 1.2.22 1.2.23 1.2.24 1.2.25 1.2.26 1.2.27 1.2.28 1.2.29 1.2.3 1.2.30 1.2.31 1.2.32 1.2.33 1.2.34 1.2.35 1.2.36 1.2.37 1.2.38 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.1.3 2.2 2.2.1 2.3
ameliabooking / vendor / stripe / stripe-php / lib / Reporting / ReportRun.php
ameliabooking / vendor / stripe / stripe-php / lib / Reporting Last commit date
ReportRun.php 7 months ago ReportType.php 7 months ago
ReportRun.php
91 lines
1 <?php
2
3 // File generated from our OpenAPI spec
4
5 namespace AmeliaVendor\Stripe\Reporting;
6
7 /**
8 * The Report Run object represents an instance of a report type generated with
9 * specific run parameters. Once the object is created, Stripe begins processing the report.
10 * When the report has finished running, it will give you a reference to a file
11 * where you can retrieve your results. For an overview, see
12 * <a href="https://stripe.com/docs/reporting/statements/api">API Access to Reports</a>.
13 *
14 * Note that certain report types can only be run based on your live-mode data (not test-mode
15 * data), and will error when queried without a <a href="https://stripe.com/docs/keys#test-live-modes">live-mode API key</a>.
16 *
17 * @property string $id Unique identifier for the object.
18 * @property string $object String representing the object's type. Objects of the same type share the same value.
19 * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch.
20 * @property null|string $error If something should go wrong during the run, a message about the failure (populated when <code>status=failed</code>).
21 * @property bool $livemode <code>true</code> if the report is run on live mode data and <code>false</code> if it is run on test mode data.
22 * @property (object{columns?: string[], connected_account?: string, currency?: string, interval_end?: int, interval_start?: int, payout?: string, reporting_category?: string, timezone?: string}&\AmeliaVendor\Stripe\StripeObject) $parameters
23 * @property string $report_type The ID of the <a href="https://stripe.com/docs/reports/report-types">report type</a> to run, such as <code>&quot;balance.summary.1&quot;</code>.
24 * @property null|\AmeliaVendor\Stripe\File $result The file object representing the result of the report run (populated when <code>status=succeeded</code>).
25 * @property string $status Status of this report run. This will be <code>pending</code> when the run is initially created. When the run finishes, this will be set to <code>succeeded</code> and the <code>result</code> field will be populated. Rarely, we may encounter an error, at which point this will be set to <code>failed</code> and the <code>error</code> field will be populated.
26 * @property null|int $succeeded_at Timestamp at which this run successfully finished (populated when <code>status=succeeded</code>). Measured in seconds since the Unix epoch.
27 */
28 class ReportRun extends \AmeliaVendor\Stripe\ApiResource
29 {
30 const OBJECT_NAME = 'reporting.report_run';
31
32 /**
33 * Creates a new object and begin running the report. (Certain report types require
34 * a <a href="https://stripe.com/docs/keys#test-live-modes">live-mode API key</a>.).
35 *
36 * @param null|array{expand?: string[], parameters?: array{columns?: string[], connected_account?: string, currency?: string, interval_end?: int, interval_start?: int, payout?: string, reporting_category?: string, timezone?: string}, report_type: string} $params
37 * @param null|array|string $options
38 *
39 * @return ReportRun the created resource
40 *
41 * @throws \AmeliaVendor\Stripe\Exception\ApiErrorException if the request fails
42 */
43 public static function create($params = null, $options = null)
44 {
45 self::_validateParams($params);
46 $url = static::classUrl();
47
48 list($response, $opts) = static::_staticRequest('post', $url, $params, $options);
49 $obj = \AmeliaVendor\Stripe\Util\Util::convertToStripeObject($response->json, $opts);
50 $obj->setLastResponse($response);
51
52 return $obj;
53 }
54
55 /**
56 * Returns a list of Report Runs, with the most recent appearing first.
57 *
58 * @param null|array{created?: array|int, ending_before?: string, expand?: string[], limit?: int, starting_after?: string} $params
59 * @param null|array|string $opts
60 *
61 * @return \AmeliaVendor\Stripe\Collection<ReportRun> of ApiResources
62 *
63 * @throws \AmeliaVendor\Stripe\Exception\ApiErrorException if the request fails
64 */
65 public static function all($params = null, $opts = null)
66 {
67 $url = static::classUrl();
68
69 return static::_requestPage($url, \AmeliaVendor\Stripe\Collection::class, $params, $opts);
70 }
71
72 /**
73 * Retrieves the details of an existing Report Run.
74 *
75 * @param array|string $id the ID of the API resource to retrieve, or an options array containing an `id` key
76 * @param null|array|string $opts
77 *
78 * @return ReportRun
79 *
80 * @throws \AmeliaVendor\Stripe\Exception\ApiErrorException if the request fails
81 */
82 public static function retrieve($id, $opts = null)
83 {
84 $opts = \AmeliaVendor\Stripe\Util\RequestOptions::parse($opts);
85 $instance = new static($id, $opts);
86 $instance->refresh();
87
88 return $instance;
89 }
90 }
91