parent
3778c2b7cd
commit
60ca6e06d7
17 changed files with 1934 additions and 0 deletions
@ -0,0 +1,122 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# NO CHECKED-IN PROTOBUF GENCODE |
||||
# source: google/protobuf/descriptor.proto |
||||
|
||||
namespace Google\Protobuf\Internal; |
||||
|
||||
use UnexpectedValueException; |
||||
|
||||
/** |
||||
* The full set of known editions. |
||||
* |
||||
* Protobuf type <code>google.protobuf.Edition</code> |
||||
*/ |
||||
class Edition |
||||
{ |
||||
/** |
||||
* A placeholder for an unknown edition value. |
||||
* |
||||
* Generated from protobuf enum <code>EDITION_UNKNOWN = 0;</code> |
||||
*/ |
||||
const EDITION_UNKNOWN = 0; |
||||
/** |
||||
* A placeholder edition for specifying default behaviors *before* a feature |
||||
* was first introduced. This is effectively an "infinite past". |
||||
* |
||||
* Generated from protobuf enum <code>EDITION_LEGACY = 900;</code> |
||||
*/ |
||||
const EDITION_LEGACY = 900; |
||||
/** |
||||
* Legacy syntax "editions". These pre-date editions, but behave much like |
||||
* distinct editions. These can't be used to specify the edition of proto |
||||
* files, but feature definitions must supply proto2/proto3 defaults for |
||||
* backwards compatibility. |
||||
* |
||||
* Generated from protobuf enum <code>EDITION_PROTO2 = 998;</code> |
||||
*/ |
||||
const EDITION_PROTO2 = 998; |
||||
/** |
||||
* Generated from protobuf enum <code>EDITION_PROTO3 = 999;</code> |
||||
*/ |
||||
const EDITION_PROTO3 = 999; |
||||
/** |
||||
* Editions that have been released. The specific values are arbitrary and |
||||
* should not be depended on, but they will always be time-ordered for easy |
||||
* comparison. |
||||
* |
||||
* Generated from protobuf enum <code>EDITION_2023 = 1000;</code> |
||||
*/ |
||||
const EDITION_2023 = 1000; |
||||
/** |
||||
* Generated from protobuf enum <code>EDITION_2024 = 1001;</code> |
||||
*/ |
||||
const EDITION_2024 = 1001; |
||||
/** |
||||
* Placeholder editions for testing feature resolution. These should not be |
||||
* used or relied on outside of tests. |
||||
* |
||||
* Generated from protobuf enum <code>EDITION_1_TEST_ONLY = 1;</code> |
||||
*/ |
||||
const EDITION_1_TEST_ONLY = 1; |
||||
/** |
||||
* Generated from protobuf enum <code>EDITION_2_TEST_ONLY = 2;</code> |
||||
*/ |
||||
const EDITION_2_TEST_ONLY = 2; |
||||
/** |
||||
* Generated from protobuf enum <code>EDITION_99997_TEST_ONLY = 99997;</code> |
||||
*/ |
||||
const EDITION_99997_TEST_ONLY = 99997; |
||||
/** |
||||
* Generated from protobuf enum <code>EDITION_99998_TEST_ONLY = 99998;</code> |
||||
*/ |
||||
const EDITION_99998_TEST_ONLY = 99998; |
||||
/** |
||||
* Generated from protobuf enum <code>EDITION_99999_TEST_ONLY = 99999;</code> |
||||
*/ |
||||
const EDITION_99999_TEST_ONLY = 99999; |
||||
/** |
||||
* Placeholder for specifying unbounded edition support. This should only |
||||
* ever be used by plugins that can expect to never require any changes to |
||||
* support a new edition. |
||||
* |
||||
* Generated from protobuf enum <code>EDITION_MAX = 2147483647;</code> |
||||
*/ |
||||
const EDITION_MAX = 2147483647; |
||||
|
||||
private static $valueToName = [ |
||||
self::EDITION_UNKNOWN => 'EDITION_UNKNOWN', |
||||
self::EDITION_LEGACY => 'EDITION_LEGACY', |
||||
self::EDITION_PROTO2 => 'EDITION_PROTO2', |
||||
self::EDITION_PROTO3 => 'EDITION_PROTO3', |
||||
self::EDITION_2023 => 'EDITION_2023', |
||||
self::EDITION_2024 => 'EDITION_2024', |
||||
self::EDITION_1_TEST_ONLY => 'EDITION_1_TEST_ONLY', |
||||
self::EDITION_2_TEST_ONLY => 'EDITION_2_TEST_ONLY', |
||||
self::EDITION_99997_TEST_ONLY => 'EDITION_99997_TEST_ONLY', |
||||
self::EDITION_99998_TEST_ONLY => 'EDITION_99998_TEST_ONLY', |
||||
self::EDITION_99999_TEST_ONLY => 'EDITION_99999_TEST_ONLY', |
||||
self::EDITION_MAX => 'EDITION_MAX', |
||||
]; |
||||
|
||||
public static function name($value) |
||||
{ |
||||
if (!isset(self::$valueToName[$value])) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no name defined for value %s', __CLASS__, $value)); |
||||
} |
||||
return self::$valueToName[$value]; |
||||
} |
||||
|
||||
|
||||
public static function value($name) |
||||
{ |
||||
$const = __CLASS__ . '::' . strtoupper($name); |
||||
if (!defined($const)) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no value defined for name %s', __CLASS__, $name)); |
||||
} |
||||
return constant($const); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,278 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# NO CHECKED-IN PROTOBUF GENCODE |
||||
# source: google/protobuf/descriptor.proto |
||||
|
||||
namespace Google\Protobuf\Internal\ExtensionRangeOptions; |
||||
|
||||
use Google\Protobuf\Internal\GPBType; |
||||
use Google\Protobuf\Internal\GPBWire; |
||||
use Google\Protobuf\Internal\RepeatedField; |
||||
use Google\Protobuf\Internal\InputStream; |
||||
use Google\Protobuf\Internal\GPBUtil; |
||||
|
||||
/** |
||||
* Generated from protobuf message <code>google.protobuf.ExtensionRangeOptions.Declaration</code> |
||||
*/ |
||||
class Declaration extends \Google\Protobuf\Internal\Message |
||||
{ |
||||
/** |
||||
* The extension number declared within the extension range. |
||||
* |
||||
* Generated from protobuf field <code>optional int32 number = 1;</code> |
||||
*/ |
||||
protected $number = null; |
||||
/** |
||||
* The fully-qualified name of the extension field. There must be a leading |
||||
* dot in front of the full name. |
||||
* |
||||
* Generated from protobuf field <code>optional string full_name = 2;</code> |
||||
*/ |
||||
protected $full_name = null; |
||||
/** |
||||
* The fully-qualified type name of the extension field. Unlike |
||||
* Metadata.type, Declaration.type must have a leading dot for messages |
||||
* and enums. |
||||
* |
||||
* Generated from protobuf field <code>optional string type = 3;</code> |
||||
*/ |
||||
protected $type = null; |
||||
/** |
||||
* If true, indicates that the number is reserved in the extension range, |
||||
* and any extension field with the number will fail to compile. Set this |
||||
* when a declared extension field is deleted. |
||||
* |
||||
* Generated from protobuf field <code>optional bool reserved = 5;</code> |
||||
*/ |
||||
protected $reserved = null; |
||||
/** |
||||
* If true, indicates that the extension must be defined as repeated. |
||||
* Otherwise the extension must be defined as optional. |
||||
* |
||||
* Generated from protobuf field <code>optional bool repeated = 6;</code> |
||||
*/ |
||||
protected $repeated = null; |
||||
|
||||
/** |
||||
* Constructor. |
||||
* |
||||
* @param array $data { |
||||
* Optional. Data for populating the Message object. |
||||
* |
||||
* @type int $number |
||||
* The extension number declared within the extension range. |
||||
* @type string $full_name |
||||
* The fully-qualified name of the extension field. There must be a leading |
||||
* dot in front of the full name. |
||||
* @type string $type |
||||
* The fully-qualified type name of the extension field. Unlike |
||||
* Metadata.type, Declaration.type must have a leading dot for messages |
||||
* and enums. |
||||
* @type bool $reserved |
||||
* If true, indicates that the number is reserved in the extension range, |
||||
* and any extension field with the number will fail to compile. Set this |
||||
* when a declared extension field is deleted. |
||||
* @type bool $repeated |
||||
* If true, indicates that the extension must be defined as repeated. |
||||
* Otherwise the extension must be defined as optional. |
||||
* } |
||||
*/ |
||||
public function __construct($data = NULL) { |
||||
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); |
||||
parent::__construct($data); |
||||
} |
||||
|
||||
/** |
||||
* The extension number declared within the extension range. |
||||
* |
||||
* Generated from protobuf field <code>optional int32 number = 1;</code> |
||||
* @return int |
||||
*/ |
||||
public function getNumber() |
||||
{ |
||||
return isset($this->number) ? $this->number : 0; |
||||
} |
||||
|
||||
public function hasNumber() |
||||
{ |
||||
return isset($this->number); |
||||
} |
||||
|
||||
public function clearNumber() |
||||
{ |
||||
unset($this->number); |
||||
} |
||||
|
||||
/** |
||||
* The extension number declared within the extension range. |
||||
* |
||||
* Generated from protobuf field <code>optional int32 number = 1;</code> |
||||
* @param int $var |
||||
* @return $this |
||||
*/ |
||||
public function setNumber($var) |
||||
{ |
||||
GPBUtil::checkInt32($var); |
||||
$this->number = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* The fully-qualified name of the extension field. There must be a leading |
||||
* dot in front of the full name. |
||||
* |
||||
* Generated from protobuf field <code>optional string full_name = 2;</code> |
||||
* @return string |
||||
*/ |
||||
public function getFullName() |
||||
{ |
||||
return isset($this->full_name) ? $this->full_name : ''; |
||||
} |
||||
|
||||
public function hasFullName() |
||||
{ |
||||
return isset($this->full_name); |
||||
} |
||||
|
||||
public function clearFullName() |
||||
{ |
||||
unset($this->full_name); |
||||
} |
||||
|
||||
/** |
||||
* The fully-qualified name of the extension field. There must be a leading |
||||
* dot in front of the full name. |
||||
* |
||||
* Generated from protobuf field <code>optional string full_name = 2;</code> |
||||
* @param string $var |
||||
* @return $this |
||||
*/ |
||||
public function setFullName($var) |
||||
{ |
||||
GPBUtil::checkString($var, True); |
||||
$this->full_name = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* The fully-qualified type name of the extension field. Unlike |
||||
* Metadata.type, Declaration.type must have a leading dot for messages |
||||
* and enums. |
||||
* |
||||
* Generated from protobuf field <code>optional string type = 3;</code> |
||||
* @return string |
||||
*/ |
||||
public function getType() |
||||
{ |
||||
return isset($this->type) ? $this->type : ''; |
||||
} |
||||
|
||||
public function hasType() |
||||
{ |
||||
return isset($this->type); |
||||
} |
||||
|
||||
public function clearType() |
||||
{ |
||||
unset($this->type); |
||||
} |
||||
|
||||
/** |
||||
* The fully-qualified type name of the extension field. Unlike |
||||
* Metadata.type, Declaration.type must have a leading dot for messages |
||||
* and enums. |
||||
* |
||||
* Generated from protobuf field <code>optional string type = 3;</code> |
||||
* @param string $var |
||||
* @return $this |
||||
*/ |
||||
public function setType($var) |
||||
{ |
||||
GPBUtil::checkString($var, True); |
||||
$this->type = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* If true, indicates that the number is reserved in the extension range, |
||||
* and any extension field with the number will fail to compile. Set this |
||||
* when a declared extension field is deleted. |
||||
* |
||||
* Generated from protobuf field <code>optional bool reserved = 5;</code> |
||||
* @return bool |
||||
*/ |
||||
public function getReserved() |
||||
{ |
||||
return isset($this->reserved) ? $this->reserved : false; |
||||
} |
||||
|
||||
public function hasReserved() |
||||
{ |
||||
return isset($this->reserved); |
||||
} |
||||
|
||||
public function clearReserved() |
||||
{ |
||||
unset($this->reserved); |
||||
} |
||||
|
||||
/** |
||||
* If true, indicates that the number is reserved in the extension range, |
||||
* and any extension field with the number will fail to compile. Set this |
||||
* when a declared extension field is deleted. |
||||
* |
||||
* Generated from protobuf field <code>optional bool reserved = 5;</code> |
||||
* @param bool $var |
||||
* @return $this |
||||
*/ |
||||
public function setReserved($var) |
||||
{ |
||||
GPBUtil::checkBool($var); |
||||
$this->reserved = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* If true, indicates that the extension must be defined as repeated. |
||||
* Otherwise the extension must be defined as optional. |
||||
* |
||||
* Generated from protobuf field <code>optional bool repeated = 6;</code> |
||||
* @return bool |
||||
*/ |
||||
public function getRepeated() |
||||
{ |
||||
return isset($this->repeated) ? $this->repeated : false; |
||||
} |
||||
|
||||
public function hasRepeated() |
||||
{ |
||||
return isset($this->repeated); |
||||
} |
||||
|
||||
public function clearRepeated() |
||||
{ |
||||
unset($this->repeated); |
||||
} |
||||
|
||||
/** |
||||
* If true, indicates that the extension must be defined as repeated. |
||||
* Otherwise the extension must be defined as optional. |
||||
* |
||||
* Generated from protobuf field <code>optional bool repeated = 6;</code> |
||||
* @param bool $var |
||||
* @return $this |
||||
*/ |
||||
public function setRepeated($var) |
||||
{ |
||||
GPBUtil::checkBool($var); |
||||
$this->repeated = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
} |
||||
|
@ -0,0 +1,53 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# NO CHECKED-IN PROTOBUF GENCODE |
||||
# source: google/protobuf/descriptor.proto |
||||
|
||||
namespace Google\Protobuf\Internal\ExtensionRangeOptions; |
||||
|
||||
use UnexpectedValueException; |
||||
|
||||
/** |
||||
* The verification state of the extension range. |
||||
* |
||||
* Protobuf type <code>google.protobuf.ExtensionRangeOptions.VerificationState</code> |
||||
*/ |
||||
class VerificationState |
||||
{ |
||||
/** |
||||
* All the extensions of the range must be declared. |
||||
* |
||||
* Generated from protobuf enum <code>DECLARATION = 0;</code> |
||||
*/ |
||||
const DECLARATION = 0; |
||||
/** |
||||
* Generated from protobuf enum <code>UNVERIFIED = 1;</code> |
||||
*/ |
||||
const UNVERIFIED = 1; |
||||
|
||||
private static $valueToName = [ |
||||
self::DECLARATION => 'DECLARATION', |
||||
self::UNVERIFIED => 'UNVERIFIED', |
||||
]; |
||||
|
||||
public static function name($value) |
||||
{ |
||||
if (!isset(self::$valueToName[$value])) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no name defined for value %s', __CLASS__, $value)); |
||||
} |
||||
return self::$valueToName[$value]; |
||||
} |
||||
|
||||
|
||||
public static function value($name) |
||||
{ |
||||
$const = __CLASS__ . '::' . strtoupper($name); |
||||
if (!defined($const)) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no value defined for name %s', __CLASS__, $name)); |
||||
} |
||||
return constant($const); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,263 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# NO CHECKED-IN PROTOBUF GENCODE |
||||
# source: google/protobuf/descriptor.proto |
||||
|
||||
namespace Google\Protobuf\Internal; |
||||
|
||||
use Google\Protobuf\Internal\GPBType; |
||||
use Google\Protobuf\Internal\GPBWire; |
||||
use Google\Protobuf\Internal\RepeatedField; |
||||
use Google\Protobuf\Internal\InputStream; |
||||
use Google\Protobuf\Internal\GPBUtil; |
||||
|
||||
/** |
||||
* TODO Enums in C++ gencode (and potentially other languages) are |
||||
* not well scoped. This means that each of the feature enums below can clash |
||||
* with each other. The short names we've chosen maximize call-site |
||||
* readability, but leave us very open to this scenario. A future feature will |
||||
* be designed and implemented to handle this, hopefully before we ever hit a |
||||
* conflict here. |
||||
* |
||||
* Generated from protobuf message <code>google.protobuf.FeatureSet</code> |
||||
*/ |
||||
class FeatureSet extends \Google\Protobuf\Internal\Message |
||||
{ |
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.FieldPresence field_presence = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
*/ |
||||
protected $field_presence = null; |
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.EnumType enum_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
*/ |
||||
protected $enum_type = null; |
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
*/ |
||||
protected $repeated_field_encoding = null; |
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
*/ |
||||
protected $utf8_validation = null; |
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
*/ |
||||
protected $message_encoding = null; |
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.JsonFormat json_format = 6 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
*/ |
||||
protected $json_format = null; |
||||
|
||||
/** |
||||
* Constructor. |
||||
* |
||||
* @param array $data { |
||||
* Optional. Data for populating the Message object. |
||||
* |
||||
* @type int $field_presence |
||||
* @type int $enum_type |
||||
* @type int $repeated_field_encoding |
||||
* @type int $utf8_validation |
||||
* @type int $message_encoding |
||||
* @type int $json_format |
||||
* } |
||||
*/ |
||||
public function __construct($data = NULL) { |
||||
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); |
||||
parent::__construct($data); |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.FieldPresence field_presence = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
* @return int |
||||
*/ |
||||
public function getFieldPresence() |
||||
{ |
||||
return isset($this->field_presence) ? $this->field_presence : 0; |
||||
} |
||||
|
||||
public function hasFieldPresence() |
||||
{ |
||||
return isset($this->field_presence); |
||||
} |
||||
|
||||
public function clearFieldPresence() |
||||
{ |
||||
unset($this->field_presence); |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.FieldPresence field_presence = 1 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
* @param int $var |
||||
* @return $this |
||||
*/ |
||||
public function setFieldPresence($var) |
||||
{ |
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\FieldPresence::class); |
||||
$this->field_presence = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.EnumType enum_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
* @return int |
||||
*/ |
||||
public function getEnumType() |
||||
{ |
||||
return isset($this->enum_type) ? $this->enum_type : 0; |
||||
} |
||||
|
||||
public function hasEnumType() |
||||
{ |
||||
return isset($this->enum_type); |
||||
} |
||||
|
||||
public function clearEnumType() |
||||
{ |
||||
unset($this->enum_type); |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.EnumType enum_type = 2 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
* @param int $var |
||||
* @return $this |
||||
*/ |
||||
public function setEnumType($var) |
||||
{ |
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\EnumType::class); |
||||
$this->enum_type = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
* @return int |
||||
*/ |
||||
public function getRepeatedFieldEncoding() |
||||
{ |
||||
return isset($this->repeated_field_encoding) ? $this->repeated_field_encoding : 0; |
||||
} |
||||
|
||||
public function hasRepeatedFieldEncoding() |
||||
{ |
||||
return isset($this->repeated_field_encoding); |
||||
} |
||||
|
||||
public function clearRepeatedFieldEncoding() |
||||
{ |
||||
unset($this->repeated_field_encoding); |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.RepeatedFieldEncoding repeated_field_encoding = 3 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
* @param int $var |
||||
* @return $this |
||||
*/ |
||||
public function setRepeatedFieldEncoding($var) |
||||
{ |
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\RepeatedFieldEncoding::class); |
||||
$this->repeated_field_encoding = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
* @return int |
||||
*/ |
||||
public function getUtf8Validation() |
||||
{ |
||||
return isset($this->utf8_validation) ? $this->utf8_validation : 0; |
||||
} |
||||
|
||||
public function hasUtf8Validation() |
||||
{ |
||||
return isset($this->utf8_validation); |
||||
} |
||||
|
||||
public function clearUtf8Validation() |
||||
{ |
||||
unset($this->utf8_validation); |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.Utf8Validation utf8_validation = 4 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
* @param int $var |
||||
* @return $this |
||||
*/ |
||||
public function setUtf8Validation($var) |
||||
{ |
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\Utf8Validation::class); |
||||
$this->utf8_validation = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
* @return int |
||||
*/ |
||||
public function getMessageEncoding() |
||||
{ |
||||
return isset($this->message_encoding) ? $this->message_encoding : 0; |
||||
} |
||||
|
||||
public function hasMessageEncoding() |
||||
{ |
||||
return isset($this->message_encoding); |
||||
} |
||||
|
||||
public function clearMessageEncoding() |
||||
{ |
||||
unset($this->message_encoding); |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.MessageEncoding message_encoding = 5 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_FIELD, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
* @param int $var |
||||
* @return $this |
||||
*/ |
||||
public function setMessageEncoding($var) |
||||
{ |
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\MessageEncoding::class); |
||||
$this->message_encoding = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.JsonFormat json_format = 6 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
* @return int |
||||
*/ |
||||
public function getJsonFormat() |
||||
{ |
||||
return isset($this->json_format) ? $this->json_format : 0; |
||||
} |
||||
|
||||
public function hasJsonFormat() |
||||
{ |
||||
return isset($this->json_format); |
||||
} |
||||
|
||||
public function clearJsonFormat() |
||||
{ |
||||
unset($this->json_format); |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet.JsonFormat json_format = 6 [retention = RETENTION_RUNTIME, targets = TARGET_TYPE_MESSAGE, targets = TARGET_TYPE_ENUM, targets = TARGET_TYPE_FILE, edition_defaults = {</code> |
||||
* @param int $var |
||||
* @return $this |
||||
*/ |
||||
public function setJsonFormat($var) |
||||
{ |
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\FeatureSet\JsonFormat::class); |
||||
$this->json_format = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
} |
||||
|
@ -0,0 +1,54 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# NO CHECKED-IN PROTOBUF GENCODE |
||||
# source: google/protobuf/descriptor.proto |
||||
|
||||
namespace Google\Protobuf\Internal\FeatureSet; |
||||
|
||||
use UnexpectedValueException; |
||||
|
||||
/** |
||||
* Protobuf type <code>google.protobuf.FeatureSet.EnumType</code> |
||||
*/ |
||||
class EnumType |
||||
{ |
||||
/** |
||||
* Generated from protobuf enum <code>ENUM_TYPE_UNKNOWN = 0;</code> |
||||
*/ |
||||
const ENUM_TYPE_UNKNOWN = 0; |
||||
/** |
||||
* Generated from protobuf enum <code>OPEN = 1;</code> |
||||
*/ |
||||
const OPEN = 1; |
||||
/** |
||||
* Generated from protobuf enum <code>CLOSED = 2;</code> |
||||
*/ |
||||
const CLOSED = 2; |
||||
|
||||
private static $valueToName = [ |
||||
self::ENUM_TYPE_UNKNOWN => 'ENUM_TYPE_UNKNOWN', |
||||
self::OPEN => 'OPEN', |
||||
self::CLOSED => 'CLOSED', |
||||
]; |
||||
|
||||
public static function name($value) |
||||
{ |
||||
if (!isset(self::$valueToName[$value])) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no name defined for value %s', __CLASS__, $value)); |
||||
} |
||||
return self::$valueToName[$value]; |
||||
} |
||||
|
||||
|
||||
public static function value($name) |
||||
{ |
||||
$const = __CLASS__ . '::' . strtoupper($name); |
||||
if (!defined($const)) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no value defined for name %s', __CLASS__, $name)); |
||||
} |
||||
return constant($const); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,59 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# NO CHECKED-IN PROTOBUF GENCODE |
||||
# source: google/protobuf/descriptor.proto |
||||
|
||||
namespace Google\Protobuf\Internal\FeatureSet; |
||||
|
||||
use UnexpectedValueException; |
||||
|
||||
/** |
||||
* Protobuf type <code>google.protobuf.FeatureSet.FieldPresence</code> |
||||
*/ |
||||
class FieldPresence |
||||
{ |
||||
/** |
||||
* Generated from protobuf enum <code>FIELD_PRESENCE_UNKNOWN = 0;</code> |
||||
*/ |
||||
const FIELD_PRESENCE_UNKNOWN = 0; |
||||
/** |
||||
* Generated from protobuf enum <code>EXPLICIT = 1;</code> |
||||
*/ |
||||
const EXPLICIT = 1; |
||||
/** |
||||
* Generated from protobuf enum <code>IMPLICIT = 2;</code> |
||||
*/ |
||||
const IMPLICIT = 2; |
||||
/** |
||||
* Generated from protobuf enum <code>LEGACY_REQUIRED = 3;</code> |
||||
*/ |
||||
const LEGACY_REQUIRED = 3; |
||||
|
||||
private static $valueToName = [ |
||||
self::FIELD_PRESENCE_UNKNOWN => 'FIELD_PRESENCE_UNKNOWN', |
||||
self::EXPLICIT => 'EXPLICIT', |
||||
self::IMPLICIT => 'IMPLICIT', |
||||
self::LEGACY_REQUIRED => 'LEGACY_REQUIRED', |
||||
]; |
||||
|
||||
public static function name($value) |
||||
{ |
||||
if (!isset(self::$valueToName[$value])) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no name defined for value %s', __CLASS__, $value)); |
||||
} |
||||
return self::$valueToName[$value]; |
||||
} |
||||
|
||||
|
||||
public static function value($name) |
||||
{ |
||||
$const = __CLASS__ . '::' . strtoupper($name); |
||||
if (!defined($const)) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no value defined for name %s', __CLASS__, $name)); |
||||
} |
||||
return constant($const); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,54 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# NO CHECKED-IN PROTOBUF GENCODE |
||||
# source: google/protobuf/descriptor.proto |
||||
|
||||
namespace Google\Protobuf\Internal\FeatureSet; |
||||
|
||||
use UnexpectedValueException; |
||||
|
||||
/** |
||||
* Protobuf type <code>google.protobuf.FeatureSet.JsonFormat</code> |
||||
*/ |
||||
class JsonFormat |
||||
{ |
||||
/** |
||||
* Generated from protobuf enum <code>JSON_FORMAT_UNKNOWN = 0;</code> |
||||
*/ |
||||
const JSON_FORMAT_UNKNOWN = 0; |
||||
/** |
||||
* Generated from protobuf enum <code>ALLOW = 1;</code> |
||||
*/ |
||||
const ALLOW = 1; |
||||
/** |
||||
* Generated from protobuf enum <code>LEGACY_BEST_EFFORT = 2;</code> |
||||
*/ |
||||
const LEGACY_BEST_EFFORT = 2; |
||||
|
||||
private static $valueToName = [ |
||||
self::JSON_FORMAT_UNKNOWN => 'JSON_FORMAT_UNKNOWN', |
||||
self::ALLOW => 'ALLOW', |
||||
self::LEGACY_BEST_EFFORT => 'LEGACY_BEST_EFFORT', |
||||
]; |
||||
|
||||
public static function name($value) |
||||
{ |
||||
if (!isset(self::$valueToName[$value])) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no name defined for value %s', __CLASS__, $value)); |
||||
} |
||||
return self::$valueToName[$value]; |
||||
} |
||||
|
||||
|
||||
public static function value($name) |
||||
{ |
||||
$const = __CLASS__ . '::' . strtoupper($name); |
||||
if (!defined($const)) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no value defined for name %s', __CLASS__, $name)); |
||||
} |
||||
return constant($const); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,54 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# NO CHECKED-IN PROTOBUF GENCODE |
||||
# source: google/protobuf/descriptor.proto |
||||
|
||||
namespace Google\Protobuf\Internal\FeatureSet; |
||||
|
||||
use UnexpectedValueException; |
||||
|
||||
/** |
||||
* Protobuf type <code>google.protobuf.FeatureSet.MessageEncoding</code> |
||||
*/ |
||||
class MessageEncoding |
||||
{ |
||||
/** |
||||
* Generated from protobuf enum <code>MESSAGE_ENCODING_UNKNOWN = 0;</code> |
||||
*/ |
||||
const MESSAGE_ENCODING_UNKNOWN = 0; |
||||
/** |
||||
* Generated from protobuf enum <code>LENGTH_PREFIXED = 1;</code> |
||||
*/ |
||||
const LENGTH_PREFIXED = 1; |
||||
/** |
||||
* Generated from protobuf enum <code>DELIMITED = 2;</code> |
||||
*/ |
||||
const DELIMITED = 2; |
||||
|
||||
private static $valueToName = [ |
||||
self::MESSAGE_ENCODING_UNKNOWN => 'MESSAGE_ENCODING_UNKNOWN', |
||||
self::LENGTH_PREFIXED => 'LENGTH_PREFIXED', |
||||
self::DELIMITED => 'DELIMITED', |
||||
]; |
||||
|
||||
public static function name($value) |
||||
{ |
||||
if (!isset(self::$valueToName[$value])) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no name defined for value %s', __CLASS__, $value)); |
||||
} |
||||
return self::$valueToName[$value]; |
||||
} |
||||
|
||||
|
||||
public static function value($name) |
||||
{ |
||||
$const = __CLASS__ . '::' . strtoupper($name); |
||||
if (!defined($const)) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no value defined for name %s', __CLASS__, $name)); |
||||
} |
||||
return constant($const); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,54 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# NO CHECKED-IN PROTOBUF GENCODE |
||||
# source: google/protobuf/descriptor.proto |
||||
|
||||
namespace Google\Protobuf\Internal\FeatureSet; |
||||
|
||||
use UnexpectedValueException; |
||||
|
||||
/** |
||||
* Protobuf type <code>google.protobuf.FeatureSet.RepeatedFieldEncoding</code> |
||||
*/ |
||||
class RepeatedFieldEncoding |
||||
{ |
||||
/** |
||||
* Generated from protobuf enum <code>REPEATED_FIELD_ENCODING_UNKNOWN = 0;</code> |
||||
*/ |
||||
const REPEATED_FIELD_ENCODING_UNKNOWN = 0; |
||||
/** |
||||
* Generated from protobuf enum <code>PACKED = 1;</code> |
||||
*/ |
||||
const PACKED = 1; |
||||
/** |
||||
* Generated from protobuf enum <code>EXPANDED = 2;</code> |
||||
*/ |
||||
const EXPANDED = 2; |
||||
|
||||
private static $valueToName = [ |
||||
self::REPEATED_FIELD_ENCODING_UNKNOWN => 'REPEATED_FIELD_ENCODING_UNKNOWN', |
||||
self::PACKED => 'PACKED', |
||||
self::EXPANDED => 'EXPANDED', |
||||
]; |
||||
|
||||
public static function name($value) |
||||
{ |
||||
if (!isset(self::$valueToName[$value])) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no name defined for value %s', __CLASS__, $value)); |
||||
} |
||||
return self::$valueToName[$value]; |
||||
} |
||||
|
||||
|
||||
public static function value($name) |
||||
{ |
||||
$const = __CLASS__ . '::' . strtoupper($name); |
||||
if (!defined($const)) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no value defined for name %s', __CLASS__, $name)); |
||||
} |
||||
return constant($const); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,54 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# NO CHECKED-IN PROTOBUF GENCODE |
||||
# source: google/protobuf/descriptor.proto |
||||
|
||||
namespace Google\Protobuf\Internal\FeatureSet; |
||||
|
||||
use UnexpectedValueException; |
||||
|
||||
/** |
||||
* Protobuf type <code>google.protobuf.FeatureSet.Utf8Validation</code> |
||||
*/ |
||||
class Utf8Validation |
||||
{ |
||||
/** |
||||
* Generated from protobuf enum <code>UTF8_VALIDATION_UNKNOWN = 0;</code> |
||||
*/ |
||||
const UTF8_VALIDATION_UNKNOWN = 0; |
||||
/** |
||||
* Generated from protobuf enum <code>VERIFY = 2;</code> |
||||
*/ |
||||
const VERIFY = 2; |
||||
/** |
||||
* Generated from protobuf enum <code>NONE = 3;</code> |
||||
*/ |
||||
const NONE = 3; |
||||
|
||||
private static $valueToName = [ |
||||
self::UTF8_VALIDATION_UNKNOWN => 'UTF8_VALIDATION_UNKNOWN', |
||||
self::VERIFY => 'VERIFY', |
||||
self::NONE => 'NONE', |
||||
]; |
||||
|
||||
public static function name($value) |
||||
{ |
||||
if (!isset(self::$valueToName[$value])) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no name defined for value %s', __CLASS__, $value)); |
||||
} |
||||
return self::$valueToName[$value]; |
||||
} |
||||
|
||||
|
||||
public static function value($name) |
||||
{ |
||||
$const = __CLASS__ . '::' . strtoupper($name); |
||||
if (!defined($const)) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no value defined for name %s', __CLASS__, $name)); |
||||
} |
||||
return constant($const); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,162 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# NO CHECKED-IN PROTOBUF GENCODE |
||||
# source: google/protobuf/descriptor.proto |
||||
|
||||
namespace Google\Protobuf\Internal; |
||||
|
||||
use Google\Protobuf\Internal\GPBType; |
||||
use Google\Protobuf\Internal\GPBWire; |
||||
use Google\Protobuf\Internal\RepeatedField; |
||||
use Google\Protobuf\Internal\InputStream; |
||||
use Google\Protobuf\Internal\GPBUtil; |
||||
|
||||
/** |
||||
* A compiled specification for the defaults of a set of features. These |
||||
* messages are generated from FeatureSet extensions and can be used to seed |
||||
* feature resolution. The resolution with this object becomes a simple search |
||||
* for the closest matching edition, followed by proto merges. |
||||
* |
||||
* Generated from protobuf message <code>google.protobuf.FeatureSetDefaults</code> |
||||
*/ |
||||
class FeatureSetDefaults extends \Google\Protobuf\Internal\Message |
||||
{ |
||||
/** |
||||
* Generated from protobuf field <code>repeated .google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1;</code> |
||||
*/ |
||||
private $defaults; |
||||
/** |
||||
* The minimum supported edition (inclusive) when this was constructed. |
||||
* Editions before this will not have defaults. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition minimum_edition = 4;</code> |
||||
*/ |
||||
protected $minimum_edition = null; |
||||
/** |
||||
* The maximum known edition (inclusive) when this was constructed. Editions |
||||
* after this will not have reliable defaults. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition maximum_edition = 5;</code> |
||||
*/ |
||||
protected $maximum_edition = null; |
||||
|
||||
/** |
||||
* Constructor. |
||||
* |
||||
* @param array $data { |
||||
* Optional. Data for populating the Message object. |
||||
* |
||||
* @type array<\Google\Protobuf\Internal\FeatureSetDefaults\FeatureSetEditionDefault>|\Google\Protobuf\Internal\RepeatedField $defaults |
||||
* @type int $minimum_edition |
||||
* The minimum supported edition (inclusive) when this was constructed. |
||||
* Editions before this will not have defaults. |
||||
* @type int $maximum_edition |
||||
* The maximum known edition (inclusive) when this was constructed. Editions |
||||
* after this will not have reliable defaults. |
||||
* } |
||||
*/ |
||||
public function __construct($data = NULL) { |
||||
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); |
||||
parent::__construct($data); |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>repeated .google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1;</code> |
||||
* @return \Google\Protobuf\Internal\RepeatedField |
||||
*/ |
||||
public function getDefaults() |
||||
{ |
||||
return $this->defaults; |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>repeated .google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault defaults = 1;</code> |
||||
* @param array<\Google\Protobuf\Internal\FeatureSetDefaults\FeatureSetEditionDefault>|\Google\Protobuf\Internal\RepeatedField $var |
||||
* @return $this |
||||
*/ |
||||
public function setDefaults($var) |
||||
{ |
||||
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\FeatureSetDefaults\FeatureSetEditionDefault::class); |
||||
$this->defaults = $arr; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* The minimum supported edition (inclusive) when this was constructed. |
||||
* Editions before this will not have defaults. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition minimum_edition = 4;</code> |
||||
* @return int |
||||
*/ |
||||
public function getMinimumEdition() |
||||
{ |
||||
return isset($this->minimum_edition) ? $this->minimum_edition : 0; |
||||
} |
||||
|
||||
public function hasMinimumEdition() |
||||
{ |
||||
return isset($this->minimum_edition); |
||||
} |
||||
|
||||
public function clearMinimumEdition() |
||||
{ |
||||
unset($this->minimum_edition); |
||||
} |
||||
|
||||
/** |
||||
* The minimum supported edition (inclusive) when this was constructed. |
||||
* Editions before this will not have defaults. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition minimum_edition = 4;</code> |
||||
* @param int $var |
||||
* @return $this |
||||
*/ |
||||
public function setMinimumEdition($var) |
||||
{ |
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); |
||||
$this->minimum_edition = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* The maximum known edition (inclusive) when this was constructed. Editions |
||||
* after this will not have reliable defaults. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition maximum_edition = 5;</code> |
||||
* @return int |
||||
*/ |
||||
public function getMaximumEdition() |
||||
{ |
||||
return isset($this->maximum_edition) ? $this->maximum_edition : 0; |
||||
} |
||||
|
||||
public function hasMaximumEdition() |
||||
{ |
||||
return isset($this->maximum_edition); |
||||
} |
||||
|
||||
public function clearMaximumEdition() |
||||
{ |
||||
unset($this->maximum_edition); |
||||
} |
||||
|
||||
/** |
||||
* The maximum known edition (inclusive) when this was constructed. Editions |
||||
* after this will not have reliable defaults. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition maximum_edition = 5;</code> |
||||
* @param int $var |
||||
* @return $this |
||||
*/ |
||||
public function setMaximumEdition($var) |
||||
{ |
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); |
||||
$this->maximum_edition = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
} |
||||
|
@ -0,0 +1,164 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# NO CHECKED-IN PROTOBUF GENCODE |
||||
# source: google/protobuf/descriptor.proto |
||||
|
||||
namespace Google\Protobuf\Internal\FeatureSetDefaults; |
||||
|
||||
use Google\Protobuf\Internal\GPBType; |
||||
use Google\Protobuf\Internal\GPBWire; |
||||
use Google\Protobuf\Internal\RepeatedField; |
||||
use Google\Protobuf\Internal\InputStream; |
||||
use Google\Protobuf\Internal\GPBUtil; |
||||
|
||||
/** |
||||
* A map from every known edition with a unique set of defaults to its |
||||
* defaults. Not all editions may be contained here. For a given edition, |
||||
* the defaults at the closest matching edition ordered at or before it should |
||||
* be used. This field must be in strict ascending order by edition. |
||||
* |
||||
* Generated from protobuf message <code>google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault</code> |
||||
*/ |
||||
class FeatureSetEditionDefault extends \Google\Protobuf\Internal\Message |
||||
{ |
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition = 3;</code> |
||||
*/ |
||||
protected $edition = null; |
||||
/** |
||||
* Defaults of features that can be overridden in this edition. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet overridable_features = 4;</code> |
||||
*/ |
||||
protected $overridable_features = null; |
||||
/** |
||||
* Defaults of features that can't be overridden in this edition. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet fixed_features = 5;</code> |
||||
*/ |
||||
protected $fixed_features = null; |
||||
|
||||
/** |
||||
* Constructor. |
||||
* |
||||
* @param array $data { |
||||
* Optional. Data for populating the Message object. |
||||
* |
||||
* @type int $edition |
||||
* @type \Google\Protobuf\Internal\FeatureSet $overridable_features |
||||
* Defaults of features that can be overridden in this edition. |
||||
* @type \Google\Protobuf\Internal\FeatureSet $fixed_features |
||||
* Defaults of features that can't be overridden in this edition. |
||||
* } |
||||
*/ |
||||
public function __construct($data = NULL) { |
||||
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); |
||||
parent::__construct($data); |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition = 3;</code> |
||||
* @return int |
||||
*/ |
||||
public function getEdition() |
||||
{ |
||||
return isset($this->edition) ? $this->edition : 0; |
||||
} |
||||
|
||||
public function hasEdition() |
||||
{ |
||||
return isset($this->edition); |
||||
} |
||||
|
||||
public function clearEdition() |
||||
{ |
||||
unset($this->edition); |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition = 3;</code> |
||||
* @param int $var |
||||
* @return $this |
||||
*/ |
||||
public function setEdition($var) |
||||
{ |
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); |
||||
$this->edition = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* Defaults of features that can be overridden in this edition. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet overridable_features = 4;</code> |
||||
* @return \Google\Protobuf\Internal\FeatureSet|null |
||||
*/ |
||||
public function getOverridableFeatures() |
||||
{ |
||||
return $this->overridable_features; |
||||
} |
||||
|
||||
public function hasOverridableFeatures() |
||||
{ |
||||
return isset($this->overridable_features); |
||||
} |
||||
|
||||
public function clearOverridableFeatures() |
||||
{ |
||||
unset($this->overridable_features); |
||||
} |
||||
|
||||
/** |
||||
* Defaults of features that can be overridden in this edition. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet overridable_features = 4;</code> |
||||
* @param \Google\Protobuf\Internal\FeatureSet $var |
||||
* @return $this |
||||
*/ |
||||
public function setOverridableFeatures($var) |
||||
{ |
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); |
||||
$this->overridable_features = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* Defaults of features that can't be overridden in this edition. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet fixed_features = 5;</code> |
||||
* @return \Google\Protobuf\Internal\FeatureSet|null |
||||
*/ |
||||
public function getFixedFeatures() |
||||
{ |
||||
return $this->fixed_features; |
||||
} |
||||
|
||||
public function hasFixedFeatures() |
||||
{ |
||||
return isset($this->fixed_features); |
||||
} |
||||
|
||||
public function clearFixedFeatures() |
||||
{ |
||||
unset($this->fixed_features); |
||||
} |
||||
|
||||
/** |
||||
* Defaults of features that can't be overridden in this edition. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.FeatureSet fixed_features = 5;</code> |
||||
* @param \Google\Protobuf\Internal\FeatureSet $var |
||||
* @return $this |
||||
*/ |
||||
public function setFixedFeatures($var) |
||||
{ |
||||
GPBUtil::checkMessage($var, \Google\Protobuf\Internal\FeatureSet::class); |
||||
$this->fixed_features = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
} |
||||
|
@ -0,0 +1,115 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# NO CHECKED-IN PROTOBUF GENCODE |
||||
# source: google/protobuf/descriptor.proto |
||||
|
||||
namespace Google\Protobuf\Internal\FieldOptions; |
||||
|
||||
use Google\Protobuf\Internal\GPBType; |
||||
use Google\Protobuf\Internal\GPBWire; |
||||
use Google\Protobuf\Internal\RepeatedField; |
||||
use Google\Protobuf\Internal\InputStream; |
||||
use Google\Protobuf\Internal\GPBUtil; |
||||
|
||||
/** |
||||
* Generated from protobuf message <code>google.protobuf.FieldOptions.EditionDefault</code> |
||||
*/ |
||||
class EditionDefault extends \Google\Protobuf\Internal\Message |
||||
{ |
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition = 3;</code> |
||||
*/ |
||||
protected $edition = null; |
||||
/** |
||||
* Textproto value. |
||||
* |
||||
* Generated from protobuf field <code>optional string value = 2;</code> |
||||
*/ |
||||
protected $value = null; |
||||
|
||||
/** |
||||
* Constructor. |
||||
* |
||||
* @param array $data { |
||||
* Optional. Data for populating the Message object. |
||||
* |
||||
* @type int $edition |
||||
* @type string $value |
||||
* Textproto value. |
||||
* } |
||||
*/ |
||||
public function __construct($data = NULL) { |
||||
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); |
||||
parent::__construct($data); |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition = 3;</code> |
||||
* @return int |
||||
*/ |
||||
public function getEdition() |
||||
{ |
||||
return isset($this->edition) ? $this->edition : 0; |
||||
} |
||||
|
||||
public function hasEdition() |
||||
{ |
||||
return isset($this->edition); |
||||
} |
||||
|
||||
public function clearEdition() |
||||
{ |
||||
unset($this->edition); |
||||
} |
||||
|
||||
/** |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition = 3;</code> |
||||
* @param int $var |
||||
* @return $this |
||||
*/ |
||||
public function setEdition($var) |
||||
{ |
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); |
||||
$this->edition = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* Textproto value. |
||||
* |
||||
* Generated from protobuf field <code>optional string value = 2;</code> |
||||
* @return string |
||||
*/ |
||||
public function getValue() |
||||
{ |
||||
return isset($this->value) ? $this->value : ''; |
||||
} |
||||
|
||||
public function hasValue() |
||||
{ |
||||
return isset($this->value); |
||||
} |
||||
|
||||
public function clearValue() |
||||
{ |
||||
unset($this->value); |
||||
} |
||||
|
||||
/** |
||||
* Textproto value. |
||||
* |
||||
* Generated from protobuf field <code>optional string value = 2;</code> |
||||
* @param string $var |
||||
* @return $this |
||||
*/ |
||||
public function setValue($var) |
||||
{ |
||||
GPBUtil::checkString($var, True); |
||||
$this->value = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
} |
||||
|
@ -0,0 +1,236 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# NO CHECKED-IN PROTOBUF GENCODE |
||||
# source: google/protobuf/descriptor.proto |
||||
|
||||
namespace Google\Protobuf\Internal\FieldOptions; |
||||
|
||||
use Google\Protobuf\Internal\GPBType; |
||||
use Google\Protobuf\Internal\GPBWire; |
||||
use Google\Protobuf\Internal\RepeatedField; |
||||
use Google\Protobuf\Internal\InputStream; |
||||
use Google\Protobuf\Internal\GPBUtil; |
||||
|
||||
/** |
||||
* Information about the support window of a feature. |
||||
* |
||||
* Generated from protobuf message <code>google.protobuf.FieldOptions.FeatureSupport</code> |
||||
*/ |
||||
class FeatureSupport extends \Google\Protobuf\Internal\Message |
||||
{ |
||||
/** |
||||
* The edition that this feature was first available in. In editions |
||||
* earlier than this one, the default assigned to EDITION_LEGACY will be |
||||
* used, and proto files will not be able to override it. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition_introduced = 1;</code> |
||||
*/ |
||||
protected $edition_introduced = null; |
||||
/** |
||||
* The edition this feature becomes deprecated in. Using this after this |
||||
* edition may trigger warnings. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition_deprecated = 2;</code> |
||||
*/ |
||||
protected $edition_deprecated = null; |
||||
/** |
||||
* The deprecation warning text if this feature is used after the edition it |
||||
* was marked deprecated in. |
||||
* |
||||
* Generated from protobuf field <code>optional string deprecation_warning = 3;</code> |
||||
*/ |
||||
protected $deprecation_warning = null; |
||||
/** |
||||
* The edition this feature is no longer available in. In editions after |
||||
* this one, the last default assigned will be used, and proto files will |
||||
* not be able to override it. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition_removed = 4;</code> |
||||
*/ |
||||
protected $edition_removed = null; |
||||
|
||||
/** |
||||
* Constructor. |
||||
* |
||||
* @param array $data { |
||||
* Optional. Data for populating the Message object. |
||||
* |
||||
* @type int $edition_introduced |
||||
* The edition that this feature was first available in. In editions |
||||
* earlier than this one, the default assigned to EDITION_LEGACY will be |
||||
* used, and proto files will not be able to override it. |
||||
* @type int $edition_deprecated |
||||
* The edition this feature becomes deprecated in. Using this after this |
||||
* edition may trigger warnings. |
||||
* @type string $deprecation_warning |
||||
* The deprecation warning text if this feature is used after the edition it |
||||
* was marked deprecated in. |
||||
* @type int $edition_removed |
||||
* The edition this feature is no longer available in. In editions after |
||||
* this one, the last default assigned will be used, and proto files will |
||||
* not be able to override it. |
||||
* } |
||||
*/ |
||||
public function __construct($data = NULL) { |
||||
\GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce(); |
||||
parent::__construct($data); |
||||
} |
||||
|
||||
/** |
||||
* The edition that this feature was first available in. In editions |
||||
* earlier than this one, the default assigned to EDITION_LEGACY will be |
||||
* used, and proto files will not be able to override it. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition_introduced = 1;</code> |
||||
* @return int |
||||
*/ |
||||
public function getEditionIntroduced() |
||||
{ |
||||
return isset($this->edition_introduced) ? $this->edition_introduced : 0; |
||||
} |
||||
|
||||
public function hasEditionIntroduced() |
||||
{ |
||||
return isset($this->edition_introduced); |
||||
} |
||||
|
||||
public function clearEditionIntroduced() |
||||
{ |
||||
unset($this->edition_introduced); |
||||
} |
||||
|
||||
/** |
||||
* The edition that this feature was first available in. In editions |
||||
* earlier than this one, the default assigned to EDITION_LEGACY will be |
||||
* used, and proto files will not be able to override it. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition_introduced = 1;</code> |
||||
* @param int $var |
||||
* @return $this |
||||
*/ |
||||
public function setEditionIntroduced($var) |
||||
{ |
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); |
||||
$this->edition_introduced = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* The edition this feature becomes deprecated in. Using this after this |
||||
* edition may trigger warnings. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition_deprecated = 2;</code> |
||||
* @return int |
||||
*/ |
||||
public function getEditionDeprecated() |
||||
{ |
||||
return isset($this->edition_deprecated) ? $this->edition_deprecated : 0; |
||||
} |
||||
|
||||
public function hasEditionDeprecated() |
||||
{ |
||||
return isset($this->edition_deprecated); |
||||
} |
||||
|
||||
public function clearEditionDeprecated() |
||||
{ |
||||
unset($this->edition_deprecated); |
||||
} |
||||
|
||||
/** |
||||
* The edition this feature becomes deprecated in. Using this after this |
||||
* edition may trigger warnings. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition_deprecated = 2;</code> |
||||
* @param int $var |
||||
* @return $this |
||||
*/ |
||||
public function setEditionDeprecated($var) |
||||
{ |
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); |
||||
$this->edition_deprecated = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* The deprecation warning text if this feature is used after the edition it |
||||
* was marked deprecated in. |
||||
* |
||||
* Generated from protobuf field <code>optional string deprecation_warning = 3;</code> |
||||
* @return string |
||||
*/ |
||||
public function getDeprecationWarning() |
||||
{ |
||||
return isset($this->deprecation_warning) ? $this->deprecation_warning : ''; |
||||
} |
||||
|
||||
public function hasDeprecationWarning() |
||||
{ |
||||
return isset($this->deprecation_warning); |
||||
} |
||||
|
||||
public function clearDeprecationWarning() |
||||
{ |
||||
unset($this->deprecation_warning); |
||||
} |
||||
|
||||
/** |
||||
* The deprecation warning text if this feature is used after the edition it |
||||
* was marked deprecated in. |
||||
* |
||||
* Generated from protobuf field <code>optional string deprecation_warning = 3;</code> |
||||
* @param string $var |
||||
* @return $this |
||||
*/ |
||||
public function setDeprecationWarning($var) |
||||
{ |
||||
GPBUtil::checkString($var, True); |
||||
$this->deprecation_warning = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* The edition this feature is no longer available in. In editions after |
||||
* this one, the last default assigned will be used, and proto files will |
||||
* not be able to override it. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition_removed = 4;</code> |
||||
* @return int |
||||
*/ |
||||
public function getEditionRemoved() |
||||
{ |
||||
return isset($this->edition_removed) ? $this->edition_removed : 0; |
||||
} |
||||
|
||||
public function hasEditionRemoved() |
||||
{ |
||||
return isset($this->edition_removed); |
||||
} |
||||
|
||||
public function clearEditionRemoved() |
||||
{ |
||||
unset($this->edition_removed); |
||||
} |
||||
|
||||
/** |
||||
* The edition this feature is no longer available in. In editions after |
||||
* this one, the last default assigned will be used, and proto files will |
||||
* not be able to override it. |
||||
* |
||||
* Generated from protobuf field <code>optional .google.protobuf.Edition edition_removed = 4;</code> |
||||
* @param int $var |
||||
* @return $this |
||||
*/ |
||||
public function setEditionRemoved($var) |
||||
{ |
||||
GPBUtil::checkEnum($var, \Google\Protobuf\Internal\Edition::class); |
||||
$this->edition_removed = $var; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
} |
||||
|
@ -0,0 +1,56 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# NO CHECKED-IN PROTOBUF GENCODE |
||||
# source: google/protobuf/descriptor.proto |
||||
|
||||
namespace Google\Protobuf\Internal\FieldOptions; |
||||
|
||||
use UnexpectedValueException; |
||||
|
||||
/** |
||||
* If set to RETENTION_SOURCE, the option will be omitted from the binary. |
||||
* |
||||
* Protobuf type <code>google.protobuf.FieldOptions.OptionRetention</code> |
||||
*/ |
||||
class OptionRetention |
||||
{ |
||||
/** |
||||
* Generated from protobuf enum <code>RETENTION_UNKNOWN = 0;</code> |
||||
*/ |
||||
const RETENTION_UNKNOWN = 0; |
||||
/** |
||||
* Generated from protobuf enum <code>RETENTION_RUNTIME = 1;</code> |
||||
*/ |
||||
const RETENTION_RUNTIME = 1; |
||||
/** |
||||
* Generated from protobuf enum <code>RETENTION_SOURCE = 2;</code> |
||||
*/ |
||||
const RETENTION_SOURCE = 2; |
||||
|
||||
private static $valueToName = [ |
||||
self::RETENTION_UNKNOWN => 'RETENTION_UNKNOWN', |
||||
self::RETENTION_RUNTIME => 'RETENTION_RUNTIME', |
||||
self::RETENTION_SOURCE => 'RETENTION_SOURCE', |
||||
]; |
||||
|
||||
public static function name($value) |
||||
{ |
||||
if (!isset(self::$valueToName[$value])) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no name defined for value %s', __CLASS__, $value)); |
||||
} |
||||
return self::$valueToName[$value]; |
||||
} |
||||
|
||||
|
||||
public static function value($name) |
||||
{ |
||||
$const = __CLASS__ . '::' . strtoupper($name); |
||||
if (!defined($const)) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no value defined for name %s', __CLASS__, $name)); |
||||
} |
||||
return constant($const); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,93 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# NO CHECKED-IN PROTOBUF GENCODE |
||||
# source: google/protobuf/descriptor.proto |
||||
|
||||
namespace Google\Protobuf\Internal\FieldOptions; |
||||
|
||||
use UnexpectedValueException; |
||||
|
||||
/** |
||||
* This indicates the types of entities that the field may apply to when used |
||||
* as an option. If it is unset, then the field may be freely used as an |
||||
* option on any kind of entity. |
||||
* |
||||
* Protobuf type <code>google.protobuf.FieldOptions.OptionTargetType</code> |
||||
*/ |
||||
class OptionTargetType |
||||
{ |
||||
/** |
||||
* Generated from protobuf enum <code>TARGET_TYPE_UNKNOWN = 0;</code> |
||||
*/ |
||||
const TARGET_TYPE_UNKNOWN = 0; |
||||
/** |
||||
* Generated from protobuf enum <code>TARGET_TYPE_FILE = 1;</code> |
||||
*/ |
||||
const TARGET_TYPE_FILE = 1; |
||||
/** |
||||
* Generated from protobuf enum <code>TARGET_TYPE_EXTENSION_RANGE = 2;</code> |
||||
*/ |
||||
const TARGET_TYPE_EXTENSION_RANGE = 2; |
||||
/** |
||||
* Generated from protobuf enum <code>TARGET_TYPE_MESSAGE = 3;</code> |
||||
*/ |
||||
const TARGET_TYPE_MESSAGE = 3; |
||||
/** |
||||
* Generated from protobuf enum <code>TARGET_TYPE_FIELD = 4;</code> |
||||
*/ |
||||
const TARGET_TYPE_FIELD = 4; |
||||
/** |
||||
* Generated from protobuf enum <code>TARGET_TYPE_ONEOF = 5;</code> |
||||
*/ |
||||
const TARGET_TYPE_ONEOF = 5; |
||||
/** |
||||
* Generated from protobuf enum <code>TARGET_TYPE_ENUM = 6;</code> |
||||
*/ |
||||
const TARGET_TYPE_ENUM = 6; |
||||
/** |
||||
* Generated from protobuf enum <code>TARGET_TYPE_ENUM_ENTRY = 7;</code> |
||||
*/ |
||||
const TARGET_TYPE_ENUM_ENTRY = 7; |
||||
/** |
||||
* Generated from protobuf enum <code>TARGET_TYPE_SERVICE = 8;</code> |
||||
*/ |
||||
const TARGET_TYPE_SERVICE = 8; |
||||
/** |
||||
* Generated from protobuf enum <code>TARGET_TYPE_METHOD = 9;</code> |
||||
*/ |
||||
const TARGET_TYPE_METHOD = 9; |
||||
|
||||
private static $valueToName = [ |
||||
self::TARGET_TYPE_UNKNOWN => 'TARGET_TYPE_UNKNOWN', |
||||
self::TARGET_TYPE_FILE => 'TARGET_TYPE_FILE', |
||||
self::TARGET_TYPE_EXTENSION_RANGE => 'TARGET_TYPE_EXTENSION_RANGE', |
||||
self::TARGET_TYPE_MESSAGE => 'TARGET_TYPE_MESSAGE', |
||||
self::TARGET_TYPE_FIELD => 'TARGET_TYPE_FIELD', |
||||
self::TARGET_TYPE_ONEOF => 'TARGET_TYPE_ONEOF', |
||||
self::TARGET_TYPE_ENUM => 'TARGET_TYPE_ENUM', |
||||
self::TARGET_TYPE_ENUM_ENTRY => 'TARGET_TYPE_ENUM_ENTRY', |
||||
self::TARGET_TYPE_SERVICE => 'TARGET_TYPE_SERVICE', |
||||
self::TARGET_TYPE_METHOD => 'TARGET_TYPE_METHOD', |
||||
]; |
||||
|
||||
public static function name($value) |
||||
{ |
||||
if (!isset(self::$valueToName[$value])) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no name defined for value %s', __CLASS__, $value)); |
||||
} |
||||
return self::$valueToName[$value]; |
||||
} |
||||
|
||||
|
||||
public static function value($name) |
||||
{ |
||||
$const = __CLASS__ . '::' . strtoupper($name); |
||||
if (!defined($const)) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no value defined for name %s', __CLASS__, $name)); |
||||
} |
||||
return constant($const); |
||||
} |
||||
} |
||||
|
@ -0,0 +1,63 @@ |
||||
<?php |
||||
# Generated by the protocol buffer compiler. DO NOT EDIT! |
||||
# NO CHECKED-IN PROTOBUF GENCODE |
||||
# source: google/protobuf/descriptor.proto |
||||
|
||||
namespace Google\Protobuf\Internal\GeneratedCodeInfo\Annotation; |
||||
|
||||
use UnexpectedValueException; |
||||
|
||||
/** |
||||
* Represents the identified object's effect on the element in the original |
||||
* .proto file. |
||||
* |
||||
* Protobuf type <code>google.protobuf.GeneratedCodeInfo.Annotation.Semantic</code> |
||||
*/ |
||||
class Semantic |
||||
{ |
||||
/** |
||||
* There is no effect or the effect is indescribable. |
||||
* |
||||
* Generated from protobuf enum <code>NONE = 0;</code> |
||||
*/ |
||||
const NONE = 0; |
||||
/** |
||||
* The element is set or otherwise mutated. |
||||
* |
||||
* Generated from protobuf enum <code>SET = 1;</code> |
||||
*/ |
||||
const SET = 1; |
||||
/** |
||||
* An alias to the element is returned. |
||||
* |
||||
* Generated from protobuf enum <code>ALIAS = 2;</code> |
||||
*/ |
||||
const ALIAS = 2; |
||||
|
||||
private static $valueToName = [ |
||||
self::NONE => 'NONE', |
||||
self::SET => 'SET', |
||||
self::ALIAS => 'ALIAS', |
||||
]; |
||||
|
||||
public static function name($value) |
||||
{ |
||||
if (!isset(self::$valueToName[$value])) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no name defined for value %s', __CLASS__, $value)); |
||||
} |
||||
return self::$valueToName[$value]; |
||||
} |
||||
|
||||
|
||||
public static function value($name) |
||||
{ |
||||
$const = __CLASS__ . '::' . strtoupper($name); |
||||
if (!defined($const)) { |
||||
throw new UnexpectedValueException(sprintf( |
||||
'Enum %s has no value defined for name %s', __CLASS__, $name)); |
||||
} |
||||
return constant($const); |
||||
} |
||||
} |
||||
|
Loading…
Reference in new issue