Payload.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <?php
  2. # Generated by the protocol buffer compiler. DO NOT EDIT!
  3. # source: src/proto/grpc/testing/messages.proto
  4. namespace Grpc\Testing;
  5. use Google\Protobuf\Internal\GPBType;
  6. use Google\Protobuf\Internal\RepeatedField;
  7. use Google\Protobuf\Internal\GPBUtil;
  8. /**
  9. * A block of data, to simply increase gRPC message size.
  10. *
  11. * Generated from protobuf message <code>grpc.testing.Payload</code>
  12. */
  13. class Payload extends \Google\Protobuf\Internal\Message
  14. {
  15. /**
  16. * The type of data in body.
  17. *
  18. * Generated from protobuf field <code>.grpc.testing.PayloadType type = 1;</code>
  19. */
  20. protected $type = 0;
  21. /**
  22. * Primary contents of payload.
  23. *
  24. * Generated from protobuf field <code>bytes body = 2;</code>
  25. */
  26. protected $body = '';
  27. /**
  28. * Constructor.
  29. *
  30. * @param array $data {
  31. * Optional. Data for populating the Message object.
  32. *
  33. * @type int $type
  34. * The type of data in body.
  35. * @type string $body
  36. * Primary contents of payload.
  37. * }
  38. */
  39. public function __construct($data = NULL) {
  40. \GPBMetadata\Src\Proto\Grpc\Testing\Messages::initOnce();
  41. parent::__construct($data);
  42. }
  43. /**
  44. * The type of data in body.
  45. *
  46. * Generated from protobuf field <code>.grpc.testing.PayloadType type = 1;</code>
  47. * @return int
  48. */
  49. public function getType()
  50. {
  51. return $this->type;
  52. }
  53. /**
  54. * The type of data in body.
  55. *
  56. * Generated from protobuf field <code>.grpc.testing.PayloadType type = 1;</code>
  57. * @param int $var
  58. * @return $this
  59. */
  60. public function setType($var)
  61. {
  62. GPBUtil::checkEnum($var, \Grpc\Testing\PayloadType::class);
  63. $this->type = $var;
  64. return $this;
  65. }
  66. /**
  67. * Primary contents of payload.
  68. *
  69. * Generated from protobuf field <code>bytes body = 2;</code>
  70. * @return string
  71. */
  72. public function getBody()
  73. {
  74. return $this->body;
  75. }
  76. /**
  77. * Primary contents of payload.
  78. *
  79. * Generated from protobuf field <code>bytes body = 2;</code>
  80. * @param string $var
  81. * @return $this
  82. */
  83. public function setBody($var)
  84. {
  85. GPBUtil::checkString($var, False);
  86. $this->body = $var;
  87. return $this;
  88. }
  89. }