blob: 4e43ae8897f4a22a983aab33db019c21a6d66ecb [file] [log] [blame]
Adrià Vilanova Martínezf7ee6582021-09-02 21:53:28 +02001// source: api_proto/common.proto
2/**
3 * @fileoverview
4 * @enhanceable
5 * @suppress {missingRequire} reports error on implicit type usages.
6 * @suppress {messageConventions} JS Compiler reports an error if a variable or
7 * field starts with 'MSG_' and isn't a translatable message.
8 * @public
9 */
10// GENERATED CODE -- DO NOT EDIT!
11/* eslint-disable */
12// @ts-nocheck
13
14var jspb = require('google-protobuf');
15var goog = jspb;
Adrià Vilanova Martínezdc5d29f2023-04-15 17:22:13 +020016var global =
17 (typeof globalThis !== 'undefined' && globalThis) ||
18 (typeof window !== 'undefined' && window) ||
19 (typeof global !== 'undefined' && global) ||
20 (typeof self !== 'undefined' && self) ||
21 (function () { return this; }).call(null) ||
22 Function('return this')();
Adrià Vilanova Martínezf7ee6582021-09-02 21:53:28 +020023
24goog.exportSymbol('proto.Environment', null, global);
25goog.exportSymbol('proto.Environment.Browser', null, global);
26goog.exportSymbol('proto.Environment.VersionChannel', null, global);
27/**
28 * Generated by JsPbCodeGenerator.
29 * @param {Array=} opt_data Optional initial data array, typically from a
30 * server response, or constructed directly in Javascript. The array is used
31 * in place and becomes part of the constructed object. It is not cloned.
32 * If no data is provided, the constructed object will be empty, but still
33 * valid.
34 * @extends {jspb.Message}
35 * @constructor
36 */
37proto.Environment = function(opt_data) {
38 jspb.Message.initialize(this, opt_data, 0, -1, null, null);
39};
40goog.inherits(proto.Environment, jspb.Message);
41if (goog.DEBUG && !COMPILED) {
42 /**
43 * @public
44 * @override
45 */
46 proto.Environment.displayName = 'proto.Environment';
47}
48
49
50
51if (jspb.Message.GENERATE_TO_OBJECT) {
52/**
53 * Creates an object representation of this proto.
54 * Field names that are reserved in JavaScript and will be renamed to pb_name.
55 * Optional fields that are not set will be set to undefined.
56 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
57 * For the list of reserved names please see:
58 * net/proto2/compiler/js/internal/generator.cc#kKeyword.
59 * @param {boolean=} opt_includeInstance Deprecated. whether to include the
60 * JSPB instance for transitional soy proto support:
61 * http://goto/soy-param-migration
62 * @return {!Object}
63 */
64proto.Environment.prototype.toObject = function(opt_includeInstance) {
65 return proto.Environment.toObject(opt_includeInstance, this);
66};
67
68
69/**
70 * Static version of the {@see toObject} method.
71 * @param {boolean|undefined} includeInstance Deprecated. Whether to include
72 * the JSPB instance for transitional soy proto support:
73 * http://goto/soy-param-migration
74 * @param {!proto.Environment} msg The msg instance to transform.
75 * @return {!Object}
76 * @suppress {unusedLocalVariables} f is only used for nested messages
77 */
78proto.Environment.toObject = function(includeInstance, msg) {
79 var f, obj = {
80 browser: jspb.Message.getFieldWithDefault(msg, 1, 0),
81 version: jspb.Message.getFieldWithDefault(msg, 2, ""),
82 versionChannel: jspb.Message.getFieldWithDefault(msg, 3, 0)
83 };
84
85 if (includeInstance) {
86 obj.$jspbMessageInstance = msg;
87 }
88 return obj;
89};
90}
91
92
93/**
94 * Deserializes binary data (in protobuf wire format).
95 * @param {jspb.ByteSource} bytes The bytes to deserialize.
96 * @return {!proto.Environment}
97 */
98proto.Environment.deserializeBinary = function(bytes) {
99 var reader = new jspb.BinaryReader(bytes);
100 var msg = new proto.Environment;
101 return proto.Environment.deserializeBinaryFromReader(msg, reader);
102};
103
104
105/**
106 * Deserializes binary data (in protobuf wire format) from the
107 * given reader into the given message object.
108 * @param {!proto.Environment} msg The message object to deserialize into.
109 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
110 * @return {!proto.Environment}
111 */
112proto.Environment.deserializeBinaryFromReader = function(msg, reader) {
113 while (reader.nextField()) {
114 if (reader.isEndGroup()) {
115 break;
116 }
117 var field = reader.getFieldNumber();
118 switch (field) {
119 case 1:
120 var value = /** @type {!proto.Environment.Browser} */ (reader.readEnum());
121 msg.setBrowser(value);
122 break;
123 case 2:
124 var value = /** @type {string} */ (reader.readString());
125 msg.setVersion(value);
126 break;
127 case 3:
128 var value = /** @type {!proto.Environment.VersionChannel} */ (reader.readEnum());
129 msg.setVersionChannel(value);
130 break;
131 default:
132 reader.skipField();
133 break;
134 }
135 }
136 return msg;
137};
138
139
140/**
141 * Serializes the message to binary data (in protobuf wire format).
142 * @return {!Uint8Array}
143 */
144proto.Environment.prototype.serializeBinary = function() {
145 var writer = new jspb.BinaryWriter();
146 proto.Environment.serializeBinaryToWriter(this, writer);
147 return writer.getResultBuffer();
148};
149
150
151/**
152 * Serializes the given message to binary data (in protobuf wire
153 * format), writing to the given BinaryWriter.
154 * @param {!proto.Environment} message
155 * @param {!jspb.BinaryWriter} writer
156 * @suppress {unusedLocalVariables} f is only used for nested messages
157 */
158proto.Environment.serializeBinaryToWriter = function(message, writer) {
159 var f = undefined;
160 f = message.getBrowser();
161 if (f !== 0.0) {
162 writer.writeEnum(
163 1,
164 f
165 );
166 }
167 f = message.getVersion();
168 if (f.length > 0) {
169 writer.writeString(
170 2,
171 f
172 );
173 }
174 f = message.getVersionChannel();
175 if (f !== 0.0) {
176 writer.writeEnum(
177 3,
178 f
179 );
180 }
181};
182
183
184/**
185 * @enum {number}
186 */
187proto.Environment.Browser = {
188 BROWSER_UNKNOWN: 0,
189 BROWSER_CHROMIUM: 1,
190 BROWSER_GECKO: 2
191};
192
193/**
194 * @enum {number}
195 */
196proto.Environment.VersionChannel = {
197 CHANNEL_UNKNOWN: 0,
198 CHANNEL_STABLE: 1,
199 CHANNEL_BETA: 2
200};
201
202/**
203 * optional Browser browser = 1;
204 * @return {!proto.Environment.Browser}
205 */
206proto.Environment.prototype.getBrowser = function() {
207 return /** @type {!proto.Environment.Browser} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
208};
209
210
211/**
212 * @param {!proto.Environment.Browser} value
213 * @return {!proto.Environment} returns this
214 */
215proto.Environment.prototype.setBrowser = function(value) {
216 return jspb.Message.setProto3EnumField(this, 1, value);
217};
218
219
220/**
221 * optional string version = 2;
222 * @return {string}
223 */
224proto.Environment.prototype.getVersion = function() {
225 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
226};
227
228
229/**
230 * @param {string} value
231 * @return {!proto.Environment} returns this
232 */
233proto.Environment.prototype.setVersion = function(value) {
234 return jspb.Message.setProto3StringField(this, 2, value);
235};
236
237
238/**
239 * optional VersionChannel version_channel = 3;
240 * @return {!proto.Environment.VersionChannel}
241 */
242proto.Environment.prototype.getVersionChannel = function() {
243 return /** @type {!proto.Environment.VersionChannel} */ (jspb.Message.getFieldWithDefault(this, 3, 0));
244};
245
246
247/**
248 * @param {!proto.Environment.VersionChannel} value
249 * @return {!proto.Environment} returns this
250 */
251proto.Environment.prototype.setVersionChannel = function(value) {
252 return jspb.Message.setProto3EnumField(this, 3, value);
253};
254
255
256goog.object.extend(exports, proto);