phenopackets/schema/v2/core/pedigree_pb.js

// source: phenopackets/schema/v2/core/pedigree.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 phenopackets_schema_v2_core_individual_pb = require('../../../../phenopackets/schema/v2/core/individual_pb.js');
goog.object.extend(proto, phenopackets_schema_v2_core_individual_pb);
goog.exportSymbol('proto.org.phenopackets.schema.v2.core.Pedigree', null, global);
goog.exportSymbol('proto.org.phenopackets.schema.v2.core.Pedigree.Person', null, global);
goog.exportSymbol('proto.org.phenopackets.schema.v2.core.Pedigree.Person.AffectedStatus', 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.Pedigree = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, proto.org.phenopackets.schema.v2.core.Pedigree.repeatedFields_, null);
};
goog.inherits(proto.org.phenopackets.schema.v2.core.Pedigree, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.org.phenopackets.schema.v2.core.Pedigree.displayName = 'proto.org.phenopackets.schema.v2.core.Pedigree';
}
/**
 * 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.Pedigree.Person = function(opt_data) {
  jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.org.phenopackets.schema.v2.core.Pedigree.Person, jspb.Message);
if (goog.DEBUG && !COMPILED) {
  /**
   * @public
   * @override
   */
  proto.org.phenopackets.schema.v2.core.Pedigree.Person.displayName = 'proto.org.phenopackets.schema.v2.core.Pedigree.Person';
}

/**
 * List of repeated fields within this message type.
 * @private {!Array<number>}
 * @const
 */
proto.org.phenopackets.schema.v2.core.Pedigree.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.org.phenopackets.schema.v2.core.Pedigree.prototype.toObject = function(opt_includeInstance) {
  return proto.org.phenopackets.schema.v2.core.Pedigree.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.Pedigree} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.org.phenopackets.schema.v2.core.Pedigree.toObject = function(includeInstance, msg) {
  var f, obj = {
personsList: jspb.Message.toObjectList(msg.getPersonsList(),
    proto.org.phenopackets.schema.v2.core.Pedigree.Person.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.Pedigree}
 */
proto.org.phenopackets.schema.v2.core.Pedigree.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.org.phenopackets.schema.v2.core.Pedigree;
  return proto.org.phenopackets.schema.v2.core.Pedigree.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.Pedigree} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.org.phenopackets.schema.v2.core.Pedigree}
 */
