github.com/hyperledger/burrow@v0.34.5-0.20220512172541-77f09336001d/js/proto/names_pb.js (about) 1 // source: names.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 global = Function('return this')(); 17 18 var gogoproto_gogo_pb = require('./gogoproto/gogo_pb.js'); 19 goog.object.extend(proto, gogoproto_gogo_pb); 20 goog.exportSymbol('proto.names.Entry', null, global); 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.names.Entry = function(opt_data) { 32 jspb.Message.initialize(this, opt_data, 0, -1, null, null); 33 }; 34 goog.inherits(proto.names.Entry, jspb.Message); 35 if (goog.DEBUG && !COMPILED) { 36 /** 37 * @public 38 * @override 39 */ 40 proto.names.Entry.displayName = 'proto.names.Entry'; 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.names.Entry.prototype.toObject = function(opt_includeInstance) { 59 return proto.names.Entry.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.names.Entry} msg The msg instance to transform. 69 * @return {!Object} 70 * @suppress {unusedLocalVariables} f is only used for nested messages 71 */ 72 proto.names.Entry.toObject = function(includeInstance, msg) { 73 var f, obj = { 74 name: jspb.Message.getFieldWithDefault(msg, 1, ""), 75 owner: msg.getOwner_asB64(), 76 data: jspb.Message.getFieldWithDefault(msg, 3, ""), 77 expires: jspb.Message.getFieldWithDefault(msg, 4, 0) 78 }; 79 80 if (includeInstance) { 81 obj.$jspbMessageInstance = msg; 82 } 83 return obj; 84 }; 85 } 86 87 88 /** 89 * Deserializes binary data (in protobuf wire format). 90 * @param {jspb.ByteSource} bytes The bytes to deserialize. 91 * @return {!proto.names.Entry} 92 */ 93 proto.names.Entry.deserializeBinary = function(bytes) { 94 var reader = new jspb.BinaryReader(bytes); 95 var msg = new proto.names.Entry; 96 return proto.names.Entry.deserializeBinaryFromReader(msg, reader); 97 }; 98 99 100 /** 101 * Deserializes binary data (in protobuf wire format) from the 102 * given reader into the given message object. 103 * @param {!proto.names.Entry} msg The message object to deserialize into. 104 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 105 * @return {!proto.names.Entry} 106 */ 107 proto.names.Entry.deserializeBinaryFromReader = function(msg, reader) { 108 while (reader.nextField()) { 109 if (reader.isEndGroup()) { 110 break; 111 } 112 var field = reader.getFieldNumber(); 113 switch (field) { 114 case 1: 115 var value = /** @type {string} */ (reader.readString()); 116 msg.setName(value); 117 break; 118 case 2: 119 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 120 msg.setOwner(value); 121 break; 122 case 3: 123 var value = /** @type {string} */ (reader.readString()); 124 msg.setData(value); 125 break; 126 case 4: 127 var value = /** @type {number} */ (reader.readUint64()); 128 msg.setExpires(value); 129 break; 130 default: 131 reader.skipField(); 132 break; 133 } 134 } 135 return msg; 136 }; 137 138 139 /** 140 * Serializes the message to binary data (in protobuf wire format). 141 * @return {!Uint8Array} 142 */ 143 proto.names.Entry.prototype.serializeBinary = function() { 144 var writer = new jspb.BinaryWriter(); 145 proto.names.Entry.serializeBinaryToWriter(this, writer); 146 return writer.getResultBuffer(); 147 }; 148 149 150 /** 151 * Serializes the given message to binary data (in protobuf wire 152 * format), writing to the given BinaryWriter. 153 * @param {!proto.names.Entry} message 154 * @param {!jspb.BinaryWriter} writer 155 * @suppress {unusedLocalVariables} f is only used for nested messages 156 */ 157 proto.names.Entry.serializeBinaryToWriter = function(message, writer) { 158 var f = undefined; 159 f = message.getName(); 160 if (f.length > 0) { 161 writer.writeString( 162 1, 163 f 164 ); 165 } 166 f = message.getOwner_asU8(); 167 if (f.length > 0) { 168 writer.writeBytes( 169 2, 170 f 171 ); 172 } 173 f = message.getData(); 174 if (f.length > 0) { 175 writer.writeString( 176 3, 177 f 178 ); 179 } 180 f = message.getExpires(); 181 if (f !== 0) { 182 writer.writeUint64( 183 4, 184 f 185 ); 186 } 187 }; 188 189 190 /** 191 * optional string Name = 1; 192 * @return {string} 193 */ 194 proto.names.Entry.prototype.getName = function() { 195 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); 196 }; 197 198 199 /** 200 * @param {string} value 201 * @return {!proto.names.Entry} returns this 202 */ 203 proto.names.Entry.prototype.setName = function(value) { 204 return jspb.Message.setProto3StringField(this, 1, value); 205 }; 206 207 208 /** 209 * optional bytes Owner = 2; 210 * @return {!(string|Uint8Array)} 211 */ 212 proto.names.Entry.prototype.getOwner = function() { 213 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); 214 }; 215 216 217 /** 218 * optional bytes Owner = 2; 219 * This is a type-conversion wrapper around `getOwner()` 220 * @return {string} 221 */ 222 proto.names.Entry.prototype.getOwner_asB64 = function() { 223 return /** @type {string} */ (jspb.Message.bytesAsB64( 224 this.getOwner())); 225 }; 226 227 228 /** 229 * optional bytes Owner = 2; 230 * Note that Uint8Array is not supported on all browsers. 231 * @see http://caniuse.com/Uint8Array 232 * This is a type-conversion wrapper around `getOwner()` 233 * @return {!Uint8Array} 234 */ 235 proto.names.Entry.prototype.getOwner_asU8 = function() { 236 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 237 this.getOwner())); 238 }; 239 240 241 /** 242 * @param {!(string|Uint8Array)} value 243 * @return {!proto.names.Entry} returns this 244 */ 245 proto.names.Entry.prototype.setOwner = function(value) { 246 return jspb.Message.setProto3BytesField(this, 2, value); 247 }; 248 249 250 /** 251 * optional string Data = 3; 252 * @return {string} 253 */ 254 proto.names.Entry.prototype.getData = function() { 255 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); 256 }; 257 258 259 /** 260 * @param {string} value 261 * @return {!proto.names.Entry} returns this 262 */ 263 proto.names.Entry.prototype.setData = function(value) { 264 return jspb.Message.setProto3StringField(this, 3, value); 265 }; 266 267 268 /** 269 * optional uint64 Expires = 4; 270 * @return {number} 271 */ 272 proto.names.Entry.prototype.getExpires = function() { 273 return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); 274 }; 275 276 277 /** 278 * @param {number} value 279 * @return {!proto.names.Entry} returns this 280 */ 281 proto.names.Entry.prototype.setExpires = function(value) { 282 return jspb.Message.setProto3IntField(this, 4, value); 283 }; 284 285 286 goog.object.extend(exports, proto.names);