LocationService.php 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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<\Stripe\Terminal\Location>
  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. For further details, including which
  22. * address fields are required in each country, see the <a
  23. * href="/docs/terminal/fleet/locations">Manage locations</a> guide.
  24. *
  25. * @param null|array $params
  26. * @param null|array|\Stripe\Util\RequestOptions $opts
  27. *
  28. * @throws \Stripe\Exception\ApiErrorException if the request fails
  29. *
  30. * @return \Stripe\Terminal\Location
  31. */
  32. public function create($params = null, $opts = null)
  33. {
  34. return $this->request('post', '/v1/terminal/locations', $params, $opts);
  35. }
  36. /**
  37. * Deletes a <code>Location</code> object.
  38. *
  39. * @param string $id
  40. * @param null|array $params
  41. * @param null|array|\Stripe\Util\RequestOptions $opts
  42. *
  43. * @throws \Stripe\Exception\ApiErrorException if the request fails
  44. *
  45. * @return \Stripe\Terminal\Location
  46. */
  47. public function delete($id, $params = null, $opts = null)
  48. {
  49. return $this->request('delete', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts);
  50. }
  51. /**
  52. * Retrieves a <code>Location</code> object.
  53. *
  54. * @param string $id
  55. * @param null|array $params
  56. * @param null|array|\Stripe\Util\RequestOptions $opts
  57. *
  58. * @throws \Stripe\Exception\ApiErrorException if the request fails
  59. *
  60. * @return \Stripe\Terminal\Location
  61. */
  62. public function retrieve($id, $params = null, $opts = null)
  63. {
  64. return $this->request('get', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts);
  65. }
  66. /**
  67. * Updates a <code>Location</code> object by setting the values of the parameters
  68. * passed. Any parameters not provided will be left unchanged.
  69. *
  70. * @param string $id
  71. * @param null|array $params
  72. * @param null|array|\Stripe\Util\RequestOptions $opts
  73. *
  74. * @throws \Stripe\Exception\ApiErrorException if the request fails
  75. *
  76. * @return \Stripe\Terminal\Location
  77. */
  78. public function update($id, $params = null, $opts = null)
  79. {
  80. return $this->request('post', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts);
  81. }
  82. }