proto.org.phenopackets.schema.v2.core.Pedigree.deserializeBinaryFromReader = function(msg, reader) {
  while (reader.nextField()) {
    if (reader.isEndGroup()) {
      break;
    }
    var field = reader.getFieldNumber();
    switch (field) {
    case 1:
      var value = new proto.org.phenopackets.schema.v2.core.Pedigree.Person;
      reader.readMessage(value,proto.org.phenopackets.schema.v2.core.Pedigree.Person.deserializeBinaryFromReader);
      msg.addPersons(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.Pedigree.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.org.phenopackets.schema.v2.core.Pedigree.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.Pedigree} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.org.phenopackets.schema.v2.core.Pedigree.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getPersonsList();
  if (f.length > 0) {
    writer.writeRepeatedMessage(
      1,
      f,
      proto.org.phenopackets.schema.v2.core.Pedigree.Person.serializeBinaryToWriter
    );
  }
};





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.Pedigree.Person.prototype.toObject = function(opt_includeInstance) {
  return proto.org.phenopackets.schema.v2.core.Pedigree.Person.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.Pedigree.Person} msg The msg instance to transform.
 * @return {!Object}
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.org.phenopackets.schema.v2.core.Pedigree.Person.toObject = function(includeInstance, msg) {
  var f, obj = {
familyId: jspb.Message.getFieldWithDefault(msg, 1, ""),
individualId: jspb.Message.getFieldWithDefault(msg, 2, ""),
paternalId: jspb.Message.getFieldWithDefault(msg, 3, ""),
maternalId: jspb.Message.getFieldWithDefault(msg, 4, ""),
sex: jspb.Message.getFieldWithDefault(msg, 5, 0),
affectedStatus: jspb.Message.getFieldWithDefault(msg, 6, 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.org.phenopackets.schema.v2.core.Pedigree.Person}
 */
proto.org.phenopackets.schema.v2.core.Pedigree.Person.deserializeBinary = function(bytes) {
  var reader = new jspb.BinaryReader(bytes);
  var msg = new proto.org.phenopackets.schema.v2.core.Pedigree.Person;
  return proto.org.phenopackets.schema.v2.core.Pedigree.Person.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.Pedigree.Person} msg The message object to deserialize into.
 * @param {!jspb.BinaryReader} reader The BinaryReader to use.
 * @return {!proto.org.phenopackets.schema.v2.core.Pedigree.Person}
 */
proto.org.phenopackets.schema.v2.core.Pedigree.Person.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.setFamilyId(value);
      break;
    case 2:
      var value = /** @type {string} */ (reader.readString());
      msg.setIndividualId(value);
      break;
    case 3:
      var value = /** @type {string} */ (reader.readString());
      msg.setPaternalId(value);
      break;
    case 4:
      var value = /** @type {string} */ (reader.readString());
      msg.setMaternalId(value);
      break;
    case 5:
      var value = /** @type {!proto.org.phenopackets.schema.v2.core.Sex} */ (reader.readEnum());
      msg.setSex(value);
      break;
    case 6:
      var value = /** @type {!proto.org.phenopackets.schema.v2.core.Pedigree.Person.AffectedStatus} */ (reader.readEnum());
      msg.setAffectedStatus(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.Pedigree.Person.prototype.serializeBinary = function() {
  var writer = new jspb.BinaryWriter();
  proto.org.phenopackets.schema.v2.core.Pedigree.Person.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.Pedigree.Person} message
 * @param {!jspb.BinaryWriter} writer
 * @suppress {unusedLocalVariables} f is only used for nested messages
 */
proto.org.phenopackets.schema.v2.core.Pedigree.Person.serializeBinaryToWriter = function(message, writer) {
  var f = undefined;
  f = message.getFamilyId();
  if (f.length > 0) {
    writer.writeString(
      1,
      f
    );
  }
  f = message.getIndividualId();
  if (f.length > 0) {
    writer.writeString(
      2,
      f
    );
  }
  f = message.getPaternalId();
  if (f.length > 0) {
    writer.writeString(
      3,
      f
    );
  }
  f = message.getMaternalId();
  if (f.length > 0) {
    writer.writeString(
      4,
      f
    );
  }
  f = message.getSex();
  if (f !== 0.0) {
    writer.writeEnum(
      5,
      f
    );
  }
  f = message.getAffectedStatus();
  if (f !== 0.0) {
    writer.writeEnum(
      6,
      f
    );
  }
};


/**
 * @enum {number}
 */
proto.org.phenopackets.schema.v2.core.Pedigree.Person.AffectedStatus = {
  MISSING: 0,
  UNAFFECTED: 1,
  AFFECTED: 2
};

/**
 * optional string family_id = 1;
 * @return {string}
 */
proto.org.phenopackets.schema.v2.core.Pedigree.Person.prototype.getFamilyId = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};


/**
 * @param {string} value
 * @return {!proto.org.phenopackets.schema.v2.core.Pedigree.Person} returns this
 */
proto.org.phenopackets.schema.v2.core.Pedigree.Person.prototype.setFamilyId = function(value) {
  return jspb.Message.setProto3StringField(this, 1, value);
};


/**
 * optional string individual_id = 2;
 * @return {string}
 */
proto.org.phenopackets.schema.v2.core.Pedigree.Person.prototype.getIndividualId = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};


/**
 * @param {string} value
 * @return {!proto.org.phenopackets.schema.v2.core.Pedigree.Person} returns this
 */
proto.org.phenopackets.schema.v2.core.Pedigree.Person.prototype.setIndividualId = function(value) {
  return jspb.Message.setProto3StringField(this, 2, value);
};


/**
 * optional string paternal_id = 3;
 * @return {string}
 */
proto.org.phenopackets.schema.v2.core.Pedigree.Person.prototype.getPaternalId = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, ""));
};


