LocationService.php 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\Terminal;
  4. class LocationService extends \Stripe\Service\AbstractService
  5. {
  6. /**
  7. * Returns a list of <code>Location</code> objects.
  8. *
  9. * @param null|array $params
  10. * @param null|array|\Stripe\Util\RequestOptions $opts
  11. *
  12. * @throws \Stripe\Exception\ApiErrorException if the request fails
  13. *
  14. * @return \Stripe\Collection
  15. */
  16. public function all($params = null, $opts = null)
  17. {
  18. return $this->requestCollection('get', '/v1/terminal/locations', $params, $opts);
  19. }
  20. /**
  21. * Creates a new <code>Location</code> object.
  22. *
  23. * @param null|array $params
  24. * @param null|array|\Stripe\Util\RequestOptions $opts
  25. *
  26. * @throws \Stripe\Exception\ApiErrorException if the request fails
  27. *
  28. * @return \Stripe\Terminal\Location
  29. */
  30. public function create($params = null, $opts = null)
  31. {
  32. return $this->request('post', '/v1/terminal/locations', $params, $opts);
  33. }
  34. /**
  35. * Deletes a <code>Location</code> object.
  36. *
  37. * @param string $id
  38. * @param null|array $params
  39. * @param null|array|\Stripe\Util\RequestOptions $opts
  40. *
  41. * @throws \Stripe\Exception\ApiErrorException if the request fails
  42. *
  43. * @return \Stripe\Terminal\Location
  44. */
  45. public function delete($id, $params = null, $opts = null)
  46. {
  47. return $this->request('delete', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts);
  48. }
  49. /**
  50. * Retrieves a <code>Location</code> object.
  51. *
  52. * @param string $id
  53. * @param null|array $params
  54. * @param null|array|\Stripe\Util\RequestOptions $opts
  55. *
  56. * @throws \Stripe\Exception\ApiErrorException if the request fails
  57. *
  58. * @return \Stripe\Terminal\Location
  59. */
  60. public function retrieve($id, $params = null, $opts = null)
  61. {
  62. return $this->request('get', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts);
  63. }
  64. /**
  65. * Updates a <code>Location</code> object by setting the values of the parameters
  66. * passed. Any parameters not provided will be left unchanged.
  67. *
  68. * @param string $id
  69. * @param null|array $params
  70. * @param null|array|\Stripe\Util\RequestOptions $opts
  71. *
  72. * @throws \Stripe\Exception\ApiErrorException if the request fails
  73. *
  74. * @return \Stripe\Terminal\Location
  75. */
  76. public function update($id, $params = null, $opts = null)
  77. {
  78. return $this->request('post', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts);
  79. }
  80. }