ValueListItemService.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\Radar;
  4. class ValueListItemService extends \Stripe\Service\AbstractService
  5. {
  6. /**
  7. * Returns a list of <code>ValueListItem</code> objects. The objects are sorted in
  8. * descending order by creation date, with the most recently created object
  9. * appearing first.
  10. *
  11. * @param null|array $params
  12. * @param null|array|\Stripe\Util\RequestOptions $opts
  13. *
  14. * @throws \Stripe\Exception\ApiErrorException if the request fails
  15. *
  16. * @return \Stripe\Collection
  17. */
  18. public function all($params = null, $opts = null)
  19. {
  20. return $this->requestCollection('get', '/v1/radar/value_list_items', $params, $opts);
  21. }
  22. /**
  23. * Creates a new <code>ValueListItem</code> object, which is added to the specified
  24. * parent value list.
  25. *
  26. * @param null|array $params
  27. * @param null|array|\Stripe\Util\RequestOptions $opts
  28. *
  29. * @throws \Stripe\Exception\ApiErrorException if the request fails
  30. *
  31. * @return \Stripe\Radar\ValueListItem
  32. */
  33. public function create($params = null, $opts = null)
  34. {
  35. return $this->request('post', '/v1/radar/value_list_items', $params, $opts);
  36. }
  37. /**
  38. * Deletes a <code>ValueListItem</code> object, removing it from its parent value
  39. * list.
  40. *
  41. * @param string $id
  42. * @param null|array $params
  43. * @param null|array|\Stripe\Util\RequestOptions $opts
  44. *
  45. * @throws \Stripe\Exception\ApiErrorException if the request fails
  46. *
  47. * @return \Stripe\Radar\ValueListItem
  48. */
  49. public function delete($id, $params = null, $opts = null)
  50. {
  51. return $this->request('delete', $this->buildPath('/v1/radar/value_list_items/%s', $id), $params, $opts);
  52. }
  53. /**
  54. * Retrieves a <code>ValueListItem</code> object.
  55. *
  56. * @param string $id
  57. * @param null|array $params
  58. * @param null|array|\Stripe\Util\RequestOptions $opts
  59. *
  60. * @throws \Stripe\Exception\ApiErrorException if the request fails
  61. *
  62. * @return \Stripe\Radar\ValueListItem
  63. */
  64. public function retrieve($id, $params = null, $opts = null)
  65. {
  66. return $this->request('get', $this->buildPath('/v1/radar/value_list_items/%s', $id), $params, $opts);
  67. }
  68. }