types/js/stream_pb.js
2017-12-14 14:39:53 -05:00

270 lines
7.1 KiB
JavaScript

/**
* @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 metadata_pb = require('./metadata_pb.js');
var source_pb = require('./source_pb.js');
goog.exportSymbol('proto.pb.Stream', null, global);
goog.exportSymbol('proto.pb.Stream.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.Stream = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pb.Stream, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.pb.Stream.displayName = 'proto.pb.Stream';
}
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_<name>, 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.Stream.prototype.toObject = function(opt_includeInstance) {
return proto.pb.Stream.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.Stream} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pb.Stream.toObject = function(includeInstance, msg) {
var f, obj = {
version: jspb.Message.getField(msg, 1),
metadata: (f = msg.getMetadata()) && metadata_pb.Metadata.toObject(includeInstance, f),
source: (f = msg.getSource()) && source_pb.Source.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.Stream}
*/
proto.pb.Stream.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pb.Stream;
return proto.pb.Stream.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pb.Stream} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pb.Stream}
*/
proto.pb.Stream.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {!proto.pb.Stream.Version} */ (reader.readEnum());
msg.setVersion(value);
break;
case 2:
var value = new metadata_pb.Metadata;
reader.readMessage(value,metadata_pb.Metadata.deserializeBinaryFromReader);
msg.setMetadata(value);
break;
case 3:
var value = new source_pb.Source;
reader.readMessage(value,source_pb.Source.deserializeBinaryFromReader);
msg.setSource(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pb.Stream.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pb.Stream.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.Stream} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pb.Stream.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = /** @type {!proto.pb.Stream.Version} */ (jspb.Message.getField(message, 1));
if (f != null) {
writer.writeEnum(
1,
f
);
}
f = message.getMetadata();
if (f != null) {
writer.writeMessage(
2,
f,
metadata_pb.Metadata.serializeBinaryToWriter
);
}
f = message.getSource();
if (f != null) {
writer.writeMessage(
3,
f,
source_pb.Source.serializeBinaryToWriter
);
}
};
/**
* @enum {number}
*/
proto.pb.Stream.Version = {
UNKNOWN_VERSION: 0,
_0_0_1: 1
};
/**
* required Version version = 1;
* @return {!proto.pb.Stream.Version}
*/
proto.pb.Stream.prototype.getVersion = function() {
return /** @type {!proto.pb.Stream.Version} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/** @param {!proto.pb.Stream.Version} value */
proto.pb.Stream.prototype.setVersion = function(value) {
jspb.Message.setField(this, 1, value);
};
proto.pb.Stream.prototype.clearVersion = function() {
jspb.Message.setField(this, 1, undefined);
};
/**
* Returns whether this field is set.
* @return {!boolean}
*/
proto.pb.Stream.prototype.hasVersion = function() {
return jspb.Message.getField(this, 1) != null;
};
/**
* required Metadata metadata = 2;
* @return {!proto.pb.Metadata}
*/
proto.pb.Stream.prototype.getMetadata = function() {
return /** @type{!proto.pb.Metadata} */ (
jspb.Message.getWrapperField(this, metadata_pb.Metadata, 2, 1));
};
/** @param {!proto.pb.Metadata} value */
proto.pb.Stream.prototype.setMetadata = function(value) {
jspb.Message.setWrapperField(this, 2, value);
};
proto.pb.Stream.prototype.clearMetadata = function() {
jspb.Message.setField(this, 2, undefined);
};
/**
* Returns whether this field is set.
* @return {!boolean}
*/
proto.pb.Stream.prototype.hasMetadata = function() {
return jspb.Message.getField(this, 2) != null;
};
/**
* required Source source = 3;
* @return {!proto.pb.Source}
*/
proto.pb.Stream.prototype.getSource = function() {
return /** @type{!proto.pb.Source} */ (
jspb.Message.getWrapperField(this, source_pb.Source, 3, 1));
};
/** @param {!proto.pb.Source} value */
proto.pb.Stream.prototype.setSource = function(value) {
jspb.Message.setWrapperField(this, 3, value);
};
proto.pb.Stream.prototype.clearSource = function() {
jspb.Message.setField(this, 3, undefined);
};
/**
* Returns whether this field is set.
* @return {!boolean}
*/
proto.pb.Stream.prototype.hasSource = function() {
return jspb.Message.getField(this, 3) != null;
};
goog.object.extend(exports, proto.pb);