github.com/hyperledger/burrow@v0.34.5-0.20220512172541-77f09336001d/js/proto/spec_pb.js (about) 1 // source: spec.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 var crypto_pb = require('./crypto_pb.js'); 21 goog.object.extend(proto, crypto_pb); 22 var balance_pb = require('./balance_pb.js'); 23 goog.object.extend(proto, balance_pb); 24 goog.exportSymbol('proto.spec.TemplateAccount', null, global); 25 /** 26 * Generated by JsPbCodeGenerator. 27 * @param {Array=} opt_data Optional initial data array, typically from a 28 * server response, or constructed directly in Javascript. The array is used 29 * in place and becomes part of the constructed object. It is not cloned. 30 * If no data is provided, the constructed object will be empty, but still 31 * valid. 32 * @extends {jspb.Message} 33 * @constructor 34 */ 35 proto.spec.TemplateAccount = function(opt_data) { 36 jspb.Message.initialize(this, opt_data, 0, -1, proto.spec.TemplateAccount.repeatedFields_, null); 37 }; 38 goog.inherits(proto.spec.TemplateAccount, jspb.Message); 39 if (goog.DEBUG && !COMPILED) { 40 /** 41 * @public 42 * @override 43 */ 44 proto.spec.TemplateAccount.displayName = 'proto.spec.TemplateAccount'; 45 } 46 47 /** 48 * List of repeated fields within this message type. 49 * @private {!Array<number>} 50 * @const 51 */ 52 proto.spec.TemplateAccount.repeatedFields_ = [4,5,6]; 53 54 55 56 if (jspb.Message.GENERATE_TO_OBJECT) { 57 /** 58 * Creates an object representation of this proto. 59 * Field names that are reserved in JavaScript and will be renamed to pb_name. 60 * Optional fields that are not set will be set to undefined. 61 * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. 62 * For the list of reserved names please see: 63 * net/proto2/compiler/js/internal/generator.cc#kKeyword. 64 * @param {boolean=} opt_includeInstance Deprecated. whether to include the 65 * JSPB instance for transitional soy proto support: 66 * http://goto/soy-param-migration 67 * @return {!Object} 68 */ 69 proto.spec.TemplateAccount.prototype.toObject = function(opt_includeInstance) { 70 return proto.spec.TemplateAccount.toObject(opt_includeInstance, this); 71 }; 72 73 74 /** 75 * Static version of the {@see toObject} method. 76 * @param {boolean|undefined} includeInstance Deprecated. Whether to include 77 * the JSPB instance for transitional soy proto support: 78 * http://goto/soy-param-migration 79 * @param {!proto.spec.TemplateAccount} msg The msg instance to transform. 80 * @return {!Object} 81 * @suppress {unusedLocalVariables} f is only used for nested messages 82 */ 83 proto.spec.TemplateAccount.toObject = function(includeInstance, msg) { 84 var f, obj = { 85 name: jspb.Message.getFieldWithDefault(msg, 1, ""), 86 address: msg.getAddress_asB64(), 87 publickey: (f = msg.getPublickey()) && crypto_pb.PublicKey.toObject(includeInstance, f), 88 amountsList: jspb.Message.toObjectList(msg.getAmountsList(), 89 balance_pb.Balance.toObject, includeInstance), 90 permissionsList: (f = jspb.Message.getRepeatedField(msg, 5)) == null ? undefined : f, 91 rolesList: (f = jspb.Message.getRepeatedField(msg, 6)) == null ? undefined : f, 92 code: msg.getCode_asB64() 93 }; 94 95 if (includeInstance) { 96 obj.$jspbMessageInstance = msg; 97 } 98 return obj; 99 }; 100 } 101 102 103 /** 104 * Deserializes binary data (in protobuf wire format). 105 * @param {jspb.ByteSource} bytes The bytes to deserialize. 106 * @return {!proto.spec.TemplateAccount} 107 */ 108 proto.spec.TemplateAccount.deserializeBinary = function(bytes) { 109 var reader = new jspb.BinaryReader(bytes); 110 var msg = new proto.spec.TemplateAccount; 111 return proto.spec.TemplateAccount.deserializeBinaryFromReader(msg, reader); 112 }; 113 114 115 /** 116 * Deserializes binary data (in protobuf wire format) from the 117 * given reader into the given message object. 118 * @param {!proto.spec.TemplateAccount} msg The message object to deserialize into. 119 * @param {!jspb.BinaryReader} reader The BinaryReader to use. 120 * @return {!proto.spec.TemplateAccount} 121 */ 122 proto.spec.TemplateAccount.deserializeBinaryFromReader = function(msg, reader) { 123 while (reader.nextField()) { 124 if (reader.isEndGroup()) { 125 break; 126 } 127 var field = reader.getFieldNumber(); 128 switch (field) { 129 case 1: 130 var value = /** @type {string} */ (reader.readString()); 131 msg.setName(value); 132 break; 133 case 2: 134 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 135 msg.setAddress(value); 136 break; 137 case 3: 138 var value = new crypto_pb.PublicKey; 139 reader.readMessage(value,crypto_pb.PublicKey.deserializeBinaryFromReader); 140 msg.setPublickey(value); 141 break; 142 case 4: 143 var value = new balance_pb.Balance; 144 reader.readMessage(value,balance_pb.Balance.deserializeBinaryFromReader); 145 msg.addAmounts(value); 146 break; 147 case 5: 148 var value = /** @type {string} */ (reader.readString()); 149 msg.addPermissions(value); 150 break; 151 case 6: 152 var value = /** @type {string} */ (reader.readString()); 153 msg.addRoles(value); 154 break; 155 case 7: 156 var value = /** @type {!Uint8Array} */ (reader.readBytes()); 157 msg.setCode(value); 158 break; 159 default: 160 reader.skipField(); 161 break; 162 } 163 } 164 return msg; 165 }; 166 167 168 /** 169 * Serializes the message to binary data (in protobuf wire format). 170 * @return {!Uint8Array} 171 */ 172 proto.spec.TemplateAccount.prototype.serializeBinary = function() { 173 var writer = new jspb.BinaryWriter(); 174 proto.spec.TemplateAccount.serializeBinaryToWriter(this, writer); 175 return writer.getResultBuffer(); 176 }; 177 178 179 /** 180 * Serializes the given message to binary data (in protobuf wire 181 * format), writing to the given BinaryWriter. 182 * @param {!proto.spec.TemplateAccount} message 183 * @param {!jspb.BinaryWriter} writer 184 * @suppress {unusedLocalVariables} f is only used for nested messages 185 */ 186 proto.spec.TemplateAccount.serializeBinaryToWriter = function(message, writer) { 187 var f = undefined; 188 f = message.getName(); 189 if (f.length > 0) { 190 writer.writeString( 191 1, 192 f 193 ); 194 } 195 f = message.getAddress_asU8(); 196 if (f.length > 0) { 197 writer.writeBytes( 198 2, 199 f 200 ); 201 } 202 f = message.getPublickey(); 203 if (f != null) { 204 writer.writeMessage( 205 3, 206 f, 207 crypto_pb.PublicKey.serializeBinaryToWriter 208 ); 209 } 210 f = message.getAmountsList(); 211 if (f.length > 0) { 212 writer.writeRepeatedMessage( 213 4, 214 f, 215 balance_pb.Balance.serializeBinaryToWriter 216 ); 217 } 218 f = message.getPermissionsList(); 219 if (f.length > 0) { 220 writer.writeRepeatedString( 221 5, 222 f 223 ); 224 } 225 f = message.getRolesList(); 226 if (f.length > 0) { 227 writer.writeRepeatedString( 228 6, 229 f 230 ); 231 } 232 f = message.getCode_asU8(); 233 if (f.length > 0) { 234 writer.writeBytes( 235 7, 236 f 237 ); 238 } 239 }; 240 241 242 /** 243 * optional string Name = 1; 244 * @return {string} 245 */ 246 proto.spec.TemplateAccount.prototype.getName = function() { 247 return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); 248 }; 249 250 251 /** 252 * @param {string} value 253 * @return {!proto.spec.TemplateAccount} returns this 254 */ 255 proto.spec.TemplateAccount.prototype.setName = function(value) { 256 return jspb.Message.setProto3StringField(this, 1, value); 257 }; 258 259 260 /** 261 * optional bytes Address = 2; 262 * @return {!(string|Uint8Array)} 263 */ 264 proto.spec.TemplateAccount.prototype.getAddress = function() { 265 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); 266 }; 267 268 269 /** 270 * optional bytes Address = 2; 271 * This is a type-conversion wrapper around `getAddress()` 272 * @return {string} 273 */ 274 proto.spec.TemplateAccount.prototype.getAddress_asB64 = function() { 275 return /** @type {string} */ (jspb.Message.bytesAsB64( 276 this.getAddress())); 277 }; 278 279 280 /** 281 * optional bytes Address = 2; 282 * Note that Uint8Array is not supported on all browsers. 283 * @see http://caniuse.com/Uint8Array 284 * This is a type-conversion wrapper around `getAddress()` 285 * @return {!Uint8Array} 286 */ 287 proto.spec.TemplateAccount.prototype.getAddress_asU8 = function() { 288 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 289 this.getAddress())); 290 }; 291 292 293 /** 294 * @param {!(string|Uint8Array)} value 295 * @return {!proto.spec.TemplateAccount} returns this 296 */ 297 proto.spec.TemplateAccount.prototype.setAddress = function(value) { 298 return jspb.Message.setProto3BytesField(this, 2, value); 299 }; 300 301 302 /** 303 * optional crypto.PublicKey PublicKey = 3; 304 * @return {?proto.crypto.PublicKey} 305 */ 306 proto.spec.TemplateAccount.prototype.getPublickey = function() { 307 return /** @type{?proto.crypto.PublicKey} */ ( 308 jspb.Message.getWrapperField(this, crypto_pb.PublicKey, 3)); 309 }; 310 311 312 /** 313 * @param {?proto.crypto.PublicKey|undefined} value 314 * @return {!proto.spec.TemplateAccount} returns this 315 */ 316 proto.spec.TemplateAccount.prototype.setPublickey = function(value) { 317 return jspb.Message.setWrapperField(this, 3, value); 318 }; 319 320 321 /** 322 * Clears the message field making it undefined. 323 * @return {!proto.spec.TemplateAccount} returns this 324 */ 325 proto.spec.TemplateAccount.prototype.clearPublickey = function() { 326 return this.setPublickey(undefined); 327 }; 328 329 330 /** 331 * Returns whether this field is set. 332 * @return {boolean} 333 */ 334 proto.spec.TemplateAccount.prototype.hasPublickey = function() { 335 return jspb.Message.getField(this, 3) != null; 336 }; 337 338 339 /** 340 * repeated balance.Balance Amounts = 4; 341 * @return {!Array<!proto.balance.Balance>} 342 */ 343 proto.spec.TemplateAccount.prototype.getAmountsList = function() { 344 return /** @type{!Array<!proto.balance.Balance>} */ ( 345 jspb.Message.getRepeatedWrapperField(this, balance_pb.Balance, 4)); 346 }; 347 348 349 /** 350 * @param {!Array<!proto.balance.Balance>} value 351 * @return {!proto.spec.TemplateAccount} returns this 352 */ 353 proto.spec.TemplateAccount.prototype.setAmountsList = function(value) { 354 return jspb.Message.setRepeatedWrapperField(this, 4, value); 355 }; 356 357 358 /** 359 * @param {!proto.balance.Balance=} opt_value 360 * @param {number=} opt_index 361 * @return {!proto.balance.Balance} 362 */ 363 proto.spec.TemplateAccount.prototype.addAmounts = function(opt_value, opt_index) { 364 return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.balance.Balance, opt_index); 365 }; 366 367 368 /** 369 * Clears the list making it empty but non-null. 370 * @return {!proto.spec.TemplateAccount} returns this 371 */ 372 proto.spec.TemplateAccount.prototype.clearAmountsList = function() { 373 return this.setAmountsList([]); 374 }; 375 376 377 /** 378 * repeated string Permissions = 5; 379 * @return {!Array<string>} 380 */ 381 proto.spec.TemplateAccount.prototype.getPermissionsList = function() { 382 return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 5)); 383 }; 384 385 386 /** 387 * @param {!Array<string>} value 388 * @return {!proto.spec.TemplateAccount} returns this 389 */ 390 proto.spec.TemplateAccount.prototype.setPermissionsList = function(value) { 391 return jspb.Message.setField(this, 5, value || []); 392 }; 393 394 395 /** 396 * @param {string} value 397 * @param {number=} opt_index 398 * @return {!proto.spec.TemplateAccount} returns this 399 */ 400 proto.spec.TemplateAccount.prototype.addPermissions = function(value, opt_index) { 401 return jspb.Message.addToRepeatedField(this, 5, value, opt_index); 402 }; 403 404 405 /** 406 * Clears the list making it empty but non-null. 407 * @return {!proto.spec.TemplateAccount} returns this 408 */ 409 proto.spec.TemplateAccount.prototype.clearPermissionsList = function() { 410 return this.setPermissionsList([]); 411 }; 412 413 414 /** 415 * repeated string Roles = 6; 416 * @return {!Array<string>} 417 */ 418 proto.spec.TemplateAccount.prototype.getRolesList = function() { 419 return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 6)); 420 }; 421 422 423 /** 424 * @param {!Array<string>} value 425 * @return {!proto.spec.TemplateAccount} returns this 426 */ 427 proto.spec.TemplateAccount.prototype.setRolesList = function(value) { 428 return jspb.Message.setField(this, 6, value || []); 429 }; 430 431 432 /** 433 * @param {string} value 434 * @param {number=} opt_index 435 * @return {!proto.spec.TemplateAccount} returns this 436 */ 437 proto.spec.TemplateAccount.prototype.addRoles = function(value, opt_index) { 438 return jspb.Message.addToRepeatedField(this, 6, value, opt_index); 439 }; 440 441 442 /** 443 * Clears the list making it empty but non-null. 444 * @return {!proto.spec.TemplateAccount} returns this 445 */ 446 proto.spec.TemplateAccount.prototype.clearRolesList = function() { 447 return this.setRolesList([]); 448 }; 449 450 451 /** 452 * optional bytes Code = 7; 453 * @return {!(string|Uint8Array)} 454 */ 455 proto.spec.TemplateAccount.prototype.getCode = function() { 456 return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 7, "")); 457 }; 458 459 460 /** 461 * optional bytes Code = 7; 462 * This is a type-conversion wrapper around `getCode()` 463 * @return {string} 464 */ 465 proto.spec.TemplateAccount.prototype.getCode_asB64 = function() { 466 return /** @type {string} */ (jspb.Message.bytesAsB64( 467 this.getCode())); 468 }; 469 470 471 /** 472 * optional bytes Code = 7; 473 * Note that Uint8Array is not supported on all browsers. 474 * @see http://caniuse.com/Uint8Array 475 * This is a type-conversion wrapper around `getCode()` 476 * @return {!Uint8Array} 477 */ 478 proto.spec.TemplateAccount.prototype.getCode_asU8 = function() { 479 return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( 480 this.getCode())); 481 }; 482 483 484 /** 485 * @param {!(string|Uint8Array)} value 486 * @return {!proto.spec.TemplateAccount} returns this 487 */ 488 proto.spec.TemplateAccount.prototype.setCode = function(value) { 489 return jspb.Message.setProto3BytesField(this, 7, value); 490 }; 491 492 493 goog.object.extend(exports, proto.spec);