Progress.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: protos/ydb_export.proto
  4. namespace Ydb\Export\ExportProgress;
  5. use UnexpectedValueException;
  6. /**
  7. * Protobuf type <code>Ydb.Export.ExportProgress.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_DONE = 3;</code>
  25. */
  26. const PROGRESS_DONE = 3;
  27. /**
  28. * Generated from protobuf enum <code>PROGRESS_CANCELLATION = 4;</code>
  29. */
  30. const PROGRESS_CANCELLATION = 4;
  31. /**
  32. * Generated from protobuf enum <code>PROGRESS_CANCELLED = 5;</code>
  33. */
  34. const PROGRESS_CANCELLED = 5;
  35. private static $valueToName = [
  36. self::PROGRESS_UNSPECIFIED => 'PROGRESS_UNSPECIFIED',
  37. self::PROGRESS_PREPARING => 'PROGRESS_PREPARING',
  38. self::PROGRESS_TRANSFER_DATA => 'PROGRESS_TRANSFER_DATA',
  39. self::PROGRESS_DONE => 'PROGRESS_DONE',
  40. self::PROGRESS_CANCELLATION => 'PROGRESS_CANCELLATION',
  41. self::PROGRESS_CANCELLED => 'PROGRESS_CANCELLED',
  42. ];
  43. public static function name($value)
  44. {
  45. if (!isset(self::$valueToName[$value])) {
  46. throw new UnexpectedValueException(sprintf(
  47. 'Enum %s has no name defined for value %s', __CLASS__, $value));
  48. }
  49. return self::$valueToName[$value];
  50. }
  51. public static function value($name)
  52. {
  53. $const = __CLASS__ . '::' . strtoupper($name);
  54. if (!defined($const)) {
  55. throw new UnexpectedValueException(sprintf(
  56. 'Enum %s has no value defined for name %s', __CLASS__, $name));
  57. }
  58. return constant($const);
  59. }
  60. }
  61. // Adding a class alias for backwards compatibility with the previous class name.
  62. class_alias(Progress::class, \Ydb\Export\ExportProgress_Progress::class);