OperationMode.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_operation.proto
  4. namespace Ydb\Operations\OperationParams;
  5. use UnexpectedValueException;
  6. /**
  7. * Protobuf type <code>Ydb.Operations.OperationParams.OperationMode</code>
  8. */
  9. class OperationMode
  10. {
  11. /**
  12. * Generated from protobuf enum <code>OPERATION_MODE_UNSPECIFIED = 0;</code>
  13. */
  14. const OPERATION_MODE_UNSPECIFIED = 0;
  15. /**
  16. * Server will only reply once operation is finished (ready=true), and operation object won't be
  17. * accessible after the reply. This is a basic request-response mode.
  18. *
  19. * Generated from protobuf enum <code>SYNC = 1;</code>
  20. */
  21. const SYNC = 1;
  22. /**
  23. * Generated from protobuf enum <code>ASYNC = 2;</code>
  24. */
  25. const ASYNC = 2;
  26. private static $valueToName = [
  27. self::OPERATION_MODE_UNSPECIFIED => 'OPERATION_MODE_UNSPECIFIED',
  28. self::SYNC => 'SYNC',
  29. self::ASYNC => 'ASYNC',
  30. ];
  31. public static function name($value)
  32. {
  33. if (!isset(self::$valueToName[$value])) {
  34. throw new UnexpectedValueException(sprintf(
  35. 'Enum %s has no name defined for value %s', __CLASS__, $value));
  36. }
  37. return self::$valueToName[$value];
  38. }
  39. public static function value($name)
  40. {
  41. $const = __CLASS__ . '::' . strtoupper($name);
  42. if (!defined($const)) {
  43. throw new UnexpectedValueException(sprintf(
  44. 'Enum %s has no value defined for name %s', __CLASS__, $name));
  45. }
  46. return constant($const);
  47. }
  48. }
  49. // Adding a class alias for backwards compatibility with the previous class name.
  50. class_alias(OperationMode::class, \Ydb\Operations\OperationParams_OperationMode::class);