• 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 * Generated from protobuf message <code>google.protobuf.EnumOptions</code>
15 */
16class EnumOptions extends \Google\Protobuf\Internal\Message
17{
18    /**
19     * Set this option to true to allow mapping different tag names to the same
20     * value.
21     *
22     * Generated from protobuf field <code>optional bool allow_alias = 2;</code>
23     */
24    protected $allow_alias = null;
25    /**
26     * Is this enum deprecated?
27     * Depending on the target platform, this can emit Deprecated annotations
28     * for the enum, or it will be completely ignored; in the very least, this
29     * is a formalization for deprecating enums.
30     *
31     * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
32     */
33    protected $deprecated = null;
34    /**
35     * Enable the legacy handling of JSON field name conflicts.  This lowercases
36     * and strips underscored from the fields before comparison in proto3 only.
37     * The new behavior takes `json_name` into account and applies to proto2 as
38     * well.
39     * TODO Remove this legacy behavior once downstream teams have
40     * had time to migrate.
41     *
42     * Generated from protobuf field <code>optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];</code>
43     * @deprecated
44     */
45    protected $deprecated_legacy_json_field_conflicts = null;
46    /**
47     * The parser stores options it doesn't recognize here. See above.
48     *
49     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
50     */
51    private $uninterpreted_option;
52
53    /**
54     * Constructor.
55     *
56     * @param array $data {
57     *     Optional. Data for populating the Message object.
58     *
59     *     @type bool $allow_alias
60     *           Set this option to true to allow mapping different tag names to the same
61     *           value.
62     *     @type bool $deprecated
63     *           Is this enum deprecated?
64     *           Depending on the target platform, this can emit Deprecated annotations
65     *           for the enum, or it will be completely ignored; in the very least, this
66     *           is a formalization for deprecating enums.
67     *     @type bool $deprecated_legacy_json_field_conflicts
68     *           Enable the legacy handling of JSON field name conflicts.  This lowercases
69     *           and strips underscored from the fields before comparison in proto3 only.
70     *           The new behavior takes `json_name` into account and applies to proto2 as
71     *           well.
72     *           TODO Remove this legacy behavior once downstream teams have
73     *           had time to migrate.
74     *     @type array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $uninterpreted_option
75     *           The parser stores options it doesn't recognize here. See above.
76     * }
77     */
78    public function __construct($data = NULL) {
79        \GPBMetadata\Google\Protobuf\Internal\Descriptor::initOnce();
80        parent::__construct($data);
81    }
82
83    /**
84     * Set this option to true to allow mapping different tag names to the same
85     * value.
86     *
87     * Generated from protobuf field <code>optional bool allow_alias = 2;</code>
88     * @return bool
89     */
90    public function getAllowAlias()
91    {
92        return isset($this->allow_alias) ? $this->allow_alias : false;
93    }
94
95    public function hasAllowAlias()
96    {
97        return isset($this->allow_alias);
98    }
99
100    public function clearAllowAlias()
101    {
102        unset($this->allow_alias);
103    }
104
105    /**
106     * Set this option to true to allow mapping different tag names to the same
107     * value.
108     *
109     * Generated from protobuf field <code>optional bool allow_alias = 2;</code>
110     * @param bool $var
111     * @return $this
112     */
113    public function setAllowAlias($var)
114    {
115        GPBUtil::checkBool($var);
116        $this->allow_alias = $var;
117
118        return $this;
119    }
120
121    /**
122     * Is this enum deprecated?
123     * Depending on the target platform, this can emit Deprecated annotations
124     * for the enum, or it will be completely ignored; in the very least, this
125     * is a formalization for deprecating enums.
126     *
127     * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
128     * @return bool
129     */
130    public function getDeprecated()
131    {
132        return isset($this->deprecated) ? $this->deprecated : false;
133    }
134
135    public function hasDeprecated()
136    {
137        return isset($this->deprecated);
138    }
139
140    public function clearDeprecated()
141    {
142        unset($this->deprecated);
143    }
144
145    /**
146     * Is this enum deprecated?
147     * Depending on the target platform, this can emit Deprecated annotations
148     * for the enum, or it will be completely ignored; in the very least, this
149     * is a formalization for deprecating enums.
150     *
151     * Generated from protobuf field <code>optional bool deprecated = 3 [default = false];</code>
152     * @param bool $var
153     * @return $this
154     */
155    public function setDeprecated($var)
156    {
157        GPBUtil::checkBool($var);
158        $this->deprecated = $var;
159
160        return $this;
161    }
162
163    /**
164     * Enable the legacy handling of JSON field name conflicts.  This lowercases
165     * and strips underscored from the fields before comparison in proto3 only.
166     * The new behavior takes `json_name` into account and applies to proto2 as
167     * well.
168     * TODO Remove this legacy behavior once downstream teams have
169     * had time to migrate.
170     *
171     * Generated from protobuf field <code>optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];</code>
172     * @return bool
173     * @deprecated
174     */
175    public function getDeprecatedLegacyJsonFieldConflicts()
176    {
177        @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED);
178        return isset($this->deprecated_legacy_json_field_conflicts) ? $this->deprecated_legacy_json_field_conflicts : false;
179    }
180
181    public function hasDeprecatedLegacyJsonFieldConflicts()
182    {
183        @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED);
184        return isset($this->deprecated_legacy_json_field_conflicts);
185    }
186
187    public function clearDeprecatedLegacyJsonFieldConflicts()
188    {
189        @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED);
190        unset($this->deprecated_legacy_json_field_conflicts);
191    }
192
193    /**
194     * Enable the legacy handling of JSON field name conflicts.  This lowercases
195     * and strips underscored from the fields before comparison in proto3 only.
196     * The new behavior takes `json_name` into account and applies to proto2 as
197     * well.
198     * TODO Remove this legacy behavior once downstream teams have
199     * had time to migrate.
200     *
201     * Generated from protobuf field <code>optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];</code>
202     * @param bool $var
203     * @return $this
204     * @deprecated
205     */
206    public function setDeprecatedLegacyJsonFieldConflicts($var)
207    {
208        @trigger_error('deprecated_legacy_json_field_conflicts is deprecated.', E_USER_DEPRECATED);
209        GPBUtil::checkBool($var);
210        $this->deprecated_legacy_json_field_conflicts = $var;
211
212        return $this;
213    }
214
215    /**
216     * The parser stores options it doesn't recognize here. See above.
217     *
218     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
219     * @return \Google\Protobuf\Internal\RepeatedField
220     */
221    public function getUninterpretedOption()
222    {
223        return $this->uninterpreted_option;
224    }
225
226    /**
227     * The parser stores options it doesn't recognize here. See above.
228     *
229     * Generated from protobuf field <code>repeated .google.protobuf.UninterpretedOption uninterpreted_option = 999;</code>
230     * @param array<\Google\Protobuf\Internal\UninterpretedOption>|\Google\Protobuf\Internal\RepeatedField $var
231     * @return $this
232     */
233    public function setUninterpretedOption($var)
234    {
235        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Protobuf\Internal\UninterpretedOption::class);
236        $this->uninterpreted_option = $arr;
237
238        return $this;
239    }
240
241}
242
243