SecretService.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. // File generated from our OpenAPI spec
  3. namespace Stripe\Service\Apps;
  4. /**
  5. * @phpstan-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  6. * @psalm-import-type RequestOptionsArray from \Stripe\Util\RequestOptions
  7. */
  8. class SecretService extends \Stripe\Service\AbstractService
  9. {
  10. /**
  11. * List all secrets stored on the given scope.
  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\Apps\Secret>
  19. */
  20. public function all($params = null, $opts = null)
  21. {
  22. return $this->requestCollection('get', '/v1/apps/secrets', $params, $opts);
  23. }
  24. /**
  25. * Create or replace a secret in the secret store.
  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\Apps\Secret
  33. */
  34. public function create($params = null, $opts = null)
  35. {
  36. return $this->request('post', '/v1/apps/secrets', $params, $opts);
  37. }
  38. /**
  39. * Deletes a secret from the secret store by name and scope.
  40. *
  41. * @param null|array $params
  42. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  43. *
  44. * @throws \Stripe\Exception\ApiErrorException if the request fails
  45. *
  46. * @return \Stripe\Apps\Secret
  47. */
  48. public function deleteWhere($params = null, $opts = null)
  49. {
  50. return $this->request('post', '/v1/apps/secrets/delete', $params, $opts);
  51. }
  52. /**
  53. * Finds a secret in the secret store by name and scope.
  54. *
  55. * @param null|array $params
  56. * @param null|RequestOptionsArray|\Stripe\Util\RequestOptions $opts
  57. *
  58. * @throws \Stripe\Exception\ApiErrorException if the request fails
  59. *
  60. * @return \Stripe\Apps\Secret
  61. */
  62. public function find($params = null, $opts = null)
  63. {
  64. return $this->request('get', '/v1/apps/secrets/find', $params, $opts);
  65. }
  66. }