• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?php
2# Generated by the protocol buffer compiler.  DO NOT EDIT!
3# source: google/protobuf/descriptor.proto
4
5namespace Google\Protobuf\Internal;
6
7use Google\Protobuf\Internal\GPBType;
8use Google\Protobuf\Internal\GPBWire;
9use Google\Protobuf\Internal\RepeatedField;
10use Google\Protobuf\Internal\InputStream;
11use Google\Protobuf\Internal\GPBUtil;
12
13/**
14 * Describes an enum type.
15 *
16 * Generated from protobuf message <code>google.protobuf.EnumDescriptorProto</code>
17 */
18class EnumDescriptorProto extends \Google\Protobuf\Internal\Message
19{
20    /**
21     * Generated from protobuf field <code>optional string name = 1;</code>
22     */
23    private $name = '';
24    private $has_name = false;
25    /**
26     * Generated from protobuf field <code>repeated .google.protobuf.EnumValueDescriptorProto value = 2;</code>
27     */
28    private $value;
29    private $has_value = false;
30    /**
31     * Generated from protobuf field <code>optional .google.protobuf.EnumOptions options = 3;</code>
32     */
33    private $options = null;
34    private $has_options = false;
35    /**
36     * Range of reserved numeric values. Reserved numeric values may not be used
37     * by enum values in the same enum declaration. Reserved ranges may not
38     * overlap.
39     *
40     * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;</code>
41     */
42    private $reserved_range;
43    private $has_reserved_range = false;
44    /**
45     * Reserved enum value names, which may not be reused. A given name may only
46     * be reserved once.
47     *
48     * Generated from protobuf field <code>repeated string reserved_name = 5;</code>
49     */
50    private $reserved_name;
51    private $has_reserved_name = false;
52
53    /**
54     * Constructor.
55     *
56     * @param array $data {
57     *     Optional. Data for populating the Message object.
58     *
59     *     @type string $name
60     *     @type \Google\Protobuf\Internal\EnumValueDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $value
61     *     @type \Google\Protobuf\Internal\EnumOptions $options
62     *     @type \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange[]|\Google\Protobuf\Internal\RepeatedField $reserved_range
63     *           Range of reserved numeric values. Reserved numeric values may not be used
64     *           by enum values in the same enum declaration. Reserved ranges may not
65     *           overlap.
66     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $reserved_name
67     *           Reserved enum value names, which may not be reused. A given name may only
68     *           be reserved once.
69     * }
70     */
71    public function __construct($data = NULL) {
72        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
73        parent::__construct($data);
74    }
75
76    /**
77     * Generated from protobuf field <code>optional string name = 1;</code>
78     * @return string
79     */
80    public function getName()
81    {
82        return $this->name;
83    }
84
85    /**
86     * Generated from protobuf field <code>optional string name = 1;</code>
87     * @param string $var
88     * @return $this
89     */
90    public function setName($var)
91    {
92        GPBUtil::checkString($var, True);
93        $this->name = $var;
94        $this->has_name = true;
95
96        return $this;
97    }
98
99    public function hasName()
100    {
101        return $this->has_name;
102    }
103
104    /**
105     * Generated from protobuf field <code>repeated .google.protobuf.EnumValueDescriptorProto value = 2;</code>
106     * @return \Google\Protobuf\Internal\RepeatedField
107     */
108    public function getValue()
109    {
110        return $this->value;
111    }
112
113    /**
114     * Generated from protobuf field <code>repeated .google.protobuf.EnumValueDescriptorProto value = 2;</code>
115     * @param \Google\Protobuf\Internal\EnumValueDescriptorProto[]|\Google\Protobuf\Internal\RepeatedField $var
116     * @return $this
117     */
118    public function setValue($var)
119    {
120        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumValueDescriptorProto::class);
121        $this->value = $arr;
122        $this->has_value = true;
123
124        return $this;
125    }
126
127    public function hasValue()
128    {
129        return $this->has_value;
130    }
131
132    /**
133     * Generated from protobuf field <code>optional .google.protobuf.EnumOptions options = 3;</code>
134     * @return \Google\Protobuf\Internal\EnumOptions
135     */
136    public function getOptions()
137    {
138        return $this->options;
139    }
140
141    /**
142     * Generated from protobuf field <code>optional .google.protobuf.EnumOptions options = 3;</code>
143     * @param \Google\Protobuf\Internal\EnumOptions $var
144     * @return $this
145     */
146    public function setOptions($var)
147    {
148        GPBUtil::checkMessage($var, \Google\Protobuf\Internal\EnumOptions::class);
149        $this->options = $var;
150        $this->has_options = true;
151
152        return $this;
153    }
154
155    public function hasOptions()
156    {
157        return $this->has_options;
158    }
159
160    /**
161     * Range of reserved numeric values. Reserved numeric values may not be used
162     * by enum values in the same enum declaration. Reserved ranges may not
163     * overlap.
164     *
165     * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;</code>
166     * @return \Google\Protobuf\Internal\RepeatedField
167     */
168    public function getReservedRange()
169    {
170        return $this->reserved_range;
171    }
172
173    /**
174     * Range of reserved numeric values. Reserved numeric values may not be used
175     * by enum values in the same enum declaration. Reserved ranges may not
176     * overlap.
177     *
178     * Generated from protobuf field <code>repeated .google.protobuf.EnumDescriptorProto.EnumReservedRange reserved_range = 4;</code>
179     * @param \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange[]|\Google\Protobuf\Internal\RepeatedField $var
180     * @return $this
181     */
182    public function setReservedRange($var)
183    {
184        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\EnumDescriptorProto\EnumReservedRange::class);
185        $this->reserved_range = $arr;
186        $this->has_reserved_range = true;
187
188        return $this;
189    }
190
191    public function hasReservedRange()
192    {
193        return $this->has_reserved_range;
194    }
195
196    /**
197     * Reserved enum value names, which may not be reused. A given name may only
198     * be reserved once.
199     *
200     * Generated from protobuf field <code>repeated string reserved_name = 5;</code>
201     * @return \Google\Protobuf\Internal\RepeatedField
202     */
203    public function getReservedName()
204    {
205        return $this->reserved_name;
206    }
207
208    /**
209     * Reserved enum value names, which may not be reused. A given name may only
210     * be reserved once.
211     *
212     * Generated from protobuf field <code>repeated string reserved_name = 5;</code>
213     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
214     * @return $this
215     */
216    public function setReservedName($var)
217    {
218        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
219        $this->reserved_name = $arr;
220        $this->has_reserved_name = true;
221
222        return $this;
223    }
224
225    public function hasReservedName()
226    {
227        return $this->has_reserved_name;
228    }
229
230}
231
232