ReportRunService.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\Reporting;
  4. class ReportRunService extends \Stripe\Service\AbstractService
  5. {
  6. /**
  7. * Returns a list of Report Runs, with the most recent appearing first. (Requires a
  8. * <a href="https://stripe.com/docs/keys#test-live-modes">live-mode API key</a>.).
  9. *
  10. * @param null|array $params
  11. * @param null|array|\Stripe\Util\RequestOptions $opts
  12. *
  13. * @throws \Stripe\Exception\ApiErrorException if the request fails
  14. *
  15. * @return \Stripe\Collection
  16. */
  17. public function all($params = null, $opts = null)
  18. {
  19. return $this->requestCollection('get', '/v1/reporting/report_runs', $params, $opts);
  20. }
  21. /**
  22. * Creates a new object and begin running the report. (Requires a <a
  23. * href="https://stripe.com/docs/keys#test-live-modes">live-mode API key</a>.).
  24. *
  25. * @param null|array $params
  26. * @param null|array|\Stripe\Util\RequestOptions $opts
  27. *
  28. * @throws \Stripe\Exception\ApiErrorException if the request fails
  29. *
  30. * @return \Stripe\Reporting\ReportRun
  31. */
  32. public function create($params = null, $opts = null)
  33. {
  34. return $this->request('post', '/v1/reporting/report_runs', $params, $opts);
  35. }
  36. /**
  37. * Retrieves the details of an existing Report Run. (Requires a <a
  38. * href="https://stripe.com/docs/keys#test-live-modes">live-mode API key</a>.).
  39. *
  40. * @param string $id
  41. * @param null|array $params
  42. * @param null|array|\Stripe\Util\RequestOptions $opts
  43. *
  44. * @throws \Stripe\Exception\ApiErrorException if the request fails
  45. *
  46. * @return \Stripe\Reporting\ReportRun
  47. */
  48. public function retrieve($id, $params = null, $opts = null)
  49. {
  50. return $this->request('get', $this->buildPath('/v1/reporting/report_runs/%s', $id), $params, $opts);
  51. }
  52. }