UNPKG

@digitalasset/daml-ledger

Version:
545 lines (470 loc) 16.4 kB
// source: com/digitalasset/daml_lf_1_8/daml_lf.proto /** * @fileoverview * @enhanceable * @suppress {messageConventions} JS Compiler reports an error if a variable or * field starts with 'MSG_' and isn't a translatable message. * @public */ // GENERATED CODE -- DO NOT EDIT! var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); var com_digitalasset_daml_lf_1_8_daml_lf_0_pb = require('../../../com/digitalasset/daml_lf_1_8/daml_lf_0_pb.js'); goog.object.extend(proto, com_digitalasset_daml_lf_1_8_daml_lf_0_pb); var com_digitalasset_daml_lf_1_8_daml_lf_1_pb = require('../../../com/digitalasset/daml_lf_1_8/daml_lf_1_pb.js'); goog.object.extend(proto, com_digitalasset_daml_lf_1_8_daml_lf_1_pb); goog.exportSymbol('proto.daml_lf_1_8.Archive', null, global); goog.exportSymbol('proto.daml_lf_1_8.ArchivePayload', null, global); goog.exportSymbol('proto.daml_lf_1_8.ArchivePayload.SumCase', null, global); goog.exportSymbol('proto.daml_lf_1_8.HashFunction', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.daml_lf_1_8.ArchivePayload = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, proto.daml_lf_1_8.ArchivePayload.oneofGroups_); }; goog.inherits(proto.daml_lf_1_8.ArchivePayload, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.daml_lf_1_8.ArchivePayload.displayName = 'proto.daml_lf_1_8.ArchivePayload'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.daml_lf_1_8.Archive = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.daml_lf_1_8.Archive, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.daml_lf_1_8.Archive.displayName = 'proto.daml_lf_1_8.Archive'; } /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all * other fields in the group are cleared. During deserialization, if multiple * fields are encountered for a group, only the last value seen will be kept. * @private {!Array<!Array<number>>} * @const */ proto.daml_lf_1_8.ArchivePayload.oneofGroups_ = [[1,2]]; /** * @enum {number} */ proto.daml_lf_1_8.ArchivePayload.SumCase = { SUM_NOT_SET: 0, DAML_LF_0: 1, DAML_LF_1: 2 }; /** * @return {proto.daml_lf_1_8.ArchivePayload.SumCase} */ proto.daml_lf_1_8.ArchivePayload.prototype.getSumCase = function() { return /** @type {proto.daml_lf_1_8.ArchivePayload.SumCase} */(jspb.Message.computeOneofCase(this, proto.daml_lf_1_8.ArchivePayload.oneofGroups_[0])); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.daml_lf_1_8.ArchivePayload.prototype.toObject = function(opt_includeInstance) { return proto.daml_lf_1_8.ArchivePayload.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.daml_lf_1_8.ArchivePayload} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.daml_lf_1_8.ArchivePayload.toObject = function(includeInstance, msg) { var f, obj = { minor: jspb.Message.getFieldWithDefault(msg, 3, ""), damlLf0: (f = msg.getDamlLf0()) && com_digitalasset_daml_lf_1_8_daml_lf_0_pb.Package.toObject(includeInstance, f), damlLf1: (f = msg.getDamlLf1()) && com_digitalasset_daml_lf_1_8_daml_lf_1_pb.Package.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.daml_lf_1_8.ArchivePayload} */ proto.daml_lf_1_8.ArchivePayload.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.daml_lf_1_8.ArchivePayload; return proto.daml_lf_1_8.ArchivePayload.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.daml_lf_1_8.ArchivePayload} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.daml_lf_1_8.ArchivePayload} */ proto.daml_lf_1_8.ArchivePayload.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 3: var value = /** @type {string} */ (reader.readString()); msg.setMinor(value); break; case 1: var value = new com_digitalasset_daml_lf_1_8_daml_lf_0_pb.Package; reader.readMessage(value,com_digitalasset_daml_lf_1_8_daml_lf_0_pb.Package.deserializeBinaryFromReader); msg.setDamlLf0(value); break; case 2: var value = new com_digitalasset_daml_lf_1_8_daml_lf_1_pb.Package; reader.readMessage(value,com_digitalasset_daml_lf_1_8_daml_lf_1_pb.Package.deserializeBinaryFromReader); msg.setDamlLf1(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.daml_lf_1_8.ArchivePayload.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.daml_lf_1_8.ArchivePayload.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.daml_lf_1_8.ArchivePayload} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.daml_lf_1_8.ArchivePayload.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getMinor(); if (f.length > 0) { writer.writeString( 3, f ); } f = message.getDamlLf0(); if (f != null) { writer.writeMessage( 1, f, com_digitalasset_daml_lf_1_8_daml_lf_0_pb.Package.serializeBinaryToWriter ); } f = message.getDamlLf1(); if (f != null) { writer.writeMessage( 2, f, com_digitalasset_daml_lf_1_8_daml_lf_1_pb.Package.serializeBinaryToWriter ); } }; /** * optional string minor = 3; * @return {string} */ proto.daml_lf_1_8.ArchivePayload.prototype.getMinor = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * @param {string} value * @return {!proto.daml_lf_1_8.ArchivePayload} returns this */ proto.daml_lf_1_8.ArchivePayload.prototype.setMinor = function(value) { return jspb.Message.setProto3StringField(this, 3, value); }; /** * optional daml_lf_0.Package daml_lf_0 = 1; * @return {?proto.daml_lf_0.Package} */ proto.daml_lf_1_8.ArchivePayload.prototype.getDamlLf0 = function() { return /** @type{?proto.daml_lf_0.Package} */ ( jspb.Message.getWrapperField(this, com_digitalasset_daml_lf_1_8_daml_lf_0_pb.Package, 1)); }; /** * @param {?proto.daml_lf_0.Package|undefined} value * @return {!proto.daml_lf_1_8.ArchivePayload} returns this */ proto.daml_lf_1_8.ArchivePayload.prototype.setDamlLf0 = function(value) { return jspb.Message.setOneofWrapperField(this, 1, proto.daml_lf_1_8.ArchivePayload.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. * @return {!proto.daml_lf_1_8.ArchivePayload} returns this */ proto.daml_lf_1_8.ArchivePayload.prototype.clearDamlLf0 = function() { return this.setDamlLf0(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.daml_lf_1_8.ArchivePayload.prototype.hasDamlLf0 = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional daml_lf_1.Package daml_lf_1 = 2; * @return {?proto.daml_lf_1.Package} */ proto.daml_lf_1_8.ArchivePayload.prototype.getDamlLf1 = function() { return /** @type{?proto.daml_lf_1.Package} */ ( jspb.Message.getWrapperField(this, com_digitalasset_daml_lf_1_8_daml_lf_1_pb.Package, 2)); }; /** * @param {?proto.daml_lf_1.Package|undefined} value * @return {!proto.daml_lf_1_8.ArchivePayload} returns this */ proto.daml_lf_1_8.ArchivePayload.prototype.setDamlLf1 = function(value) { return jspb.Message.setOneofWrapperField(this, 2, proto.daml_lf_1_8.ArchivePayload.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. * @return {!proto.daml_lf_1_8.ArchivePayload} returns this */ proto.daml_lf_1_8.ArchivePayload.prototype.clearDamlLf1 = function() { return this.setDamlLf1(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.daml_lf_1_8.ArchivePayload.prototype.hasDamlLf1 = function() { return jspb.Message.getField(this, 2) != null; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.daml_lf_1_8.Archive.prototype.toObject = function(opt_includeInstance) { return proto.daml_lf_1_8.Archive.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.daml_lf_1_8.Archive} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.daml_lf_1_8.Archive.toObject = function(includeInstance, msg) { var f, obj = { hashFunction: jspb.Message.getFieldWithDefault(msg, 1, 0), payload: msg.getPayload_asB64(), hash: jspb.Message.getFieldWithDefault(msg, 4, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.daml_lf_1_8.Archive} */ proto.daml_lf_1_8.Archive.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.daml_lf_1_8.Archive; return proto.daml_lf_1_8.Archive.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.daml_lf_1_8.Archive} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.daml_lf_1_8.Archive} */ proto.daml_lf_1_8.Archive.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!proto.daml_lf_1_8.HashFunction} */ (reader.readEnum()); msg.setHashFunction(value); break; case 3: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setPayload(value); break; case 4: var value = /** @type {string} */ (reader.readString()); msg.setHash(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.daml_lf_1_8.Archive.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.daml_lf_1_8.Archive.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.daml_lf_1_8.Archive} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.daml_lf_1_8.Archive.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getHashFunction(); if (f !== 0.0) { writer.writeEnum( 1, f ); } f = message.getPayload_asU8(); if (f.length > 0) { writer.writeBytes( 3, f ); } f = message.getHash(); if (f.length > 0) { writer.writeString( 4, f ); } }; /** * optional HashFunction hash_function = 1; * @return {!proto.daml_lf_1_8.HashFunction} */ proto.daml_lf_1_8.Archive.prototype.getHashFunction = function() { return /** @type {!proto.daml_lf_1_8.HashFunction} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {!proto.daml_lf_1_8.HashFunction} value * @return {!proto.daml_lf_1_8.Archive} returns this */ proto.daml_lf_1_8.Archive.prototype.setHashFunction = function(value) { return jspb.Message.setProto3EnumField(this, 1, value); }; /** * optional bytes payload = 3; * @return {!(string|Uint8Array)} */ proto.daml_lf_1_8.Archive.prototype.getPayload = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 3, "")); }; /** * optional bytes payload = 3; * This is a type-conversion wrapper around `getPayload()` * @return {string} */ proto.daml_lf_1_8.Archive.prototype.getPayload_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getPayload())); }; /** * optional bytes payload = 3; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getPayload()` * @return {!Uint8Array} */ proto.daml_lf_1_8.Archive.prototype.getPayload_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getPayload())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.daml_lf_1_8.Archive} returns this */ proto.daml_lf_1_8.Archive.prototype.setPayload = function(value) { return jspb.Message.setProto3BytesField(this, 3, value); }; /** * optional string hash = 4; * @return {string} */ proto.daml_lf_1_8.Archive.prototype.getHash = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * @param {string} value * @return {!proto.daml_lf_1_8.Archive} returns this */ proto.daml_lf_1_8.Archive.prototype.setHash = function(value) { return jspb.Message.setProto3StringField(this, 4, value); }; /** * @enum {number} */ proto.daml_lf_1_8.HashFunction = { SHA256: 0 }; goog.object.extend(exports, proto.daml_lf_1_8);