ConfigurationService.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\Terminal;
  4. /**
  5. * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  6. * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  7. */
  8. class ConfigurationService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * Returns a list of <code>Configuration</code> 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\Terminal\Configuration>
  19. */
  20. public function all($params = null, $opts = null)
  21. {
  22. return $this->requestCollection('get', '/v1/terminal/configurations', $params, $opts);
  23. }
  24. /**
  25. * Creates a new <code>Configuration</code> 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\Terminal\Configuration
  33. */
  34. public function create($params = null, $opts = null)
  35. {
  36. return $this->request('post', '/v1/terminal/configurations', $params, $opts);
  37. }
  38. /**
  39. * Deletes a <code>Configuration</code> 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\Terminal\Configuration
  48. */
  49. public function delete($id, $params = null, $opts = null)
  50. {
  51. return $this->request('delete', $this->buildPath('/v1/terminal/configurations/%s', $id), $params, $opts);
  52. }
  53. /**
  54. * Retrieves a <code>Configuration</code> object.
  55. *
  56. * @param string $id
  57. * @param null|array $params
  58. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  59. *
  60. * @throws \Stripe\Exception\ApiErrorException if the request fails
  61. *
  62. * @return \Stripe\Terminal\Configuration
  63. */
  64. public function retrieve($id, $params = null, $opts = null)
  65. {
  66. return $this->request('get', $this->buildPath('/v1/terminal/configurations/%s', $id), $params, $opts);
  67. }
  68. /**
  69. * Updates a new <code>Configuration</code> object.
  70. *
  71. * @param string $id
  72. * @param null|array $params
  73. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  74. *
  75. * @throws \Stripe\Exception\ApiErrorException if the request fails
  76. *
  77. * @return \Stripe\Terminal\Configuration
  78. */
  79. public function update($id, $params = null, $opts = null)
  80. {
  81. return $this->request('post', $this->buildPath('/v1/terminal/configurations/%s', $id), $params, $opts);
  82. }
  83. }