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