RateLimiterServiceClient.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. // GENERATED CODE -- DO NOT EDIT!
  3. namespace Ydb\RateLimiter\V1;
  4. /**
  5. * Service that implements distributed rate limiting.
  6. *
  7. * To use rate limiter functionality you need an existing coordination node.
  8. *
  9. */
  10. class RateLimiterServiceClient extends \Grpc\BaseStub {
  11. /**
  12. * @param string $hostname hostname
  13. * @param array $opts channel options
  14. * @param \Grpc\Channel $channel (optional) re-use channel object
  15. */
  16. public function __construct($hostname, $opts, $channel = null) {
  17. parent::__construct($hostname, $opts, $channel);
  18. }
  19. /**
  20. * Create a new resource in existing coordination node.
  21. * @param \Ydb\RateLimiter\CreateResourceRequest $argument input argument
  22. * @param array $metadata metadata
  23. * @param array $options call options
  24. * @return \Grpc\UnaryCall
  25. */
  26. public function CreateResource(\Ydb\RateLimiter\CreateResourceRequest $argument,
  27. $metadata = [], $options = []) {
  28. return $this->_simpleRequest('/Ydb.RateLimiter.V1.RateLimiterService/CreateResource',
  29. $argument,
  30. ['\Ydb\RateLimiter\CreateResourceResponse', 'decode'],
  31. $metadata, $options);
  32. }
  33. /**
  34. * Update a resource in coordination node.
  35. * @param \Ydb\RateLimiter\AlterResourceRequest $argument input argument
  36. * @param array $metadata metadata
  37. * @param array $options call options
  38. * @return \Grpc\UnaryCall
  39. */
  40. public function AlterResource(\Ydb\RateLimiter\AlterResourceRequest $argument,
  41. $metadata = [], $options = []) {
  42. return $this->_simpleRequest('/Ydb.RateLimiter.V1.RateLimiterService/AlterResource',
  43. $argument,
  44. ['\Ydb\RateLimiter\AlterResourceResponse', 'decode'],
  45. $metadata, $options);
  46. }
  47. /**
  48. * Delete a resource from coordination node.
  49. * @param \Ydb\RateLimiter\DropResourceRequest $argument input argument
  50. * @param array $metadata metadata
  51. * @param array $options call options
  52. * @return \Grpc\UnaryCall
  53. */
  54. public function DropResource(\Ydb\RateLimiter\DropResourceRequest $argument,
  55. $metadata = [], $options = []) {
  56. return $this->_simpleRequest('/Ydb.RateLimiter.V1.RateLimiterService/DropResource',
  57. $argument,
  58. ['\Ydb\RateLimiter\DropResourceResponse', 'decode'],
  59. $metadata, $options);
  60. }
  61. /**
  62. * List resources in given coordination node.
  63. * @param \Ydb\RateLimiter\ListResourcesRequest $argument input argument
  64. * @param array $metadata metadata
  65. * @param array $options call options
  66. * @return \Grpc\UnaryCall
  67. */
  68. public function ListResources(\Ydb\RateLimiter\ListResourcesRequest $argument,
  69. $metadata = [], $options = []) {
  70. return $this->_simpleRequest('/Ydb.RateLimiter.V1.RateLimiterService/ListResources',
  71. $argument,
  72. ['\Ydb\RateLimiter\ListResourcesResponse', 'decode'],
  73. $metadata, $options);
  74. }
  75. /**
  76. * Describe properties of resource in coordination node.
  77. * @param \Ydb\RateLimiter\DescribeResourceRequest $argument input argument
  78. * @param array $metadata metadata
  79. * @param array $options call options
  80. * @return \Grpc\UnaryCall
  81. */
  82. public function DescribeResource(\Ydb\RateLimiter\DescribeResourceRequest $argument,
  83. $metadata = [], $options = []) {
  84. return $this->_simpleRequest('/Ydb.RateLimiter.V1.RateLimiterService/DescribeResource',
  85. $argument,
  86. ['\Ydb\RateLimiter\DescribeResourceResponse', 'decode'],
  87. $metadata, $options);
  88. }
  89. /**
  90. * Take units for usage of a resource in coordination node.
  91. * @param \Ydb\RateLimiter\AcquireResourceRequest $argument input argument
  92. * @param array $metadata metadata
  93. * @param array $options call options
  94. * @return \Grpc\UnaryCall
  95. */
  96. public function AcquireResource(\Ydb\RateLimiter\AcquireResourceRequest $argument,
  97. $metadata = [], $options = []) {
  98. return $this->_simpleRequest('/Ydb.RateLimiter.V1.RateLimiterService/AcquireResource',
  99. $argument,
  100. ['\Ydb\RateLimiter\AcquireResourceResponse', 'decode'],
  101. $metadata, $options);
  102. }
  103. }