/** * @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 stream_pb = require('./stream_pb.js'); var certificate_pb = require('./certificate_pb.js'); var signature_pb = require('./signature_pb.js'); goog.exportSymbol('proto.pb.Claim', null, global); goog.exportSymbol('proto.pb.Claim.ClaimType', null, global); goog.exportSymbol('proto.pb.Claim.Version', 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.pb.Claim = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.pb.Claim, jspb.Message); if (goog.DEBUG && !COMPILED) { proto.pb.Claim.displayName = 'proto.pb.Claim'; } if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto suitable for use in Soy templates. * Field names that are reserved in JavaScript and will be renamed to pb_name. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. * @param {boolean=} opt_includeInstance Whether to include the JSPB instance * for transitional soy proto support: http://goto/soy-param-migration * @return {!Object} */ proto.pb.Claim.prototype.toObject = function(opt_includeInstance) { return proto.pb.Claim.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Whether to include the JSPB * instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.pb.Claim} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.pb.Claim.toObject = function(includeInstance, msg) { var f, obj = { version: jspb.Message.getField(msg, 1), claimtype: jspb.Message.getField(msg, 2), stream: (f = msg.getStream()) && stream_pb.Stream.toObject(includeInstance, f), certificate: (f = msg.getCertificate()) && certificate_pb.Certificate.toObject(includeInstance, f), publishersignature: (f = msg.getPublishersignature()) && signature_pb.Signature.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.pb.Claim} */ proto.pb.Claim.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.pb.Claim; return proto.pb.Claim.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.pb.Claim} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.pb.Claim} */ proto.pb.Claim.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!proto.pb.Claim.Version} */ (reader.readEnum()); msg.setVersion(value); break; case 2: var value = /** @type {!proto.pb.Claim.ClaimType} */ (reader.readEnum()); msg.setClaimtype(value); break; case 3: var value = new stream_pb.Stream; reader.readMessage(value,stream_pb.Stream.deserializeBinaryFromReader); msg.setStream(value); break; case 4: var value = new certificate_pb.Certificate; reader.readMessage(value,certificate_pb.Certificate.deserializeBinaryFromReader); msg.setCertificate(value); break; case 5: var value = new signature_pb.Signature; reader.readMessage(value,signature_pb.Signature.deserializeBinaryFromReader); msg.setPublishersignature(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.pb.Claim.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.pb.Claim.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.pb.Claim} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.pb.Claim.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = /** @type {!proto.pb.Claim.Version} */ (jspb.Message.getField(message, 1)); if (f != null) { writer.writeEnum( 1, f ); } f = /** @type {!proto.pb.Claim.ClaimType} */ (jspb.Message.getField(message, 2)); if (f != null) { writer.writeEnum( 2, f ); } f = message.getStream(); if (f != null) { writer.writeMessage( 3, f, stream_pb.Stream.serializeBinaryToWriter ); } f = message.getCertificate(); if (f != null) { writer.writeMessage( 4, f, certificate_pb.Certificate.serializeBinaryToWriter ); } f = message.getPublishersignature(); if (f != null) { writer.writeMessage( 5, f, signature_pb.Signature.serializeBinaryToWriter ); } }; /** * @enum {number} */ proto.pb.Claim.Version = { UNKNOWN_VERSION: 0, _0_0_1: 1 }; /** * @enum {number} */ proto.pb.Claim.ClaimType = { UNKNOWN_CLAIM_TYPE: 0, STREAMTYPE: 1, CERTIFICATETYPE: 2 }; /** * required Version version = 1; * @return {!proto.pb.Claim.Version} */ proto.pb.Claim.prototype.getVersion = function() { return /** @type {!proto.pb.Claim.Version} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** @param {!proto.pb.Claim.Version} value */ proto.pb.Claim.prototype.setVersion = function(value) { jspb.Message.setField(this, 1, value); }; proto.pb.Claim.prototype.clearVersion = function() { jspb.Message.setField(this, 1, undefined); }; /** * Returns whether this field is set. * @return {!boolean} */ proto.pb.Claim.prototype.hasVersion = function() { return jspb.Message.getField(this, 1) != null; }; /** * required ClaimType claimType = 2; * @return {!proto.pb.Claim.ClaimType} */ proto.pb.Claim.prototype.getClaimtype = function() { return /** @type {!proto.pb.Claim.ClaimType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** @param {!proto.pb.Claim.ClaimType} value */ proto.pb.Claim.prototype.setClaimtype = function(value) { jspb.Message.setField(this, 2, value); }; proto.pb.Claim.prototype.clearClaimtype = function() { jspb.Message.setField(this, 2, undefined); }; /** * Returns whether this field is set. * @return {!boolean} */ proto.pb.Claim.prototype.hasClaimtype = function() { return jspb.Message.getField(this, 2) != null; }; /** * optional Stream stream = 3; * @return {?proto.pb.Stream} */ proto.pb.Claim.prototype.getStream = function() { return /** @type{?proto.pb.Stream} */ ( jspb.Message.getWrapperField(this, stream_pb.Stream, 3)); }; /** @param {?proto.pb.Stream|undefined} value */ proto.pb.Claim.prototype.setStream = function(value) { jspb.Message.setWrapperField(this, 3, value); }; proto.pb.Claim.prototype.clearStream = function() { this.setStream(undefined); }; /** * Returns whether this field is set. * @return {!boolean} */ proto.pb.Claim.prototype.hasStream = function() { return jspb.Message.getField(this, 3) != null; }; /** * optional Certificate certificate = 4; * @return {?proto.pb.Certificate} */ proto.pb.Claim.prototype.getCertificate = function() { return /** @type{?proto.pb.Certificate} */ ( jspb.Message.getWrapperField(this, certificate_pb.Certificate, 4)); }; /** @param {?proto.pb.Certificate|undefined} value */ proto.pb.Claim.prototype.setCertificate = function(value) { jspb.Message.setWrapperField(this, 4, value); }; proto.pb.Claim.prototype.clearCertificate = function() { this.setCertificate(undefined); }; /** * Returns whether this field is set. * @return {!boolean} */ proto.pb.Claim.prototype.hasCertificate = function() { return jspb.Message.getField(this, 4) != null; }; /** * optional Signature publisherSignature = 5; * @return {?proto.pb.Signature} */ proto.pb.Claim.prototype.getPublishersignature = function() { return /** @type{?proto.pb.Signature} */ ( jspb.Message.getWrapperField(this, signature_pb.Signature, 5)); }; /** @param {?proto.pb.Signature|undefined} value */ proto.pb.Claim.prototype.setPublishersignature = function(value) { jspb.Message.setWrapperField(this, 5, value); }; proto.pb.Claim.prototype.clearPublishersignature = function() { this.setPublishersignature(undefined); }; /** * Returns whether this field is set. * @return {!boolean} */ proto.pb.Claim.prototype.hasPublishersignature = function() { return jspb.Message.getField(this, 5) != null; }; goog.object.extend(exports, proto.pb);