@digitalasset/daml-ledger
Version:
DAML Ledger API Node.js bindings
1,270 lines (1,096 loc) • 41.9 kB
JavaScript
// source: com/daml/ledger/api/v1/package_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 com_daml_ledger_api_v1_trace_context_pb = require('../../../../../com/daml/ledger/api/v1/trace_context_pb.js');
goog.object.extend(proto, com_daml_ledger_api_v1_trace_context_pb);
goog.exportSymbol('proto.com.daml.ledger.api.v1.GetPackageRequest', null, global);
goog.exportSymbol('proto.com.daml.ledger.api.v1.GetPackageResponse', null, global);
goog.exportSymbol('proto.com.daml.ledger.api.v1.GetPackageStatusRequest', null, global);
goog.exportSymbol('proto.com.daml.ledger.api.v1.GetPackageStatusResponse', null, global);
goog.exportSymbol('proto.com.daml.ledger.api.v1.HashFunction', null, global);
goog.exportSymbol('proto.com.daml.ledger.api.v1.ListPackagesRequest', null, global);
goog.exportSymbol('proto.com.daml.ledger.api.v1.ListPackagesResponse', null, global);
goog.exportSymbol('proto.com.daml.ledger.api.v1.PackageStatus', 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.ListPackagesRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, 500, null, null);
};
goog.inherits(proto.com.daml.ledger.api.v1.ListPackagesRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.com.daml.ledger.api.v1.ListPackagesRequest.displayName = 'proto.com.daml.ledger.api.v1.ListPackagesRequest';
}
/**
* 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.ListPackagesResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.com.daml.ledger.api.v1.ListPackagesResponse.repeatedFields_, null);
};
goog.inherits(proto.com.daml.ledger.api.v1.ListPackagesResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.com.daml.ledger.api.v1.ListPackagesResponse.displayName = 'proto.com.daml.ledger.api.v1.ListPackagesResponse';
}
/**
* 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.GetPackageRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, 500, null, null);
};
goog.inherits(proto.com.daml.ledger.api.v1.GetPackageRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.com.daml.ledger.api.v1.GetPackageRequest.displayName = 'proto.com.daml.ledger.api.v1.GetPackageRequest';
}
/**
* 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.GetPackageResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.com.daml.ledger.api.v1.GetPackageResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.com.daml.ledger.api.v1.GetPackageResponse.displayName = 'proto.com.daml.ledger.api.v1.GetPackageResponse';
}
/**
* 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.GetPackageStatusRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, 500, null, null);
};
goog.inherits(proto.com.daml.ledger.api.v1.GetPackageStatusRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.com.daml.ledger.api.v1.GetPackageStatusRequest.displayName = 'proto.com.daml.ledger.api.v1.GetPackageStatusRequest';
}
/**
* 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.GetPackageStatusResponse = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.com.daml.ledger.api.v1.GetPackageStatusResponse, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.com.daml.ledger.api.v1.GetPackageStatusResponse.displayName = 'proto.com.daml.ledger.api.v1.GetPackageStatusResponse';
}
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.ListPackagesRequest.prototype.toObject = function(opt_includeInstance) {
return proto.com.daml.ledger.api.v1.ListPackagesRequest.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.ListPackagesRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.com.daml.ledger.api.v1.ListPackagesRequest.toObject = function(includeInstance, msg) {
var f, obj = {
ledgerId: jspb.Message.getFieldWithDefault(msg, 1, ""),
traceContext: (f = msg.getTraceContext()) && com_daml_ledger_api_v1_trace_context_pb.TraceContext.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.ListPackagesRequest}
*/
proto.com.daml.ledger.api.v1.ListPackagesRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.com.daml.ledger.api.v1.ListPackagesRequest;
return proto.com.daml.ledger.api.v1.ListPackagesRequest.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.ListPackagesRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.com.daml.ledger.api.v1.ListPackagesRequest}
*/
proto.com.daml.ledger.api.v1.ListPackagesRequest.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 1000:
var value = new com_daml_ledger_api_v1_trace_context_pb.TraceContext;
reader.readMessage(value,com_daml_ledger_api_v1_trace_context_pb.TraceContext.deserializeBinaryFromReader);
msg.setTraceContext(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.ListPackagesRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.com.daml.ledger.api.v1.ListPackagesRequest.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.ListPackagesRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.com.daml.ledger.api.v1.ListPackagesRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getLedgerId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getTraceContext();
if (f != null) {
writer.writeMessage(
1000,
f,
com_daml_ledger_api_v1_trace_context_pb.TraceContext.serializeBinaryToWriter
);
}
};
/**
* optional string ledger_id = 1;
* @return {string}
*/
proto.com.daml.ledger.api.v1.ListPackagesRequest.prototype.getLedgerId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.com.daml.ledger.api.v1.ListPackagesRequest} returns this
*/
proto.com.daml.ledger.api.v1.ListPackagesRequest.prototype.setLedgerId = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional TraceContext trace_context = 1000;
* @return {?proto.com.daml.ledger.api.v1.TraceContext}
*/
proto.com.daml.ledger.api.v1.ListPackagesRequest.prototype.getTraceContext = function() {
return /** @type{?proto.com.daml.ledger.api.v1.TraceContext} */ (
jspb.Message.getWrapperField(this, com_daml_ledger_api_v1_trace_context_pb.TraceContext, 1000));
};
/**
* @param {?proto.com.daml.ledger.api.v1.TraceContext|undefined} value
* @return {!proto.com.daml.ledger.api.v1.ListPackagesRequest} returns this
*/
proto.com.daml.ledger.api.v1.ListPackagesRequest.prototype.setTraceContext = function(value) {
return jspb.Message.setWrapperField(this, 1000, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.com.daml.ledger.api.v1.ListPackagesRequest} returns this
*/
proto.com.daml.ledger.api.v1.ListPackagesRequest.prototype.clearTraceContext = function() {
return this.setTraceContext(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.com.daml.ledger.api.v1.ListPackagesRequest.prototype.hasTraceContext = function() {
return jspb.Message.getField(this, 1000) != null;
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.com.daml.ledger.api.v1.ListPackagesResponse.repeatedFields_ = [1];
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.ListPackagesResponse.prototype.toObject = function(opt_includeInstance) {
return proto.com.daml.ledger.api.v1.ListPackagesResponse.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.ListPackagesResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.com.daml.ledger.api.v1.ListPackagesResponse.toObject = function(includeInstance, msg) {
var f, obj = {
packageIdsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : 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.ListPackagesResponse}
*/
proto.com.daml.ledger.api.v1.ListPackagesResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.com.daml.ledger.api.v1.ListPackagesResponse;
return proto.com.daml.ledger.api.v1.ListPackagesResponse.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.ListPackagesResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.com.daml.ledger.api.v1.ListPackagesResponse}
*/
proto.com.daml.ledger.api.v1.ListPackagesResponse.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.addPackageIds(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.ListPackagesResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.com.daml.ledger.api.v1.ListPackagesResponse.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.ListPackagesResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.com.daml.ledger.api.v1.ListPackagesResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getPackageIdsList();
if (f.length > 0) {
writer.writeRepeatedString(
1,
f
);
}
};
/**
* repeated string package_ids = 1;
* @return {!Array<string>}
*/
proto.com.daml.ledger.api.v1.ListPackagesResponse.prototype.getPackageIdsList = function() {
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 1));
};
/**
* @param {!Array<string>} value
* @return {!proto.com.daml.ledger.api.v1.ListPackagesResponse} returns this
*/
proto.com.daml.ledger.api.v1.ListPackagesResponse.prototype.setPackageIdsList = function(value) {
return jspb.Message.setField(this, 1, value || []);
};
/**
* @param {string} value
* @param {number=} opt_index
* @return {!proto.com.daml.ledger.api.v1.ListPackagesResponse} returns this
*/
proto.com.daml.ledger.api.v1.ListPackagesResponse.prototype.addPackageIds = function(value, opt_index) {
return jspb.Message.addToRepeatedField(this, 1, value, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.com.daml.ledger.api.v1.ListPackagesResponse} returns this
*/
proto.com.daml.ledger.api.v1.ListPackagesResponse.prototype.clearPackageIdsList = function() {
return this.setPackageIdsList([]);
};
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.GetPackageRequest.prototype.toObject = function(opt_includeInstance) {
return proto.com.daml.ledger.api.v1.GetPackageRequest.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.GetPackageRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.com.daml.ledger.api.v1.GetPackageRequest.toObject = function(includeInstance, msg) {
var f, obj = {
ledgerId: jspb.Message.getFieldWithDefault(msg, 1, ""),
packageId: jspb.Message.getFieldWithDefault(msg, 2, ""),
traceContext: (f = msg.getTraceContext()) && com_daml_ledger_api_v1_trace_context_pb.TraceContext.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.GetPackageRequest}
*/
proto.com.daml.ledger.api.v1.GetPackageRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.com.daml.ledger.api.v1.GetPackageRequest;
return proto.com.daml.ledger.api.v1.GetPackageRequest.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.GetPackageRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.com.daml.ledger.api.v1.GetPackageRequest}
*/
proto.com.daml.ledger.api.v1.GetPackageRequest.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 = /** @type {string} */ (reader.readString());
msg.setPackageId(value);
break;
case 1000:
var value = new com_daml_ledger_api_v1_trace_context_pb.TraceContext;
reader.readMessage(value,com_daml_ledger_api_v1_trace_context_pb.TraceContext.deserializeBinaryFromReader);
msg.setTraceContext(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.GetPackageRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.com.daml.ledger.api.v1.GetPackageRequest.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.GetPackageRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.com.daml.ledger.api.v1.GetPackageRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getLedgerId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getPackageId();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getTraceContext();
if (f != null) {
writer.writeMessage(
1000,
f,
com_daml_ledger_api_v1_trace_context_pb.TraceContext.serializeBinaryToWriter
);
}
};
/**
* optional string ledger_id = 1;
* @return {string}
*/
proto.com.daml.ledger.api.v1.GetPackageRequest.prototype.getLedgerId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.com.daml.ledger.api.v1.GetPackageRequest} returns this
*/
proto.com.daml.ledger.api.v1.GetPackageRequest.prototype.setLedgerId = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string package_id = 2;
* @return {string}
*/
proto.com.daml.ledger.api.v1.GetPackageRequest.prototype.getPackageId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.com.daml.ledger.api.v1.GetPackageRequest} returns this
*/
proto.com.daml.ledger.api.v1.GetPackageRequest.prototype.setPackageId = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional TraceContext trace_context = 1000;
* @return {?proto.com.daml.ledger.api.v1.TraceContext}
*/
proto.com.daml.ledger.api.v1.GetPackageRequest.prototype.getTraceContext = function() {
return /** @type{?proto.com.daml.ledger.api.v1.TraceContext} */ (
jspb.Message.getWrapperField(this, com_daml_ledger_api_v1_trace_context_pb.TraceContext, 1000));
};
/**
* @param {?proto.com.daml.ledger.api.v1.TraceContext|undefined} value
* @return {!proto.com.daml.ledger.api.v1.GetPackageRequest} returns this
*/
proto.com.daml.ledger.api.v1.GetPackageRequest.prototype.setTraceContext = function(value) {
return jspb.Message.setWrapperField(this, 1000, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.com.daml.ledger.api.v1.GetPackageRequest} returns this
*/
proto.com.daml.ledger.api.v1.GetPackageRequest.prototype.clearTraceContext = function() {
return this.setTraceContext(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.com.daml.ledger.api.v1.GetPackageRequest.prototype.hasTraceContext = function() {
return jspb.Message.getField(this, 1000) != 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.GetPackageResponse.prototype.toObject = function(opt_includeInstance) {
return proto.com.daml.ledger.api.v1.GetPackageResponse.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.GetPackageResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.com.daml.ledger.api.v1.GetPackageResponse.toObject = function(includeInstance, msg) {
var f, obj = {
hashFunction: jspb.Message.getFieldWithDefault(msg, 1, 0),
archivePayload: msg.getArchivePayload_asB64(),
hash: jspb.Message.getFieldWithDefault(msg, 3, "")
};
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.GetPackageResponse}
*/
proto.com.daml.ledger.api.v1.GetPackageResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.com.daml.ledger.api.v1.GetPackageResponse;
return proto.com.daml.ledger.api.v1.GetPackageResponse.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.GetPackageResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.com.daml.ledger.api.v1.GetPackageResponse}
*/
proto.com.daml.ledger.api.v1.GetPackageResponse.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {!proto.com.daml.ledger.api.v1.HashFunction} */ (reader.readEnum());
msg.setHashFunction(value);
break;
case 2:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setArchivePayload(value);
break;
case 3:
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.com.daml.ledger.api.v1.GetPackageResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.com.daml.ledger.api.v1.GetPackageResponse.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.GetPackageResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.com.daml.ledger.api.v1.GetPackageResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getHashFunction();
if (f !== 0.0) {
writer.writeEnum(
1,
f
);
}
f = message.getArchivePayload_asU8();
if (f.length > 0) {
writer.writeBytes(
2,
f
);
}
f = message.getHash();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
};
/**
* optional HashFunction hash_function = 1;
* @return {!proto.com.daml.ledger.api.v1.HashFunction}
*/
proto.com.daml.ledger.api.v1.GetPackageResponse.prototype.getHashFunction = function() {
return /** @type {!proto.com.daml.ledger.api.v1.HashFunction} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {!proto.com.daml.ledger.api.v1.HashFunction} value
* @return {!proto.com.daml.ledger.api.v1.GetPackageResponse} returns this
*/
proto.com.daml.ledger.api.v1.GetPackageResponse.prototype.setHashFunction = function(value) {
return jspb.Message.setProto3EnumField(this, 1, value);
};
/**
* optional bytes archive_payload = 2;
* @return {!(string|Uint8Array)}
*/
proto.com.daml.ledger.api.v1.GetPackageResponse.prototype.getArchivePayload = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* optional bytes archive_payload = 2;
* This is a type-conversion wrapper around `getArchivePayload()`
* @return {string}
*/
proto.com.daml.ledger.api.v1.GetPackageResponse.prototype.getArchivePayload_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getArchivePayload()));
};
/**
* optional bytes archive_payload = 2;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getArchivePayload()`
* @return {!Uint8Array}
*/
proto.com.daml.ledger.api.v1.GetPackageResponse.prototype.getArchivePayload_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getArchivePayload()));
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.com.daml.ledger.api.v1.GetPackageResponse} returns this
*/
proto.com.daml.ledger.api.v1.GetPackageResponse.prototype.setArchivePayload = function(value) {
return jspb.Message.setProto3BytesField(this, 2, value);
};
/**
* optional string hash = 3;
* @return {string}
*/
proto.com.daml.ledger.api.v1.GetPackageResponse.prototype.getHash = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.com.daml.ledger.api.v1.GetPackageResponse} returns this
*/
proto.com.daml.ledger.api.v1.GetPackageResponse.prototype.setHash = function(value) {
return jspb.Message.setProto3StringField(this, 3, 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.GetPackageStatusRequest.prototype.toObject = function(opt_includeInstance) {
return proto.com.daml.ledger.api.v1.GetPackageStatusRequest.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.GetPackageStatusRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.com.daml.ledger.api.v1.GetPackageStatusRequest.toObject = function(includeInstance, msg) {
var f, obj = {
ledgerId: jspb.Message.getFieldWithDefault(msg, 1, ""),
packageId: jspb.Message.getFieldWithDefault(msg, 2, ""),
traceContext: (f = msg.getTraceContext()) && com_daml_ledger_api_v1_trace_context_pb.TraceContext.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.GetPackageStatusRequest}
*/
proto.com.daml.ledger.api.v1.GetPackageStatusRequest.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.com.daml.ledger.api.v1.GetPackageStatusRequest;
return proto.com.daml.ledger.api.v1.GetPackageStatusRequest.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.GetPackageStatusRequest} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.com.daml.ledger.api.v1.GetPackageStatusRequest}
*/
proto.com.daml.ledger.api.v1.GetPackageStatusRequest.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 = /** @type {string} */ (reader.readString());
msg.setPackageId(value);
break;
case 1000:
var value = new com_daml_ledger_api_v1_trace_context_pb.TraceContext;
reader.readMessage(value,com_daml_ledger_api_v1_trace_context_pb.TraceContext.deserializeBinaryFromReader);
msg.setTraceContext(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.GetPackageStatusRequest.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.com.daml.ledger.api.v1.GetPackageStatusRequest.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.GetPackageStatusRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.com.daml.ledger.api.v1.GetPackageStatusRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getLedgerId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getPackageId();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getTraceContext();
if (f != null) {
writer.writeMessage(
1000,
f,
com_daml_ledger_api_v1_trace_context_pb.TraceContext.serializeBinaryToWriter
);
}
};
/**
* optional string ledger_id = 1;
* @return {string}
*/
proto.com.daml.ledger.api.v1.GetPackageStatusRequest.prototype.getLedgerId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.com.daml.ledger.api.v1.GetPackageStatusRequest} returns this
*/
proto.com.daml.ledger.api.v1.GetPackageStatusRequest.prototype.setLedgerId = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string package_id = 2;
* @return {string}
*/
proto.com.daml.ledger.api.v1.GetPackageStatusRequest.prototype.getPackageId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.com.daml.ledger.api.v1.GetPackageStatusRequest} returns this
*/
proto.com.daml.ledger.api.v1.GetPackageStatusRequest.prototype.setPackageId = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional TraceContext trace_context = 1000;
* @return {?proto.com.daml.ledger.api.v1.TraceContext}
*/
proto.com.daml.ledger.api.v1.GetPackageStatusRequest.prototype.getTraceContext = function() {
return /** @type{?proto.com.daml.ledger.api.v1.TraceContext} */ (
jspb.Message.getWrapperField(this, com_daml_ledger_api_v1_trace_context_pb.TraceContext, 1000));
};
/**
* @param {?proto.com.daml.ledger.api.v1.TraceContext|undefined} value
* @return {!proto.com.daml.ledger.api.v1.GetPackageStatusRequest} returns this
*/
proto.com.daml.ledger.api.v1.GetPackageStatusRequest.prototype.setTraceContext = function(value) {
return jspb.Message.setWrapperField(this, 1000, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.com.daml.ledger.api.v1.GetPackageStatusRequest} returns this
*/
proto.com.daml.ledger.api.v1.GetPackageStatusRequest.prototype.clearTraceContext = function() {
return this.setTraceContext(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.com.daml.ledger.api.v1.GetPackageStatusRequest.prototype.hasTraceContext = function() {
return jspb.Message.getField(this, 1000) != 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.GetPackageStatusResponse.prototype.toObject = function(opt_includeInstance) {
return proto.com.daml.ledger.api.v1.GetPackageStatusResponse.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.GetPackageStatusResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.com.daml.ledger.api.v1.GetPackageStatusResponse.toObject = function(includeInstance, msg) {
var f, obj = {
packageStatus: jspb.Message.getFieldWithDefault(msg, 1, 0)
};
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.GetPackageStatusResponse}
*/
proto.com.daml.ledger.api.v1.GetPackageStatusResponse.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.com.daml.ledger.api.v1.GetPackageStatusResponse;
return proto.com.daml.ledger.api.v1.GetPackageStatusResponse.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.GetPackageStatusResponse} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.com.daml.ledger.api.v1.GetPackageStatusResponse}
*/
proto.com.daml.ledger.api.v1.GetPackageStatusResponse.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {!proto.com.daml.ledger.api.v1.PackageStatus} */ (reader.readEnum());
msg.setPackageStatus(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.GetPackageStatusResponse.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.com.daml.ledger.api.v1.GetPackageStatusResponse.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.GetPackageStatusResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.com.daml.ledger.api.v1.GetPackageStatusResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getPackageStatus();
if (f !== 0.0) {
writer.writeEnum(
1,
f
);
}
};
/**
* optional PackageStatus package_status = 1;
* @return {!proto.com.daml.ledger.api.v1.PackageStatus}
*/
proto.com.daml.ledger.api.v1.GetPackageStatusResponse.prototype.getPackageStatus = function() {
return /** @type {!proto.com.daml.ledger.api.v1.PackageStatus} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {!proto.com.daml.ledger.api.v1.PackageStatus} value
* @return {!proto.com.daml.ledger.api.v1.GetPackageStatusResponse} returns this
*/
proto.com.daml.ledger.api.v1.GetPackageStatusResponse.prototype.setPackageStatus = function(value) {
return jspb.Message.setProto3EnumField(this, 1, value);
};
/**
* @enum {number}
*/
proto.com.daml.ledger.api.v1.PackageStatus = {
UNKNOWN: 0,
REGISTERED: 1
};
/**
* @enum {number}
*/
proto.com.daml.ledger.api.v1.HashFunction = {
SHA256: 0
};
goog.object.extend(exports, proto.com.daml.ledger.api.v1);