Progress.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_import.proto
  4. namespace Ydb\Import\ImportProgress;
  5. use UnexpectedValueException;
  6. /**
  7. * Protobuf type <code>Ydb.Import.ImportProgress.Progress</code>
  8. */
  9. class Progress
  10. {
  11. /**
  12. * Generated from protobuf enum <code>PROGRESS_UNSPECIFIED = 0;</code>
  13. */
  14. const PROGRESS_UNSPECIFIED = 0;
  15. /**
  16. * Generated from protobuf enum <code>PROGRESS_PREPARING = 1;</code>
  17. */
  18. const PROGRESS_PREPARING = 1;
  19. /**
  20. * Generated from protobuf enum <code>PROGRESS_TRANSFER_DATA = 2;</code>
  21. */
  22. const PROGRESS_TRANSFER_DATA = 2;
  23. /**
  24. * Generated from protobuf enum <code>PROGRESS_BUILD_INDEXES = 3;</code>
  25. */
  26. const PROGRESS_BUILD_INDEXES = 3;
  27. /**
  28. * Generated from protobuf enum <code>PROGRESS_DONE = 4;</code>
  29. */
  30. const PROGRESS_DONE = 4;
  31. /**
  32. * Generated from protobuf enum <code>PROGRESS_CANCELLATION = 5;</code>
  33. */
  34. const PROGRESS_CANCELLATION = 5;
  35. /**
  36. * Generated from protobuf enum <code>PROGRESS_CANCELLED = 6;</code>
  37. */
  38. const PROGRESS_CANCELLED = 6;
  39. private static $valueToName = [
  40. self::PROGRESS_UNSPECIFIED => 'PROGRESS_UNSPECIFIED',
  41. self::PROGRESS_PREPARING => 'PROGRESS_PREPARING',
  42. self::PROGRESS_TRANSFER_DATA => 'PROGRESS_TRANSFER_DATA',
  43. self::PROGRESS_BUILD_INDEXES => 'PROGRESS_BUILD_INDEXES',
  44. self::PROGRESS_DONE => 'PROGRESS_DONE',
  45. self::PROGRESS_CANCELLATION => 'PROGRESS_CANCELLATION',
  46. self::PROGRESS_CANCELLED => 'PROGRESS_CANCELLED',
  47. ];
  48. public static function name($value)
  49. {
  50. if (!isset(self::$valueToName[$value])) {
  51. throw new UnexpectedValueException(sprintf(
  52. 'Enum %s has no name defined for value %s', __CLASS__, $value));
  53. }
  54. return self::$valueToName[$value];
  55. }
  56. public static function value($name)
  57. {
  58. $const = __CLASS__ . '::' . strtoupper($name);
  59. if (!defined($const)) {
  60. throw new UnexpectedValueException(sprintf(
  61. 'Enum %s has no value defined for name %s', __CLASS__, $name));
  62. }
  63. return constant($const);
  64. }
  65. }
  66. // Adding a class alias for backwards compatibility with the previous class name.
  67. class_alias(Progress::class, \Ydb\Import\ImportProgress_Progress::class);