UNPKG

@digitalasset/daml-ledger

Version:
599 lines (516 loc) 20.3 kB
// source: com/daml/ledger/api/v1/testing/time_service.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 google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js'); goog.object.extend(proto, google_protobuf_empty_pb); var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js'); goog.object.extend(proto, google_protobuf_timestamp_pb); goog.exportSymbol('proto.com.daml.ledger.api.v1.testing.GetTimeRequest', null, global); goog.exportSymbol('proto.com.daml.ledger.api.v1.testing.GetTimeResponse', null, global); goog.exportSymbol('proto.com.daml.ledger.api.v1.testing.SetTimeRequest', 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.com.daml.ledger.api.v1.testing.GetTimeRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.com.daml.ledger.api.v1.testing.GetTimeRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.com.daml.ledger.api.v1.testing.GetTimeRequest.displayName = 'proto.com.daml.ledger.api.v1.testing.GetTimeRequest'; } /** * 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.com.daml.ledger.api.v1.testing.GetTimeResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.com.daml.ledger.api.v1.testing.GetTimeResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.com.daml.ledger.api.v1.testing.GetTimeResponse.displayName = 'proto.com.daml.ledger.api.v1.testing.GetTimeResponse'; } /** * 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.com.daml.ledger.api.v1.testing.SetTimeRequest = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.com.daml.ledger.api.v1.testing.SetTimeRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.com.daml.ledger.api.v1.testing.SetTimeRequest.displayName = 'proto.com.daml.ledger.api.v1.testing.SetTimeRequest'; } 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.com.daml.ledger.api.v1.testing.GetTimeRequest.prototype.toObject = function(opt_includeInstance) { return proto.com.daml.ledger.api.v1.testing.GetTimeRequest.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.com.daml.ledger.api.v1.testing.GetTimeRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.com.daml.ledger.api.v1.testing.GetTimeRequest.toObject = function(includeInstance, msg) { var f, obj = { ledgerId: jspb.Message.getFieldWithDefault(msg, 1, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.com.daml.ledger.api.v1.testing.GetTimeRequest} */ proto.com.daml.ledger.api.v1.testing.GetTimeRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.com.daml.ledger.api.v1.testing.GetTimeRequest; return proto.com.daml.ledger.api.v1.testing.GetTimeRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.com.daml.ledger.api.v1.testing.GetTimeRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.com.daml.ledger.api.v1.testing.GetTimeRequest} */ proto.com.daml.ledger.api.v1.testing.GetTimeRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setLedgerId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.com.daml.ledger.api.v1.testing.GetTimeRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.com.daml.ledger.api.v1.testing.GetTimeRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.com.daml.ledger.api.v1.testing.GetTimeRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.com.daml.ledger.api.v1.testing.GetTimeRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getLedgerId(); if (f.length > 0) { writer.writeString( 1, f ); } }; /** * optional string ledger_id = 1; * @return {string} */ proto.com.daml.ledger.api.v1.testing.GetTimeRequest.prototype.getLedgerId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.com.daml.ledger.api.v1.testing.GetTimeRequest} returns this */ proto.com.daml.ledger.api.v1.testing.GetTimeRequest.prototype.setLedgerId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; 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.com.daml.ledger.api.v1.testing.GetTimeResponse.prototype.toObject = function(opt_includeInstance) { return proto.com.daml.ledger.api.v1.testing.GetTimeResponse.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.com.daml.ledger.api.v1.testing.GetTimeResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.com.daml.ledger.api.v1.testing.GetTimeResponse.toObject = function(includeInstance, msg) { var f, obj = { currentTime: (f = msg.getCurrentTime()) && google_protobuf_timestamp_pb.Timestamp.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.com.daml.ledger.api.v1.testing.GetTimeResponse} */ proto.com.daml.ledger.api.v1.testing.GetTimeResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.com.daml.ledger.api.v1.testing.GetTimeResponse; return proto.com.daml.ledger.api.v1.testing.GetTimeResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.com.daml.ledger.api.v1.testing.GetTimeResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.com.daml.ledger.api.v1.testing.GetTimeResponse} */ proto.com.daml.ledger.api.v1.testing.GetTimeResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new google_protobuf_timestamp_pb.Timestamp; reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); msg.setCurrentTime(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.com.daml.ledger.api.v1.testing.GetTimeResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.com.daml.ledger.api.v1.testing.GetTimeResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.com.daml.ledger.api.v1.testing.GetTimeResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.com.daml.ledger.api.v1.testing.GetTimeResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getCurrentTime(); if (f != null) { writer.writeMessage( 1, f, google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter ); } }; /** * optional google.protobuf.Timestamp current_time = 1; * @return {?proto.google.protobuf.Timestamp} */ proto.com.daml.ledger.api.v1.testing.GetTimeResponse.prototype.getCurrentTime = function() { return /** @type{?proto.google.protobuf.Timestamp} */ ( jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 1)); }; /** * @param {?proto.google.protobuf.Timestamp|undefined} value * @return {!proto.com.daml.ledger.api.v1.testing.GetTimeResponse} returns this */ proto.com.daml.ledger.api.v1.testing.GetTimeResponse.prototype.setCurrentTime = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.com.daml.ledger.api.v1.testing.GetTimeResponse} returns this */ proto.com.daml.ledger.api.v1.testing.GetTimeResponse.prototype.clearCurrentTime = function() { return this.setCurrentTime(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.com.daml.ledger.api.v1.testing.GetTimeResponse.prototype.hasCurrentTime = function() { return jspb.Message.getField(this, 1) != 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.com.daml.ledger.api.v1.testing.SetTimeRequest.prototype.toObject = function(opt_includeInstance) { return proto.com.daml.ledger.api.v1.testing.SetTimeRequest.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.com.daml.ledger.api.v1.testing.SetTimeRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.com.daml.ledger.api.v1.testing.SetTimeRequest.toObject = function(includeInstance, msg) { var f, obj = { ledgerId: jspb.Message.getFieldWithDefault(msg, 1, ""), currentTime: (f = msg.getCurrentTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), newTime: (f = msg.getNewTime()) && google_protobuf_timestamp_pb.Timestamp.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.com.daml.ledger.api.v1.testing.SetTimeRequest} */ proto.com.daml.ledger.api.v1.testing.SetTimeRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.com.daml.ledger.api.v1.testing.SetTimeRequest; return proto.com.daml.ledger.api.v1.testing.SetTimeRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.com.daml.ledger.api.v1.testing.SetTimeRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.com.daml.ledger.api.v1.testing.SetTimeRequest} */ proto.com.daml.ledger.api.v1.testing.SetTimeRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {string} */ (reader.readString()); msg.setLedgerId(value); break; case 2: var value = new google_protobuf_timestamp_pb.Timestamp; reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); msg.setCurrentTime(value); break; case 3: var value = new google_protobuf_timestamp_pb.Timestamp; reader.readMessage(value,google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); msg.setNewTime(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.com.daml.ledger.api.v1.testing.SetTimeRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.com.daml.ledger.api.v1.testing.SetTimeRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.com.daml.ledger.api.v1.testing.SetTimeRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.com.daml.ledger.api.v1.testing.SetTimeRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getLedgerId(); if (f.length > 0) { writer.writeString( 1, f ); } f = message.getCurrentTime(); if (f != null) { writer.writeMessage( 2, f, google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter ); } f = message.getNewTime(); if (f != null) { writer.writeMessage( 3, f, google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter ); } }; /** * optional string ledger_id = 1; * @return {string} */ proto.com.daml.ledger.api.v1.testing.SetTimeRequest.prototype.getLedgerId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * @param {string} value * @return {!proto.com.daml.ledger.api.v1.testing.SetTimeRequest} returns this */ proto.com.daml.ledger.api.v1.testing.SetTimeRequest.prototype.setLedgerId = function(value) { return jspb.Message.setProto3StringField(this, 1, value); }; /** * optional google.protobuf.Timestamp current_time = 2; * @return {?proto.google.protobuf.Timestamp} */ proto.com.daml.ledger.api.v1.testing.SetTimeRequest.prototype.getCurrentTime = function() { return /** @type{?proto.google.protobuf.Timestamp} */ ( jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 2)); }; /** * @param {?proto.google.protobuf.Timestamp|undefined} value * @return {!proto.com.daml.ledger.api.v1.testing.SetTimeRequest} returns this */ proto.com.daml.ledger.api.v1.testing.SetTimeRequest.prototype.setCurrentTime = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.com.daml.ledger.api.v1.testing.SetTimeRequest} returns this */ proto.com.daml.ledger.api.v1.testing.SetTimeRequest.prototype.clearCurrentTime = function() { return this.setCurrentTime(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.com.daml.ledger.api.v1.testing.SetTimeRequest.prototype.hasCurrentTime = function() { return jspb.Message.getField(this, 2) != null; }; /** * optional google.protobuf.Timestamp new_time = 3; * @return {?proto.google.protobuf.Timestamp} */ proto.com.daml.ledger.api.v1.testing.SetTimeRequest.prototype.getNewTime = function() { return /** @type{?proto.google.protobuf.Timestamp} */ ( jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 3)); }; /** * @param {?proto.google.protobuf.Timestamp|undefined} value * @return {!proto.com.daml.ledger.api.v1.testing.SetTimeRequest} returns this */ proto.com.daml.ledger.api.v1.testing.SetTimeRequest.prototype.setNewTime = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. * @return {!proto.com.daml.ledger.api.v1.testing.SetTimeRequest} returns this */ proto.com.daml.ledger.api.v1.testing.SetTimeRequest.prototype.clearNewTime = function() { return this.setNewTime(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.com.daml.ledger.api.v1.testing.SetTimeRequest.prototype.hasNewTime = function() { return jspb.Message.getField(this, 3) != null; }; goog.object.extend(exports, proto.com.daml.ledger.api.v1.testing);