From 77f64bb7779ec2195f9bc4dc82497d12c18fc6b7 Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Thu, 5 Oct 2017 21:03:57 -0700 Subject: Add well known types to php runtime. (#3697) * Add well known types to php runtime. * Fix php7.0 tests * No longer generate empty.proto in test as it has been included in runtime. * Fix zts build * Clean code * Rename g_p_b_empty to empty. * Don't generate code for empty.proto in compatibility test * Fix 32-bit * Fix mac build * Fix Makefile.am to add new files --- php/src/Google/Protobuf/Api.php | 310 +++++++++++++++++++++++ php/src/Google/Protobuf/BoolValue.php | 58 +++++ php/src/Google/Protobuf/BytesValue.php | 58 +++++ php/src/Google/Protobuf/DoubleValue.php | 58 +++++ php/src/Google/Protobuf/Enum.php | 185 ++++++++++++++ php/src/Google/Protobuf/EnumValue.php | 121 +++++++++ php/src/Google/Protobuf/Field.php | 351 ++++++++++++++++++++++++++ php/src/Google/Protobuf/FieldMask.php | 209 +++++++++++++++ php/src/Google/Protobuf/Field_Cardinality.php | 39 +++ php/src/Google/Protobuf/Field_Kind.php | 129 ++++++++++ php/src/Google/Protobuf/FloatValue.php | 58 +++++ php/src/Google/Protobuf/GPBEmpty.php | 31 +++ php/src/Google/Protobuf/Int32Value.php | 58 +++++ php/src/Google/Protobuf/Int64Value.php | 58 +++++ php/src/Google/Protobuf/ListValue.php | 58 +++++ php/src/Google/Protobuf/Method.php | 249 ++++++++++++++++++ php/src/Google/Protobuf/Mixin.php | 153 +++++++++++ php/src/Google/Protobuf/NullValue.php | 23 ++ php/src/Google/Protobuf/Option.php | 108 ++++++++ php/src/Google/Protobuf/SourceContext.php | 61 +++++ php/src/Google/Protobuf/StringValue.php | 58 +++++ php/src/Google/Protobuf/Struct.php | 63 +++++ php/src/Google/Protobuf/Syntax.php | 27 ++ php/src/Google/Protobuf/Type.php | 217 ++++++++++++++++ php/src/Google/Protobuf/UInt32Value.php | 58 +++++ php/src/Google/Protobuf/UInt64Value.php | 58 +++++ php/src/Google/Protobuf/Value.php | 194 ++++++++++++++ 27 files changed, 3050 insertions(+) create mode 100644 php/src/Google/Protobuf/Api.php create mode 100644 php/src/Google/Protobuf/BoolValue.php create mode 100644 php/src/Google/Protobuf/BytesValue.php create mode 100644 php/src/Google/Protobuf/DoubleValue.php create mode 100644 php/src/Google/Protobuf/Enum.php create mode 100644 php/src/Google/Protobuf/EnumValue.php create mode 100644 php/src/Google/Protobuf/Field.php create mode 100644 php/src/Google/Protobuf/FieldMask.php create mode 100644 php/src/Google/Protobuf/Field_Cardinality.php create mode 100644 php/src/Google/Protobuf/Field_Kind.php create mode 100644 php/src/Google/Protobuf/FloatValue.php create mode 100644 php/src/Google/Protobuf/GPBEmpty.php create mode 100644 php/src/Google/Protobuf/Int32Value.php create mode 100644 php/src/Google/Protobuf/Int64Value.php create mode 100644 php/src/Google/Protobuf/ListValue.php create mode 100644 php/src/Google/Protobuf/Method.php create mode 100644 php/src/Google/Protobuf/Mixin.php create mode 100644 php/src/Google/Protobuf/NullValue.php create mode 100644 php/src/Google/Protobuf/Option.php create mode 100644 php/src/Google/Protobuf/SourceContext.php create mode 100644 php/src/Google/Protobuf/StringValue.php create mode 100644 php/src/Google/Protobuf/Struct.php create mode 100644 php/src/Google/Protobuf/Syntax.php create mode 100644 php/src/Google/Protobuf/Type.php create mode 100644 php/src/Google/Protobuf/UInt32Value.php create mode 100644 php/src/Google/Protobuf/UInt64Value.php create mode 100644 php/src/Google/Protobuf/Value.php (limited to 'php/src/Google') diff --git a/php/src/Google/Protobuf/Api.php b/php/src/Google/Protobuf/Api.php new file mode 100644 index 00000000..d0dda3cd --- /dev/null +++ b/php/src/Google/Protobuf/Api.php @@ -0,0 +1,310 @@ +google.protobuf.Api + */ +class Api extends \Google\Protobuf\Internal\Message +{ + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * + * Generated from protobuf field string name = 1; + */ + private $name = ''; + /** + * The methods of this interface, in unspecified order. + * + * Generated from protobuf field repeated .google.protobuf.Method methods = 2; + */ + private $methods; + /** + * Any metadata attached to the interface. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + */ + private $options; + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * + * Generated from protobuf field string version = 4; + */ + private $version = ''; + /** + * Source context for the protocol buffer service represented by this + * message. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + */ + private $source_context = null; + /** + * Included interfaces. See [Mixin][]. + * + * Generated from protobuf field repeated .google.protobuf.Mixin mixins = 6; + */ + private $mixins; + /** + * The source syntax of the service. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7; + */ + private $syntax = 0; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Api::initOnce(); + parent::__construct(); + } + + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The fully qualified name of this interface, including package name + * followed by the interface's simple name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The methods of this interface, in unspecified order. + * + * Generated from protobuf field repeated .google.protobuf.Method methods = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMethods() + { + return $this->methods; + } + + /** + * The methods of this interface, in unspecified order. + * + * Generated from protobuf field repeated .google.protobuf.Method methods = 2; + * @param \Google\Protobuf\Method[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMethods($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Method::class); + $this->methods = $arr; + + return $this; + } + + /** + * Any metadata attached to the interface. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOptions() + { + return $this->options; + } + + /** + * Any metadata attached to the interface. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @param \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * + * Generated from protobuf field string version = 4; + * @return string + */ + public function getVersion() + { + return $this->version; + } + + /** + * A version string for this interface. If specified, must have the form + * `major-version.minor-version`, as in `1.10`. If the minor version is + * omitted, it defaults to zero. If the entire version field is empty, the + * major version is derived from the package name, as outlined below. If the + * field is not empty, the version in the package name will be verified to be + * consistent with what is provided here. + * The versioning schema uses [semantic + * versioning](http://semver.org) where the major version number + * indicates a breaking change and the minor version an additive, + * non-breaking change. Both version numbers are signals to users + * what to expect from different versions, and should be carefully + * chosen based on the product plan. + * The major version is also reflected in the package name of the + * interface, which must end in `v`, as in + * `google.feature.v1`. For major versions 0 and 1, the suffix can + * be omitted. Zero major versions must only be used for + * experimental, non-GA interfaces. + * + * Generated from protobuf field string version = 4; + * @param string $var + * @return $this + */ + public function setVersion($var) + { + GPBUtil::checkString($var, True); + $this->version = $var; + + return $this; + } + + /** + * Source context for the protocol buffer service represented by this + * message. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + * @return \Google\Protobuf\SourceContext + */ + public function getSourceContext() + { + return $this->source_context; + } + + /** + * Source context for the protocol buffer service represented by this + * message. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + * @param \Google\Protobuf\SourceContext $var + * @return $this + */ + public function setSourceContext($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\SourceContext::class); + $this->source_context = $var; + + return $this; + } + + /** + * Included interfaces. See [Mixin][]. + * + * Generated from protobuf field repeated .google.protobuf.Mixin mixins = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getMixins() + { + return $this->mixins; + } + + /** + * Included interfaces. See [Mixin][]. + * + * Generated from protobuf field repeated .google.protobuf.Mixin mixins = 6; + * @param \Google\Protobuf\Mixin[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setMixins($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Mixin::class); + $this->mixins = $arr; + + return $this; + } + + /** + * The source syntax of the service. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7; + * @return int + */ + public function getSyntax() + { + return $this->syntax; + } + + /** + * The source syntax of the service. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7; + * @param int $var + * @return $this + */ + public function setSyntax($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class); + $this->syntax = $var; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/BoolValue.php b/php/src/Google/Protobuf/BoolValue.php new file mode 100644 index 00000000..c28bf941 --- /dev/null +++ b/php/src/Google/Protobuf/BoolValue.php @@ -0,0 +1,58 @@ +google.protobuf.BoolValue + */ +class BoolValue extends \Google\Protobuf\Internal\Message +{ + /** + * The bool value. + * + * Generated from protobuf field bool value = 1; + */ + private $value = false; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct(); + } + + /** + * The bool value. + * + * Generated from protobuf field bool value = 1; + * @return bool + */ + public function getValue() + { + return $this->value; + } + + /** + * The bool value. + * + * Generated from protobuf field bool value = 1; + * @param bool $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkBool($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/BytesValue.php b/php/src/Google/Protobuf/BytesValue.php new file mode 100644 index 00000000..d6a6b2e6 --- /dev/null +++ b/php/src/Google/Protobuf/BytesValue.php @@ -0,0 +1,58 @@ +google.protobuf.BytesValue + */ +class BytesValue extends \Google\Protobuf\Internal\Message +{ + /** + * The bytes value. + * + * Generated from protobuf field bytes value = 1; + */ + private $value = ''; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct(); + } + + /** + * The bytes value. + * + * Generated from protobuf field bytes value = 1; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The bytes value. + * + * Generated from protobuf field bytes value = 1; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, False); + $this->value = $var; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/DoubleValue.php b/php/src/Google/Protobuf/DoubleValue.php new file mode 100644 index 00000000..6718ce3c --- /dev/null +++ b/php/src/Google/Protobuf/DoubleValue.php @@ -0,0 +1,58 @@ +google.protobuf.DoubleValue + */ +class DoubleValue extends \Google\Protobuf\Internal\Message +{ + /** + * The double value. + * + * Generated from protobuf field double value = 1; + */ + private $value = 0.0; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct(); + } + + /** + * The double value. + * + * Generated from protobuf field double value = 1; + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * The double value. + * + * Generated from protobuf field double value = 1; + * @param float $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkDouble($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/Enum.php b/php/src/Google/Protobuf/Enum.php new file mode 100644 index 00000000..c63efc74 --- /dev/null +++ b/php/src/Google/Protobuf/Enum.php @@ -0,0 +1,185 @@ +google.protobuf.Enum + */ +class Enum extends \Google\Protobuf\Internal\Message +{ + /** + * Enum type name. + * + * Generated from protobuf field string name = 1; + */ + private $name = ''; + /** + * Enum value definitions. + * + * Generated from protobuf field repeated .google.protobuf.EnumValue enumvalue = 2; + */ + private $enumvalue; + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + */ + private $options; + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 4; + */ + private $source_context = null; + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 5; + */ + private $syntax = 0; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Type::initOnce(); + parent::__construct(); + } + + /** + * Enum type name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Enum type name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Enum value definitions. + * + * Generated from protobuf field repeated .google.protobuf.EnumValue enumvalue = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getEnumvalue() + { + return $this->enumvalue; + } + + /** + * Enum value definitions. + * + * Generated from protobuf field repeated .google.protobuf.EnumValue enumvalue = 2; + * @param \Google\Protobuf\EnumValue[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setEnumvalue($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\EnumValue::class); + $this->enumvalue = $arr; + + return $this; + } + + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOptions() + { + return $this->options; + } + + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @param \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 4; + * @return \Google\Protobuf\SourceContext + */ + public function getSourceContext() + { + return $this->source_context; + } + + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 4; + * @param \Google\Protobuf\SourceContext $var + * @return $this + */ + public function setSourceContext($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\SourceContext::class); + $this->source_context = $var; + + return $this; + } + + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 5; + * @return int + */ + public function getSyntax() + { + return $this->syntax; + } + + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 5; + * @param int $var + * @return $this + */ + public function setSyntax($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class); + $this->syntax = $var; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/EnumValue.php b/php/src/Google/Protobuf/EnumValue.php new file mode 100644 index 00000000..e102c29f --- /dev/null +++ b/php/src/Google/Protobuf/EnumValue.php @@ -0,0 +1,121 @@ +google.protobuf.EnumValue + */ +class EnumValue extends \Google\Protobuf\Internal\Message +{ + /** + * Enum value name. + * + * Generated from protobuf field string name = 1; + */ + private $name = ''; + /** + * Enum value number. + * + * Generated from protobuf field int32 number = 2; + */ + private $number = 0; + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + */ + private $options; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Type::initOnce(); + parent::__construct(); + } + + /** + * Enum value name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * Enum value name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * Enum value number. + * + * Generated from protobuf field int32 number = 2; + * @return int + */ + public function getNumber() + { + return $this->number; + } + + /** + * Enum value number. + * + * Generated from protobuf field int32 number = 2; + * @param int $var + * @return $this + */ + public function setNumber($var) + { + GPBUtil::checkInt32($var); + $this->number = $var; + + return $this; + } + + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOptions() + { + return $this->options; + } + + /** + * Protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 3; + * @param \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/Field.php b/php/src/Google/Protobuf/Field.php new file mode 100644 index 00000000..0b560d89 --- /dev/null +++ b/php/src/Google/Protobuf/Field.php @@ -0,0 +1,351 @@ +google.protobuf.Field + */ +class Field extends \Google\Protobuf\Internal\Message +{ + /** + * The field type. + * + * Generated from protobuf field .google.protobuf.Field.Kind kind = 1; + */ + private $kind = 0; + /** + * The field cardinality. + * + * Generated from protobuf field .google.protobuf.Field.Cardinality cardinality = 2; + */ + private $cardinality = 0; + /** + * The field number. + * + * Generated from protobuf field int32 number = 3; + */ + private $number = 0; + /** + * The field name. + * + * Generated from protobuf field string name = 4; + */ + private $name = ''; + /** + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + * + * Generated from protobuf field string type_url = 6; + */ + private $type_url = ''; + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + * + * Generated from protobuf field int32 oneof_index = 7; + */ + private $oneof_index = 0; + /** + * Whether to use alternative packed wire representation. + * + * Generated from protobuf field bool packed = 8; + */ + private $packed = false; + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 9; + */ + private $options; + /** + * The field JSON name. + * + * Generated from protobuf field string json_name = 10; + */ + private $json_name = ''; + /** + * The string value of the default value of this field. Proto2 syntax only. + * + * Generated from protobuf field string default_value = 11; + */ + private $default_value = ''; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Type::initOnce(); + parent::__construct(); + } + + /** + * The field type. + * + * Generated from protobuf field .google.protobuf.Field.Kind kind = 1; + * @return int + */ + public function getKind() + { + return $this->kind; + } + + /** + * The field type. + * + * Generated from protobuf field .google.protobuf.Field.Kind kind = 1; + * @param int $var + * @return $this + */ + public function setKind($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Field_Kind::class); + $this->kind = $var; + + return $this; + } + + /** + * The field cardinality. + * + * Generated from protobuf field .google.protobuf.Field.Cardinality cardinality = 2; + * @return int + */ + public function getCardinality() + { + return $this->cardinality; + } + + /** + * The field cardinality. + * + * Generated from protobuf field .google.protobuf.Field.Cardinality cardinality = 2; + * @param int $var + * @return $this + */ + public function setCardinality($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Field_Cardinality::class); + $this->cardinality = $var; + + return $this; + } + + /** + * The field number. + * + * Generated from protobuf field int32 number = 3; + * @return int + */ + public function getNumber() + { + return $this->number; + } + + /** + * The field number. + * + * Generated from protobuf field int32 number = 3; + * @param int $var + * @return $this + */ + public function setNumber($var) + { + GPBUtil::checkInt32($var); + $this->number = $var; + + return $this; + } + + /** + * The field name. + * + * Generated from protobuf field string name = 4; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The field name. + * + * Generated from protobuf field string name = 4; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + * + * Generated from protobuf field string type_url = 6; + * @return string + */ + public function getTypeUrl() + { + return $this->type_url; + } + + /** + * The field type URL, without the scheme, for message or enumeration + * types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + * + * Generated from protobuf field string type_url = 6; + * @param string $var + * @return $this + */ + public function setTypeUrl($var) + { + GPBUtil::checkString($var, True); + $this->type_url = $var; + + return $this; + } + + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + * + * Generated from protobuf field int32 oneof_index = 7; + * @return int + */ + public function getOneofIndex() + { + return $this->oneof_index; + } + + /** + * The index of the field type in `Type.oneofs`, for message or enumeration + * types. The first type has index 1; zero means the type is not in the list. + * + * Generated from protobuf field int32 oneof_index = 7; + * @param int $var + * @return $this + */ + public function setOneofIndex($var) + { + GPBUtil::checkInt32($var); + $this->oneof_index = $var; + + return $this; + } + + /** + * Whether to use alternative packed wire representation. + * + * Generated from protobuf field bool packed = 8; + * @return bool + */ + public function getPacked() + { + return $this->packed; + } + + /** + * Whether to use alternative packed wire representation. + * + * Generated from protobuf field bool packed = 8; + * @param bool $var + * @return $this + */ + public function setPacked($var) + { + GPBUtil::checkBool($var); + $this->packed = $var; + + return $this; + } + + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 9; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOptions() + { + return $this->options; + } + + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 9; + * @param \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + + /** + * The field JSON name. + * + * Generated from protobuf field string json_name = 10; + * @return string + */ + public function getJsonName() + { + return $this->json_name; + } + + /** + * The field JSON name. + * + * Generated from protobuf field string json_name = 10; + * @param string $var + * @return $this + */ + public function setJsonName($var) + { + GPBUtil::checkString($var, True); + $this->json_name = $var; + + return $this; + } + + /** + * The string value of the default value of this field. Proto2 syntax only. + * + * Generated from protobuf field string default_value = 11; + * @return string + */ + public function getDefaultValue() + { + return $this->default_value; + } + + /** + * The string value of the default value of this field. Proto2 syntax only. + * + * Generated from protobuf field string default_value = 11; + * @param string $var + * @return $this + */ + public function setDefaultValue($var) + { + GPBUtil::checkString($var, True); + $this->default_value = $var; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/FieldMask.php b/php/src/Google/Protobuf/FieldMask.php new file mode 100644 index 00000000..e18586af --- /dev/null +++ b/php/src/Google/Protobuf/FieldMask.php @@ -0,0 +1,209 @@ +google.protobuf.FieldMask + */ +class FieldMask extends \Google\Protobuf\Internal\Message +{ + /** + * The set of field mask paths. + * + * Generated from protobuf field repeated string paths = 1; + */ + private $paths; + + public function __construct() { + \GPBMetadata\Google\Protobuf\FieldMask::initOnce(); + parent::__construct(); + } + + /** + * The set of field mask paths. + * + * Generated from protobuf field repeated string paths = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getPaths() + { + return $this->paths; + } + + /** + * The set of field mask paths. + * + * Generated from protobuf field repeated string paths = 1; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setPaths($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->paths = $arr; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/Field_Cardinality.php b/php/src/Google/Protobuf/Field_Cardinality.php new file mode 100644 index 00000000..422587ca --- /dev/null +++ b/php/src/Google/Protobuf/Field_Cardinality.php @@ -0,0 +1,39 @@ +Google\Protobuf\Field\Cardinality + */ +class Field_Cardinality +{ + /** + * For fields with unknown cardinality. + * + * Generated from protobuf enum CARDINALITY_UNKNOWN = 0; + */ + const CARDINALITY_UNKNOWN = 0; + /** + * For optional fields. + * + * Generated from protobuf enum CARDINALITY_OPTIONAL = 1; + */ + const CARDINALITY_OPTIONAL = 1; + /** + * For required fields. Proto2 syntax only. + * + * Generated from protobuf enum CARDINALITY_REQUIRED = 2; + */ + const CARDINALITY_REQUIRED = 2; + /** + * For repeated fields. + * + * Generated from protobuf enum CARDINALITY_REPEATED = 3; + */ + const CARDINALITY_REPEATED = 3; +} + diff --git a/php/src/Google/Protobuf/Field_Kind.php b/php/src/Google/Protobuf/Field_Kind.php new file mode 100644 index 00000000..d0774970 --- /dev/null +++ b/php/src/Google/Protobuf/Field_Kind.php @@ -0,0 +1,129 @@ +Google\Protobuf\Field\Kind + */ +class Field_Kind +{ + /** + * Field type unknown. + * + * Generated from protobuf enum TYPE_UNKNOWN = 0; + */ + const TYPE_UNKNOWN = 0; + /** + * Field type double. + * + * Generated from protobuf enum TYPE_DOUBLE = 1; + */ + const TYPE_DOUBLE = 1; + /** + * Field type float. + * + * Generated from protobuf enum TYPE_FLOAT = 2; + */ + const TYPE_FLOAT = 2; + /** + * Field type int64. + * + * Generated from protobuf enum TYPE_INT64 = 3; + */ + const TYPE_INT64 = 3; + /** + * Field type uint64. + * + * Generated from protobuf enum TYPE_UINT64 = 4; + */ + const TYPE_UINT64 = 4; + /** + * Field type int32. + * + * Generated from protobuf enum TYPE_INT32 = 5; + */ + const TYPE_INT32 = 5; + /** + * Field type fixed64. + * + * Generated from protobuf enum TYPE_FIXED64 = 6; + */ + const TYPE_FIXED64 = 6; + /** + * Field type fixed32. + * + * Generated from protobuf enum TYPE_FIXED32 = 7; + */ + const TYPE_FIXED32 = 7; + /** + * Field type bool. + * + * Generated from protobuf enum TYPE_BOOL = 8; + */ + const TYPE_BOOL = 8; + /** + * Field type string. + * + * Generated from protobuf enum TYPE_STRING = 9; + */ + const TYPE_STRING = 9; + /** + * Field type group. Proto2 syntax only, and deprecated. + * + * Generated from protobuf enum TYPE_GROUP = 10; + */ + const TYPE_GROUP = 10; + /** + * Field type message. + * + * Generated from protobuf enum TYPE_MESSAGE = 11; + */ + const TYPE_MESSAGE = 11; + /** + * Field type bytes. + * + * Generated from protobuf enum TYPE_BYTES = 12; + */ + const TYPE_BYTES = 12; + /** + * Field type uint32. + * + * Generated from protobuf enum TYPE_UINT32 = 13; + */ + const TYPE_UINT32 = 13; + /** + * Field type enum. + * + * Generated from protobuf enum TYPE_ENUM = 14; + */ + const TYPE_ENUM = 14; + /** + * Field type sfixed32. + * + * Generated from protobuf enum TYPE_SFIXED32 = 15; + */ + const TYPE_SFIXED32 = 15; + /** + * Field type sfixed64. + * + * Generated from protobuf enum TYPE_SFIXED64 = 16; + */ + const TYPE_SFIXED64 = 16; + /** + * Field type sint32. + * + * Generated from protobuf enum TYPE_SINT32 = 17; + */ + const TYPE_SINT32 = 17; + /** + * Field type sint64. + * + * Generated from protobuf enum TYPE_SINT64 = 18; + */ + const TYPE_SINT64 = 18; +} + diff --git a/php/src/Google/Protobuf/FloatValue.php b/php/src/Google/Protobuf/FloatValue.php new file mode 100644 index 00000000..68787ef9 --- /dev/null +++ b/php/src/Google/Protobuf/FloatValue.php @@ -0,0 +1,58 @@ +google.protobuf.FloatValue + */ +class FloatValue extends \Google\Protobuf\Internal\Message +{ + /** + * The float value. + * + * Generated from protobuf field float value = 1; + */ + private $value = 0.0; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct(); + } + + /** + * The float value. + * + * Generated from protobuf field float value = 1; + * @return float + */ + public function getValue() + { + return $this->value; + } + + /** + * The float value. + * + * Generated from protobuf field float value = 1; + * @param float $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkFloat($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/GPBEmpty.php b/php/src/Google/Protobuf/GPBEmpty.php new file mode 100644 index 00000000..24a93f96 --- /dev/null +++ b/php/src/Google/Protobuf/GPBEmpty.php @@ -0,0 +1,31 @@ +google.protobuf.Empty + */ +class GPBEmpty extends \Google\Protobuf\Internal\Message +{ + + public function __construct() { + \GPBMetadata\Google\Protobuf\GPBEmpty::initOnce(); + parent::__construct(); + } + +} + diff --git a/php/src/Google/Protobuf/Int32Value.php b/php/src/Google/Protobuf/Int32Value.php new file mode 100644 index 00000000..d48aff1b --- /dev/null +++ b/php/src/Google/Protobuf/Int32Value.php @@ -0,0 +1,58 @@ +google.protobuf.Int32Value + */ +class Int32Value extends \Google\Protobuf\Internal\Message +{ + /** + * The int32 value. + * + * Generated from protobuf field int32 value = 1; + */ + private $value = 0; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct(); + } + + /** + * The int32 value. + * + * Generated from protobuf field int32 value = 1; + * @return int + */ + public function getValue() + { + return $this->value; + } + + /** + * The int32 value. + * + * Generated from protobuf field int32 value = 1; + * @param int $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkInt32($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/Int64Value.php b/php/src/Google/Protobuf/Int64Value.php new file mode 100644 index 00000000..a6fb9c5d --- /dev/null +++ b/php/src/Google/Protobuf/Int64Value.php @@ -0,0 +1,58 @@ +google.protobuf.Int64Value + */ +class Int64Value extends \Google\Protobuf\Internal\Message +{ + /** + * The int64 value. + * + * Generated from protobuf field int64 value = 1; + */ + private $value = 0; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct(); + } + + /** + * The int64 value. + * + * Generated from protobuf field int64 value = 1; + * @return int|string + */ + public function getValue() + { + return $this->value; + } + + /** + * The int64 value. + * + * Generated from protobuf field int64 value = 1; + * @param int|string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkInt64($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/ListValue.php b/php/src/Google/Protobuf/ListValue.php new file mode 100644 index 00000000..12552ef4 --- /dev/null +++ b/php/src/Google/Protobuf/ListValue.php @@ -0,0 +1,58 @@ +google.protobuf.ListValue + */ +class ListValue extends \Google\Protobuf\Internal\Message +{ + /** + * Repeated field of dynamically typed values. + * + * Generated from protobuf field repeated .google.protobuf.Value values = 1; + */ + private $values; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Struct::initOnce(); + parent::__construct(); + } + + /** + * Repeated field of dynamically typed values. + * + * Generated from protobuf field repeated .google.protobuf.Value values = 1; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getValues() + { + return $this->values; + } + + /** + * Repeated field of dynamically typed values. + * + * Generated from protobuf field repeated .google.protobuf.Value values = 1; + * @param \Google\Protobuf\Value[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setValues($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); + $this->values = $arr; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/Method.php b/php/src/Google/Protobuf/Method.php new file mode 100644 index 00000000..f55cb764 --- /dev/null +++ b/php/src/Google/Protobuf/Method.php @@ -0,0 +1,249 @@ +google.protobuf.Method + */ +class Method extends \Google\Protobuf\Internal\Message +{ + /** + * The simple name of this method. + * + * Generated from protobuf field string name = 1; + */ + private $name = ''; + /** + * A URL of the input message type. + * + * Generated from protobuf field string request_type_url = 2; + */ + private $request_type_url = ''; + /** + * If true, the request is streamed. + * + * Generated from protobuf field bool request_streaming = 3; + */ + private $request_streaming = false; + /** + * The URL of the output message type. + * + * Generated from protobuf field string response_type_url = 4; + */ + private $response_type_url = ''; + /** + * If true, the response is streamed. + * + * Generated from protobuf field bool response_streaming = 5; + */ + private $response_streaming = false; + /** + * Any metadata attached to the method. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 6; + */ + private $options; + /** + * The source syntax of this method. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7; + */ + private $syntax = 0; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Api::initOnce(); + parent::__construct(); + } + + /** + * The simple name of this method. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The simple name of this method. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * A URL of the input message type. + * + * Generated from protobuf field string request_type_url = 2; + * @return string + */ + public function getRequestTypeUrl() + { + return $this->request_type_url; + } + + /** + * A URL of the input message type. + * + * Generated from protobuf field string request_type_url = 2; + * @param string $var + * @return $this + */ + public function setRequestTypeUrl($var) + { + GPBUtil::checkString($var, True); + $this->request_type_url = $var; + + return $this; + } + + /** + * If true, the request is streamed. + * + * Generated from protobuf field bool request_streaming = 3; + * @return bool + */ + public function getRequestStreaming() + { + return $this->request_streaming; + } + + /** + * If true, the request is streamed. + * + * Generated from protobuf field bool request_streaming = 3; + * @param bool $var + * @return $this + */ + public function setRequestStreaming($var) + { + GPBUtil::checkBool($var); + $this->request_streaming = $var; + + return $this; + } + + /** + * The URL of the output message type. + * + * Generated from protobuf field string response_type_url = 4; + * @return string + */ + public function getResponseTypeUrl() + { + return $this->response_type_url; + } + + /** + * The URL of the output message type. + * + * Generated from protobuf field string response_type_url = 4; + * @param string $var + * @return $this + */ + public function setResponseTypeUrl($var) + { + GPBUtil::checkString($var, True); + $this->response_type_url = $var; + + return $this; + } + + /** + * If true, the response is streamed. + * + * Generated from protobuf field bool response_streaming = 5; + * @return bool + */ + public function getResponseStreaming() + { + return $this->response_streaming; + } + + /** + * If true, the response is streamed. + * + * Generated from protobuf field bool response_streaming = 5; + * @param bool $var + * @return $this + */ + public function setResponseStreaming($var) + { + GPBUtil::checkBool($var); + $this->response_streaming = $var; + + return $this; + } + + /** + * Any metadata attached to the method. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 6; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOptions() + { + return $this->options; + } + + /** + * Any metadata attached to the method. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 6; + * @param \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + + /** + * The source syntax of this method. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7; + * @return int + */ + public function getSyntax() + { + return $this->syntax; + } + + /** + * The source syntax of this method. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 7; + * @param int $var + * @return $this + */ + public function setSyntax($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class); + $this->syntax = $var; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/Mixin.php b/php/src/Google/Protobuf/Mixin.php new file mode 100644 index 00000000..eb5117e0 --- /dev/null +++ b/php/src/Google/Protobuf/Mixin.php @@ -0,0 +1,153 @@ +google.protobuf.Mixin + */ +class Mixin extends \Google\Protobuf\Internal\Message +{ + /** + * The fully qualified name of the interface which is included. + * + * Generated from protobuf field string name = 1; + */ + private $name = ''; + /** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * + * Generated from protobuf field string root = 2; + */ + private $root = ''; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Api::initOnce(); + parent::__construct(); + } + + /** + * The fully qualified name of the interface which is included. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The fully qualified name of the interface which is included. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * + * Generated from protobuf field string root = 2; + * @return string + */ + public function getRoot() + { + return $this->root; + } + + /** + * If non-empty specifies a path under which inherited HTTP paths + * are rooted. + * + * Generated from protobuf field string root = 2; + * @param string $var + * @return $this + */ + public function setRoot($var) + { + GPBUtil::checkString($var, True); + $this->root = $var; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/NullValue.php b/php/src/Google/Protobuf/NullValue.php new file mode 100644 index 00000000..d4022ccc --- /dev/null +++ b/php/src/Google/Protobuf/NullValue.php @@ -0,0 +1,23 @@ +Google\Protobuf\NullValue + */ +class NullValue +{ + /** + * Null value. + * + * Generated from protobuf enum NULL_VALUE = 0; + */ + const NULL_VALUE = 0; +} + diff --git a/php/src/Google/Protobuf/Option.php b/php/src/Google/Protobuf/Option.php new file mode 100644 index 00000000..f8038681 --- /dev/null +++ b/php/src/Google/Protobuf/Option.php @@ -0,0 +1,108 @@ +google.protobuf.Option + */ +class Option extends \Google\Protobuf\Internal\Message +{ + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, `"map_entry"`. + * For custom options, it should be the fully-qualified name. For example, + * `"google.api.http"`. + * + * Generated from protobuf field string name = 1; + */ + private $name = ''; + /** + * The option's value packed in an Any message. If the value is a primitive, + * the corresponding wrapper type defined in google/protobuf/wrappers.proto + * should be used. If the value is an enum, it should be stored as an int32 + * value using the google.protobuf.Int32Value type. + * + * Generated from protobuf field .google.protobuf.Any value = 2; + */ + private $value = null; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Type::initOnce(); + parent::__construct(); + } + + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, `"map_entry"`. + * For custom options, it should be the fully-qualified name. For example, + * `"google.api.http"`. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The option's name. For protobuf built-in options (options defined in + * descriptor.proto), this is the short name. For example, `"map_entry"`. + * For custom options, it should be the fully-qualified name. For example, + * `"google.api.http"`. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The option's value packed in an Any message. If the value is a primitive, + * the corresponding wrapper type defined in google/protobuf/wrappers.proto + * should be used. If the value is an enum, it should be stored as an int32 + * value using the google.protobuf.Int32Value type. + * + * Generated from protobuf field .google.protobuf.Any value = 2; + * @return \Google\Protobuf\Any + */ + public function getValue() + { + return $this->value; + } + + /** + * The option's value packed in an Any message. If the value is a primitive, + * the corresponding wrapper type defined in google/protobuf/wrappers.proto + * should be used. If the value is an enum, it should be stored as an int32 + * value using the google.protobuf.Int32Value type. + * + * Generated from protobuf field .google.protobuf.Any value = 2; + * @param \Google\Protobuf\Any $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Any::class); + $this->value = $var; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/SourceContext.php b/php/src/Google/Protobuf/SourceContext.php new file mode 100644 index 00000000..07d90c68 --- /dev/null +++ b/php/src/Google/Protobuf/SourceContext.php @@ -0,0 +1,61 @@ +google.protobuf.SourceContext + */ +class SourceContext extends \Google\Protobuf\Internal\Message +{ + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * + * Generated from protobuf field string file_name = 1; + */ + private $file_name = ''; + + public function __construct() { + \GPBMetadata\Google\Protobuf\SourceContext::initOnce(); + parent::__construct(); + } + + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * + * Generated from protobuf field string file_name = 1; + * @return string + */ + public function getFileName() + { + return $this->file_name; + } + + /** + * The path-qualified name of the .proto file that contained the associated + * protobuf element. For example: `"google/protobuf/source_context.proto"`. + * + * Generated from protobuf field string file_name = 1; + * @param string $var + * @return $this + */ + public function setFileName($var) + { + GPBUtil::checkString($var, True); + $this->file_name = $var; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/StringValue.php b/php/src/Google/Protobuf/StringValue.php new file mode 100644 index 00000000..f6bcc48a --- /dev/null +++ b/php/src/Google/Protobuf/StringValue.php @@ -0,0 +1,58 @@ +google.protobuf.StringValue + */ +class StringValue extends \Google\Protobuf\Internal\Message +{ + /** + * The string value. + * + * Generated from protobuf field string value = 1; + */ + private $value = ''; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct(); + } + + /** + * The string value. + * + * Generated from protobuf field string value = 1; + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * The string value. + * + * Generated from protobuf field string value = 1; + * @param string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkString($var, True); + $this->value = $var; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/Struct.php b/php/src/Google/Protobuf/Struct.php new file mode 100644 index 00000000..721e991c --- /dev/null +++ b/php/src/Google/Protobuf/Struct.php @@ -0,0 +1,63 @@ +google.protobuf.Struct + */ +class Struct extends \Google\Protobuf\Internal\Message +{ + /** + * Unordered map of dynamically typed values. + * + * Generated from protobuf field map fields = 1; + */ + private $fields; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Struct::initOnce(); + parent::__construct(); + } + + /** + * Unordered map of dynamically typed values. + * + * Generated from protobuf field map fields = 1; + * @return \Google\Protobuf\Internal\MapField + */ + public function getFields() + { + return $this->fields; + } + + /** + * Unordered map of dynamically typed values. + * + * Generated from protobuf field map fields = 1; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Value::class); + $this->fields = $arr; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/Syntax.php b/php/src/Google/Protobuf/Syntax.php new file mode 100644 index 00000000..bb7b7896 --- /dev/null +++ b/php/src/Google/Protobuf/Syntax.php @@ -0,0 +1,27 @@ +Google\Protobuf\Syntax + */ +class Syntax +{ + /** + * Syntax `proto2`. + * + * Generated from protobuf enum SYNTAX_PROTO2 = 0; + */ + const SYNTAX_PROTO2 = 0; + /** + * Syntax `proto3`. + * + * Generated from protobuf enum SYNTAX_PROTO3 = 1; + */ + const SYNTAX_PROTO3 = 1; +} + diff --git a/php/src/Google/Protobuf/Type.php b/php/src/Google/Protobuf/Type.php new file mode 100644 index 00000000..7dbe2cab --- /dev/null +++ b/php/src/Google/Protobuf/Type.php @@ -0,0 +1,217 @@ +google.protobuf.Type + */ +class Type extends \Google\Protobuf\Internal\Message +{ + /** + * The fully qualified message name. + * + * Generated from protobuf field string name = 1; + */ + private $name = ''; + /** + * The list of fields. + * + * Generated from protobuf field repeated .google.protobuf.Field fields = 2; + */ + private $fields; + /** + * The list of types appearing in `oneof` definitions in this type. + * + * Generated from protobuf field repeated string oneofs = 3; + */ + private $oneofs; + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 4; + */ + private $options; + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + */ + private $source_context = null; + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 6; + */ + private $syntax = 0; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Type::initOnce(); + parent::__construct(); + } + + /** + * The fully qualified message name. + * + * Generated from protobuf field string name = 1; + * @return string + */ + public function getName() + { + return $this->name; + } + + /** + * The fully qualified message name. + * + * Generated from protobuf field string name = 1; + * @param string $var + * @return $this + */ + public function setName($var) + { + GPBUtil::checkString($var, True); + $this->name = $var; + + return $this; + } + + /** + * The list of fields. + * + * Generated from protobuf field repeated .google.protobuf.Field fields = 2; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getFields() + { + return $this->fields; + } + + /** + * The list of fields. + * + * Generated from protobuf field repeated .google.protobuf.Field fields = 2; + * @param \Google\Protobuf\Field[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setFields($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Field::class); + $this->fields = $arr; + + return $this; + } + + /** + * The list of types appearing in `oneof` definitions in this type. + * + * Generated from protobuf field repeated string oneofs = 3; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOneofs() + { + return $this->oneofs; + } + + /** + * The list of types appearing in `oneof` definitions in this type. + * + * Generated from protobuf field repeated string oneofs = 3; + * @param string[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOneofs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING); + $this->oneofs = $arr; + + return $this; + } + + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 4; + * @return \Google\Protobuf\Internal\RepeatedField + */ + public function getOptions() + { + return $this->options; + } + + /** + * The protocol buffer options. + * + * Generated from protobuf field repeated .google.protobuf.Option options = 4; + * @param \Google\Protobuf\Option[]|\Google\Protobuf\Internal\RepeatedField $var + * @return $this + */ + public function setOptions($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Option::class); + $this->options = $arr; + + return $this; + } + + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + * @return \Google\Protobuf\SourceContext + */ + public function getSourceContext() + { + return $this->source_context; + } + + /** + * The source context. + * + * Generated from protobuf field .google.protobuf.SourceContext source_context = 5; + * @param \Google\Protobuf\SourceContext $var + * @return $this + */ + public function setSourceContext($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\SourceContext::class); + $this->source_context = $var; + + return $this; + } + + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 6; + * @return int + */ + public function getSyntax() + { + return $this->syntax; + } + + /** + * The source syntax. + * + * Generated from protobuf field .google.protobuf.Syntax syntax = 6; + * @param int $var + * @return $this + */ + public function setSyntax($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\Syntax::class); + $this->syntax = $var; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/UInt32Value.php b/php/src/Google/Protobuf/UInt32Value.php new file mode 100644 index 00000000..61a3ddf1 --- /dev/null +++ b/php/src/Google/Protobuf/UInt32Value.php @@ -0,0 +1,58 @@ +google.protobuf.UInt32Value + */ +class UInt32Value extends \Google\Protobuf\Internal\Message +{ + /** + * The uint32 value. + * + * Generated from protobuf field uint32 value = 1; + */ + private $value = 0; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct(); + } + + /** + * The uint32 value. + * + * Generated from protobuf field uint32 value = 1; + * @return int + */ + public function getValue() + { + return $this->value; + } + + /** + * The uint32 value. + * + * Generated from protobuf field uint32 value = 1; + * @param int $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkUint32($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/UInt64Value.php b/php/src/Google/Protobuf/UInt64Value.php new file mode 100644 index 00000000..69f7eb8e --- /dev/null +++ b/php/src/Google/Protobuf/UInt64Value.php @@ -0,0 +1,58 @@ +google.protobuf.UInt64Value + */ +class UInt64Value extends \Google\Protobuf\Internal\Message +{ + /** + * The uint64 value. + * + * Generated from protobuf field uint64 value = 1; + */ + private $value = 0; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Wrappers::initOnce(); + parent::__construct(); + } + + /** + * The uint64 value. + * + * Generated from protobuf field uint64 value = 1; + * @return int|string + */ + public function getValue() + { + return $this->value; + } + + /** + * The uint64 value. + * + * Generated from protobuf field uint64 value = 1; + * @param int|string $var + * @return $this + */ + public function setValue($var) + { + GPBUtil::checkUint64($var); + $this->value = $var; + + return $this; + } + +} + diff --git a/php/src/Google/Protobuf/Value.php b/php/src/Google/Protobuf/Value.php new file mode 100644 index 00000000..052a3779 --- /dev/null +++ b/php/src/Google/Protobuf/Value.php @@ -0,0 +1,194 @@ +google.protobuf.Value + */ +class Value extends \Google\Protobuf\Internal\Message +{ + protected $kind; + + public function __construct() { + \GPBMetadata\Google\Protobuf\Struct::initOnce(); + parent::__construct(); + } + + /** + * Represents a null value. + * + * Generated from protobuf field .google.protobuf.NullValue null_value = 1; + * @return int + */ + public function getNullValue() + { + return $this->readOneof(1); + } + + /** + * Represents a null value. + * + * Generated from protobuf field .google.protobuf.NullValue null_value = 1; + * @param int $var + * @return $this + */ + public function setNullValue($var) + { + GPBUtil::checkEnum($var, \Google\Protobuf\NullValue::class); + $this->writeOneof(1, $var); + + return $this; + } + + /** + * Represents a double value. + * + * Generated from protobuf field double number_value = 2; + * @return float + */ + public function getNumberValue() + { + return $this->readOneof(2); + } + + /** + * Represents a double value. + * + * Generated from protobuf field double number_value = 2; + * @param float $var + * @return $this + */ + public function setNumberValue($var) + { + GPBUtil::checkDouble($var); + $this->writeOneof(2, $var); + + return $this; + } + + /** + * Represents a string value. + * + * Generated from protobuf field string string_value = 3; + * @return string + */ + public function getStringValue() + { + return $this->readOneof(3); + } + + /** + * Represents a string value. + * + * Generated from protobuf field string string_value = 3; + * @param string $var + * @return $this + */ + public function setStringValue($var) + { + GPBUtil::checkString($var, True); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Represents a boolean value. + * + * Generated from protobuf field bool bool_value = 4; + * @return bool + */ + public function getBoolValue() + { + return $this->readOneof(4); + } + + /** + * Represents a boolean value. + * + * Generated from protobuf field bool bool_value = 4; + * @param bool $var + * @return $this + */ + public function setBoolValue($var) + { + GPBUtil::checkBool($var); + $this->writeOneof(4, $var); + + return $this; + } + + /** + * Represents a structured value. + * + * Generated from protobuf field .google.protobuf.Struct struct_value = 5; + * @return \Google\Protobuf\Struct + */ + public function getStructValue() + { + return $this->readOneof(5); + } + + /** + * Represents a structured value. + * + * Generated from protobuf field .google.protobuf.Struct struct_value = 5; + * @param \Google\Protobuf\Struct $var + * @return $this + */ + public function setStructValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\Struct::class); + $this->writeOneof(5, $var); + + return $this; + } + + /** + * Represents a repeated `Value`. + * + * Generated from protobuf field .google.protobuf.ListValue list_value = 6; + * @return \Google\Protobuf\ListValue + */ + public function getListValue() + { + return $this->readOneof(6); + } + + /** + * Represents a repeated `Value`. + * + * Generated from protobuf field .google.protobuf.ListValue list_value = 6; + * @param \Google\Protobuf\ListValue $var + * @return $this + */ + public function setListValue($var) + { + GPBUtil::checkMessage($var, \Google\Protobuf\ListValue::class); + $this->writeOneof(6, $var); + + return $this; + } + + /** + * @return string + */ + public function getKind() + { + return $this->whichOneof("kind"); + } + +} + -- cgit v1.2.3