OperationServiceClient.php 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <?php
  2. // GENERATED CODE -- DO NOT EDIT!
  3. namespace Ydb\Operation\V1;
  4. /**
  5. * All rpc calls to YDB are allowed to be asynchronous. Response message
  6. * of an rpc call contains Operation structure and OperationService
  7. * is used for polling operation completion.
  8. *
  9. * Operation has a field 'ready' to notify client if operation has been
  10. * completed or not. If result is ready a client has to handle 'result' field,
  11. * otherwise it is expected that client continues polling result via
  12. * GetOperation rpc of OperationService. Polling is made via unique
  13. * operation id provided in 'id' field of Operation.
  14. *
  15. * Note: Currently some operations have synchronous implementation and their result
  16. * is available when response is obtained. But a client must not make any
  17. * assumptions about synchronous or asynchronous nature of any operation and
  18. * be ready to poll operation status.
  19. *
  20. */
  21. class OperationServiceClient extends \Grpc\BaseStub {
  22. /**
  23. * @param string $hostname hostname
  24. * @param array $opts channel options
  25. * @param \Grpc\Channel $channel (optional) re-use channel object
  26. */
  27. public function __construct($hostname, $opts, $channel = null) {
  28. parent::__construct($hostname, $opts, $channel);
  29. }
  30. /**
  31. * Check status for a given operation.
  32. * @param \Ydb\Operations\GetOperationRequest $argument input argument
  33. * @param array $metadata metadata
  34. * @param array $options call options
  35. * @return \Grpc\UnaryCall
  36. */
  37. public function GetOperation(\Ydb\Operations\GetOperationRequest $argument,
  38. $metadata = [], $options = []) {
  39. return $this->_simpleRequest('/Ydb.Operation.V1.OperationService/GetOperation',
  40. $argument,
  41. ['\Ydb\Operations\GetOperationResponse', 'decode'],
  42. $metadata, $options);
  43. }
  44. /**
  45. * Starts cancellation of a long-running operation,
  46. * Clients can use GetOperation to check whether the cancellation succeeded
  47. * or whether the operation completed despite cancellation.
  48. * @param \Ydb\Operations\CancelOperationRequest $argument input argument
  49. * @param array $metadata metadata
  50. * @param array $options call options
  51. * @return \Grpc\UnaryCall
  52. */
  53. public function CancelOperation(\Ydb\Operations\CancelOperationRequest $argument,
  54. $metadata = [], $options = []) {
  55. return $this->_simpleRequest('/Ydb.Operation.V1.OperationService/CancelOperation',
  56. $argument,
  57. ['\Ydb\Operations\CancelOperationResponse', 'decode'],
  58. $metadata, $options);
  59. }
  60. /**
  61. * Forgets long-running operation. It does not cancel the operation and returns
  62. * an error if operation was not completed.
  63. * @param \Ydb\Operations\ForgetOperationRequest $argument input argument
  64. * @param array $metadata metadata
  65. * @param array $options call options
  66. * @return \Grpc\UnaryCall
  67. */
  68. public function ForgetOperation(\Ydb\Operations\ForgetOperationRequest $argument,
  69. $metadata = [], $options = []) {
  70. return $this->_simpleRequest('/Ydb.Operation.V1.OperationService/ForgetOperation',
  71. $argument,
  72. ['\Ydb\Operations\ForgetOperationResponse', 'decode'],
  73. $metadata, $options);
  74. }
  75. /**
  76. * Lists operations that match the specified filter in the request.
  77. * @param \Ydb\Operations\ListOperationsRequest $argument input argument
  78. * @param array $metadata metadata
  79. * @param array $options call options
  80. * @return \Grpc\UnaryCall
  81. */
  82. public function ListOperations(\Ydb\Operations\ListOperationsRequest $argument,
  83. $metadata = [], $options = []) {
  84. return $this->_simpleRequest('/Ydb.Operation.V1.OperationService/ListOperations',
  85. $argument,
  86. ['\Ydb\Operations\ListOperationsResponse', 'decode'],
  87. $metadata, $options);
  88. }
  89. }