jarviscrawlercore
Version:
jarvis crawler core
1,037 lines (897 loc) • 32.5 kB
JavaScript
// source: telegraph.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!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
goog.exportSymbol('proto.jarviscrawlercore.ReplyTelegraph', null, global);
goog.exportSymbol('proto.jarviscrawlercore.ReplyTelegraph.ReplyCase', null, global);
goog.exportSymbol('proto.jarviscrawlercore.RequestTelegraph', null, global);
goog.exportSymbol('proto.jarviscrawlercore.TelegraphArticle', null, global);
goog.exportSymbol('proto.jarviscrawlercore.TelegraphImage', null, global);
goog.exportSymbol('proto.jarviscrawlercore.TelegraphImages', null, global);
goog.exportSymbol('proto.jarviscrawlercore.TelegraphMode', 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.jarviscrawlercore.TelegraphArticle = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.jarviscrawlercore.TelegraphArticle, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.jarviscrawlercore.TelegraphArticle.displayName = 'proto.jarviscrawlercore.TelegraphArticle';
}
/**
* 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.jarviscrawlercore.TelegraphImage = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.jarviscrawlercore.TelegraphImage, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.jarviscrawlercore.TelegraphImage.displayName = 'proto.jarviscrawlercore.TelegraphImage';
}
/**
* 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.jarviscrawlercore.TelegraphImages = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.jarviscrawlercore.TelegraphImages.repeatedFields_, null);
};
goog.inherits(proto.jarviscrawlercore.TelegraphImages, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.jarviscrawlercore.TelegraphImages.displayName = 'proto.jarviscrawlercore.TelegraphImages';
}
/**
* 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.jarviscrawlercore.RequestTelegraph = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.jarviscrawlercore.RequestTelegraph, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.jarviscrawlercore.RequestTelegraph.displayName = 'proto.jarviscrawlercore.RequestTelegraph';
}
/**
* 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.jarviscrawlercore.ReplyTelegraph = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.jarviscrawlercore.ReplyTelegraph.oneofGroups_);
};
goog.inherits(proto.jarviscrawlercore.ReplyTelegraph, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.jarviscrawlercore.ReplyTelegraph.displayName = 'proto.jarviscrawlercore.ReplyTelegraph';
}
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.jarviscrawlercore.TelegraphArticle.prototype.toObject = function(opt_includeInstance) {
return proto.jarviscrawlercore.TelegraphArticle.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.jarviscrawlercore.TelegraphArticle} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.jarviscrawlercore.TelegraphArticle.toObject = function(includeInstance, msg) {
var f, obj = {
url: jspb.Message.getFieldWithDefault(msg, 1, ""),
title: jspb.Message.getFieldWithDefault(msg, 2, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.jarviscrawlercore.TelegraphArticle}
*/
proto.jarviscrawlercore.TelegraphArticle.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.jarviscrawlercore.TelegraphArticle;
return proto.jarviscrawlercore.TelegraphArticle.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.jarviscrawlercore.TelegraphArticle} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.jarviscrawlercore.TelegraphArticle}
*/
proto.jarviscrawlercore.TelegraphArticle.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.setUrl(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setTitle(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.jarviscrawlercore.TelegraphArticle.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.jarviscrawlercore.TelegraphArticle.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.jarviscrawlercore.TelegraphArticle} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.jarviscrawlercore.TelegraphArticle.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getUrl();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getTitle();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
};
/**
* optional string url = 1;
* @return {string}
*/
proto.jarviscrawlercore.TelegraphArticle.prototype.getUrl = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.jarviscrawlercore.TelegraphArticle} returns this
*/
proto.jarviscrawlercore.TelegraphArticle.prototype.setUrl = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional string title = 2;
* @return {string}
*/
proto.jarviscrawlercore.TelegraphArticle.prototype.getTitle = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.jarviscrawlercore.TelegraphArticle} returns this
*/
proto.jarviscrawlercore.TelegraphArticle.prototype.setTitle = function(value) {
return jspb.Message.setProto3StringField(this, 2, 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.jarviscrawlercore.TelegraphImage.prototype.toObject = function(opt_includeInstance) {
return proto.jarviscrawlercore.TelegraphImage.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.jarviscrawlercore.TelegraphImage} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.jarviscrawlercore.TelegraphImage.toObject = function(includeInstance, msg) {
var f, obj = {
url: jspb.Message.getFieldWithDefault(msg, 1, ""),
buf: msg.getBuf_asB64()
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.jarviscrawlercore.TelegraphImage}
*/
proto.jarviscrawlercore.TelegraphImage.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.jarviscrawlercore.TelegraphImage;
return proto.jarviscrawlercore.TelegraphImage.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.jarviscrawlercore.TelegraphImage} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.jarviscrawlercore.TelegraphImage}
*/
proto.jarviscrawlercore.TelegraphImage.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.setUrl(value);
break;
case 2:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setBuf(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.jarviscrawlercore.TelegraphImage.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.jarviscrawlercore.TelegraphImage.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.jarviscrawlercore.TelegraphImage} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.jarviscrawlercore.TelegraphImage.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getUrl();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getBuf_asU8();
if (f.length > 0) {
writer.writeBytes(
2,
f
);
}
};
/**
* optional string url = 1;
* @return {string}
*/
proto.jarviscrawlercore.TelegraphImage.prototype.getUrl = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.jarviscrawlercore.TelegraphImage} returns this
*/
proto.jarviscrawlercore.TelegraphImage.prototype.setUrl = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* optional bytes buf = 2;
* @return {!(string|Uint8Array)}
*/
proto.jarviscrawlercore.TelegraphImage.prototype.getBuf = function() {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* optional bytes buf = 2;
* This is a type-conversion wrapper around `getBuf()`
* @return {string}
*/
proto.jarviscrawlercore.TelegraphImage.prototype.getBuf_asB64 = function() {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getBuf()));
};
/**
* optional bytes buf = 2;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getBuf()`
* @return {!Uint8Array}
*/
proto.jarviscrawlercore.TelegraphImage.prototype.getBuf_asU8 = function() {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getBuf()));
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.jarviscrawlercore.TelegraphImage} returns this
*/
proto.jarviscrawlercore.TelegraphImage.prototype.setBuf = function(value) {
return jspb.Message.setProto3BytesField(this, 2, value);
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.jarviscrawlercore.TelegraphImages.repeatedFields_ = [2];
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.jarviscrawlercore.TelegraphImages.prototype.toObject = function(opt_includeInstance) {
return proto.jarviscrawlercore.TelegraphImages.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.jarviscrawlercore.TelegraphImages} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.jarviscrawlercore.TelegraphImages.toObject = function(includeInstance, msg) {
var f, obj = {
url: jspb.Message.getFieldWithDefault(msg, 1, ""),
imagesList: jspb.Message.toObjectList(msg.getImagesList(),
proto.jarviscrawlercore.TelegraphImage.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.jarviscrawlercore.TelegraphImages}
*/
proto.jarviscrawlercore.TelegraphImages.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.jarviscrawlercore.TelegraphImages;
return proto.jarviscrawlercore.TelegraphImages.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.jarviscrawlercore.TelegraphImages} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.jarviscrawlercore.TelegraphImages}
*/
proto.jarviscrawlercore.TelegraphImages.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.setUrl(value);
break;
case 2:
var value = new proto.jarviscrawlercore.TelegraphImage;
reader.readMessage(value,proto.jarviscrawlercore.TelegraphImage.deserializeBinaryFromReader);
msg.addImages(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.jarviscrawlercore.TelegraphImages.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.jarviscrawlercore.TelegraphImages.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.jarviscrawlercore.TelegraphImages} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.jarviscrawlercore.TelegraphImages.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getUrl();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
f = message.getImagesList();
if (f.length > 0) {
writer.writeRepeatedMessage(
2,
f,
proto.jarviscrawlercore.TelegraphImage.serializeBinaryToWriter
);
}
};
/**
* optional string url = 1;
* @return {string}
*/
proto.jarviscrawlercore.TelegraphImages.prototype.getUrl = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/**
* @param {string} value
* @return {!proto.jarviscrawlercore.TelegraphImages} returns this
*/
proto.jarviscrawlercore.TelegraphImages.prototype.setUrl = function(value) {
return jspb.Message.setProto3StringField(this, 1, value);
};
/**
* repeated TelegraphImage images = 2;
* @return {!Array<!proto.jarviscrawlercore.TelegraphImage>}
*/
proto.jarviscrawlercore.TelegraphImages.prototype.getImagesList = function() {
return /** @type{!Array<!proto.jarviscrawlercore.TelegraphImage>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.jarviscrawlercore.TelegraphImage, 2));
};
/**
* @param {!Array<!proto.jarviscrawlercore.TelegraphImage>} value
* @return {!proto.jarviscrawlercore.TelegraphImages} returns this
*/
proto.jarviscrawlercore.TelegraphImages.prototype.setImagesList = function(value) {
return jspb.Message.setRepeatedWrapperField(this, 2, value);
};
/**
* @param {!proto.jarviscrawlercore.TelegraphImage=} opt_value
* @param {number=} opt_index
* @return {!proto.jarviscrawlercore.TelegraphImage}
*/
proto.jarviscrawlercore.TelegraphImages.prototype.addImages = function(opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.jarviscrawlercore.TelegraphImage, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.jarviscrawlercore.TelegraphImages} returns this
*/
proto.jarviscrawlercore.TelegraphImages.prototype.clearImagesList = function() {
return this.setImagesList([]);
};
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.jarviscrawlercore.RequestTelegraph.prototype.toObject = function(opt_includeInstance) {
return proto.jarviscrawlercore.RequestTelegraph.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.jarviscrawlercore.RequestTelegraph} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.jarviscrawlercore.RequestTelegraph.toObject = function(includeInstance, msg) {
var f, obj = {
mode: jspb.Message.getFieldWithDefault(msg, 1, 0),
url: jspb.Message.getFieldWithDefault(msg, 2, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.jarviscrawlercore.RequestTelegraph}
*/
proto.jarviscrawlercore.RequestTelegraph.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.jarviscrawlercore.RequestTelegraph;
return proto.jarviscrawlercore.RequestTelegraph.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.jarviscrawlercore.RequestTelegraph} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.jarviscrawlercore.RequestTelegraph}
*/
proto.jarviscrawlercore.RequestTelegraph.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {!proto.jarviscrawlercore.TelegraphMode} */ (reader.readEnum());
msg.setMode(value);
break;
case 2:
var value = /** @type {string} */ (reader.readString());
msg.setUrl(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.jarviscrawlercore.RequestTelegraph.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.jarviscrawlercore.RequestTelegraph.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.jarviscrawlercore.RequestTelegraph} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.jarviscrawlercore.RequestTelegraph.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getMode();
if (f !== 0.0) {
writer.writeEnum(
1,
f
);
}
f = message.getUrl();
if (f.length > 0) {
writer.writeString(
2,
f
);
}
};
/**
* optional TelegraphMode mode = 1;
* @return {!proto.jarviscrawlercore.TelegraphMode}
*/
proto.jarviscrawlercore.RequestTelegraph.prototype.getMode = function() {
return /** @type {!proto.jarviscrawlercore.TelegraphMode} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {!proto.jarviscrawlercore.TelegraphMode} value
* @return {!proto.jarviscrawlercore.RequestTelegraph} returns this
*/
proto.jarviscrawlercore.RequestTelegraph.prototype.setMode = function(value) {
return jspb.Message.setProto3EnumField(this, 1, value);
};
/**
* optional string url = 2;
* @return {string}
*/
proto.jarviscrawlercore.RequestTelegraph.prototype.getUrl = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
};
/**
* @param {string} value
* @return {!proto.jarviscrawlercore.RequestTelegraph} returns this
*/
proto.jarviscrawlercore.RequestTelegraph.prototype.setUrl = function(value) {
return jspb.Message.setProto3StringField(this, 2, value);
};
/**
* Oneof group definitions for this message. Each group defines the field
* numbers belonging to that group. When of these fields' value is set, all
* other fields in the group are cleared. During deserialization, if multiple
* fields are encountered for a group, only the last value seen will be kept.
* @private {!Array<!Array<number>>}
* @const
*/
proto.jarviscrawlercore.ReplyTelegraph.oneofGroups_ = [[100]];
/**
* @enum {number}
*/
proto.jarviscrawlercore.ReplyTelegraph.ReplyCase = {
REPLY_NOT_SET: 0,
IMAGES: 100
};
/**
* @return {proto.jarviscrawlercore.ReplyTelegraph.ReplyCase}
*/
proto.jarviscrawlercore.ReplyTelegraph.prototype.getReplyCase = function() {
return /** @type {proto.jarviscrawlercore.ReplyTelegraph.ReplyCase} */(jspb.Message.computeOneofCase(this, proto.jarviscrawlercore.ReplyTelegraph.oneofGroups_[0]));
};
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.jarviscrawlercore.ReplyTelegraph.prototype.toObject = function(opt_includeInstance) {
return proto.jarviscrawlercore.ReplyTelegraph.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.jarviscrawlercore.ReplyTelegraph} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.jarviscrawlercore.ReplyTelegraph.toObject = function(includeInstance, msg) {
var f, obj = {
mode: jspb.Message.getFieldWithDefault(msg, 1, 0),
images: (f = msg.getImages()) && proto.jarviscrawlercore.TelegraphImages.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.jarviscrawlercore.ReplyTelegraph}
*/
proto.jarviscrawlercore.ReplyTelegraph.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.jarviscrawlercore.ReplyTelegraph;
return proto.jarviscrawlercore.ReplyTelegraph.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.jarviscrawlercore.ReplyTelegraph} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.jarviscrawlercore.ReplyTelegraph}
*/
proto.jarviscrawlercore.ReplyTelegraph.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {!proto.jarviscrawlercore.TelegraphMode} */ (reader.readEnum());
msg.setMode(value);
break;
case 100:
var value = new proto.jarviscrawlercore.TelegraphImages;
reader.readMessage(value,proto.jarviscrawlercore.TelegraphImages.deserializeBinaryFromReader);
msg.setImages(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.jarviscrawlercore.ReplyTelegraph.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.jarviscrawlercore.ReplyTelegraph.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.jarviscrawlercore.ReplyTelegraph} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.jarviscrawlercore.ReplyTelegraph.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getMode();
if (f !== 0.0) {
writer.writeEnum(
1,
f
);
}
f = message.getImages();
if (f != null) {
writer.writeMessage(
100,
f,
proto.jarviscrawlercore.TelegraphImages.serializeBinaryToWriter
);
}
};
/**
* optional TelegraphMode mode = 1;
* @return {!proto.jarviscrawlercore.TelegraphMode}
*/
proto.jarviscrawlercore.ReplyTelegraph.prototype.getMode = function() {
return /** @type {!proto.jarviscrawlercore.TelegraphMode} */ (jspb.Message.getFieldWithDefault(this, 1, 0));
};
/**
* @param {!proto.jarviscrawlercore.TelegraphMode} value
* @return {!proto.jarviscrawlercore.ReplyTelegraph} returns this
*/
proto.jarviscrawlercore.ReplyTelegraph.prototype.setMode = function(value) {
return jspb.Message.setProto3EnumField(this, 1, value);
};
/**
* optional TelegraphImages images = 100;
* @return {?proto.jarviscrawlercore.TelegraphImages}
*/
proto.jarviscrawlercore.ReplyTelegraph.prototype.getImages = function() {
return /** @type{?proto.jarviscrawlercore.TelegraphImages} */ (
jspb.Message.getWrapperField(this, proto.jarviscrawlercore.TelegraphImages, 100));
};
/**
* @param {?proto.jarviscrawlercore.TelegraphImages|undefined} value
* @return {!proto.jarviscrawlercore.ReplyTelegraph} returns this
*/
proto.jarviscrawlercore.ReplyTelegraph.prototype.setImages = function(value) {
return jspb.Message.setOneofWrapperField(this, 100, proto.jarviscrawlercore.ReplyTelegraph.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.jarviscrawlercore.ReplyTelegraph} returns this
*/
proto.jarviscrawlercore.ReplyTelegraph.prototype.clearImages = function() {
return this.setImages(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.jarviscrawlercore.ReplyTelegraph.prototype.hasImages = function() {
return jspb.Message.getField(this, 100) != null;
};
/**
* @enum {number}
*/
proto.jarviscrawlercore.TelegraphMode = {
TGPHM_IMAGES: 0
};
goog.object.extend(exports, proto.jarviscrawlercore);