github.com/hyperledger/burrow@v0.34.5-0.20220512172541-77f09336001d/js/proto/errors_pb.js (about)

     1  // source: errors.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.errors.Exception', 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.errors.Exception = function(opt_data) {
    32    jspb.Message.initialize(this, opt_data, 0, -1, null, null);
    33  };
    34  goog.inherits(proto.errors.Exception, jspb.Message);
    35  if (goog.DEBUG && !COMPILED) {
    36    /**
    37     * @public
    38     * @override
    39     */
    40    proto.errors.Exception.displayName = 'proto.errors.Exception';
    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.errors.Exception.prototype.toObject = function(opt_includeInstance) {
    59    return proto.errors.Exception.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.errors.Exception} msg The msg instance to transform.
    69   * @return {!Object}
    70   * @suppress {unusedLocalVariables} f is only used for nested messages
    71   */
    72  proto.errors.Exception.toObject = function(includeInstance, msg) {
    73    var f, obj = {
    74      code: jspb.Message.getFieldWithDefault(msg, 1, 0),
    75      exception: jspb.Message.getFieldWithDefault(msg, 2, "")
    76    };
    77  
    78    if (includeInstance) {
    79      obj.$jspbMessageInstance = msg;
    80    }
    81    return obj;
    82  };
    83  }
    84  
    85  
    86  /**
    87   * Deserializes binary data (in protobuf wire format).
    88   * @param {jspb.ByteSource} bytes The bytes to deserialize.
    89   * @return {!proto.errors.Exception}
    90   */
    91  proto.errors.Exception.deserializeBinary = function(bytes) {
    92    var reader = new jspb.BinaryReader(bytes);
    93    var msg = new proto.errors.Exception;
    94    return proto.errors.Exception.deserializeBinaryFromReader(msg, reader);
    95  };
    96  
    97  
    98  /**
    99   * Deserializes binary data (in protobuf wire format) from the
   100   * given reader into the given message object.
   101   * @param {!proto.errors.Exception} msg The message object to deserialize into.
   102   * @param {!jspb.BinaryReader} reader The BinaryReader to use.
   103   * @return {!proto.errors.Exception}
   104   */
   105  proto.errors.Exception.deserializeBinaryFromReader = function(msg, reader) {
   106    while (reader.nextField()) {
   107      if (reader.isEndGroup()) {
   108        break;
   109      }
   110      var field = reader.getFieldNumber();
   111      switch (field) {
   112      case 1:
   113        var value = /** @type {number} */ (reader.readUint32());
   114        msg.setCode(value);
   115        break;
   116      case 2:
   117        var value = /** @type {string} */ (reader.readString());
   118        msg.setException(value);
   119        break;
   120      default:
   121        reader.skipField();
   122        break;
   123      }
   124    }
   125    return msg;
   126  };
   127  
   128  
   129  /**
   130   * Serializes the message to binary data (in protobuf wire format).
   131   * @return {!Uint8Array}
   132   */
   133  proto.errors.Exception.prototype.serializeBinary = function() {
   134    var writer = new jspb.BinaryWriter();
   135    proto.errors.Exception.serializeBinaryToWriter(this, writer);
   136    return writer.getResultBuffer();
   137  };
   138  
   139  
   140  /**
   141   * Serializes the given message to binary data (in protobuf wire
   142   * format), writing to the given BinaryWriter.
   143   * @param {!proto.errors.Exception} message
   144   * @param {!jspb.BinaryWriter} writer
   145   * @suppress {unusedLocalVariables} f is only used for nested messages
   146   */
   147  proto.errors.Exception.serializeBinaryToWriter = function(message, writer) {
   148    var f = undefined;
   149    f = message.getCode();
   150    if (f !== 0) {
   151      writer.writeUint32(
   152        1,
   153        f
   154      );
   155    }
   156    f = message.getException();
   157    if (f.length > 0) {
   158      writer.writeString(
   159        2,
   160        f
   161      );
   162    }
   163  };
   164  
   165  
   166  /**
   167   * optional uint32 Code = 1;
   168   * @return {number}
   169   */
   170  proto.errors.Exception.prototype.getCode = function() {
   171    return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
   172  };
   173  
   174  
   175  /**
   176   * @param {number} value
   177   * @return {!proto.errors.Exception} returns this
   178   */
   179  proto.errors.Exception.prototype.setCode = function(value) {
   180    return jspb.Message.setProto3IntField(this, 1, value);
   181  };
   182  
   183  
   184  /**
   185   * optional string Exception = 2;
   186   * @return {string}
   187   */
   188  proto.errors.Exception.prototype.getException = function() {
   189    return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
   190  };
   191  
   192  
   193  /**
   194   * @param {string} value
   195   * @return {!proto.errors.Exception} returns this
   196   */
   197  proto.errors.Exception.prototype.setException = function(value) {
   198    return jspb.Message.setProto3StringField(this, 2, value);
   199  };
   200  
   201  
   202  goog.object.extend(exports, proto.errors);