ValueListService.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\Radar;
  4. class ValueListService extends \Stripe\Service\AbstractService
  5. {
  6. /**
  7. * Returns a list of <code>ValueList</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_lists', $params, $opts);
  21. }
  22. /**
  23. * Creates a new <code>ValueList</code> object, which can then be referenced in
  24. * rules.
  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\ValueList
  32. */
  33. public function create($params = null, $opts = null)
  34. {
  35. return $this->request('post', '/v1/radar/value_lists', $params, $opts);
  36. }
  37. /**
  38. * Deletes a <code>ValueList</code> object, also deleting any items contained
  39. * within the value list. To be deleted, a value list must not be referenced in any
  40. * rules.
  41. *
  42. * @param string $id
  43. * @param null|array $params
  44. * @param null|array|\Stripe\Util\RequestOptions $opts
  45. *
  46. * @throws \Stripe\Exception\ApiErrorException if the request fails
  47. *
  48. * @return \Stripe\Radar\ValueList
  49. */
  50. public function delete($id, $params = null, $opts = null)
  51. {
  52. return $this->request('delete', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts);
  53. }
  54. /**
  55. * Retrieves a <code>ValueList</code> object.
  56. *
  57. * @param string $id
  58. * @param null|array $params
  59. * @param null|array|\Stripe\Util\RequestOptions $opts
  60. *
  61. * @throws \Stripe\Exception\ApiErrorException if the request fails
  62. *
  63. * @return \Stripe\Radar\ValueList
  64. */
  65. public function retrieve($id, $params = null, $opts = null)
  66. {
  67. return $this->request('get', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts);
  68. }
  69. /**
  70. * Updates a <code>ValueList</code> object by setting the values of the parameters
  71. * passed. Any parameters not provided will be left unchanged. Note that
  72. * <code>item_type</code> is immutable.
  73. *
  74. * @param string $id
  75. * @param null|array $params
  76. * @param null|array|\Stripe\Util\RequestOptions $opts
  77. *
  78. * @throws \Stripe\Exception\ApiErrorException if the request fails
  79. *
  80. * @return \Stripe\Radar\ValueList
  81. */
  82. public function update($id, $params = null, $opts = null)
  83. {
  84. return $this->request('post', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts);
  85. }
  86. }