// source: phenopackets/schema/v2/core/meta_data.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @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!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global =
(typeof globalThis !== 'undefined' && globalThis) ||
(typeof window !== 'undefined' && window) ||
(typeof global !== 'undefined' && global) ||
(typeof self !== 'undefined' && self) ||
(function () { return this; }).call(null) ||
Function('return this')();
var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js');
goog.object.extend(proto, google_protobuf_timestamp_pb);
var phenopackets_schema_v2_core_base_pb = require('../../../../phenopackets/schema/v2/core/base_pb.js');
goog.object.extend(proto, phenopackets_schema_v2_core_base_pb);
goog.exportSymbol('proto.org.phenopackets.schema.v2.core.MetaData', null, global);
goog.exportSymbol('proto.org.phenopackets.schema.v2.core.Resource', null, global);
goog.exportSymbol('proto.org.phenopackets.schema.v2.core.Update', 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.org.phenopackets.schema.v2.core.MetaData = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.org.phenopackets.schema.v2.core.MetaData.repeatedFields_, null);
};
goog.inherits(proto.org.phenopackets.schema.v2.core.MetaData, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.org.phenopackets.schema.v2.core.MetaData.displayName = 'proto.org.phenopackets.schema.v2.core.MetaData';
}
/**
* 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.org.phenopackets.schema.v2.core.Resource = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.org.phenopackets.schema.v2.core.Resource, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.org.phenopackets.schema.v2.core.Resource.displayName = 'proto.org.phenopackets.schema.v2.core.Resource';
}
/**
* 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.org.phenopackets.schema.v2.core.Update = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.org.phenopackets.schema.v2.core.Update, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.org.phenopackets.schema.v2.core.Update.displayName = 'proto.org.phenopackets.schema.v2.core.Update';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.org.phenopackets.schema.v2.core.MetaData.repeatedFields_ = [4,5,7];
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.org.phenopackets.schema.v2.core.MetaData.prototype.toObject = function(opt_includeInstance) {
return proto.org.phenopackets.schema.v2.core.MetaData.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.org.phenopackets.schema.v2.core.MetaData} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.org.phenopackets.schema.v2.core.MetaData.toObject = function(includeInstance, msg) {
var f, obj = {
created: (f = msg.getCreated()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
createdBy: jspb.Message.getFieldWithDefault(msg, 2, ""),
submittedBy: jspb.Message.getFieldWithDefault(msg, 3, ""),
resourcesList: jspb.Message.toObjectList(msg.getResourcesList(),
proto.org.phenopackets.schema.v2.core.Resource.toObject, includeInstance),
updatesList: jspb.Message.toObjectList(msg.getUpdatesList(),
proto.org.phenopackets.schema.v2.core.Update.toObject, includeInstance),
phenopacketSchemaVersion: jspb.Message.getFieldWithDefault(msg, 6, ""),
externalReferencesList: jspb.Message.toObjectList(msg.getExternalReferencesList(),
phenopackets_schema_v2_core_base_pb.ExternalReference.toObject, includeInstance)
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.org.phenopackets.schema.v2.core.MetaData}
*/
proto.org.phenopackets.schema.v2.core.MetaData.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.org.phenopackets.schema.v2.core.MetaData;
return proto.org.phenopackets.schema.v2.core.MetaData.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.org.phenopackets.schema.v2.core.MetaData} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.org.phenopackets.schema.v2.core.MetaData}
*/
proto.org.phenopackets.schema.v2.core.MetaData.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.setCreated(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setCreatedBy(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setSubmittedBy(value);
break;
case 4:
var value = new proto.org.phenopackets.schema.v2.core.Resource;
reader.readMessage(value,proto.org.phenopackets.schema.v2.core.Resource.deserializeBinaryFromReader);
msg.addResources(value);
break;
case 5:
var value = new proto.org.phenopackets.schema.v2.core.Update;
reader.readMessage(value,proto.org.phenopackets.schema.v2.core.Update.deserializeBinaryFromReader);
msg.addUpdates(value);
break;
case 6:
var value = /** @type {string} */ (reader.readString());
msg.setPhenopacketSchemaVersion(value);
break;
case 7:
var value = new phenopackets_schema_v2_core_base_pb.ExternalReference;
reader.readMessage(value,phenopackets_schema_v2_core_base_pb.ExternalReference.deserializeBinaryFromReader);
msg.addExternalReferences(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.org.phenopackets.schema.v2.core.MetaData.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.org.phenopackets.schema.v2.core.MetaData} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.org.phenopackets.schema.v2.core.MetaData.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getCreated();
if (f != null) {
writer.writeMessage(
1,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
f = message.getCreatedBy();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getSubmittedBy();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getResourcesList();
if (f.length > 0) {
writer.writeRepeatedMessage(
4,
f,
proto.org.phenopackets.schema.v2.core.Resource.serializeBinaryToWriter
);
}
f = message.getUpdatesList();
if (f.length > 0) {
writer.writeRepeatedMessage(
5,
f,
proto.org.phenopackets.schema.v2.core.Update.serializeBinaryToWriter
);
}
f = message.getPhenopacketSchemaVersion();
if (f.length > 0) {
writer.writeString(
6,
f
);
}
f = message.getExternalReferencesList();
if (f.length > 0) {
writer.writeRepeatedMessage(
7,
f,
phenopackets_schema_v2_core_base_pb.ExternalReference.serializeBinaryToWriter
);
}
};
/**
* optional google.protobuf.Timestamp created = 1;
* @return {?proto.google.protobuf.Timestamp}
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.getCreated = 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.org.phenopackets.schema.v2.core.MetaData} returns this
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.setCreated = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.org.phenopackets.schema.v2.core.MetaData} returns this
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.clearCreated = function() {
return this.setCreated(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.hasCreated = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional string created_by = 2;
* @return {string}
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.getCreatedBy = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.org.phenopackets.schema.v2.core.MetaData} returns this
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.setCreatedBy = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string submitted_by = 3;
* @return {string}
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.getSubmittedBy = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.org.phenopackets.schema.v2.core.MetaData} returns this
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.setSubmittedBy = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
/**
* repeated Resource resources = 4;
* @return {!Array<!proto.org.phenopackets.schema.v2.core.Resource>}
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.getResourcesList = function() {
return /** @type{!Array<!proto.org.phenopackets.schema.v2.core.Resource>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.org.phenopackets.schema.v2.core.Resource, 4));
};
/**
* @param {!Array<!proto.org.phenopackets.schema.v2.core.Resource>} value
* @return {!proto.org.phenopackets.schema.v2.core.MetaData} returns this
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.setResourcesList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 4, value);
};
/**
* @param {!proto.org.phenopackets.schema.v2.core.Resource=} opt_value
* @param {number=} opt_index
* @return {!proto.org.phenopackets.schema.v2.core.Resource}
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.addResources = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.org.phenopackets.schema.v2.core.Resource, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.org.phenopackets.schema.v2.core.MetaData} returns this
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.clearResourcesList = function() {
return this.setResourcesList([]);
};
/**
* repeated Update updates = 5;
* @return {!Array<!proto.org.phenopackets.schema.v2.core.Update>}
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.getUpdatesList = function() {
return /** @type{!Array<!proto.org.phenopackets.schema.v2.core.Update>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.org.phenopackets.schema.v2.core.Update, 5));
};
/**
* @param {!Array<!proto.org.phenopackets.schema.v2.core.Update>} value
* @return {!proto.org.phenopackets.schema.v2.core.MetaData} returns this
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.setUpdatesList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 5, value);
};
/**
* @param {!proto.org.phenopackets.schema.v2.core.Update=} opt_value
* @param {number=} opt_index
* @return {!proto.org.phenopackets.schema.v2.core.Update}
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.addUpdates = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 5, opt_value, proto.org.phenopackets.schema.v2.core.Update, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.org.phenopackets.schema.v2.core.MetaData} returns this
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.clearUpdatesList = function() {
return this.setUpdatesList([]);
};
/**
* optional string phenopacket_schema_version = 6;
* @return {string}
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.getPhenopacketSchemaVersion = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
};
/**
* @param {string} value
* @return {!proto.org.phenopackets.schema.v2.core.MetaData} returns this
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.setPhenopacketSchemaVersion = function(value) {
return jspb.Message.setProto3StringField(this, 6, value);
};
/**
* repeated ExternalReference external_references = 7;
* @return {!Array<!proto.org.phenopackets.schema.v2.core.ExternalReference>}
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.getExternalReferencesList = function() {
return /** @type{!Array<!proto.org.phenopackets.schema.v2.core.ExternalReference>} */ (
jspb.Message.getRepeatedWrapperField(this, phenopackets_schema_v2_core_base_pb.ExternalReference, 7));
};
/**
* @param {!Array<!proto.org.phenopackets.schema.v2.core.ExternalReference>} value
* @return {!proto.org.phenopackets.schema.v2.core.MetaData} returns this
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.setExternalReferencesList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 7, value);
};
/**
* @param {!proto.org.phenopackets.schema.v2.core.ExternalReference=} opt_value
* @param {number=} opt_index
* @return {!proto.org.phenopackets.schema.v2.core.ExternalReference}
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.addExternalReferences = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 7, opt_value, proto.org.phenopackets.schema.v2.core.ExternalReference, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.org.phenopackets.schema.v2.core.MetaData} returns this
*/
proto.org.phenopackets.schema.v2.core.MetaData.prototype.clearExternalReferencesList = function() {
return this.setExternalReferencesList([]);
};
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.org.phenopackets.schema.v2.core.Resource.prototype.toObject = function(opt_includeInstance) {
return proto.org.phenopackets.schema.v2.core.Resource.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.org.phenopackets.schema.v2.core.Resource} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.org.phenopackets.schema.v2.core.Resource.toObject = function(includeInstance, msg) {
var f, obj = {
id: jspb.Message.getFieldWithDefault(msg, 1, ""),
name: jspb.Message.getFieldWithDefault(msg, 2, ""),
url: jspb.Message.getFieldWithDefault(msg, 3, ""),
version: jspb.Message.getFieldWithDefault(msg, 4, ""),
namespacePrefix: jspb.Message.getFieldWithDefault(msg, 5, ""),
iriPrefix: jspb.Message.getFieldWithDefault(msg, 6, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.org.phenopackets.schema.v2.core.Resource}
*/
proto.org.phenopackets.schema.v2.core.Resource.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.org.phenopackets.schema.v2.core.Resource;
return proto.org.phenopackets.schema.v2.core.Resource.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.org.phenopackets.schema.v2.core.Resource} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.org.phenopackets.schema.v2.core.Resource}
*/
proto.org.phenopackets.schema.v2.core.Resource.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.setId(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setName(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setUrl(value);
break;
case 4:
var value = /** @type {string} */ (reader.readString());
msg.setVersion(value);
break;
case 5:
var value = /** @type {string} */ (reader.readString());
msg.setNamespacePrefix(value);
break;
case 6:
var value = /** @type {string} */ (reader.readString());
msg.setIriPrefix(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.org.phenopackets.schema.v2.core.Resource.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.org.phenopackets.schema.v2.core.Resource.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.org.phenopackets.schema.v2.core.Resource} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.org.phenopackets.schema.v2.core.Resource.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getId();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getName();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getUrl();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
f = message.getVersion();
if (f.length > 0) {
writer.writeString(
4,
f
);
}
f = message.getNamespacePrefix();
if (f.length > 0) {
writer.writeString(
5,
f
);
}
f = message.getIriPrefix();
if (f.length > 0) {
writer.writeString(
6,
f
);
}
};
/**
* optional string id = 1;
* @return {string}
*/
proto.org.phenopackets.schema.v2.core.Resource.prototype.getId = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.org.phenopackets.schema.v2.core.Resource} returns this
*/
proto.org.phenopackets.schema.v2.core.Resource.prototype.setId = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string name = 2;
* @return {string}
*/
proto.org.phenopackets.schema.v2.core.Resource.prototype.getName = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.org.phenopackets.schema.v2.core.Resource} returns this
*/
proto.org.phenopackets.schema.v2.core.Resource.prototype.setName = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string url = 3;
* @return {string}
*/
proto.org.phenopackets.schema.v2.core.Resource.prototype.getUrl = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.org.phenopackets.schema.v2.core.Resource} returns this
*/
proto.org.phenopackets.schema.v2.core.Resource.prototype.setUrl = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
/**
* optional string version = 4;
* @return {string}
*/
proto.org.phenopackets.schema.v2.core.Resource.prototype.getVersion = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};
/**
* @param {string} value
* @return {!proto.org.phenopackets.schema.v2.core.Resource} returns this
*/
proto.org.phenopackets.schema.v2.core.Resource.prototype.setVersion = function(value) {
return jspb.Message.setProto3StringField(this, 4, value);
};
/**
* optional string namespace_prefix = 5;
* @return {string}
*/
proto.org.phenopackets.schema.v2.core.Resource.prototype.getNamespacePrefix = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 5, ""));
};
/**
* @param {string} value
* @return {!proto.org.phenopackets.schema.v2.core.Resource} returns this
*/
proto.org.phenopackets.schema.v2.core.Resource.prototype.setNamespacePrefix = function(value) {
return jspb.Message.setProto3StringField(this, 5, value);
};
/**
* optional string iri_prefix = 6;
* @return {string}
*/
proto.org.phenopackets.schema.v2.core.Resource.prototype.getIriPrefix = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, ""));
};
/**
* @param {string} value
* @return {!proto.org.phenopackets.schema.v2.core.Resource} returns this
*/
proto.org.phenopackets.schema.v2.core.Resource.prototype.setIriPrefix = function(value) {
return jspb.Message.setProto3StringField(this, 6, 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.org.phenopackets.schema.v2.core.Update.prototype.toObject = function(opt_includeInstance) {
return proto.org.phenopackets.schema.v2.core.Update.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.org.phenopackets.schema.v2.core.Update} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.org.phenopackets.schema.v2.core.Update.toObject = function(includeInstance, msg) {
var f, obj = {
timestamp: (f = msg.getTimestamp()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f),
updatedBy: jspb.Message.getFieldWithDefault(msg, 2, ""),
comment: 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.org.phenopackets.schema.v2.core.Update}
*/
proto.org.phenopackets.schema.v2.core.Update.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.org.phenopackets.schema.v2.core.Update;
return proto.org.phenopackets.schema.v2.core.Update.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.org.phenopackets.schema.v2.core.Update} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.org.phenopackets.schema.v2.core.Update}
*/
proto.org.phenopackets.schema.v2.core.Update.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.setTimestamp(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setUpdatedBy(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.setComment(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.org.phenopackets.schema.v2.core.Update.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.org.phenopackets.schema.v2.core.Update.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.org.phenopackets.schema.v2.core.Update} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.org.phenopackets.schema.v2.core.Update.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getTimestamp();
if (f != null) {
writer.writeMessage(
1,
f,
google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter
);
}
f = message.getUpdatedBy();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
f = message.getComment();
if (f.length > 0) {
writer.writeString(
3,
f
);
}
};
/**
* optional google.protobuf.Timestamp timestamp = 1;
* @return {?proto.google.protobuf.Timestamp}
*/
proto.org.phenopackets.schema.v2.core.Update.prototype.getTimestamp = 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.org.phenopackets.schema.v2.core.Update} returns this
*/
proto.org.phenopackets.schema.v2.core.Update.prototype.setTimestamp = function(value) {
return jspb.Message.setWrapperField(this, 1, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.org.phenopackets.schema.v2.core.Update} returns this
*/
proto.org.phenopackets.schema.v2.core.Update.prototype.clearTimestamp = function() {
return this.setTimestamp(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.org.phenopackets.schema.v2.core.Update.prototype.hasTimestamp = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional string updated_by = 2;
* @return {string}
*/
proto.org.phenopackets.schema.v2.core.Update.prototype.getUpdatedBy = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.org.phenopackets.schema.v2.core.Update} returns this
*/
proto.org.phenopackets.schema.v2.core.Update.prototype.setUpdatedBy = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* optional string comment = 3;
* @return {string}
*/
proto.org.phenopackets.schema.v2.core.Update.prototype.getComment = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};
/**
* @param {string} value
* @return {!proto.org.phenopackets.schema.v2.core.Update} returns this
*/
proto.org.phenopackets.schema.v2.core.Update.prototype.setComment = function(value) {
return jspb.Message.setProto3StringField(this, 3, value);
};
goog.object.extend(exports, proto.org.phenopackets.schema.v2.core);