RequestService.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\Forwarding;
  4. /**
  5. * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  6. * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  7. */
  8. class RequestService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * Lists all ForwardingRequest objects.
  12. *
  13. * @param null|array $params
  14. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  15. *
  16. * @throws \Stripe\Exception\ApiErrorException if the request fails
  17. *
  18. * @return \Stripe\Collection<\Stripe\Forwarding\Request>
  19. */
  20. public function all($params = null, $opts = null)
  21. {
  22. return $this->requestCollection('get', '/v1/forwarding/requests', $params, $opts);
  23. }
  24. /**
  25. * Creates a ForwardingRequest object.
  26. *
  27. * @param null|array $params
  28. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  29. *
  30. * @throws \Stripe\Exception\ApiErrorException if the request fails
  31. *
  32. * @return \Stripe\Forwarding\Request
  33. */
  34. public function create($params = null, $opts = null)
  35. {
  36. return $this->request('post', '/v1/forwarding/requests', $params, $opts);
  37. }
  38. /**
  39. * Retrieves a ForwardingRequest object.
  40. *
  41. * @param string $id
  42. * @param null|array $params
  43. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  44. *
  45. * @throws \Stripe\Exception\ApiErrorException if the request fails
  46. *
  47. * @return \Stripe\Forwarding\Request
  48. */
  49. public function retrieve($id, $params = null, $opts = null)
  50. {
  51. return $this->request('get', $this->buildPath('/v1/forwarding/requests/%s', $id), $params, $opts);
  52. }
  53. }