/**
 * @param {string} value
 * @return {!proto.org.phenopackets.schema.v2.core.Pedigree.Person} returns this
 */
proto.org.phenopackets.schema.v2.core.Pedigree.Person.prototype.setPaternalId = function(value) {
  return jspb.Message.setProto3StringField(this, 3, value);
};


/**
 * optional string maternal_id = 4;
 * @return {string}
 */
proto.org.phenopackets.schema.v2.core.Pedigree.Person.prototype.getMaternalId = function() {
  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, ""));
};


/**
 * @param {string} value
 * @return {!proto.org.phenopackets.schema.v2.core.Pedigree.Person} returns this
 */
proto.org.phenopackets.schema.v2.core.Pedigree.Person.prototype.setMaternalId = function(value) {
  return jspb.Message.setProto3StringField(this, 4, value);
};


/**
 * optional Sex sex = 5;
 * @return {!proto.org.phenopackets.schema.v2.core.Sex}
 */
proto.org.phenopackets.schema.v2.core.Pedigree.Person.prototype.getSex = function() {
  return /** @type {!proto.org.phenopackets.schema.v2.core.Sex} */ (jspb.Message.getFieldWithDefault(this, 5, 0));
};


/**
 * @param {!proto.org.phenopackets.schema.v2.core.Sex} value
 * @return {!proto.org.phenopackets.schema.v2.core.Pedigree.Person} returns this
 */
proto.org.phenopackets.schema.v2.core.Pedigree.Person.prototype.setSex = function(value) {
  return jspb.Message.setProto3EnumField(this, 5, value);
};


/**
 * optional AffectedStatus affected_status = 6;
 * @return {!proto.org.phenopackets.schema.v2.core.Pedigree.Person.AffectedStatus}
 */
proto.org.phenopackets.schema.v2.core.Pedigree.Person.prototype.getAffectedStatus = function() {
  return /** @type {!proto.org.phenopackets.schema.v2.core.Pedigree.Person.AffectedStatus} */ (jspb.Message.getFieldWithDefault(this, 6, 0));
};


/**
 * @param {!proto.org.phenopackets.schema.v2.core.Pedigree.Person.AffectedStatus} value
 * @return {!proto.org.phenopackets.schema.v2.core.Pedigree.Person} returns this
 */
proto.org.phenopackets.schema.v2.core.Pedigree.Person.prototype.setAffectedStatus = function(value) {
  return jspb.Message.setProto3EnumField(this, 6, value);
};


/**
 * repeated Person persons = 1;
 * @return {!Array<!proto.org.phenopackets.schema.v2.core.Pedigree.Person>}
 */
proto.org.phenopackets.schema.v2.core.Pedigree.prototype.getPersonsList = function() {
  return /** @type{!Array<!proto.org.phenopackets.schema.v2.core.Pedigree.Person>} */ (
    jspb.Message.getRepeatedWrapperField(this, proto.org.phenopackets.schema.v2.core.Pedigree.Person, 1));
};


/**
 * @param {!Array<!proto.org.phenopackets.schema.v2.core.Pedigree.Person>} value
 * @return {!proto.org.phenopackets.schema.v2.core.Pedigree} returns this
*/
proto.org.phenopackets.schema.v2.core.Pedigree.prototype.setPersonsList = function(value) {
  return jspb.Message.setRepeatedWrapperField(this, 1, value);
};


/**
 * @param {!proto.org.phenopackets.schema.v2.core.Pedigree.Person=} opt_value
 * @param {number=} opt_index
 * @return {!proto.org.phenopackets.schema.v2.core.Pedigree.Person}
 */
proto.org.phenopackets.schema.v2.core.Pedigree.prototype.addPersons = function(opt_value, opt_index) {
  return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.phenopackets.schema.v2.core.Pedigree.Person, opt_index);
};


/**
 * Clears the list making it empty but non-null.
 * @return {!proto.org.phenopackets.schema.v2.core.Pedigree} returns this
 */
proto.org.phenopackets.schema.v2.core.Pedigree.prototype.clearPersonsList = function() {
  return this.setPersonsList([]);
};


goog.object.extend(exports, proto.org.phenopackets.schema.v2.core);